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

Move all configuration settings to data/config.php #41

Closed
nodiscc opened this issue Nov 5, 2014 · 6 comments
Closed

Move all configuration settings to data/config.php #41

nodiscc opened this issue Nov 5, 2014 · 6 comments
Labels
easy good place to start contributing enhancement
Milestone

Comments

@nodiscc
Copy link
Member

nodiscc commented Nov 5, 2014

Once #40 is solved we can think about moving options.php out of data/. It is not program data and should not be writeable by the server.

We can also provide a options.example.php presenting all switches from https://github.com/shaarli/Shaarli/blob/master/index.php and https://github.com/shaarli/Shaarli/wiki#configuration and have evrything in one place.

See below

@nodiscc
Copy link
Member Author

nodiscc commented Dec 5, 2014

We currently have 2 config files: data/config.php and data/options.php

I think it would be better to get rid of config.php, and write all options/config variables in options.php. Of course options.php will then really need to be writable by the server. So if we go this way, this bug can be closed.

@e2jk
Copy link

e2jk commented Dec 5, 2014

I like the idea of combining into 1 file. I do prefer the name config rather than options.
I can't think of any at this point, but we need to be careful as to not introduce locking/race conditions/data loss, where a user manually edits the config file, an option is then changed via the website, and either the server can't commit its changes or it overwrites what the user set.

@nodiscc
Copy link
Member Author

nodiscc commented Dec 5, 2014

The race condition is already present when you have 2 ?do=configure tabs open at the same time. Of course the last saved file/config changes overwrites the previous. You're right that we should check for write permissions on the config file itself.

@nodiscc nodiscc changed the title Move options.php out of data/ Move all configuration settings to data/options.php Dec 5, 2014
@nodiscc nodiscc removed the security label Dec 5, 2014
@nodiscc
Copy link
Member Author

nodiscc commented Dec 10, 2014

On install, all hardcoded options in index.php should also be written to data/options.php so that users have all configuration options visible when editing the file.

Then we can get rid of the need to manually create options.php (https://github.com/shaarli/Shaarli/wiki#configuration). We should update the doc when it's done.

@nodiscc nodiscc added the easy good place to start contributing label Jan 9, 2015
@nodiscc
Copy link
Member Author

nodiscc commented Feb 17, 2015

Pull request #108 solves this

@ArthurHoaro
Copy link
Member

It can be done easily by iterating over $GLOBALS['config']. However, I'd prefer to keep config.php instead of using options.php.

@nodiscc nodiscc changed the title Move all configuration settings to data/options.php Move all configuration settings to data/config.php Jun 19, 2015
@virtualtam virtualtam modified the milestones: 0.9.0, 0.5.0 Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy good place to start contributing enhancement
Projects
None yet
Development

No branches or pull requests

4 participants