From 368ec84d6780d1e96a9bd41ead2966b9bfa487cf Mon Sep 17 00:00:00 2001 From: ljf Date: Fri, 14 Jan 2022 02:31:12 +0100 Subject: [PATCH] [fix] Force SSL + ajust permission --- conf/config.php | 9 +++++---- conf/data.sql | 11 +++++------ scripts/install | 22 +++++++++++----------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/conf/config.php b/conf/config.php index 91d8943..f369905 100644 --- a/conf/config.php +++ b/conf/config.php @@ -59,12 +59,13 @@ return array( // then please check your error-logs - either in your hosting provider admin panel or in some /logs directory // on your webspace. // LimeSurvey developers: Set this to 2 to additionally display STRICT PHP error messages and put MySQL in STRICT mode and get full access to standard themes - 'debug'=>0, - 'debugsql'=>0, // Set this to 1 to enanble sql logging, only active when debug = 2 + 'debug' => 0, + 'debugsql' => 0, // Set this to 1 to enanble sql logging, only active when debug = 2 // 'force_xmlsettings_for_survey_rendering' => true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) // 'use_asset_manager'=>true, // Uncomment if you want to use debug mode and asset manager at the same time - 'enableLdap'=>true, - 'uploaddir'=>'__DATADIR__' + 'enableLdap' => true, + 'force_ssl' => true, + 'uploaddir' => '__DATADIR__' ) ); /* End of file config.php */ diff --git a/conf/data.sql b/conf/data.sql index d734af9..65c3d25 100644 --- a/conf/data.sql +++ b/conf/data.sql @@ -17,7 +17,7 @@ INSERT INTO `lime_plugin_settings` (`id`, `plugin_id`, `model`, `model_id`, `key (9, 5, NULL, NULL, 'domainsuffix', 'null'), (10, 5, NULL, NULL, 'searchuserattribute', '\"uid\"'), (11, 5, NULL, NULL, 'usersearchbase', '\"ou=users,dc=yunohost,dc=org\"'), -(12, 5, NULL, NULL, 'extrauserfilter', '\"(&(|(objectclass=posixAccount))(uid=%uid)(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org))\"'), +(12, 5, NULL, NULL, 'extrauserfilter', '\"(&(objectClass=inetOrgPerson)(permission=cn=__APP__.admin,ou=permission,dc=yunohost,dc=org))\"'), (13, 5, NULL, NULL, 'binddn', '\"\"'), (14, 5, NULL, NULL, 'bindpwd', '\"\"'), (15, 5, NULL, NULL, 'mailattribute', '\"mail\"'), @@ -25,8 +25,8 @@ INSERT INTO `lime_plugin_settings` (`id`, `plugin_id`, `model`, `model_id`, `key (17, 5, NULL, NULL, 'is_default', '\"\"'), (18, 5, NULL, NULL, 'autocreate', '\"1\"'), (19, 5, NULL, NULL, 'automaticsurveycreation', '\"1\"'), -(20, 5, NULL, NULL, 'groupsearchbase', '\"ou=groups,dc=yunohost,dc=org\"'), -(21, 5, NULL, NULL, 'groupsearchfilter', '\"(&(objectclass=top)(memberUid=*))\"'), +(20, 5, NULL, NULL, 'groupsearchbase', '\"\"'), +(21, 5, NULL, NULL, 'groupsearchfilter', '\"\"'), (22, 5, NULL, NULL, 'allowInitialUser', '\"1\"'); @@ -35,7 +35,6 @@ INSERT INTO `lime_plugin_settings` (`id`, `plugin_id`, `model`, `model_id`, `key #(24, 7, NULL, NULL, 'serverkey', '"REMOTE_USER"'), #(25, 7,NULL,NULL,'is_default','\"1\"'); -INSERT INTO `lime_settings_global` VALUESi +INSERT INTO `lime_settings_global` VALUES ('defaultlang','__LANGUAGE__'), -('AssetsVersion','30214'), -('DBVersion', 449); +('AssetsVersion','30214'); diff --git a/scripts/install b/scripts/install index 437b70c..5a73bec 100755 --- a/scripts/install +++ b/scripts/install @@ -90,7 +90,7 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" chmod 750 "$final_path/tmp" -chmod 750 "$data_dir/upload" +chmod 750 "$final_path/upload" chmod 750 "$final_path/application/config/" #================================================= @@ -111,13 +111,6 @@ ynh_add_fpm_config #================================================= # SPECIFIC SETUP -#================================================= -# CONFIGURE -#================================================= -ynh_script_progression --message="Configuring Limesurvey..." --weight=1 - -ynh_add_config --template="../conf/config.php" --destination="$final_path/application/config/config.php" - #================================================= # CREATE THE DATA DIRECTORY #================================================= @@ -130,6 +123,13 @@ mv "$final_path/upload" $datadir/upload chown -R $app:www-data "$datadir" chmod -R o-rwx "$datadir" +#================================================= +# CONFIGURE +#================================================= +ynh_script_progression --message="Configuring Limesurvey..." --weight=1 + +ynh_add_config --template="../conf/config.php" --destination="$final_path/application/config/config.php" + #================================================= # INSTALL #================================================= @@ -175,13 +175,13 @@ ynh_script_progression --message="Configuring permissions..." --weight=1 if [ $is_public -eq 1 ] then - allowed_groups="visitors" + allowed_groups="visitors $admin" else allowed_groups="$admin" fi -ynh_permission_update --permission="main" --url="/admin" --allowed="$allowed_groups" +ynh_permission_update --permission="main" --show_tile="false" --add="visitors" -ynh_permission_create --permission="answer" --url="/" --allowed="visitors" --show_tile="false" +ynh_permission_create --permission="admin" --url="/admin" --allowed=$allowed_groups --show_tile="true" #=================================================