From bcb7e4ab67c4647452847ba00ef12b3ea8e53915 Mon Sep 17 00:00:00 2001 From: orhtej2 <2871798+orhtej2@users.noreply.github.com> Date: Tue, 15 Aug 2023 22:42:56 +0200 Subject: [PATCH 1/4] Fixup permissions on cockpit.conf --- scripts/change_url | 7 ++++++- scripts/install | 7 ++++++- scripts/restore | 5 +++++ scripts/upgrade | 7 ++++++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 27f477b..6320d98 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -30,12 +30,17 @@ ynh_change_url_nginx_config #================================================= # UPDATE A CONFIG FILE #================================================= +ynh_script_progression --message="Fixing up permissions..." --weight=1 + +usermod -a -G cockpit cockpit-ws +usermod -a -G cockpit cockpit-wsinstance + ynh_script_progression --message="Updating a configuration file..." --weight=1 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" +chown root:$app "/etc/cockpit/cockpit.conf" #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 23e7e82..a84aa68 100644 --- a/scripts/install +++ b/scripts/install @@ -22,6 +22,11 @@ ynh_add_nginx_config #================================================= # ADD A CONFIGURATION #================================================= +ynh_script_progression --message="Fixing up permissions..." --weight=1 + +usermod -a -G cockpit cockpit-ws +usermod -a -G cockpit cockpit-wsinstance + ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_replace_string --match_string="ListenStream=.*" --replace_string="ListenStream=$port" --target_file="/lib/systemd/system/cockpit.socket" @@ -31,7 +36,7 @@ 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" +chown root:$app "/etc/cockpit/cockpit.conf" #================================================= # GENERIC FINALIZATION diff --git a/scripts/restore b/scripts/restore index 92551e1..65ebc3a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -13,6 +13,11 @@ source /usr/share/yunohost/helpers #================================================= # RESTORE VARIOUS FILES #================================================= +ynh_script_progression --message="Fixing up permissions..." --weight=1 + +usermod -a -G cockpit cockpit-ws +usermod -a -G cockpit cockpit-wsinstance + 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" diff --git a/scripts/upgrade b/scripts/upgrade index a4b40fa..4049d4f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -37,6 +37,11 @@ yunohost service add $app --description="Sysadmin login session in a web browser #================================================= # UPDATE A CONFIG FILE #================================================= +ynh_script_progression --message="Fixing up permissions..." --weight=1 + +usermod -a -G cockpit cockpit-ws +usermod -a -G cockpit cockpit-wsinstance + ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_replace_string --match_string="ListenStream=.*" --replace_string="ListenStream=$port" --target_file="/lib/systemd/system/cockpit.socket" @@ -46,7 +51,7 @@ 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" +chown root:$app "/etc/cockpit/cockpit.conf" #================================================= # START SYSTEMD SERVICE From 51f2da2b19092663a3cbda72add206a725f1c65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 12 Sep 2023 09:41:17 +0200 Subject: [PATCH 2/4] Update manifest.toml --- manifest.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifest.toml b/manifest.toml index 4c38cee..5a4efd2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -35,6 +35,10 @@ ram.runtime = "50M" type = "path" default = "/monitor" + [install.init_main_permission] + type = "group" + default = "visitors" + [resources] [resources.system_user] From f31af1eba31ec98e6f23fc9aadb5ba23a4b32b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 12 Sep 2023 11:37:02 +0200 Subject: [PATCH 3/4] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 5a4efd2..1799633 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 = "239~ynh1" +version = "239~ynh2" maintainers = [] From 65d19619bbe050ef2739e8c550cd4a199ded66fd Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 12 Sep 2023 09:37:08 +0000 Subject: [PATCH 4/4] 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 b152edc..c2d6c1f 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:** 239~ynh1 +**Shipped version:** 239~ynh2 ## Screenshots diff --git a/README_fr.md b/README_fr.md index f446db9..b91e697 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 :** 239~ynh1 +**Version incluse :** 239~ynh2 ## Captures d’écran