From 1871a5dc9f370bf72a2daf46c02c130f74a70d14 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 3 Sep 2022 00:44:25 +0200 Subject: [PATCH 1/5] apply example_ynh --- doc/.DS_Store | Bin 6148 -> 0 bytes scripts/change_url | 17 ++++++++--------- scripts/install | 4 ++++ scripts/remove | 4 ++-- scripts/restore | 18 +++++++++--------- scripts/upgrade | 19 +++++++++---------- 6 files changed, 32 insertions(+), 30 deletions(-) delete mode 100644 doc/.DS_Store diff --git a/doc/.DS_Store b/doc/.DS_Store deleted file mode 100644 index c90376b56b73b627c519d1a34c5d8c9abb7004dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKyG{c^3>-s>NNG}1?l15Mt0;UyegFv&DbPhqfch%Fi%(bFB<-Yt6!=#P*lfL7ulP#UTPH8)y|&RG>0a|qcjG!J4AG8> j(T=(Cc6=8_S=W5c^IkY62A%n!6ZJFTy2zx!wH5dQ#>Eyj diff --git a/scripts/change_url b/scripts/change_url index 139a41c..01de24d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -37,12 +37,11 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - ynh_clean_check_starting # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" @@ -73,14 +72,14 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." +ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -111,7 +110,7 @@ fi #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." +ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/cockpit.conf" @@ -120,7 +119,7 @@ ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/coc #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started" @@ -128,7 +127,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -136,4 +135,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index 7000613..7db2c80 100644 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,10 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + true +} +# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= diff --git a/scripts/remove b/scripts/remove index 17169c8..5de99c5 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -62,7 +62,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing various files..." +ynh_script_progression --message="Removing various files..." --weight=1 # Remove a directory securely ynh_secure_remove --file="/etc/$app" diff --git a/scripts/restore b/scripts/restore index 8c924fa..9725a54 100644 --- a/scripts/restore +++ b/scripts/restore @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ynh_clean_check_starting + true } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -38,13 +38,6 @@ ynh_script_progression --message="Validating restoration parameters..." --weight #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # SPECIFIC RESTORATION #================================================= @@ -55,10 +48,17 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=7 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # RESTORE VARIOUS FILES #================================================= -ynh_script_progression --message="Restoring various files..." +ynh_script_progression --message="Restoring various files..." --weight=1 ynh_replace_string --match_string="ListenStream=.*" --replace_string="ListenStream=$port" --target_file="/lib/systemd/system/cockpit.socket" systemctl daemon-reload diff --git a/scripts/upgrade b/scripts/upgrade index 6f813ab..c2c9421 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,19 +24,18 @@ port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." +ynh_script_progression --message="Checking version..." --weight=1 upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - ynh_clean_check_starting # Restore it if the upgrade fails ynh_restore_upgradebackup } @@ -52,6 +51,13 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=20 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # NGINX CONFIGURATION #================================================= @@ -60,13 +66,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=20 - -ynh_install_app_dependencies $pkg_dependencies - #================================================= # SPECIFIC UPGRADE #================================================= From 13bfca45ef49ba864854677539c827f1ab805223 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 2 Sep 2022 22:44:31 +0000 Subject: [PATCH 2/5] Auto-update README --- README.md | 1 + README_fr.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9dae77c..e7a3607 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Cockpit is a web-based graphical interface for servers, intended for everyone. **Shipped version:** 188~ynh2 + ## Screenshots ![Screenshot of Cockpit](./doc/screenshots/screenshot-storage.png) diff --git a/README_fr.md b/README_fr.md index fcf3956..e5908e9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,8 @@ Cockpit is a web-based graphical interface for servers, intended for everyone. -**Version incluse :** 188~ynh2 +**Version incluse :** 188~ynh2 + ## Captures d'écran From db656663608c0cd542e597c039b198f5925a103e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 3 Sep 2022 20:48:29 +0200 Subject: [PATCH 3/5] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index e480917..6691922 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app +# dependencies used by the app (must be on a single line) pkg_dependencies="cockpit" #================================================= From efdecba8371c1d523f430d6b026870c5d9b6676e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 4 Sep 2022 20:30:32 +0200 Subject: [PATCH 4/5] spacing --- conf/cockpit.conf | 2 +- doc/DESCRIPTION.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/conf/cockpit.conf b/conf/cockpit.conf index c6ed880..4dba969 100644 --- a/conf/cockpit.conf +++ b/conf/cockpit.conf @@ -1,4 +1,4 @@ [WebService] Origins = https://__DOMAIN__ wss://__DOMAIN__ ProtocolHeader = X-Forwarded-Proto -UrlRoot = __PATH__ \ No newline at end of file +UrlRoot = __PATH__ diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 39c4d8d..d4dd7e9 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,2 +1 @@ Cockpit is a web-based graphical interface for servers, intended for everyone. - From 76515b476824b762862e6601c3afdfb6cb189213 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 4 Sep 2022 18:30:36 +0000 Subject: [PATCH 5/5] Auto-update README --- README.md | 1 - README_fr.md | 1 - 2 files changed, 2 deletions(-) diff --git a/README.md b/README.md index e7a3607..97e68ca 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Cockpit is a web-based graphical interface for servers, intended for everyone. - **Shipped version:** 188~ynh2 diff --git a/README_fr.md b/README_fr.md index e5908e9..1abdef3 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,6 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Cockpit is a web-based graphical interface for servers, intended for everyone. - **Version incluse :** 188~ynh2