mirror of
https://github.com/YunoHost-Apps/limesurvey_ynh.git
synced 2024-09-03 19:36:32 +02:00
commit
da4959616e
5 changed files with 37 additions and 21 deletions
|
@ -9,7 +9,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
|
|||
## Overview
|
||||
LimeSurvey is used to create advanced poll.
|
||||
|
||||
**Shipped version:** 3.16.1
|
||||
**Shipped version:** 3.17.1
|
||||
|
||||
**Categories:** Productivity, Poll
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
SOURCE_URL=https://github.com/LimeSurvey/LimeSurvey/archive/3.16.1+190314.tar.gz
|
||||
SOURCE_SUM=cfed9f8f8e4aa7fe70ae6c3e946f6f33d8aa3aab38f7ac994054af595b11f0a3
|
||||
SOURCE_FILENAME=limesurvey-3.16.1+190314.tar.gz
|
||||
SOURCE_URL=https://github.com/LimeSurvey/LimeSurvey/archive/3.17.1+190408.tar.gz
|
||||
SOURCE_SUM=a2c63a5a28f7f724f5bd7017959caf76e845c7fce9d8b1177075d030641fdbac
|
||||
SOURCE_FILENAME=limesurvey-3.17.1+190408.tar.gz
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "LimeSurvey",
|
||||
"id": "limesurvey",
|
||||
"packaging_format": 1,
|
||||
"version": "3.16.1~ynh2",
|
||||
"version": "3.17.1~ynh1",
|
||||
"description": {
|
||||
"en": "LimeSurvey is used to create advanced poll.",
|
||||
"fr": "LimeSurvey est un outil de création et diffusion de sondage en ligne."
|
||||
|
@ -15,7 +15,7 @@
|
|||
},
|
||||
"url": "https://www.limesurvey.org/",
|
||||
"requirements": {
|
||||
"yunohost": ">= 2.7.2"
|
||||
"yunohost": ">= 3.5.2"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
@ -55,6 +55,7 @@
|
|||
},
|
||||
{
|
||||
"name": "language",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Choose the default language of this LimeSurvey",
|
||||
"fr": "Choisissez la langue par défault de LimeSurvey"
|
||||
|
|
|
@ -31,34 +31,34 @@ export db_user=$db_name
|
|||
#=================================================
|
||||
# CHECK IF THE APP CAN BE INSTALLED WITH THIS ARGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating installation parameters..." --time --weight=1
|
||||
|
||||
export final_path=/var/www/$app
|
||||
test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
||||
|
||||
# Normalize the url path syntax
|
||||
path_url=$(ynh_normalize_url_path $path_url)
|
||||
|
||||
# Check web path availability
|
||||
ynh_webpath_available $domain $path_url
|
||||
# Register (book) web path
|
||||
ynh_webpath_register $app $domain $path_url
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Storing installation settings..." --time --weight=1
|
||||
|
||||
ynh_save_args domain admin is_public language final_path prefix path_url db_name db_user
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..." --time --weight=1
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
ynh_save_args domain admin is_public language final_path prefix path_url db_name db_user
|
||||
|
||||
#=================================================
|
||||
# CREATE A SQL BDD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a MySQL database..." --time --weight=1
|
||||
|
||||
ynh_mysql_setup_db $db_user $db_name
|
||||
export db_pwd=$(ynh_app_setting_get $app mysqlpwd)
|
||||
|
@ -66,6 +66,7 @@ export db_pwd=$(ynh_app_setting_get $app mysqlpwd)
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setting up source files..." --time --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source "$final_path"
|
||||
|
@ -73,12 +74,15 @@ ynh_setup_source "$final_path"
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring nginx web server..." --time --weight=1
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring system user..." --time --weight=1
|
||||
|
||||
# Create a system user
|
||||
ynh_system_user_create $app
|
||||
|
@ -86,6 +90,7 @@ ynh_system_user_create $app
|
|||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring php-fpm..." --time --weight=1
|
||||
|
||||
# Create a dedicated php-fpm config
|
||||
ynh_add_fpm_config
|
||||
|
@ -93,6 +98,7 @@ ynh_add_fpm_config
|
|||
#=================================================
|
||||
# SECURING FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
# Set permissions
|
||||
set_permissions
|
||||
|
||||
|
@ -139,33 +145,41 @@ mysql -u $db_user -p$db_pwd $db_user < ./data.sql
|
|||
#=================================================
|
||||
# SECURING FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Apply permissions..." --time --weight=1
|
||||
# Set permissions
|
||||
set_permissions
|
||||
|
||||
#=================================================
|
||||
# SETUP FAIL2BAN
|
||||
#=================================================
|
||||
|
||||
# ynh_script_progression --message="Configuring fail2ban..." --time --weight=1
|
||||
#ynh_add_fail2ban_config "/var/log/nginx/${domain}-error.log" "PHP message: Leed: wrong login for .* client: <HOST>" 5
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring SSOwat..." --time --weight=1
|
||||
|
||||
yunohost app addaccess $app -u $admin
|
||||
ynh_sso_access "/index.php?r=admin,/index.php?r=plugins,/scripts"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1
|
||||
|
||||
systemctl reload nginx
|
||||
|
||||
#=================================================
|
||||
# SEND A README FOR THE ADMIN
|
||||
#=================================================
|
||||
ynh_script_progression --message="Sending some explanation to use $app..." --time --weight=1
|
||||
|
||||
ynh_print_OFF
|
||||
message="You can now create a poll on this address: https://${domain}${path_url}/admin/
|
||||
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/limesurvey_ynh"
|
||||
|
||||
ynh_send_readme_to_admin "$message" "$admin"
|
||||
ynh_print_ON
|
||||
|
||||
ynh_script_progression --message="Installation of $app completed" --time --last
|
||||
|
|
|
@ -94,8 +94,9 @@ fi
|
|||
#=================================================
|
||||
|
||||
# Backup config, plugins and themes and delete previous files
|
||||
ynh_keep_if_no_upgrade themes/admin/* themes/question/* themes/survey/* plugins/*
|
||||
ynh_keep application/config/config.php upload
|
||||
ynh_keep_if_no_upgrade plugins/*
|
||||
ynh_keep application/config/config.php
|
||||
ynh_keep upload
|
||||
|
||||
# Copie new files and restore config, plugins, upload and themes
|
||||
ynh_secure_remove $final_path
|
||||
|
@ -132,8 +133,8 @@ set_permissions
|
|||
#=================================================
|
||||
|
||||
# Migrate DB
|
||||
cd $final_path/application/commands
|
||||
ynh_exec_as "$app" php console.php updatedb
|
||||
cd $final_path
|
||||
ynh_exec_as "$app" php application/commands/console.php updatedb
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
|
|
Loading…
Add table
Reference in a new issue