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

OTP-ification: Replace z_config with application:{get,set}_env #403

Closed
arjan opened this Issue Sep 6, 2012 · 11 comments

Comments

Projects
None yet
3 participants
Owner

arjan commented Sep 6, 2012

Instead of the z_config server that there is now, we can also just use a regular Erlang .config file and the application environment functions to retrieve those options.

z_config now can write the config file as well, but writing the config file from zotonic is not very necessary imho. It only complicates things.

Owner

kaos commented Sep 6, 2012

+1 :)

2012/9/6 Arjan Scherpenisse notifications@github.com

Instead of the z_config server that there is now, we can also just use a
regular Erlang .config file and the application environment functions to
retrieve those options.

z_config now can write the config file as well, but writing the config
file from zotonic is not very necessary imho. It only complicates things.


Reply to this email directly or view it on GitHubhttps://github.com/zotonic/zotonic/issues/403.

Owner

kaos commented Dec 11, 2012

Would be nice to be more OTP-ified when going 1.0, I think.

@arjan arjan closed this in c1f0af3 May 27, 2014

Owner

mworrell commented May 28, 2014

Do we have a config reload?

BTW writing the config file was added for saving the super-secret-password of the zotonic-sites pages. This password is generated if it is missing.

For easy installation and maintenance (using nice web-pages) it might also be nice to be able to write the config file. Think of storing database connections, changing smtp settings etc etc

Owner

arjan commented May 28, 2014

We don't have a config reload but you can use application:set_env. However, these changes are not persisted.

A password is still generated when the zotonic.config file is missing, by the way, but now it is done in the zotonic_setup bash script.

Owner

kaos commented May 28, 2014

Additional generated options could be persisted into a generated.config file, leaving the other user modifiable config files alone.

Owner

mworrell commented May 28, 2014

Sounds good - and that one can then overlay the default one.

Owner

arjan commented May 28, 2014

I generally don't like servers that modify their own configuration. I think most sysops will agree with me. Although it is nice for novice users, it can make stuff very complicated in production.

Owner

mworrell commented May 28, 2014

True, though we need to be able to save settings outside the database.

An alternative could be a separate directory for mnesia files.
Or a special database for Zotonic itself… where we can store stuff (think queues for e-mail etc etc)

Owner

kaos commented May 28, 2014

Agreed, it shouldn't modify its own configuration on a fling. I was thinking of generated in this case more as persisted options requested by the user (using e.g. a browser GUI or some such).

Owner

mworrell commented May 28, 2014

You can always add an option to disable any modifications via something else than direct editing of the config file :-)

Owner

kaos commented May 28, 2014

Indeed, and this could also be the default mode of operation on new installs. It would be nice if this option could be changed from the web GUI though, so you can enable it from the web and go ahead tweaking other file based *.config options from the GUI as well, without having to first locate and tweak a file system config file.

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