1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/limesurvey_ynh.git synced 2024-09-03 19:36:32 +02:00
This commit is contained in:
ericgaspar 2021-07-12 12:28:53 +02:00
parent 7daf2364a9
commit 5241a9ad49
2 changed files with 35 additions and 14 deletions

View file

@ -38,7 +38,7 @@ INSERT INTO `lime_plugin_settings` (`id`, `plugin_id`, `model`, `model_id`, `key
(20, 5, NULL, NULL, 'serverkey', '"REMOTE_USER"'), (20, 5, NULL, NULL, 'serverkey', '"REMOTE_USER"'),
(21, 5,NULL,NULL,'is_default','\"1\"'); (21, 5,NULL,NULL,'is_default','\"1\"');
INSERT INTO `lime_settings_global` VALUES ('defaultlang','{{ language }}'),('AssetsVersion','2620'); INSERT INTO `lime_settings_global` VALUES ('defaultlang','__LANGUAGE__'),('AssetsVersion','2620');
{% if is_public == "1" %} {% if is_public == "1" %}
UPDATE `lime_plugin_settings` SET value='\"0\"' WHERE `id`=21; UPDATE `lime_plugin_settings` SET value='\"0\"' WHERE `id`=21;

View file

@ -43,7 +43,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # STORE SETTINGS FROM MANIFEST
#================================================= #=================================================
ynh_script_progression --message="Storing installation settings..." --time --weight=1 ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=path --value=$path_url
@ -88,6 +88,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -109,13 +113,14 @@ ynh_add_fpm_config
#================================================= #=================================================
# Set permissions # Set permissions
set_permissions #set_permissions
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
# CONFIGURE # CONFIGURE
#================================================= #=================================================
ynh_add_config --template="../conf/config.php" --destination="$final_path/application/config/config.php" ynh_add_config --template="../conf/config.php" --destination="$final_path/application/config/config.php"
#================================================= #=================================================
@ -140,8 +145,9 @@ ynh_store_file_checksum "$final_path/application/config/config.php"
# LOAD SQL SPECIFIC CONFIG # LOAD SQL SPECIFIC CONFIG
#================================================= #=================================================
ynh_configure data.sql ./data.sql ynh_add_config --template="../conf/data.sql" --destination="$final_path/data.sql"
mysql -u $db_user -p$db_pwd $db_user < ./data.sql
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < $final_path/data.sql
#================================================= #=================================================
# Add nice themes # Add nice themes
@ -156,8 +162,7 @@ mysql -u $db_user -p$db_pwd $db_user < ./data.sql
#================================================= #=================================================
ynh_script_progression --message="Apply permissions..." --weight=1 ynh_script_progression --message="Apply permissions..." --weight=1
# Set permissions #set_permissions
set_permissions
#================================================= #=================================================
# SETUP FAIL2BAN # SETUP FAIL2BAN
@ -168,22 +173,34 @@ set_permissions
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." --weight=1 ynh_script_progression --message="Configuring permissions..." --time --weight=1
yunohost app addaccess $app -u $admin # Make app public if necessary
ynh_sso_access "/index.php?r=admin,/index.php?r=plugins,/scripts" if [ $is_public -eq 1 ]
then
ynh_permission_update --permission="main" --add="visitors"
fi
# Only the admin can access the admin panel of the app (if the app has an admin panel)
ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin
#ynh_script_progression --message="Configuring SSOwat..." --weight=1
#yunohost app addaccess $app -u $admin
#ynh_sso_access "/index.php?r=admin,/index.php?r=plugins,/scripts"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 ynh_script_progression --message="Reloading NGINX web server..." --weight=1
systemctl reload nginx ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# SEND A README FOR THE ADMIN # SEND A README FOR THE ADMIN
#================================================= #=================================================
ynh_script_progression --message="Sending some explanation to use $app..." --time --weight=1 ynh_script_progression --message="Sending some explanation to use $app..." --weight=1
ynh_print_OFF ynh_print_OFF
message="You can now create a poll on this address: https://${domain}${path_url}/admin/ message="You can now create a poll on this address: https://${domain}${path_url}/admin/
@ -192,4 +209,8 @@ If you facing an issue or want to improve this app, please open a new issue in t
ynh_send_readme_to_admin "$message" "$admin" ynh_send_readme_to_admin "$message" "$admin"
ynh_print_ON ynh_print_ON
ynh_script_progression --message="Installation of $app completed" --time --last #=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last