[Owncloud] owncloud autosetup

Frank Karlitschek karlitschek at kde.org
Tue Oct 4 09:48:19 UTC 2011


Cool Stuff,


I think this is an important addition for ownCloud 2 because it´s a requirement for auto setup and it doesn´t interfere with the rest of ownCloud.
But I would love to hear an opinion from another developer. :-)


Cheers
Frank


On 04.10.2011, at 11:02, Thomas Schmidt wrote:

> Hi, I wrote a patch to enable an autosetup of owncloud:
> 
> 
> diff --git a/index.php b/index.php
> index 2ac3f6d..e72b427 100644
> --- a/index.php
> +++ b/index.php
> @@ -27,8 +27,16 @@ require_once('lib/base.php');
> 
> // Setup required :
> $not_installed = !OC_Config::getValue('installed', false);
> -$install_called = (isset($_POST['install']) AND $_POST['install']=='true');
> if($not_installed) {
> +       // Check for autosetup:
> +       $autosetup_file = OC::$SERVERROOT."/config/autoconfig.php";
> +       if( file_exists( $autosetup_file )){
> +               error_log("Autoconfig file found, setting up owncloud...");
> +               include( $autosetup_file );
> +               $_POST['install'] = 'true';
> +               $_POST = array_merge ($_POST, $AUTOCONFIG);
> +               unlink($autosetup_file);
> +       }
>        OC_Util::addScript('setup');
>        require_once('setup.php');
>        exit();
> 
> 
> That will be useful when installing owncloud 'headless', for example by using the
> new owncloud-admin script, or just copying the files over by ftp and using it without opening a browser.
> 
> It expects an autoconfig.php in the config directory which gets removed after setup.
> A minimal example file looks like this:
> 
> <?php
> $AUTOCONFIG = array(
>    "dbtype" => 'sqlite',
>    "directory" => "/space/workspace/owncloud/data",
>    "adminlogin" => "tom",
>    "adminpass" => "tom"
> );
> ?>
> 
> 
> What do you think, should I commit this to the master branch, so it's included in the release?
> 
> Greetings
> 
> -- 
> Thomas Schmidt (tschmidt [at] suse.de)
> SUSE Linux Products GmbH :: Research & Development :: Tools
> "Don't Panic", Douglas Adams (11.03.1952 - 11.05.2001)
> _______________________________________________
> Owncloud mailing list
> Owncloud at kde.org
> https://mail.kde.org/mailman/listinfo/owncloud

Frank Karlitschek
karlitschek at kde.org





More information about the Owncloud mailing list