diff --git a/core/Controller/SetupController.php b/core/Controller/SetupController.php index fc1efe4c11b5b..a2f06db6d7259 100644 --- a/core/Controller/SetupController.php +++ b/core/Controller/SetupController.php @@ -40,7 +40,12 @@ class SetupController { * @param Setup $setupHelper */ function __construct(Setup $setupHelper) { - $this->autoConfigFile = \OC::$SERVERROOT.'/config/autoconfig.php'; + $config_directory = getenv('NEXTCLOUD_CONFIG_DIR'); + if ($config_directory) { + $this->autoConfigFile = $config_directory.'/autoconfig.php'; + } else { + $this->autoConfigFile = \OC::$SERVERROOT.'/config/autoconfig.php'; + } $this->setupHelper = $setupHelper; } diff --git a/lib/base.php b/lib/base.php index d22490ca5dc7e..bfb860b7c41c5 100644 --- a/lib/base.php +++ b/lib/base.php @@ -124,7 +124,12 @@ public static function initPaths() { } elseif(defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT . '/tests/config/')) { self::$configDir = OC::$SERVERROOT . '/tests/config/'; } else { - self::$configDir = OC::$SERVERROOT . '/config/'; + $config_directory = getenv('NEXTCLOUD_CONFIG_DIR'); + if($config_directory) { + self::$configDir = $config_directory.'/'; + } else { + self::$configDir = OC::$SERVERROOT . '/config/'; + } } self::$config = new \OC\Config(self::$configDir);