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

Disable the Rails sandbox console #101

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ By default, sessions will be incinerated with a job 30 days after they are creat

When starting a console session, `console1984` will eager load all the application classes if necessary. In practice, production environments already load classes eagerly, so this won't represent any change for those.

## `rails console --sandbox`

`console1984` will disable the Rails sandbox console, becuase it's not able to record sessions while in sandbox mode.
ghiculescu marked this conversation as resolved.
Show resolved Hide resolved

## Configuration

These config options are namespaced in `config.console1984`:
Expand Down
6 changes: 6 additions & 0 deletions lib/console1984/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ class Engine < ::Rails::Engine
config.console1984.protected_environments ||= %i[ production ]
config.console1984.protected_urls ||= []

# Console 1984 doesn't work with the sandboxed Rails console, becuase
ghiculescu marked this conversation as resolved.
Show resolved Hide resolved
# it can't write its audit entries to the database.
initializer "console1984.disable_sandbox" do |app|
app.config.disable_sandbox = true
end

initializer "console1984.config" do
config.console1984.each do |key, value|
Console1984.config.send("#{key}=", value)
Expand Down