From e1e1e69d326b2a62259123cc051433a1b18e4d61 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 12 Feb 2014 17:22:51 +0100 Subject: [PATCH] Allow ManualConf also for bootstrap.json --- .../pydio/plugins/boot.conf/bootstrap.json/10All | 117 +++++++++------------ 1 file changed, 51 insertions(+), 66 deletions(-) diff --git a/root/etc/e-smith/templates/var/lib/pydio/plugins/boot.conf/bootstrap.json/10All b/root/etc/e-smith/templates/var/lib/pydio/plugins/boot.conf/bootstrap.json/10All index 8cba7c1..d6a67ce 100644 --- a/root/etc/e-smith/templates/var/lib/pydio/plugins/boot.conf/bootstrap.json/10All +++ b/root/etc/e-smith/templates/var/lib/pydio/plugins/boot.conf/bootstrap.json/10All @@ -8,72 +8,57 @@ my $url = $pydio{'LogoutUrl'} || ''; my $createUser = $pydio{'ShareCreateUser'} || 'disabled'; $createUser = ($createUser eq 'enabled') ? JSON::true : JSON::false; -my $data = { - 'core.conf' => { - 'USERS_LIST_COMPLETE_MIN_CHARS' => '3', - 'SKIP_USER_HISTORY' => JSON::true, - 'DIBI_PRECONFIGURATION' => { - 'mysql_username' => $dbu, - 'mysql_password' => $dbp, - 'mysql_driver' => 'mysql', - 'group_switch_value' => 'mysql', - 'mysql_database' => $dbn, - 'mysql_host' => 'localhost' - }, - 'UNIQUE_INSTANCE_CONFIG' => { - 'FAST_CHECKS' => JSON::false, - 'ROLES_FILEPATH' => '/var/lib/pydio/plugins/auth.serial/roles.ser', - 'USERS_DIRPATH' => '/var/lib/pydio/plugins/auth.serial', - 'instance_name' => 'conf.serial', - 'group_switch_value' => 'conf.serial', - 'REPOSITORIES_FILEPATH' => '/var/lib/pydio/plugins/conf.serial/repo.ser' - }, - 'USER_CREATE_REPOSITORY' => JSON::false, - 'SAVE_GUEST_PREFERENCES' => JSON::false, - 'USERS_LIST_HIDE_LOGIN' => JSON::false, - 'USERS_LIST_COMPLETE_LIMIT' => '20', - 'ALLOW_CROSSUSERS_SHARING' => JSON::true, - 'USER_CREATE_USERS' => $createUser - }, - 'core.auth' => { - 'MASTER_INSTANCE_CONFIG' => { - 'LOGOUT_URL' => $url, - 'LOGIN_REDIRECT' => '', - 'instance_name' => 'auth.basic_http', - 'AJXP_ADMIN_LOGIN' => '', - 'TRANSMIT_CLEAR_PASS' => JSON::true, - 'AUTOCREATE_AJXPUSER' => JSON::false, - 'group_switch_value' => 'auth.basic_http', - 'USERS_FILEPATH' => '/var/lib/pydio/plugins/auth.serial/users.ser' - }, - 'MULTI_MODE' => { - 'instance_name' => 'MASTER_SLAVE', - 'CACHE_MASTER_USERS_TO_SLAVE' => JSON::false, - 'group_switch_value' => 'MASTER_SLAVE' - }, - 'MULTI_USER_BASE_DRIVER' => 'slave', - 'SLAVE_INSTANCE_CONFIG' => { - 'instance_name' => 'auth.serial', - 'USERS_FILEPATH' => '/var/lib/pydio/plugins/auth.serial/guests.ser', - 'TRANSMIT_CLEAR_PASS' => JSON::true, - 'LOGIN_REDIRECT' => '', - 'FAST_CHECKS' => JSON::false, - 'AUTOCREATE_AJXPUSER' => JSON::false, - 'AJXP_ADMIN_LOGIN' => '', - 'group_switch_value' => 'auth.serial' - }, - 'SECURE_LOGIN_FORM' => JSON::false, - 'SESSION_SET_CREDENTIALS' => JSON::false, - 'MULTI_MODE' => { - 'instance_name' => 'MASTER_SLAVE', - 'group_switch_value' => 'MASTER_SLAVE' - }, - 'CASE_SENSITIVE' => JSON::true, - 'ENABLE_USERS' => JSON::true, - 'ALLOW_GUEST_BROWSING' => JSON::false, - 'PASSWORD_MINLENGTH' => '4' - } - }; +my $data; + +if ((($pydio->prop('ManualConf') || 'disabled') eq 'enabled') && open CONF, "/var/lib/pydio/plugins/conf.serial/boot.conf/bootstrap.json"){ + $data = ; + close CONF; + $data = from_json($data); +} + +$data->{'core.conf'}->{'USERS_LIST_COMPLETE_MIN_CHARS'} ||= '3'; +$data->{'core.conf'}->{'SKIP_USER_HISTORY'} ||= JSON::true; +$data->{'core.conf'}->{'USER_CREATE_REPOSITORY'} ||= JSON::false; +$data->{'core.conf'}->{'SAVE_GUEST_PREFERENCES'} ||= JSON::false; +$data->{'core.conf'}->{'USERS_LIST_HIDE_LOGIN'} ||= JSON::false; +$data->{'core.conf'}->{'USERS_LIST_COMPLETE_LIMIT'} ||= '20'; +$data->{'core.conf'}->{'ALLOW_CROSSUSERS_SHARING'} ||= JSON::true; +$data->{'core.conf'}->{'USER_CREATE_USERS'} ||= $createUser; +$data->{'core.conf'}->{'DIBI_PRECONFIGURATION'}->{'mysql_username'} ||= $dbu; +$data->{'core.conf'}->{'DIBI_PRECONFIGURATION'}->{'mysql_password'} ||= $dbp; +$data->{'core.conf'}->{'DIBI_PRECONFIGURATION'}->{'mysql_driver'} ||= 'mysql'; +$data->{'core.conf'}->{'DIBI_PRECONFIGURATION'}->{'group_switch_value'} ||= 'mysql'; +$data->{'core.conf'}->{'DIBI_PRECONFIGURATION'}->{'mysql_database'} ||= $dbn; +$data->{'core.conf'}->{'DIBI_PRECONFIGURATION'}->{'mysql_host'} ||= 'localhost'; + +$data->{'core.auth'}->{'MASTER_INSTANCE_CONFIG'}->{'LOGOUT_URL'} ||= $url; +$data->{'core.auth'}->{'MASTER_INSTANCE_CONFIG'}->{'LOGIN_REDIRECT'} ||= ''; +$data->{'core.auth'}->{'MASTER_INSTANCE_CONFIG'}->{'instance_name'} ||= 'auth.basic_http'; +$data->{'core.auth'}->{'MASTER_INSTANCE_CONFIG'}->{'AJXP_ADMIN_LOGIN'} ||= ''; +$data->{'core.auth'}->{'MASTER_INSTANCE_CONFIG'}->{'TRANSMIT_CLEAR_PASS'} ||= JSON::true; +$data->{'core.auth'}->{'MASTER_INSTANCE_CONFIG'}->{'AUTOCREATE_AJXPUSER'} ||= JSON::false; +$data->{'core.auth'}->{'MASTER_INSTANCE_CONFIG'}->{'group_switch_value'} ||= 'auth.basic_http'; +$data->{'core.auth'}->{'MASTER_INSTANCE_CONFIG'}->{'USERS_FILEPATH'} ||= '/var/lib/pydio/plugins/auth.serial/users.ser'; +$data->{'core.auth'}->{'MULTI_MODE'}->{'instance_name'} ||= 'MASTER_SLAVE'; +$data->{'core.auth'}->{'MULTI_MODE'}->{'CACHE_MASTER_USERS_TO_SLAVE'} ||= JSON::false; +$data->{'core.auth'}->{'MULTI_MODE'}->{'group_switch_value'} ||= 'MASTER_SLAVE'; +$data->{'core.auth'}->{'MULTI_USER_BASE_DRIVER'} ||= 'slave'; +$data->{'core.auth'}->{'SLAVE_INSTANCE_CONFIG'}->{'instance_name'} ||= 'auth.serial'; +$data->{'core.auth'}->{'SLAVE_INSTANCE_CONFIG'}->{'USERS_FILEPATH'} ||= '/var/lib/pydio/plugins/auth.serial/guests.ser'; +$data->{'core.auth'}->{'SLAVE_INSTANCE_CONFIG'}->{'TRANSMIT_CLEAR_PASS'} ||= JSON::true; +$data->{'core.auth'}->{'SLAVE_INSTANCE_CONFIG'}->{'LOGIN_REDIRECT'} ||= ''; +$data->{'core.auth'}->{'SLAVE_INSTANCE_CONFIG'}->{'FAST_CHECKS'} ||= JSON::false; +$data->{'core.auth'}->{'SLAVE_INSTANCE_CONFIG'}->{'AUTOCREATE_AJXPUSER'} ||= JSON::false; +$data->{'core.auth'}->{'SLAVE_INSTANCE_CONFIG'}->{'AJXP_ADMIN_LOGIN'} ||= ''; +$data->{'core.auth'}->{'SLAVE_INSTANCE_CONFIG'}->{'group_switch_value'} ||= 'auth.serial'; +$data->{'core.auth'}->{'SECURE_LOGIN_FORM'} ||= JSON::false; +$data->{'core.auth'}->{'SESSION_SET_CREDENTIALS'} ||= JSON::false; +$data->{'core.auth'}->{'MULTI_MODE'}->{'instance_name'} ||= 'MASTER_SLAVE'; +$data->{'core.auth'}->{'MULTI_MODE'}->{'group_switch_value'} ||= 'MASTER_SLAVE'; +$data->{'core.auth'}->{'CASE_SENSITIVE'} ||= JSON::true; +$data->{'core.auth'}->{'ENABLE_USERS'} ||= JSON::true; +$data->{'core.auth'}->{'ALLOW_GUEST_BROWSING'} ||= JSON::false; +$data->{'core.auth'}->{'PASSWORD_MINLENGTH'} ||= '4'; $OUT = to_json($data, {pretty => 1}); }