From 1edd5bbe593f60e08ea263ab73dda06f6eef6807 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 6 Dec 2021 22:54:30 +0100 Subject: [PATCH 1/8] Fix --- conf/cockpit.conf | 8 ++++++++ manifest.json | 12 +++++++----- scripts/install | 10 ++++++++-- 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 conf/cockpit.conf diff --git a/conf/cockpit.conf b/conf/cockpit.conf new file mode 100644 index 0000000..4adb59a --- /dev/null +++ b/conf/cockpit.conf @@ -0,0 +1,8 @@ +[WebService] +Origins = https://__DOMAIN__ +https://127.0.0.1:9090 + +[WebService] +ProtocolHeader = X-Forwarded-Proto + +UrlRoot = __PATH__/ \ No newline at end of file diff --git a/manifest.json b/manifest.json index e9dbce2..ab8b47e 100644 --- a/manifest.json +++ b/manifest.json @@ -11,9 +11,7 @@ "upstream": { "license": "LGPL-2.1-only", "website": "https://cockpit-project.org/", - "demo": "https://demo.example.com", - "admindoc": "https://cockpit-project.org/documentation.html", - "code": "https://some.forge.com/example/example" + "admindoc": "https://cockpit-project.org/documentation.html" }, "license": "LGPL-2.1-only", "maintainer": { @@ -35,8 +33,12 @@ { "name": "path", "type": "path", - "example": "/cockpit", - "default": "/cockpit" + "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" }, { "name": "is_public", diff --git a/scripts/install b/scripts/install index 38a1043..9e75e99 100644 --- a/scripts/install +++ b/scripts/install @@ -68,6 +68,13 @@ ynh_script_progression --message="Installing dependencies..." --weight=20 ynh_install_app_dependencies $pkg_dependencies +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_add_config --template="../conf/cockpite.conf" --destination="/etc/cockpit/cockpit.conf" + #================================================= # NGINX CONFIGURATION #================================================= @@ -82,8 +89,7 @@ ynh_add_nginx_config ynh_script_progression --message="Starting a systemd service..." --weight=2 # Reload services -systemctl start $app -systemctl enable $app --quiet +systemctl enable cockpit.socket --quiet #================================================= # SETUP SSOWAT From 3e333d1c4ad2c106cbfdae2570d5d5c71391d8b7 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 6 Dec 2021 21:54:37 +0000 Subject: [PATCH 2/8] 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 5c34233..5d95937 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Cockpit is a web-based graphical interface for servers, intended for everyone. **Shipped version:** 257~ynh1 -**Demo:** https://demo.example.com + ## Screenshots @@ -29,7 +29,6 @@ Cockpit is a web-based graphical interface for servers, intended for everyone. * Official app website: https://cockpit-project.org/ * Official admin documentation: https://cockpit-project.org/documentation.html -* Upstream app code repository: https://some.forge.com/example/example * YunoHost documentation for this app: https://yunohost.org/app_cockpit * Report a bug: https://github.com/YunoHost-Apps/cockpit_ynh/issues diff --git a/README_fr.md b/README_fr.md index 1d91fce..b55e13d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -15,7 +15,7 @@ Cockpit is a web-based graphical interface for servers, intended for everyone. **Version incluse :** 257~ynh1 -**Démo :** https://demo.example.com + ## Captures d'écran @@ -25,7 +25,6 @@ Cockpit is a web-based graphical interface for servers, intended for everyone. * Site officiel de l'app : https://cockpit-project.org/ * Documentation officielle de l'admin : https://cockpit-project.org/documentation.html -* Dépôt de code officiel de l'app : https://some.forge.com/example/example * Documentation YunoHost pour cette app : https://yunohost.org/app_cockpit * Signaler un bug : https://github.com/YunoHost-Apps/cockpit_ynh/issues From 86a3973511709634ac8b67162c72ac537d1ed72a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 6 Dec 2021 22:57:44 +0100 Subject: [PATCH 3/8] Update install --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 9e75e99..7a7516c 100644 --- a/scripts/install +++ b/scripts/install @@ -66,14 +66,14 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= ynh_script_progression --message="Installing dependencies..." --weight=20 -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= # ADD A CONFIGURATION #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/cockpite.conf" --destination="/etc/cockpit/cockpit.conf" +ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/cockpit.conf" #================================================= # NGINX CONFIGURATION From 43b1e23c12a2ff3fe6ed33d31d54084eace5a01a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 6 Dec 2021 23:01:56 +0100 Subject: [PATCH 4/8] Update install --- scripts/install | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 7a7516c..9ed57aa 100644 --- a/scripts/install +++ b/scripts/install @@ -89,18 +89,25 @@ ynh_add_nginx_config ynh_script_progression --message="Starting a systemd service..." --weight=2 # Reload services -systemctl enable cockpit.socket --quiet +#systemctl enable cockpit.socket --quiet +ynh_systemd_action --service_name=cockpit.socket --action=start + +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +yunohost service add cockpit.socket --description="Monitor" #--log="/var/log/syslog" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=1 +# ynh_script_progression --message="Configuring SSOwat..." --weight=1 -# Make app public if necessary or protect it -if [ $is_public -eq 1 ] -then - ynh_permission_update --permission "main" --add "visitors" -fi +# # Make app public if necessary or protect it +# if [ $is_public -eq 1 ] +# then +# ynh_permission_update --permission "main" --add "visitors" +# fi #================================================= # RELOAD NGINX From dff622dcdac6adca3a5a17329a4730c7dff9d24a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 6 Dec 2021 23:06:28 +0100 Subject: [PATCH 5/8] Update install --- scripts/install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 9ed57aa..9101304 100644 --- a/scripts/install +++ b/scripts/install @@ -90,7 +90,7 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 # Reload services #systemctl enable cockpit.socket --quiet -ynh_systemd_action --service_name=cockpit.socket --action=start +#ynh_systemd_action --service_name=cockpit.socket --action=start #================================================= # ADVERTISE SERVICE IN ADMIN PANEL @@ -98,6 +98,8 @@ ynh_systemd_action --service_name=cockpit.socket --action=start yunohost service add cockpit.socket --description="Monitor" #--log="/var/log/syslog" +ynh_systemd_action --service_name=cockpit.socket --action="start" --log_path="/var/log/$app/$app.log" + #================================================= # SETUP SSOWAT #================================================= From 9ac97734ed74715e54085b5b7e8e25b9e26230eb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 6 Dec 2021 23:12:58 +0100 Subject: [PATCH 6/8] Fix --- conf/nginx.conf | 2 +- manifest.json | 5 ----- scripts/install | 28 +++++++--------------------- scripts/remove | 10 +--------- 4 files changed, 9 insertions(+), 36 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 9e0344f..d386d46 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,7 +1,7 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location ^~ __PATH__/ { - proxy_pass http://127.0.0.1:__PORT__; + proxy_pass http://127.0.0.1:__PORT__/; proxy_http_version 1.1; proxy_buffering off; proxy_set_header X-Real-IP $remote_addr; diff --git a/manifest.json b/manifest.json index ab8b47e..5f88acf 100644 --- a/manifest.json +++ b/manifest.json @@ -39,11 +39,6 @@ }, "example": "/monitor", "default": "/monitor" - }, - { - "name": "is_public", - "type": "boolean", - "default": true } ] } diff --git a/scripts/install b/scripts/install index 9101304..87b5f56 100644 --- a/scripts/install +++ b/scripts/install @@ -83,34 +83,20 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 + +yunohost service add cockpit.socket --description="Monitor" --log="/var/log/$app/$app.log" + #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -# Reload services -#systemctl enable cockpit.socket --quiet -#ynh_systemd_action --service_name=cockpit.socket --action=start - -#================================================= -# ADVERTISE SERVICE IN ADMIN PANEL -#================================================= - -yunohost service add cockpit.socket --description="Monitor" #--log="/var/log/syslog" - ynh_systemd_action --service_name=cockpit.socket --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# SETUP SSOWAT -#================================================= -# ynh_script_progression --message="Configuring SSOwat..." --weight=1 - -# # Make app public if necessary or protect it -# if [ $is_public -eq 1 ] -# then -# ynh_permission_update --permission "main" --add "visitors" -# fi - #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/remove b/scripts/remove index a327b7a..09dbbb7 100644 --- a/scripts/remove +++ b/scripts/remove @@ -30,7 +30,7 @@ final_path=$(ynh_app_setting_get $app final_path) if ynh_exec_warn_less yunohost service status $app >/dev/null then ynh_script_progression --message="Removing $app service..." --weight=1 - yunohost service remove $app + yunohost service remove cockpit.socket fi #================================================= @@ -49,14 +49,6 @@ ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_app_dependencies -#================================================= -# REMOVE APP MAIN DIR -#================================================= -# ynh_print_info "Removing app main directory" - -# # Remove the app directory securely -# ynh_secure_remove "$final_path" - #================================================= # REMOVE NGINX CONFIGURATION #================================================= From 3cbb950504fac3afeda7d34c472fea020a9fad72 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 6 Dec 2021 23:14:43 +0100 Subject: [PATCH 7/8] Update install --- scripts/install | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index 87b5f56..f9a3e89 100644 --- a/scripts/install +++ b/scripts/install @@ -22,25 +22,16 @@ ynh_abort_if_errors # Retrieve arguments domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH -is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -# ynh_script_progression --message="Validating installation parameters..." --weight=1 +ynh_script_progression --message="Validating installation parameters..." --weight=1 -# 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 +# Register (book) web path +ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST From c5402814aad83e63e9a46662ac10e6aedb69bfdf Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 6 Dec 2021 23:17:42 +0100 Subject: [PATCH 8/8] Update install --- scripts/install | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index f9a3e89..ae0e14e 100644 --- a/scripts/install +++ b/scripts/install @@ -79,15 +79,16 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add cockpit.socket --description="Monitor" --log="/var/log/$app/$app.log" +#yunohost service add cockpit.socket --description="Monitor" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -ynh_systemd_action --service_name=cockpit.socket --action="start" --log_path="/var/log/$app/$app.log" - +#ynh_systemd_action --service_name=cockpit.socket --action="start" --log_path="/var/log/$app/$app.log" +systemctl enable cockpit.socket +systemctl start cockpit.socket #================================================= # RELOAD NGINX #=================================================