From ccbe98be83b2590623611b8d2957a95a976d4408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 10:34:03 +0200 Subject: [PATCH 01/13] fix permission --- doc/DISCLAIMER.md | 0 manifest.json | 2 +- scripts/install | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 doc/DISCLAIMER.md diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index e69de29..0000000 diff --git a/manifest.json b/manifest.json index 59bb8a0..52b0762 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.2" }, "multi_instance": false, "services": [ diff --git a/scripts/install b/scripts/install index 7db2c80..ca8fa34 100644 --- a/scripts/install +++ b/scripts/install @@ -83,7 +83,7 @@ systemctl restart $app.socket ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/cockpit.conf" -chmod 440 "/etc/cockpit/cockpit.conf" +chmod 650 "/etc/cockpit/cockpit.conf" chown root:$app-ws "/etc/cockpit/cockpit.conf" #================================================= From 16e1808e83afda2a0d7623ebc249b95b837a7f0e Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 12 Aug 2023 08:34:07 +0000 Subject: [PATCH 02/13] Auto-update README --- README.md | 4 ++-- README_fr.md | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 97e68ca..5b958fd 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Cockpit for YunoHost -[![Integration level](https://dash.yunohost.org/integration/cockpit.svg)](https://dash.yunohost.org/appci/app/cockpit) ![Working status](https://ci-apps.yunohost.org/ci/badges/cockpit.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/cockpit.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/cockpit.svg)](https://dash.yunohost.org/appci/app/cockpit) ![Working status](https://ci-apps.yunohost.org/ci/badges/cockpit.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/cockpit.maintain.svg) + [![Install Cockpit with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=cockpit) *[Lire ce readme en français.](./README_fr.md)* @@ -20,7 +21,6 @@ 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 1abdef3..fa667a5 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,31 +5,31 @@ It shall NOT be edited by hand. # Cockpit pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/cockpit.svg)](https://dash.yunohost.org/appci/app/cockpit) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/cockpit.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/cockpit.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/cockpit.svg)](https://dash.yunohost.org/appci/app/cockpit) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/cockpit.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/cockpit.maintain.svg) + [![Installer Cockpit avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=cockpit) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Cockpit rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Cockpit rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble Cockpit is a web-based graphical interface for servers, intended for everyone. -**Version incluse :** 188~ynh2 +**Version incluse :** 188~ynh2 +## Captures d’écran -## Captures d'écran - -![Capture d'écran de Cockpit](./doc/screenshots/screenshot-storage.png) +![Capture d’écran de Cockpit](./doc/screenshots/screenshot-storage.png) ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -45,4 +45,4 @@ ou sudo yunohost app upgrade cockpit -u https://github.com/YunoHost-Apps/cockpit_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From fb73ae73b9fc6b7795385f9e27126689db18ea69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 10:35:10 +0200 Subject: [PATCH 03/13] v2 --- manifest.toml | 48 +++++++++++++++++++++++++++++++++ scripts/_common.sh | 2 +- scripts/backup | 12 ++++----- scripts/change_url | 66 ++++++++++++++++++++++++---------------------- scripts/install | 34 ++++++++++++------------ scripts/remove | 14 +++++----- scripts/restore | 20 +++++++------- scripts/upgrade | 30 ++++++++++----------- 8 files changed, 138 insertions(+), 88 deletions(-) create mode 100644 manifest.toml diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..b7bc8b0 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,48 @@ +packaging_format = 2 + +id = "cockpit" +name = "Cockpit" +description.en = "Sysadmin login session in a web browser" +description.fr = "Session de connexion sysadmin dans un navigateur Web" + +version = "188~ynh2" + +maintainers = [] + +[upstream] +license = "LGPL-2.1-only" +website = "https://cockpit-project.org/" +admindoc = "https://cockpit-project.org/documentation.html" +code = "https://github.com/cockpit-project/cockpit" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.2" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = false +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + + [install.path] + # this is a generic question - ask strings are automatically handled by Yunohost's core + help.en = "/cockpit/ and /cockpit+ are reserved and should not be used." + help.fr = "/cockpit/ et /cockpit+ sont réservés et ne doivent pas être utilisés." + type = "path" + default = "/monitor" + +[resources] + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index 6691922..d484bcd 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app (must be on a single line) -pkg_dependencies="cockpit" +#REMOVEME? pkg_dependencies="cockpit" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 5bbfcd7..ca10fd3 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,21 +14,21 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP diff --git a/scripts/change_url b/scripts/change_url index 1eec6b9..a5b1cce 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -13,58 +13,58 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS #================================================= -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH +#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN +#REMOVEME? old_path=$YNH_APP_OLD_PATH -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH +#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN +#REMOVEME? new_path=$YNH_APP_NEW_PATH -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? 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) +#REMOVEME? # Needed for helper "ynh_add_nginx_config" +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) # Add settings here as needed by your application -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? #db_name=$(ynh_app_setting_get --app=$app --key=db_name) #db_user=$db_name -#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +#REMOVEME? #db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 +#REMOVEME? 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 () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # 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" +#REMOVEME? ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= -change_domain=0 -if [ "$old_domain" != "$new_domain" ] +#REMOVEME? change_domain=0 +#REMOVEME? if [ "$old_domain" != "$new_domain" ] then - change_domain=1 + #REMOVEME? change_domain=1 fi -change_path=0 -if [ "$old_path" != "$new_path" ] +#REMOVEME? change_path=0 +#REMOVEME? if [ "$old_path" != "$new_path" ] then - change_path=1 + #REMOVEME? change_path=1 fi #================================================= @@ -81,28 +81,30 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf +ynh_change_url_nginx_config + +#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf # Change the path in the NGINX config file if [ $change_path -eq 1 ] then # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" +#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" +#REMOVEME? domain="$old_domain" +#REMOVEME? path="$new_path" # Create a dedicated NGINX config - ynh_add_nginx_config +#REMOVEME? ynh_add_nginx_config fi # Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf +#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" +#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi #================================================= @@ -130,9 +132,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index ca8fa34..7b13413 100644 --- a/scripts/install +++ b/scripts/install @@ -13,54 +13,54 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +#REMOVEME? path=$YNH_APP_ARG_PATH -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 # Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=2 +#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=2 -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path #================================================= # STANDARD MODIFICATIONS #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --weight=2 +#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=2 # Find an available port -port=$(ynh_find_port --port=8095) -ynh_app_setting_set --app=$app --key=port --value=$port +#REMOVEME? port=$(ynh_find_port --port=8095) +#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=20 +#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=20 -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= # NGINX CONFIGURATION @@ -106,9 +106,9 @@ ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" - #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=2 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=2 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 5de99c5..86bfad9 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,13 +12,13 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -port=$(ynh_app_setting_get --app=$app --key=port) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # STANDARD REMOVE @@ -52,10 +52,10 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies #================================================= # SPECIFIC REMOVE diff --git a/scripts/restore b/scripts/restore index 9725a54..f7c4ef1 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,27 +14,27 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=2 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=2 #================================================= # STANDARD RESTORATION STEPS @@ -43,10 +43,10 @@ ynh_script_progression --message="Validating restoration parameters..." --weight #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=7 +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=7 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index c2c9421..eeeea53 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,14 +12,14 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK VERSION @@ -31,16 +31,16 @@ 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)..." --weight=1 +#REMOVEME? 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 () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS @@ -54,9 +54,9 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=20 +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=20 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # NGINX CONFIGURATION @@ -98,9 +98,9 @@ ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" - #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=2 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=2 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From 06a52022c824cbe77d407185755558e500064541 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 12 Aug 2023 08:35:14 +0000 Subject: [PATCH 04/13] Auto-update README --- README.md | 4 ++-- README_fr.md | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 97e68ca..5b958fd 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Cockpit for YunoHost -[![Integration level](https://dash.yunohost.org/integration/cockpit.svg)](https://dash.yunohost.org/appci/app/cockpit) ![Working status](https://ci-apps.yunohost.org/ci/badges/cockpit.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/cockpit.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/cockpit.svg)](https://dash.yunohost.org/appci/app/cockpit) ![Working status](https://ci-apps.yunohost.org/ci/badges/cockpit.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/cockpit.maintain.svg) + [![Install Cockpit with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=cockpit) *[Lire ce readme en français.](./README_fr.md)* @@ -20,7 +21,6 @@ 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 1abdef3..fa667a5 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,31 +5,31 @@ It shall NOT be edited by hand. # Cockpit pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/cockpit.svg)](https://dash.yunohost.org/appci/app/cockpit) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/cockpit.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/cockpit.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/cockpit.svg)](https://dash.yunohost.org/appci/app/cockpit) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/cockpit.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/cockpit.maintain.svg) + [![Installer Cockpit avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=cockpit) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Cockpit rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Cockpit rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble Cockpit is a web-based graphical interface for servers, intended for everyone. -**Version incluse :** 188~ynh2 +**Version incluse :** 188~ynh2 +## Captures d’écran -## Captures d'écran - -![Capture d'écran de Cockpit](./doc/screenshots/screenshot-storage.png) +![Capture d’écran de Cockpit](./doc/screenshots/screenshot-storage.png) ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -45,4 +45,4 @@ ou sudo yunohost app upgrade cockpit -u https://github.com/YunoHost-Apps/cockpit_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From 1e9d3b5088de075ba77a5e3e10995e9c1be3db86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 10:41:47 +0200 Subject: [PATCH 05/13] v2 --- check_process | 21 ----------- manifest.json | 48 ------------------------ manifest.toml | 22 ++++++----- scripts/_common.sh | 3 -- scripts/backup | 20 ---------- scripts/change_url | 91 +--------------------------------------------- scripts/install | 62 +------------------------------ scripts/remove | 19 ---------- scripts/restore | 40 +------------------- scripts/upgrade | 46 ++--------------------- tests.toml | 3 ++ 11 files changed, 22 insertions(+), 353 deletions(-) delete mode 100644 check_process delete mode 100644 manifest.json create mode 100644 tests.toml diff --git a/check_process b/check_process deleted file mode 100644 index db915f5..0000000 --- a/check_process +++ /dev/null @@ -1,21 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - path="/path" - ; Checks - pkg_linter=1 - setup_sub_dir=1 - setup_root=1 - setup_nourl=0 - setup_private=0 - setup_public=0 - upgrade=1 - # 188~ynh1 - upgrade=1 from_commit=d94f20300b9296f5dbe879d025a5f481ecb15011 - backup_restore=1 - multi_instance=0 - port_already_use=0 - change_url=0 -;;; Options -Email= -Notification=none diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 52b0762..0000000 --- a/manifest.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "Cockpit", - "id": "cockpit", - "packaging_format": 1, - "description": { - "en": "Sysadmin login session in a web browser", - "fr": "Session de connexion sysadmin dans un navigateur Web" - }, - "version": "188~ynh2", - "url": "https://cockpit-project.org/", - "upstream": { - "license": "LGPL-2.1-only", - "website": "https://cockpit-project.org/", - "admindoc": "https://cockpit-project.org/documentation.html", - "code": "https://github.com/cockpit-project/cockpit", - "cpe": "cpe:2.3:a:agentejo:cockpit" - }, - "license": "LGPL-2.1-only", - "maintainer": { - "name": "", - "email": "" - }, - "requirements": { - "yunohost": ">= 11.2" - }, - "multi_instance": false, - "services": [ - "nginx" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "help": { - "en": "/cockpit/ and /cockpit+ are reserved and should not be used.", - "fr": "/cockpit/ et /cockpit+ sont réservés et ne doivent pas être utilisés." - }, - "example": "/monitor", - "default": "/monitor" - } - ] - } -} \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index b7bc8b0..aafeb4a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -14,26 +14,22 @@ license = "LGPL-2.1-only" website = "https://cockpit-project.org/" admindoc = "https://cockpit-project.org/documentation.html" code = "https://github.com/cockpit-project/cockpit" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] yunohost = ">= 11.2" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +architectures = "all" multi_instance = false -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = false +sso = false +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" [install.path] - # this is a generic question - ask strings are automatically handled by Yunohost's core help.en = "/cockpit/ and /cockpit+ are reserved and should not be used." help.fr = "/cockpit/ et /cockpit+ sont réservés et ne doivent pas être utilisés." type = "path" @@ -46,3 +42,9 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.permissions] main.url = "/" + + [resources.ports] + + [resources.apt] + packages = "cockpit" + \ No newline at end of file diff --git a/scripts/_common.sh b/scripts/_common.sh index d484bcd..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app (must be on a single line) -#REMOVEME? pkg_dependencies="cockpit" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index ca10fd3..4da6512 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,26 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/change_url b/scripts/change_url index a5b1cce..27f477b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,64 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN -#REMOVEME? old_path=$YNH_APP_OLD_PATH - -#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN -#REMOVEME? new_path=$YNH_APP_NEW_PATH - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? # Needed for helper "ynh_add_nginx_config" -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - -# Add settings here as needed by your application -#REMOVEME? #db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name -#REMOVEME? #db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) - -#================================================= -# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP -#================================================= -#REMOVEME? 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 -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. -#REMOVEME? ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -#REMOVEME? change_domain=0 -#REMOVEME? if [ "$old_domain" != "$new_domain" ] -then - #REMOVEME? change_domain=1 -fi - -#REMOVEME? change_path=0 -#REMOVEME? if [ "$old_path" != "$new_path" ] -then - #REMOVEME? change_path=1 -fi - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -83,30 +25,6 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- ynh_change_url_nginx_config -#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified -#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper -#REMOVEME? domain="$old_domain" -#REMOVEME? path="$new_path" - # Create a dedicated NGINX config -#REMOVEME? ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location -#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" -#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location -#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi - #================================================= # SPECIFIC MODIFICATIONS #================================================= @@ -116,7 +34,7 @@ ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/cockpit.conf" -chmod 440 "/etc/cockpit/cockpit.conf" +chmod 650 "/etc/cockpit/cockpit.conf" chown root:$app-ws "/etc/cockpit/cockpit.conf" #================================================= @@ -129,13 +47,6 @@ 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" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index 7b13413..23e7e82 100644 --- a/scripts/install +++ b/scripts/install @@ -9,59 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -#REMOVEME? path=$YNH_APP_ARG_PATH - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=2 - -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=2 - -# Find an available port -#REMOVEME? port=$(ynh_find_port --port=8095) -#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port - -#================================================= -# INSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=20 - -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies - #================================================= # NGINX CONFIGURATION #================================================= @@ -93,7 +40,7 @@ chown root:$app-ws "/etc/cockpit/cockpit.conf" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app +yunohost service add $app --description="Sysadmin login session in a web browser" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE @@ -103,13 +50,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" --line_match="Started" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=2 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 86bfad9..d8ab278 100644 --- a/scripts/remove +++ b/scripts/remove @@ -9,17 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - #================================================= # STANDARD REMOVE #================================================= @@ -49,14 +38,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies - #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/restore b/scripts/restore index f7c4ef1..4e6de24 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,44 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=2 - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=7 - -# Define and install dependencies -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= @@ -71,7 +33,7 @@ ynh_restore_file --origin_path="/etc/cockpit/cockpit.conf" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app +yunohost service add $app --description="Sysadmin login session in a web browser" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index eeeea53..2993a9b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,39 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) - #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." --weight=1 upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -51,13 +24,6 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=20 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # NGINX CONFIGURATION #================================================= @@ -79,6 +45,9 @@ systemctl restart $app.socket ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/cockpit.conf" +chmod 650 "/etc/cockpit/cockpit.conf" +chown root:$app-ws "/etc/cockpit/cockpit.conf" + #================================================= # GENERIC FINALIZATION #================================================= @@ -86,7 +55,7 @@ ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/coc #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app +yunohost service add $app --description="Sysadmin login session in a web browser" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE @@ -95,13 +64,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" --line_match="Started" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=2 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..cbbeef1 --- /dev/null +++ b/tests.toml @@ -0,0 +1,3 @@ +test_format = 1.0 + +[default] From 23e6bf45a6cd9084cb253f3bbf4764d02b43f82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 11:07:04 +0200 Subject: [PATCH 06/13] Update DESCRIPTION.md --- doc/DESCRIPTION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index d4dd7e9..c93e29c 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1 +1 @@ -Cockpit is a web-based graphical interface for servers, intended for everyone. +Cockpit is an interactive server admin interface. It is easy to use and very lightweight. Cockpit interacts directly with the operating system from a real Linux session in a browser. \ No newline at end of file From 26e08c077f5888f76b8e89a4b1da7d2308fe631e Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 12 Aug 2023 09:07:08 +0000 Subject: [PATCH 07/13] Auto-update README --- README.md | 3 +-- README_fr.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5b958fd..405d054 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Cockpit is a web-based graphical interface for servers, intended for everyone. - +Cockpit is an interactive server admin interface. It is easy to use and very lightweight. Cockpit interacts directly with the operating system from a real Linux session in a browser. **Shipped version:** 188~ynh2 diff --git a/README_fr.md b/README_fr.md index fa667a5..7b4c432 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,8 +16,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -Cockpit is a web-based graphical interface for servers, intended for everyone. - +Cockpit is an interactive server admin interface. It is easy to use and very lightweight. Cockpit interacts directly with the operating system from a real Linux session in a browser. **Version incluse :** 188~ynh2 From 194f815e1147c3916f892dc641556ba60c5d3824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 11:07:25 +0200 Subject: [PATCH 08/13] Create DESCRIPTION_fr.md --- doc/DESCRIPTION_fr.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/DESCRIPTION_fr.md diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..0ddd212 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1 @@ +Cockpit est une interface d'administration de serveur interactive. Il est facile à utiliser et très léger. Cockpit interagit directement avec le système d'exploitation à partir d'une vraie session Linux dans un navigateur. \ No newline at end of file From 9f352eb2a6f83f45054977c3d2df020d1e9bef64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 11:14:23 +0200 Subject: [PATCH 09/13] fix --- manifest.toml | 3 ++- scripts/backup | 2 -- scripts/remove | 25 ++++--------------------- scripts/restore | 28 ++++++++++------------------ scripts/upgrade | 17 ++++------------- 5 files changed, 20 insertions(+), 55 deletions(-) diff --git a/manifest.toml b/manifest.toml index aafeb4a..030e8b6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Cockpit" description.en = "Sysadmin login session in a web browser" description.fr = "Session de connexion sysadmin dans un navigateur Web" -version = "188~ynh2" +version = "188~ynh3" maintainers = [] @@ -44,6 +44,7 @@ ram.runtime = "50M" main.url = "/" [resources.ports] + main.default = 9090 [resources.apt] packages = "cockpit" diff --git a/scripts/backup b/scripts/backup index 4da6512..9248243 100644 --- a/scripts/backup +++ b/scripts/backup @@ -21,8 +21,6 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP #================================================= # BACKUP VARIOUS FILES #================================================= diff --git a/scripts/remove b/scripts/remove index d8ab278..050233c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,10 +10,11 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# STANDARD REMOVE +# REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEMD SERVICE #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null @@ -22,29 +23,11 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - -# Remove the dedicated systemd config -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" - -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=5 +ynh_remove_systemd_config # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE 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 4e6de24..92551e1 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,13 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# 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 #================================================= @@ -29,25 +22,24 @@ systemctl restart $app.socket ynh_restore_file --origin_path="/etc/cockpit/cockpit.conf" #================================================= -# INTEGRATE SERVICE IN YUNOHOST +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" yunohost service add $app --description="Sysadmin login session in a web browser" --log="/var/log/$app/$app.log" -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=2 - -ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" --line_match="Started" - #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=2 +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" --line_match="Started" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 2993a9b..a4b40fa 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,15 +25,15 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= -# NGINX CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC UPGRADE +yunohost service add $app --description="Sysadmin login session in a web browser" --log="/var/log/$app/$app.log" + #================================================= # UPDATE A CONFIG FILE #================================================= @@ -48,15 +48,6 @@ ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/coc chmod 650 "/etc/cockpit/cockpit.conf" chown root:$app-ws "/etc/cockpit/cockpit.conf" -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Sysadmin login session in a web browser" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= From ef5bb8f1def6665c1cbcb76f26f85842cddeeac6 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 12 Aug 2023 09:14:27 +0000 Subject: [PATCH 10/13] Auto-update README --- README.md | 2 +- README_fr.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 405d054..9e7fbf3 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Cockpit is an interactive server admin interface. It is easy to use and very lightweight. Cockpit interacts directly with the operating system from a real Linux session in a browser. -**Shipped version:** 188~ynh2 +**Shipped version:** 188~ynh3 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 7b4c432..79c311e 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,9 +16,9 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -Cockpit is an interactive server admin interface. It is easy to use and very lightweight. Cockpit interacts directly with the operating system from a real Linux session in a browser. +Cockpit est une interface d'administration de serveur interactive. Il est facile à utiliser et très léger. Cockpit interagit directement avec le système d'exploitation à partir d'une vraie session Linux dans un navigateur. -**Version incluse :** 188~ynh2 +**Version incluse :** 188~ynh3 ## Captures d’écran From 9c9f68ecfa2bb85af620d2ee3932bc33742965e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 12 Aug 2023 11:16:07 +0200 Subject: [PATCH 11/13] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 030e8b6..4c38cee 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Cockpit" description.en = "Sysadmin login session in a web browser" description.fr = "Session de connexion sysadmin dans un navigateur Web" -version = "188~ynh3" +version = "239~ynh1" maintainers = [] From 76e8e736fca128a3332d9d6005aa7fb4f4155c82 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 12 Aug 2023 09:16:17 +0000 Subject: [PATCH 12/13] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e7fbf3..b152edc 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Cockpit is an interactive server admin interface. It is easy to use and very lightweight. Cockpit interacts directly with the operating system from a real Linux session in a browser. -**Shipped version:** 188~ynh3 +**Shipped version:** 239~ynh1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 79c311e..f446db9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Cockpit est une interface d'administration de serveur interactive. Il est facile à utiliser et très léger. Cockpit interagit directement avec le système d'exploitation à partir d'une vraie session Linux dans un navigateur. -**Version incluse :** 188~ynh3 +**Version incluse :** 239~ynh1 ## Captures d’écran From 33e9cf12e22b5224ec67c08daff1d9bc3c4fdd14 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 12 Aug 2023 09:20:56 +0000 Subject: [PATCH 13/13] Auto-update README --- README_fr.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README_fr.md b/README_fr.md index cd8aa40..f446db9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,10 +14,6 @@ It shall NOT be edited by hand. > *Ce package vous permet d’installer Cockpit rapidement et simplement sur un serveur YunoHost. Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* - -## Vue d’ensemble - - ## Vue d’ensemble Cockpit est une interface d'administration de serveur interactive. Il est facile à utiliser et très léger. Cockpit interagit directement avec le système d'exploitation à partir d'une vraie session Linux dans un navigateur.