From 5ab10e643b1c3c6a427bfbd69631302c4e3fc0d1 Mon Sep 17 00:00:00 2001 From: magikcypress Date: Sat, 1 Apr 2017 18:23:05 +0200 Subject: [PATCH 1/3] [add] Maintener manifest.json --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index f41b710..4a46553 100644 --- a/manifest.json +++ b/manifest.json @@ -13,8 +13,8 @@ "url": "https://git.framasoft.org/luc/lufi", "license": "AGPL", "maintainer": { - "name": "frju365", - "email": "win10@tutanota.com" + "name": "frju365, cyp", + "email": "win10@tutanota.com, cyp@rouquin.me" }, "multi_instance": false, "services": [ From d0c95803203fa788bcac5a047b274c3dbdeb9534 Mon Sep 17 00:00:00 2001 From: magikcypress Date: Sun, 2 Apr 2017 16:06:17 +0200 Subject: [PATCH 2/3] [fix] Bug proxy nginx + correct restore + clean code --- conf/nginx.conf | 2 +- scripts/backup | 5 +++-- scripts/install | 2 +- scripts/remove | 2 +- scripts/restore | 32 +++++++++++++++++++++++++------- 5 files changed, 31 insertions(+), 12 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 468fdca..ea4ce6b 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -15,7 +15,7 @@ location __PATH__ { add_header Cache-Control "public, max-age=315360000"; } - proxy_pass http://127.0.0.1:__PORT__/__PATH__; + proxy_pass http://127.0.0.1:__PORT____PATH__; # Really important ! Lufi uses WebSocket, it won't work without this proxy_set_header Upgrade $http_upgrade ; diff --git a/scripts/backup b/scripts/backup index 897ea78..719e11f 100644 --- a/scripts/backup +++ b/scripts/backup @@ -19,8 +19,9 @@ ynh_backup "${final_path}" "sources" 1 # Copy the nginx conf files ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf" -# Copy the lufi fonf file +# Copy the lufi conf file ynh_backup "${final_path}/lufi.conf" "lufi.conf" ynh_backup "/etc/systemd/system/lufi.service" "systemd_lufi.service" ynh_backup "/etc/cron.d/${app}" "cron_lufi" -ynh_backup "/etc/logrotate.d/${app}" "logrotate_lufi" \ No newline at end of file +ynh_backup "/etc/logrotate.d/${app}" "logrotate_lufi" +ynh_backup "/var/log/${app}/production.log" "production.log" \ No newline at end of file diff --git a/scripts/install b/scripts/install index 143c7b1..22515df 100644 --- a/scripts/install +++ b/scripts/install @@ -38,7 +38,7 @@ CHECK_FINALPATH # Vérifie que le dossier de destination n'est pas déjà utilis domain_regex=$(echo "$domain" | sed 's@-@.@g') CHECK_VAR "$domain_regex" "domain_regex empty" -FIND_PORT 8080 # Cherche un port libre. +FIND_PORT 8095 # Cherche un port libre. # Enregistre les infos dans la config YunoHost ynh_app_setting_set $app admin $admin diff --git a/scripts/remove b/scripts/remove index abda5de..70f6ffe 100644 --- a/scripts/remove +++ b/scripts/remove @@ -40,7 +40,7 @@ SECURE_REMOVE '/var/log/$app/' # Suppression des log REMOVE_LOGROTATE_CONF # Suppression de la configuration de logrotate -ynh_package_remove carton || echo "ShellInABox already uninstalled" +ynh_package_remove carton || echo "Carton already uninstalled" ynh_package_remove perlmagick || echo "perlmagick already uninstalled" # Régénère la configuration de SSOwat diff --git a/scripts/restore b/scripts/restore index 5b51471..71876fc 100644 --- a/scripts/restore +++ b/scripts/restore @@ -15,6 +15,11 @@ domain=$(ynh_app_setting_get $app domain) path=$(ynh_app_setting_get $app path) is_public=$(ynh_app_setting_get $app is_public) +# Installation de perlmagick, interface perl pour imagemagick et de carton, gestionnaire de dépendances perl +ynh_package_update +ynh_package_install carton +ynh_package_install perlmagick + # Check domain/path availability sudo yunohost app checkurl "${domain}${path}" -a "${app}" \ || ynh_die "Path not available: ${domain}${path}" @@ -32,13 +37,13 @@ if [ -f "${nginx_conf}" ]; then fi # Check configuration files lufi -lufi_conf="${final_path}/lufi.conf" +lufi_conf="${final_path}/${app}.conf" if [ -f "${lufi_conf}" ]; then ynh_die "The LUFI CONF configuration already exists at '${lufi_conf}'. You should safely delete it before restoring this app." fi -lufi_systemd="/etc/systemd/system/lufi.service" -if [ -f "${lufi_default}" ]; then +lufi_systemd="/etc/systemd/system/${app}.service" +if [ -f "${lufi_systemd}" ]; then ynh_die "The LUFI SYSTEMD configuration already exists at '${lufi_systemd}'. You should safely delete it before restoring this app." fi @@ -52,6 +57,11 @@ if [ -f "${lufi_logrotate}" ]; then ynh_die "The LUFI LOGROTATE configuration already exists at '${lufi_logrotate}'. You should safely delete it before restoring this app." fi +lufi_log="/var/log/${app}/production.log" +if [ -f "${lufi_log}" ]; then + ynh_die "The LUFI LOG configuration already exists at '${lufi_log}'. You should safely delete it before restoring this app." +fi + # Restore sources & data sudo cp -a ./sources "${final_path}" @@ -60,9 +70,6 @@ sudo chown -R www-data: "${final_path}" # Restore nginx configuration files sudo cp -a ./nginx.conf "${nginx_conf}" -# Restore php-fpm configuration files -sudo cp -a ./php-fpm.conf "${phpfpm_conf}" -sudo cp -a ./php-fpm.ini "${phpfpm_ini}" # Restore lufi configuration files sudo cp -a ./lufi.conf "${lufi_conf}" @@ -73,6 +80,18 @@ sudo cp -a ./systemd_lufi.service "${lufi_systemd}" sudo cp -a ./cron_lufi "${lufi_cron}" sudo cp -a ./logrotate_lufi "${lufi_logrotate}" +# Create log production +sudo mkdir "/var/log/${app}/" +sudo cp -a ./production.log "${lufi_log}" +# Delete symbolic link and restore +sudo rm -fr "${final_path}/log/production.log" +sudo ln -s "/var/log/${app}/production.log" "${final_path}/log/production.log" + +# Reload lufi service +sudo systemctl daemon-reload +sudo systemctl start lufi.service +sudo systemctl enable lufi.service + # Set ssowat config if [ "$is_public" = "No" ]; then @@ -80,6 +99,5 @@ then fi # Reload services -sudo systemctl reload php5-fpm sudo systemctl reload nginx sudo yunohost app ssowatconf \ No newline at end of file From aa907b7a1781c022804b71e729b101a3789f9ee9 Mon Sep 17 00:00:00 2001 From: magikcypress Date: Sun, 2 Apr 2017 17:26:25 +0200 Subject: [PATCH 3/3] [fix] Upload problem --- conf/nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index ea4ce6b..d761ca3 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -21,6 +21,7 @@ location __PATH__ { proxy_set_header Upgrade $http_upgrade ; proxy_set_header Connection "upgrade" ; + proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;