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 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/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 e9dbce2..5f88acf 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,13 +33,12 @@ { "name": "path", "type": "path", - "example": "/cockpit", - "default": "/cockpit" - }, - { - "name": "is_public", - "type": "boolean", - "default": true + "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" } ] } diff --git a/scripts/install b/scripts/install index 38a1043..ae0e14e 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 @@ -66,7 +57,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/cockpit.conf" --destination="/etc/cockpit/cockpit.conf" #================================================= # NGINX CONFIGURATION @@ -76,26 +74,21 @@ 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 start $app -systemctl enable $app --quiet - -#================================================= -# 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 - +#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 #================================================= 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 #=================================================