From 389230b58b6334b2bc2a4f476204db22d66c330c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 5 Feb 2024 13:11:42 +0100 Subject: [PATCH] Packagingv2, revamp --- check_process | 22 ------ conf/app.src | 7 -- conf/{client.json.example => client.json} | 14 ++-- conf/{config.conf.example => server.conf} | 13 +++- conf/systemd.service | 49 +++++++++++++ doc/DISCLAIMER.md | 0 manifest.json | 37 ---------- manifest.toml | 52 ++++++++++++++ scripts/backup | 17 ----- scripts/change_url | 83 +---------------------- scripts/install | 78 ++++----------------- scripts/remove | 38 +++-------- scripts/restore | 50 ++++---------- scripts/upgrade | 24 +++---- tests.toml | 5 ++ 15 files changed, 172 insertions(+), 317 deletions(-) delete mode 100644 check_process delete mode 100644 conf/app.src rename conf/{client.json.example => client.json} (89%) rename conf/{config.conf.example => server.conf} (89%) create mode 100644 conf/systemd.service delete mode 100644 doc/DISCLAIMER.md delete mode 100644 manifest.json create mode 100644 manifest.toml create mode 100644 tests.toml diff --git a/check_process b/check_process deleted file mode 100644 index d2aa1b0..0000000 --- a/check_process +++ /dev/null @@ -1,22 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - path="/path" - admin="john" - is_public=1 - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - backup_restore=1 - multi_instance=0 - change_url=1 -;;; Options -Email= -Notification=none -;;; Upgrade options - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1& diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 768a4e4..0000000 --- a/conf/app.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://kiwiirc.com/downloads/kiwiirc_20.05.24.1-1_amd64.deb -SOURCE_SUM=c99504c6de678fd91aed357ff0dada16a8df9e932970ed85767b516a9f87df52 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=deb -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=kiwiirc.deb -SOURCE_EXTRACT=false diff --git a/conf/client.json.example b/conf/client.json similarity index 89% rename from conf/client.json.example rename to conf/client.json index a875a34..49a1977 100644 --- a/conf/client.json.example +++ b/conf/client.json @@ -16,10 +16,16 @@ { "name": "Elite", "url": "static/themes/elite" } ], "startupOptions" : { + "infoContent": "

Welcome to your Kiwi IRC page!

Now to configure it.

You can modify this page via the /etc/kiwiirc/client.json file.
Add your IRC network details to /etc/kiwiirc/config.conf

Have a quick read through the config file - there are plenty of comments explaining each feature.

" + "infoBackground": "", + "greetingText": "Libera Chat", "channel": "#yunohost", "nick": "web?", - "greetingText": "Libera Chat", - "infoBackground": "", - "infoContent": "

Welcome to your Kiwi IRC page!

Now to configure it.

You can modify this page via the /etc/kiwiirc/client.json file.
Add your IRC network details to /etc/kiwiirc/config.conf

Have a quick read through the config file - there are plenty of comments explaining each feature.

" - } + }, + "embedly": { + "key": "" + }, + "plugins": [ + { "name": "customise", "url": "static/plugins/customise.html" } + ] } diff --git a/conf/config.conf.example b/conf/server.conf similarity index 89% rename from conf/config.conf.example rename to conf/server.conf index f721721..41f9af5 100644 --- a/conf/config.conf.example +++ b/conf/server.conf @@ -62,7 +62,7 @@ port = __PORT__ # Optional, but handy for serving the Kiwi IRC client if no other webserver is available [fileserving] enabled = true -webroot = /usr/share/kiwiirc/ +webroot = __INSTALL_DIR__/www/ [transports] websocket @@ -98,6 +98,11 @@ throttle = 2 # Webirc password as set in the IRC server config webirc = "" serverpassword = "" +# Outgoing protocol, valid options: tcp, tcp4, tcp6, unix +# this can be used to force ipv4, ipv6 etc +protocol = tcp +# IP address of the local network interface to bind for outgoing connections +localaddr = "" # A public gateway to any IRC network @@ -107,6 +112,10 @@ serverpassword = "" enabled = false timeout = 5 throttle = 2 +# Outgoing protocol, valid options: tcp, tcp4, tcp6 +protocol = tcp +# IP address of the local network interface to bind for outgoing connections +localaddr = "" # Whitelisted IRC networks while in public gateway mode # If any networks are in this list then connections can only be made to these @@ -122,7 +131,7 @@ irc.network2.org = webirc_password [dnsbl] # "verify" - if the client supports it, tell it to show a captcha # "deny" - deny the connection entirely -action = deny +action = verify [dnsbl.servers] dnsbl.dronebl.org diff --git a/conf/systemd.service b/conf/systemd.service new file mode 100644 index 0000000..d9366dd --- /dev/null +++ b/conf/systemd.service @@ -0,0 +1,49 @@ +[Unit] +Description=KiwiIRC server +After=network.target + +[Service] +Type=simple +User=__APP__ +Group=__APP__ +WorkingDirectory=__INSTALL_DIR__/ +ExecStart=__INSTALL_DIR__/kiwiirc --config __INSTALL_DIR__/config.conf +StandardOutput=append:/var/log/__APP__/__APP__.log +StandardError=inherit + +### Depending on specificities of your service/app, you may need to tweak these +### .. but this should be a good baseline +# Sandboxing options to harden security +# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html +NoNewPrivileges=yes +PrivateTmp=yes +PrivateDevices=yes +RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK +RestrictNamespaces=yes +RestrictRealtime=yes +DevicePolicy=closed +ProtectClock=yes +ProtectHostname=yes +ProtectProc=invisible +ProtectSystem=full +ProtectControlGroups=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes +LockPersonality=yes +SystemCallArchitectures=native +SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation @privileged + +# Denying access to capabilities that should not be relevant for webapps +# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html +CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD +CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE +CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT +CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK +CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM +CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG +CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE +CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW +CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG + +[Install] +WantedBy=multi-user.target 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 deleted file mode 100644 index 45e31df..0000000 --- a/manifest.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "KiwiIRC", - "id": "kiwiirc", - "packaging_format": 1, - "description": { - "en": "Versatile web based messenger using IRC", - "fr": "Messagerie Web polyvalente utilisant IRC" - }, - "version": "20.05.24.1~ynh1", - "url": "https://github.com/kiwiirc/kiwiirc", - "upstream": { - "license": "AGPL-3.0-only", - "website": "https://kiwiirc.com/", - "demo": "https://kiwiirc.com/nextclient", - "admindoc": "https://github.com/kiwiirc/kiwiirc/wiki", - "code": "https://github.com/kiwiirc/kiwiirc" - }, - "license": "AGPL-3.0-only", - "maintainer": { - "name": "eric_G" - }, - "requirements": { - "yunohost": ">= 4.3.0" - }, - "multi_instance": false, - "services": [ - "nginx" - ], - "arguments": { - "install" : [ - { - "name": "domain", - "type": "domain" - } - ] - } -} diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..c2e62ef --- /dev/null +++ b/manifest.toml @@ -0,0 +1,52 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + +packaging_format = 2 + +id = "kiwiirc" +name = "KiwiIRC" +description.en = "Versatile web based messenger using IRC" +description.fr = "Messagerie Web polyvalente utilisant IRC" + +version = "1.7.0~ynh1" + +maintainers = ["eric_G"] + +[upstream] +license = "AGPL-3.0-only" +website = "https://kiwiirc.com/" +demo = "https://kiwiirc.com/nextclient" +admindoc = "https://github.com/kiwiirc/kiwiirc/wiki" +code = "https://github.com/kiwiirc/kiwiirc" +fund = "https://kiwiirc.com/donate" + +[integration] +yunohost = ">= 11.2" +architectures = "all" +multi_instance = false +ldap = "not_relevant" +sso = "not_relevant" +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.domain] + type = "domain" + +[resources] + [resources.sources.main] + amd64.url = "https://github.com/kiwiirc/kiwiirc/releases/download/v1.7.0/kiwiirc-server_v1.7.0-2_linux_amd64.zip" + amd64.sha256 = "790d3b126ac4096d6a34de518f4cade9a291a1e0fe454c99aa460d508e916964" + arm64.url = "https://github.com/kiwiirc/kiwiirc/releases/download/v1.7.0/kiwiirc-server_v1.7.0-2_linux_arm64.zip" + arm64.sha256 = "32e1cc27f15c3057cd6c523a89c45e1663e0b02a4499df6a0c8338e8eebb0329" + armhf.url = "https://github.com/kiwiirc/kiwiirc/releases/download/v1.7.0/kiwiirc-server_v1.7.0-2_linux_armhf.zip" + armhf.sha256 = "a437d67447b169f6c72ae1a216aff277e2cd35df145c339d6ffd08eb796b6e22" + + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + main.url = "/" + + [resources.ports] + main.default = 7778 diff --git a/scripts/backup b/scripts/backup index 474d4f0..4ef0540 100644 --- a/scripts/backup +++ b/scripts/backup @@ -9,23 +9,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_print_info --message="Loading installation settings..." - -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) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/change_url b/scripts/change_url index 6834cfe..4ba8cf7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,93 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH - -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -port=$(ynh_app_setting_get --app=$app --key=port) - -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -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 () { - # 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" - - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -change_domain=0 -if [ "$old_domain" != "$new_domain" ] -then - change_domain=1 -fi - -change_path=0 -if [ "$old_path" != "$new_path" ] -then - change_path=1 -fi - #================================================= # MODIFY URL IN NGINX CONF #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 -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" - # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" - # Create a dedicated NGINX config - 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 - # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload +ynh_change_url_nginx_config #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 489f595..17786a5 100644 --- a/scripts/install +++ b/scripts/install @@ -9,83 +9,36 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -domain=$YNH_APP_ARG_DOMAIN -path_url="/" - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 - -# Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -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 - -#================================================= -# FIND AND OPEN A PORT -#================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 - -# Find an available port -port=$(ynh_find_port --port=7778) -ynh_app_setting_set --app=$app --key=port --value=$port - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=2 -tempdir="$(mktemp -d)" -ynh_setup_source --dest_dir=$tempdir --source_id=app -ynh_exec_warn_less dpkg -i $tempdir/kiwiirc.deb +ynh_setup_source --source_id="main" --dest_dir="$install_dir" #================================================= # ADD A CONFIGURATION #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/client.json.example" --destination="/etc/kiwiirc/client.json" -ynh_add_config --template="../conf/config.conf.example" --destination="/etc/kiwiirc/config.conf" +ynh_add_config --template="config.conf" --destination="$install_dir/config.conf" +chmod 400 "$install_dir/config.conf" +chown root: "$install_dir/config.conf" -chmod 744 "/etc/kiwiirc/config.conf" -chown root: "/etc/kiwiirc/config.conf" -chmod 744 "/etc/kiwiirc/client.json" -chown root: "/etc/kiwiirc/client.json" +ynh_add_config --template="client.json" --destination="$install_dir/www/static/client.json" +chmod 400 "$install_dir/www/static/client.json" +chown root: "$install_dir/www/static/client.json" #================================================= -# NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # 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 $app --description="Versatile web based messenger using IRC" --log="/var/log/$app.log" +ynh_add_systemd_config +yunohost service add "$app" --description="Versatile web based messenger using IRC" --log="/var/log/$app.log" #================================================= # START SYSTEMD SERVICE @@ -93,14 +46,7 @@ yunohost service add $app --description="Versatile web based messenger using IRC ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=2 - -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemd_action --service_name="$app" --action="restart" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 873bdbf..0707233 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,35 +10,21 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# LOAD SETTINGS +# REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 -app=$YNH_APP_INSTANCE_NAME - -domain=$(ynh_app_setting_get --app=$app --key=domain) -port=$(ynh_app_setting_get --app=$app --key=port) - -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST -#================================================= - -if ynh_exec_warn_less yunohost service status $app >/dev/null -then - ynh_script_progression --message="Removing $app service integration..." --weight=1 - yunohost service remove $app +# 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; 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_remove_systemd_config +# Remove the dedicated nginx config +ynh_remove_nginx_config + #================================================= # REMOVE APP MAIN DIR #================================================= @@ -57,14 +43,6 @@ ynh_secure_remove --file="/etc/$app" # Remove the log files ynh_secure_remove --file="/var/log/$app.log" -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=5 - -# Remove the dedicated nginx config -ynh_remove_nginx_config - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index f3c6ae1..8bc5a8d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,37 +10,13 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= -# MANAGE SCRIPT FAILURE +# RESTORE SYSTEM CONFIGURATIONS #================================================= - -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading settings..." --weight=1 - -app=$YNH_APP_INSTANCE_NAME - -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) - -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX 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" -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE -#================================================= -ynh_script_progression --message="Setting up source files..." --weight=2 - -tempdir="$(mktemp -d)" -ynh_setup_source --dest_dir=$tempdir --source_id=app -ynh_exec_warn_less dpkg -i $tempdir/kiwiirc.deb +yunohost service add $app --description="Versatile web based messenger using IRC" --log="/var/log/$app.log" #================================================= # RESTORE THE NGINX CONFIGURATION @@ -52,24 +28,22 @@ ynh_restore_file --origin_path="/etc/kiwiirc" ynh_restore_file --origin_path="/var/log/$app.log" #================================================= -# INTEGRATE SERVICE IN YUNOHOST +# DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +ynh_script_progression --message="Setting up source files..." --weight=2 -yunohost service add $app --description="Versatile web based messenger using IRC" --log="/var/log/$app.log" +tempdir="$(mktemp -d)" +ynh_setup_source --dest_dir=$tempdir +ynh_exec_warn_less dpkg -i $tempdir/kiwiirc.deb #================================================= -# START SYSTEMD SERVICE +# GENERIC FINALIZATION #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" - +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 99de337..6a1dd10 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,13 +12,13 @@ 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) -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 VERSION @@ -32,13 +32,13 @@ upgrade_type=$(ynh_check_app_version_changed) ynh_script_progression --message="Backing up KiwiIRC before upgrading..." --weight=3 # 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 #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -47,7 +47,7 @@ ynh_abort_if_errors if [ "$upgrade_type" == "UPGRADE_APP" ] then tempdir="$(mktemp -d)" - ynh_setup_source --dest_dir=$tempdir --source_id=app + ynh_setup_source --dest_dir=$tempdir ynh_exec_warn_less dpkg -i $tempdir/kiwiirc.deb fi @@ -77,9 +77,9 @@ ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" #================================================= # 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? 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..94abb79 --- /dev/null +++ b/tests.toml @@ -0,0 +1,5 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json + +test_format = 1.0 + +[default]