Package: owncloud
Version: 7.0.6+dfsg-1
Severity: wishlist
Tags: patch
X-Debbugs-Cc: [email protected], [email protected]
attached patch:
2015-06-23 18:38 GMT-03:00 Thiago Ribeiro <[email protected]>:
> Package: owncloud
> Version: 7.0.6+dfsg-1
> Severity: wishlist
> Tags: patch
> X-Debbugs-Cc: [email protected], [email protected]
>
> Dear Maintainer,
>
> I am a GSOC student, working on the project
> "Automated configuration of packaged web applications":
> https://wiki.debian.org/SummerOfCode2015/Projects/AutoConfigWebApps
> https://wiki.debian.org/SummerOfCode2015/StudentApplications/ThiagoRibeiro
>
> owncloud is the second application we are trying, and I noticed that it
> does
> not support multiple instances without duplicating the owncloud source
> tree.
>
> The upstream community is still discussing that possibility:
> https://github.com/owncloud/core/pull/16424
>
> I've made a patch based on the changes in that pull request, which makes
> it possible
> to have separate instances of owncloud, with separate database and data
> folders.
> Please consider applying it to the Debian package.
>
> If you are OK with carrying this patch while the upstream community
> discusses it,
> I can also update the documentation with a simple tutorial on how to do
> this.
>
> with this patch, I managed three instances of owncloud, also I wrote a
> cookbook
> that makes instalation and configurations that are required.
>
> Its avaliable in the repository of my GSOC project:
>
> https://gitlab.com/shak/shak/commit/0ce28daa15b1ded8c0027fb4dbd76b62e8c9943e
>
> Greetings.
>
> -- System Information:
> Debian Release: stretch/sid
> APT prefers testing-updates
> APT policy: (500, 'testing-updates'), (500, 'unstable'), (500, 'testing')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 4.0.0-1-amd64 (SMP w/4 CPU cores)
> Locale: LANG=pt_BR.utf8, LC_CTYPE=pt_BR.utf8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
>
>
Description: Add support to multiple instances in same server.
Author: Thiago Ribeiro
Last-Update: 2015-06-22
Index: owncloud-7.0.6+dfsg/core/setup/controller.php
===================================================================
--- owncloud-7.0.6+dfsg.orig/core/setup/controller.php
+++ owncloud-7.0.6+dfsg/core/setup/controller.php
@@ -67,8 +67,16 @@ class Controller {
\OC_Util::redirectToDefaultPage();
}
+ #necessary to add autoconfig.php in folders that no are /config/
+ function autoconfig_path(){
+ if (isset($_SERVER["OWNCLOUD_CONFIG_DIR"])){
+ return $_SERVER["OWNCLOUD_CONFIG_DIR"] . '/autoconfig.php';
+ }
+ return \OC::$SERVERROOT . 'config/autoconfig.php';
+ }
+
public function loadAutoConfig($post) {
- $autosetup_file = \OC::$SERVERROOT.'/config/autoconfig.php';
+ $autosetup_file = $this->autoconfig_path();
if( file_exists( $autosetup_file )) {
\OC_Log::write('core', 'Autoconfig file found, setting up owncloud...', \OC_Log::INFO);
$AUTOCONFIG = array();
Index: owncloud-7.0.6+dfsg/lib/base.php
===================================================================
--- owncloud-7.0.6+dfsg.orig/lib/base.php
+++ owncloud-7.0.6+dfsg/lib/base.php
@@ -99,6 +99,8 @@ class OC {
self::$configDir = OC::$SERVERROOT . '/' . PHPUNIT_CONFIG_DIR . '/';
} elseif(defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT . '/tests/config/')) {
self::$configDir = OC::$SERVERROOT . '/tests/config/';
+ } elseif(isset($_SERVER["OWNCLOUD_CONFIG_DIR"])) {
+ self::$configDir = $_SERVER["OWNCLOUD_CONFIG_DIR"];
} else {
self::$configDir = OC::$SERVERROOT . '/config/';
}