-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
RFE: Override config.php pathname with environment variable #300
Comments
Mhmm... Interessting. This would mean we need a 2nd config file where we set the path to the "real" config? 😁 |
that's part of the php hosting environment, afaik with apache you'd use SetEnv, and with uwsgi (my app-server of choice) you'd use --env (or Environment in its systemd service file). |
This would make the CLI tool also harder to execute and it makes the complexity of the system a bit bigger. Beside that I don't have anything in mind, why this would not work out. Maybe @nickvergessen @schiessle or @LukasReschke has something in mind. |
yes, the CLI would have to have the same env var. I consider this an advanced setting, so the default would still be as it is now. people that have it configured would have to remember to set the same env var for the cli too. |
btw, there are random places in the code-base that create paths based on OC::$SERVERROOT. Going forward it might be more practical to change those to an interface through OC, i.e. functions or properties. |
👍 I've encountered the same. |
introduce NEXTCLOUD_CONFIG_DIR env variable (see #300)
this was merged in #660 |
And will be available with Nextcloud 11 🎉 |
Hi guys, It would help us a fair bit if this was backported to 10 stable - it means we don't have to apply a patch for our Snap. Then we can even do daily snaps!!! Is it feasible to backport? |
nextcloud by default uses the `/config/` directory in the source/application tree for its config file(s). with this commit that directory can be overridden by the `NEXTCLOUD_CONFIG_DIR` environment variable. in uwsgi, you would use the option `--env "NEXTCLOUD_CONFIG_DIR=/tmp/nx-config/"` in apache `SetENV …` and the cli command can be run with: `NEXTCLOUD_CONFIG_DIR=/tmp/nx-config ./occ` (or just use `export` once in the shell). NEXTCLOUD_CONFIG_DIR can be supplied with or without the trailing slash (`/`), but in all cases `$configDir` will have it automatically added if needed. The other changes are several occurrences of `OC::$SERVERROOT . '/config'` to `OC::$configDir`.
cc @karlitschek because this is usually a feature and we only backport bug fixes 🙈 |
Already backported in #1081 |
nextcloud by default uses the `/config/` directory in the source/application tree for its config file(s). with this commit that directory can be overridden by the `NEXTCLOUD_CONFIG_DIR` environment variable. in uwsgi, you would use the option `--env "NEXTCLOUD_CONFIG_DIR=/tmp/nx-config/"` in apache `SetENV …` and the cli command can be run with: `NEXTCLOUD_CONFIG_DIR=/tmp/nx-config ./occ` (or just use `export` once in the shell). NEXTCLOUD_CONFIG_DIR can be supplied with or without the trailing slash (`/`), but in all cases `$configDir` will have it automatically added if needed. The other changes are several occurrences of `OC::$SERVERROOT . '/config'` to `OC::$configDir`.
introduce NEXTCLOUD_CONFIG_DIR env variable (see nextcloud#300)
This is a great feature, thanks. I searched if this was supported or not for many hours and couldn't find that it was. Until finally now. Would it be possible to add something about this into the documentation? Or did I just miss any mentioning of it there..? |
No, I don't think so. Can you add an issue in https://github.com/nextcloud/documentation/issues/new |
@nickvergessen Done. |
Allow to override the pathname of the config file (or config directory) so that it can be placed outside the nextcloud installed files.
This would make it easier to update the server code, and/or also to use a single code for several installations (with different configs).
ps.
if the idea is accepted, I can try make a PR too
The text was updated successfully, but these errors were encountered: