Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change location of IRB history file #29

Open
olbrich opened this issue Mar 13, 2023 · 4 comments
Open

Change location of IRB history file #29

olbrich opened this issue Mar 13, 2023 · 4 comments

Comments

@olbrich
Copy link

olbrich commented Mar 13, 2023

If you connect to a docker container and run rails console, IRB will attempt to record a history file in /rails/.irb_history, but this location is not writeable.

Perhaps configuring IRB to record this to /rails/log/irb_history.log would be preferable. Users can already do this manually by including a .irbrc file in the root of their project, so it may be helpful to create a default one if that file does not exist.

@rubys
Copy link
Collaborator

rubys commented Mar 13, 2023

I'm assuming that you are running off of main as that hasn't been released?

Not documented very well, but --sudo will make the whole /rails tree owned by rails

@olbrich
Copy link
Author

olbrich commented Mar 14, 2023

No, I'm using 1.2.5

@rubys
Copy link
Collaborator

rubys commented Mar 14, 2023

It looks like the following does not give ownership over /rails, just the files in that directory:

COPY --from=build --chown=rails:rails /rails /rails

I'm leaning towards adding an option that does a touch .irb_history and ensures that it is owned by the rails user. This way I won't have to worry about applications that have an existing .irbrc file. Thoughts?

@olbrich
Copy link
Author

olbrich commented Mar 14, 2023

That would probably work. I'm also thinking that people are likely to mount volumes for the logs directory so they can persist or otherwise retain them. Moving the .irb_history file into that directory would allow that history to be persisted as well (which might be useful for security audits or just convenience). But maybe that's something that could just be documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants