mirror of
https://github.com/YunoHost-Apps/cockpit_ynh.git
synced 2024-09-03 18:16:26 +02:00
Merge remote-tracking branch 'origin/testing' into example
This commit is contained in:
commit
cc9c5cd7a4
7 changed files with 40 additions and 52 deletions
|
@ -19,7 +19,7 @@ Cockpit is a web-based graphical interface for servers, intended for everyone.
|
||||||
|
|
||||||
**Shipped version:** 257~ynh1
|
**Shipped version:** 257~ynh1
|
||||||
|
|
||||||
**Demo:** https://demo.example.com
|
|
||||||
|
|
||||||
## Screenshots
|
## 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 app website: https://cockpit-project.org/
|
||||||
* Official admin documentation: https://cockpit-project.org/documentation.html
|
* 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
|
* YunoHost documentation for this app: https://yunohost.org/app_cockpit
|
||||||
* Report a bug: https://github.com/YunoHost-Apps/cockpit_ynh/issues
|
* Report a bug: https://github.com/YunoHost-Apps/cockpit_ynh/issues
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ Cockpit is a web-based graphical interface for servers, intended for everyone.
|
||||||
|
|
||||||
**Version incluse :** 257~ynh1
|
**Version incluse :** 257~ynh1
|
||||||
|
|
||||||
**Démo :** https://demo.example.com
|
|
||||||
|
|
||||||
## Captures d'écran
|
## 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/
|
* Site officiel de l'app : https://cockpit-project.org/
|
||||||
* Documentation officielle de l'admin : https://cockpit-project.org/documentation.html
|
* 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
|
* Documentation YunoHost pour cette app : https://yunohost.org/app_cockpit
|
||||||
* Signaler un bug : https://github.com/YunoHost-Apps/cockpit_ynh/issues
|
* Signaler un bug : https://github.com/YunoHost-Apps/cockpit_ynh/issues
|
||||||
|
|
||||||
|
|
8
conf/cockpit.conf
Normal file
8
conf/cockpit.conf
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[WebService]
|
||||||
|
Origins = https://__DOMAIN__
|
||||||
|
https://127.0.0.1:9090
|
||||||
|
|
||||||
|
[WebService]
|
||||||
|
ProtocolHeader = X-Forwarded-Proto
|
||||||
|
|
||||||
|
UrlRoot = __PATH__/
|
|
@ -1,7 +1,7 @@
|
||||||
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||||
location ^~ __PATH__/ {
|
location ^~ __PATH__/ {
|
||||||
|
|
||||||
proxy_pass http://127.0.0.1:__PORT__;
|
proxy_pass http://127.0.0.1:__PORT__/;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
|
|
@ -11,9 +11,7 @@
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "LGPL-2.1-only",
|
"license": "LGPL-2.1-only",
|
||||||
"website": "https://cockpit-project.org/",
|
"website": "https://cockpit-project.org/",
|
||||||
"demo": "https://demo.example.com",
|
"admindoc": "https://cockpit-project.org/documentation.html"
|
||||||
"admindoc": "https://cockpit-project.org/documentation.html",
|
|
||||||
"code": "https://some.forge.com/example/example"
|
|
||||||
},
|
},
|
||||||
"license": "LGPL-2.1-only",
|
"license": "LGPL-2.1-only",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
@ -35,13 +33,12 @@
|
||||||
{
|
{
|
||||||
"name": "path",
|
"name": "path",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"example": "/cockpit",
|
"help": {
|
||||||
"default": "/cockpit"
|
"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",
|
||||||
"name": "is_public",
|
"default": "/monitor"
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,25 +22,16 @@ ynh_abort_if_errors
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url=$YNH_APP_ARG_PATH
|
path_url=$YNH_APP_ARG_PATH
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
# 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
|
# Register (book) web path
|
||||||
# test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
||||||
|
|
||||||
# # 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
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE SETTINGS FROM MANIFEST
|
# 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_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
|
# NGINX CONFIGURATION
|
||||||
|
@ -76,26 +74,21 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_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
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=2
|
ynh_script_progression --message="Starting a systemd service..." --weight=2
|
||||||
|
|
||||||
# Reload services
|
#ynh_systemd_action --service_name=cockpit.socket --action="start" --log_path="/var/log/$app/$app.log"
|
||||||
systemctl start $app
|
systemctl enable cockpit.socket
|
||||||
systemctl enable $app --quiet
|
systemctl start cockpit.socket
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# 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
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -30,7 +30,7 @@ final_path=$(ynh_app_setting_get $app final_path)
|
||||||
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Removing $app service..." --weight=1
|
ynh_script_progression --message="Removing $app service..." --weight=1
|
||||||
yunohost service remove $app
|
yunohost service remove cockpit.socket
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -49,14 +49,6 @@ ynh_script_progression --message="Removing dependencies..." --weight=1
|
||||||
# Remove metapackage and its dependencies
|
# Remove metapackage and its dependencies
|
||||||
ynh_remove_app_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
|
# REMOVE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue