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

Already on GitHub? Sign in to your account

config/environment.rb will always be overwritten on update #284

Open
will-r opened this Issue Nov 2, 2011 · 8 comments

Comments

Projects
None yet
5 participants
Owner

will-r commented Nov 2, 2011

The generation of environment.rb includes a random session secret.

When radiant is updated we check for changes to the files being updated. Because of the random element, config/environment.rb always looks like it has changed, so the file is always replaced and backed up, and the user warned.

I'm not sure whether this is feature or bug, but it also has the effect of invalidating all existing sessions, so I'm leaning towards bug.

Owner

saturnflyer commented Nov 2, 2011

I often have changes to the environment.rb files and just use what ends up in environment.bak.
We could read the file and look for that key to replace it. I think this is only a problem now that we're on Bundler, previously you'd almost always have other changes.
I'm curious to see if anyone else comments.

Owner

will-r commented Nov 2, 2011

Yes, there's not much to change in environment.rb now. I wonder if we should move the site-defintion stuff to a separate initialiser?

Owner

jomz commented Nov 3, 2011

There's still one good reason to have a non-default environment.rb; namely to specify the extensions load order

Contributor

johnmuhl commented Nov 3, 2011

and disable "core" extensions.

Owner

will-r commented Nov 3, 2011

and time zones, for us foreigners.

Is there any reason not to move these local settings to a config/initializes/radiant.rb?

Owner

saturnflyer commented Nov 3, 2011

An initializer makes sense.

Member

gerrit commented Dec 9, 2011

In general (and in addition to moving random data like the session secret into its own file), instead of creating a backup copy of a file, could we perhaps detect if the project is managed using an scm and if that’s the case just overwrite the file so the user can quickly see a diff?

Owner

saturnflyer commented Dec 30, 2011

Has anyone looked at moving these to an initializer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment