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

[stable10] Allow the config dir to be specified via the enviroment #1081

Merged
merged 2 commits into from Aug 26, 2016

Conversation

Projects
None yet
6 participants
@nickvergessen
Member

nickvergessen commented Aug 26, 2016

Backport of #660 to make @jospoortvliet happy.

gdamjan added some commits Jul 29, 2016

introduce NEXTCLOUD_CONFIG_DIR env variable (see #300)
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`.
@nickvergessen

This comment has been minimized.

Show comment
Hide comment
@nickvergessen

nickvergessen Aug 26, 2016

Member

@gdamjan @kyrofa feel free to review this.

@karlitschek for backport approval (requested by the snappy guys so they dont have to patch it after each update again)

Member

nickvergessen commented Aug 26, 2016

@gdamjan @kyrofa feel free to review this.

@karlitschek for backport approval (requested by the snappy guys so they dont have to patch it after each update again)

@karlitschek

This comment has been minimized.

Show comment
Hide comment
@karlitschek

karlitschek Aug 26, 2016

Member

nice feature. please backport

Member

karlitschek commented Aug 26, 2016

nice feature. please backport

@gdamjan

This comment has been minimized.

Show comment
Hide comment
@gdamjan

gdamjan Aug 26, 2016

Contributor

looks good to me
LGTM

Contributor

gdamjan commented Aug 26, 2016

looks good to me
LGTM

@LukasReschke

This comment has been minimized.

Show comment
Hide comment
@LukasReschke
Member

LukasReschke commented Aug 26, 2016

LGTM

@LukasReschke LukasReschke merged commit 977c49a into stable10 Aug 26, 2016

3 of 4 checks passed

approvals/lgtm this commit is pending approval
Scrutinizer 2 new issues
Details
continuous-integration/drone the build was successful
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@LukasReschke LukasReschke deleted the backport-660-config-path-from-env branch Aug 26, 2016

@jospoortvliet

This comment has been minimized.

Show comment
Hide comment
@jospoortvliet

jospoortvliet Aug 26, 2016

Member

Thanks all! Love and hugs ;-)

Member

jospoortvliet commented Aug 26, 2016

Thanks all! Love and hugs ;-)

@Mehlstaub

This comment has been minimized.

Show comment
Hide comment
@Mehlstaub

Mehlstaub Sep 30, 2016

Having a problem with this. If there is no config.php in webroot/config/ folder the occ commands seem to be broken.

I've tried to put the config.php only in /etc/nextcloud

System itself works fine but occ commands return these errors

sudo -u www-data php occ maintenance:mode --on
Nextcloud is not installed - only a limited number of commands are available


  [Symfony\Component\Console\Exception\CommandNotFoundException]
  Command "maintenance:mode" is not defined.
  Did you mean this?
      maintenance:install

Mehlstaub commented Sep 30, 2016

Having a problem with this. If there is no config.php in webroot/config/ folder the occ commands seem to be broken.

I've tried to put the config.php only in /etc/nextcloud

System itself works fine but occ commands return these errors

sudo -u www-data php occ maintenance:mode --on
Nextcloud is not installed - only a limited number of commands are available


  [Symfony\Component\Console\Exception\CommandNotFoundException]
  Command "maintenance:mode" is not defined.
  Did you mean this?
      maintenance:install
@gdamjan

This comment has been minimized.

Show comment
Hide comment
@gdamjan

gdamjan Oct 1, 2016

Contributor

if you use this feature for the server, you need to define the envrinment variable in your shell too, before calling occ.

one example , with sudo is:
sudo -u www-data NEXTCLOUD_CONFIG_DIR=/etc/nextcloud php occ maintenance:mode --on

Contributor

gdamjan commented Oct 1, 2016

if you use this feature for the server, you need to define the envrinment variable in your shell too, before calling occ.

one example , with sudo is:
sudo -u www-data NEXTCLOUD_CONFIG_DIR=/etc/nextcloud php occ maintenance:mode --on

@Mehlstaub

This comment has been minimized.

Show comment
Hide comment
@Mehlstaub

Mehlstaub Oct 1, 2016

@gdamjan thanks i missed that, works now

Mehlstaub commented Oct 1, 2016

@gdamjan thanks i missed that, works now

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