From 02645c06a0f57e6515f082f8c118f963bfb7c176 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 24 Sep 2021 07:43:11 +0200 Subject: [PATCH 01/41] fix --- doc/DESCRIPTION.md | 2 +- manifest.json | 7 +++---- scripts/backup | 2 +- scripts/change_url | 4 ++-- scripts/install | 4 ++-- scripts/remove | 4 ++-- scripts/restore | 4 ++-- scripts/upgrade | 2 +- 8 files changed, 14 insertions(+), 15 deletions(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index c6e5fe0..f4092b7 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,6 +1,6 @@ A versatile web based messenger using IRC -###Features: +### Features: - For single networks, bouncer hosts, or a personal generic IRC client that remembers your networks - Works out of the box with a default IRC network - or use your own diff --git a/manifest.json b/manifest.json index 836a938..7f3f7c8 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "kiwiirc", "packaging_format": 1, "description": { - "en": "A versatile web based messenger using IRC", - "fr": "Une messagerie Web polyvalente utilisant IRC" + "en": "Versatile web based messenger using IRC", + "fr": "Messagerie Web polyvalente utilisant IRC" }, "version": "1.5.0~ynh1", "url": "https://github.com/kiwiirc/kiwiirc", @@ -31,8 +31,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "domain.org" + "type": "domain" }, { "name": "path", diff --git a/scripts/backup b/scripts/backup index 248181b..11f1bbb 100644 --- a/scripts/backup +++ b/scripts/backup @@ -56,4 +56,4 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for KiwiIRC. (YunoHost will then actually copy those files to the archive)." +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index f1f2183..554a6f8 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -33,7 +33,7 @@ port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up KiwiIRC before changing its URL (may take a while)..." --weight=1 +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 @@ -103,4 +103,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for KiwiIRC" --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index b454e28..85bae3d 100644 --- a/scripts/install +++ b/scripts/install @@ -133,7 +133,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary or protect it if [ $is_public -eq 1 ] @@ -152,4 +152,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of KiwiIRC completed" --last +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove index 65fc0d6..eb5b1aa 100644 --- a/scripts/remove +++ b/scripts/remove @@ -43,7 +43,7 @@ ynh_remove_systemd_config #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing KiwiIRC main directory..." --weight=6 +ynh_script_progression --message="Removing the app main directory..." --weight=6 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -72,4 +72,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of KiwiIRC completed" --last +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index 14fa6db..65dbec6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -56,7 +56,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring KiwiIRC main directory..." --weight=60 +ynh_script_progression --message="Restoring $app main directory..." --weight=60 ynh_restore_file --origin_path="$final_path" @@ -97,4 +97,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for KiwiIRC" --last +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index cf1817a..0357364 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -127,4 +127,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of KiwiIRC completed" --last +ynh_script_progression --message="Upgrade of $app completed" --last From 1160f7be3050cb4dd2b7d315b2ebcb058f1cd0b1 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 24 Sep 2021 05:43:16 +0000 Subject: [PATCH 02/41] 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 17191ec..58bb068 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in A versatile web based messenger using IRC -###Features: +### Features: - For single networks, bouncer hosts, or a personal generic IRC client that remembers your networks - Works out of the box with a default IRC network - or use your own diff --git a/README_fr.md b/README_fr.md index 69d6651..610416b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour A versatile web based messenger using IRC -###Features: +### Features: - For single networks, bouncer hosts, or a personal generic IRC client that remembers your networks - Works out of the box with a default IRC network - or use your own From e3130a231cc5f0a177c1c5de6e7508b0b0accf90 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 2 Feb 2022 22:58:35 +0100 Subject: [PATCH 03/41] Fix --- conf/nginx.conf | 5 ----- manifest.json | 3 +-- scripts/install | 1 + 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 052c370..508fc0a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,11 +4,6 @@ location __PATH__/ { # Path to source alias __FINALPATH__/ ; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } diff --git a/manifest.json b/manifest.json index 7f3f7c8..5acca76 100644 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,6 @@ "website": "https://kiwiirc.com/", "demo": "https://kiwiirc.com/nextclient", "admindoc": "https://github.com/kiwiirc/kiwiirc/wiki", - "userdoc": "https://yunohost.org/apps", "code": "https://github.com/kiwiirc/kiwiirc" }, "license": "AGPL-3.0-only", @@ -21,7 +20,7 @@ "name": "" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": false, "services": [ diff --git a/scripts/install b/scripts/install index 85bae3d..31c9791 100644 --- a/scripts/install +++ b/scripts/install @@ -90,6 +90,7 @@ mv ../sources/webircgateway/* $webircgateway_path chmod 750 "$webircgateway_path" chmod -R o-rwx "$webircgateway_path" chown -R $app:www-data "$webircgateway_path" +chmod +x "$webircgateway_path/kiwiirc" #================================================= # NGINX CONFIGURATION From 07513a9cbb1aa81c7b015d93bfb2bf1072063542 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Wed, 2 Feb 2022 21:58:49 +0000 Subject: [PATCH 04/41] Auto-update README --- README.md | 1 - README_fr.md | 1 - 2 files changed, 2 deletions(-) diff --git a/README.md b/README.md index 58bb068..2a1ca54 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,6 @@ A versatile web based messenger using IRC ## Documentation and resources * Official app website: https://kiwiirc.com/ -* Official user documentation: https://yunohost.org/apps * Official admin documentation: https://github.com/kiwiirc/kiwiirc/wiki * Upstream app code repository: https://github.com/kiwiirc/kiwiirc * YunoHost documentation for this app: https://yunohost.org/app_kiwiirc diff --git a/README_fr.md b/README_fr.md index 610416b..46ade42 100644 --- a/README_fr.md +++ b/README_fr.md @@ -34,7 +34,6 @@ A versatile web based messenger using IRC ## Documentations et ressources * Site officiel de l'app : https://kiwiirc.com/ -* Documentation officielle utilisateur : https://yunohost.org/apps * Documentation officielle de l'admin : https://github.com/kiwiirc/kiwiirc/wiki * Dépôt de code officiel de l'app : https://github.com/kiwiirc/kiwiirc * Documentation YunoHost pour cette app : https://yunohost.org/app_kiwiirc From 095099be8d25a6972451236abce88fdd2d3eaf0c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 2 Feb 2022 22:59:26 +0100 Subject: [PATCH 05/41] Update upgrade --- scripts/upgrade | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0357364..56d12b5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -71,22 +71,22 @@ then ynh_script_progression --message="Upgrading source files..." --weight=3 # Create a temporary directory - tmpdir="$(mktemp -d)" + #tmpdir="$(mktemp -d)" # Backup the config file in the temp dir - cp -a "$final_path/static/config.json" "$tmpdir/config.json" + #cp -a "$final_path/static/config.json" "$tmpdir/config.json" # Remove the app directory securely - ynh_secure_remove --file=$final_path + #ynh_secure_remove --file=$final_path # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir=$final_path + ynh_setup_source --dest_dir=$final_path --keep="$final_path/static/config.json" #Copy the admin saved settings from tmp directory to final path - cp -a "$tmpdir/config.json" "$final_path/static/config.json" + #cp -a "$tmpdir/config.json" "$final_path/static/config.json" # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" + #ynh_secure_remove --file="$tmpdir" fi chmod 750 "$final_path" From 006d86d0cfe122b281a926343df06b1d65a80d5e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 2 Feb 2022 23:23:32 +0100 Subject: [PATCH 06/41] Fix --- conf/app.src | 9 +++++---- scripts/install | 24 +++++++++++++++--------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/conf/app.src b/conf/app.src index f53f889..da13b92 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,7 @@ -SOURCE_URL=https://github.com/kiwiirc/kiwiirc/releases/download/v1.5.0/kiwiirc_v1.5.0.zip -SOURCE_SUM=c7b31b2a92b173db4a3878d95aa74c8eb796e7b4d5600a80a00a73d80aa12ada +SOURCE_URL=https://kiwiirc.com/downloads/kiwiirc_20.05.24.1-1_amd64.deb +SOURCE_SUM=c99504c6de678fd91aed357ff0dada16a8df9e932970ed85767b516a9f87df52 SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip +SOURCE_FORMAT=deb SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= +SOURCE_FILENAME=kiwiirc_20.05.24.1-1_amd64.deb +SOURCE_EXTRACT=false \ No newline at end of file diff --git a/scripts/install b/scripts/install index b454e28..00bdde1 100644 --- a/scripts/install +++ b/scripts/install @@ -69,27 +69,33 @@ ynh_script_progression --message="Setting up source files..." --weight=2 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" +#ynh_setup_source --dest_dir="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +tempdir="$(mktemp -d)" + +ynh_setup_source --dest_dir=$tempdir --source_id=app + +ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb + #================================================= #CREAT GATEWAYPATH #================================================= -ynh_script_progression --message="Setting up gatheway path..." --weight=2 +# ynh_script_progression --message="Setting up gatheway path..." --weight=2 -webircgateway_path=/var/www/webircgateway -mkdir -p $webircgateway_path +# webircgateway_path=/var/www/webircgateway +# mkdir -p $webircgateway_path -ynh_app_setting_set --app=$app --key=webircgateway_path --value=$webircgateway_path +# ynh_app_setting_set --app=$app --key=webircgateway_path --value=$webircgateway_path -mv ../sources/webircgateway/* $webircgateway_path +# mv ../sources/webircgateway/* $webircgateway_path -chmod 750 "$webircgateway_path" -chmod -R o-rwx "$webircgateway_path" -chown -R $app:www-data "$webircgateway_path" +# chmod 750 "$webircgateway_path" +# chmod -R o-rwx "$webircgateway_path" +# chown -R $app:www-data "$webircgateway_path" #================================================= # NGINX CONFIGURATION From d8b5c8049281a9315fcf05f4e550a0e74322bc2e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 08:19:27 +0100 Subject: [PATCH 07/41] Update nginx.conf --- conf/nginx.conf | 5 ----- 1 file changed, 5 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 052c370..508fc0a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,11 +4,6 @@ location __PATH__/ { # Path to source alias __FINALPATH__/ ; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } From f1ced0ac4e05c43dd48bffb8ee056ed8b79fd41b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 09:48:16 +0100 Subject: [PATCH 08/41] Add permissions --- conf/app.src | 1 - scripts/install | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/conf/app.src b/conf/app.src index f53f889..9c038a2 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,4 +3,3 @@ SOURCE_SUM=c7b31b2a92b173db4a3878d95aa74c8eb796e7b4d5600a80a00a73d80aa12ada SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/scripts/install b/scripts/install index 31c9791..e320bf6 100644 --- a/scripts/install +++ b/scripts/install @@ -116,6 +116,11 @@ ynh_script_progression --message="Modifying a config file..." ynh_add_config --template="../conf/config.json.example" --destination="$final_path/static/config.json" ynh_add_config --template="../conf/config.conf.example" --destination="$webircgateway_path/config.conf" +chmod 600 "$final_path/static/config.json" +chmod 600 "$webircgateway_path/config.conf" +chown $app:$app "$final_path/some_config_file" +chown $app:$app "$webircgateway_path/config.conf" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= From 5c6fdf62d16150fc72c5935f2a0067d6b4fc6b98 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 09:51:01 +0100 Subject: [PATCH 09/41] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index e320bf6..4e6b163 100644 --- a/scripts/install +++ b/scripts/install @@ -118,7 +118,7 @@ ynh_add_config --template="../conf/config.conf.example" --destination="$webircga chmod 600 "$final_path/static/config.json" chmod 600 "$webircgateway_path/config.conf" -chown $app:$app "$final_path/some_config_file" +chown $app:$app "$final_path/static/config.json" chown $app:$app "$webircgateway_path/config.conf" #================================================= From 644ac6a23d3fd0522a79258ace48fb1c51f78d47 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 18:49:01 +0100 Subject: [PATCH 10/41] Update install --- scripts/install | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/scripts/install b/scripts/install index 00bdde1..2aa3206 100644 --- a/scripts/install +++ b/scripts/install @@ -48,11 +48,11 @@ 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 +# 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 +# # Find an available port +# port=$(ynh_find_port --port=7778) +# ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # CREATE DEDICATED USER @@ -65,15 +65,15 @@ ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=2 +# ynh_script_progression --message="Setting up source files..." --weight=2 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path -# Download, check integrity, uncompress and patch the source from app.src -#ynh_setup_source --dest_dir="$final_path" +# ynh_app_setting_set --app=$app --key=final_path --value=$final_path +# # Download, check integrity, uncompress and patch the source from app.src +# #ynh_setup_source --dest_dir="$final_path" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +# chmod 750 "$final_path" +# chmod -R o-rwx "$final_path" +# chown -R $app:www-data "$final_path" tempdir="$(mktemp -d)" @@ -100,10 +100,10 @@ ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 +# ynh_script_progression --message="Configuring NGINX web server..." --weight=2 -# Create a dedicated NGINX config -ynh_add_nginx_config +# # Create a dedicated NGINX config +# ynh_add_nginx_config #================================================= # SETUP SYSTEMD @@ -113,13 +113,13 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# MODIFY A CONFIG FILE -#================================================= -ynh_script_progression --message="Modifying a config file..." +# #================================================= +# # MODIFY A CONFIG FILE +# #================================================= +# ynh_script_progression --message="Modifying a config file..." -ynh_add_config --template="../conf/config.json.example" --destination="$final_path/static/config.json" -ynh_add_config --template="../conf/config.conf.example" --destination="$webircgateway_path/config.conf" +# ynh_add_config --template="../conf/config.json.example" --destination="$final_path/static/config.json" +# ynh_add_config --template="../conf/config.conf.example" --destination="$webircgateway_path/config.conf" #================================================= # INTEGRATE SERVICE IN YUNOHOST From 8efcb6bc7b777433cbd0423021ef8e7629d48142 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 18:51:24 +0100 Subject: [PATCH 11/41] Fix --- conf/nginx.conf | 14 ++++++++++---- scripts/install | 8 ++++---- scripts/remove | 8 ++++---- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 508fc0a..2424f64 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,9 +1,15 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Path to source - alias __FINALPATH__/ ; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header x-forwarded-for $remote_addr; - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; + proxy_pass http://127.0.0.1:__PORT__; + proxy_redirect default; + + # Websocket support (from version 1.4) + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; } diff --git a/scripts/install b/scripts/install index 2aa3206..4ffd8e5 100644 --- a/scripts/install +++ b/scripts/install @@ -48,11 +48,11 @@ 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 +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 +# Find an available port +port=$(ynh_find_port --port=7778) +ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # CREATE DEDICATED USER diff --git a/scripts/remove b/scripts/remove index 65fc0d6..d09b0bd 100644 --- a/scripts/remove +++ b/scripts/remove @@ -45,11 +45,11 @@ ynh_remove_systemd_config #================================================= ynh_script_progression --message="Removing KiwiIRC main directory..." --weight=6 -# Remove the app directory securely -ynh_secure_remove --file="$final_path" - -ynh_secure_remove --file="/var/www/webircgateway" +# # Remove the app directory securely +# ynh_secure_remove --file="$final_path" +# ynh_secure_remove --file="/var/www/webircgateway" +dpkg --remove kiwiirc #================================================= # REMOVE NGINX CONFIGURATION #================================================= From f8bc5e34a446804c7f1d68ee3d7acb18c40c54ae Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 18:58:38 +0100 Subject: [PATCH 12/41] Fix --- conf/nginx.conf | 2 +- scripts/install | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 2424f64..f4bb9b0 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -5,7 +5,7 @@ location __PATH__/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header x-forwarded-for $remote_addr; - proxy_pass http://127.0.0.1:__PORT__; + proxy_pass http://127.0.0.1:__PORT__/kiwi/; proxy_redirect default; # Websocket support (from version 1.4) diff --git a/scripts/install b/scripts/install index 4ffd8e5..f06dd46 100644 --- a/scripts/install +++ b/scripts/install @@ -100,10 +100,10 @@ ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb #================================================= # NGINX CONFIGURATION #================================================= -# ynh_script_progression --message="Configuring NGINX web server..." --weight=2 +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 -# # Create a dedicated NGINX config -# ynh_add_nginx_config +# Create a dedicated NGINX config +ynh_add_nginx_config #================================================= # SETUP SYSTEMD From 73173b86ad97c33cfaa7de73edf337b54f2042e4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 19:18:24 +0100 Subject: [PATCH 13/41] Fix --- conf/nginx.conf | 34 ++++++++++++++++++++-------------- conf/systemd.service | 14 -------------- scripts/install | 12 ++++++------ 3 files changed, 26 insertions(+), 34 deletions(-) delete mode 100644 conf/systemd.service diff --git a/conf/nginx.conf b/conf/nginx.conf index f4bb9b0..19d6268 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,15 +1,21 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { - - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header x-forwarded-for $remote_addr; - - proxy_pass http://127.0.0.1:__PORT__/kiwi/; - proxy_redirect default; - - # Websocket support (from version 1.4) - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; +location / { + index index.html; + root /usr/share/kiwiirc/; } + +location /webirc/ { + # Forward incoming requests to local webircgateway socket + proxy_pass http://127.0.0.1:__PORT__/webirc/; + + # Set http version and headers + proxy_http_version 1.1; + + # Add X-Forwarded-* headers + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-For $remote_addr; + + # Allow upgrades to websockets + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; +} \ No newline at end of file diff --git a/conf/systemd.service b/conf/systemd.service deleted file mode 100644 index defb1a1..0000000 --- a/conf/systemd.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Websocket gateway to IRC networks -Documentation=https://github.com/kiwiirc/webircgateway -After=network.target - -[Service] -User=__APP__ -Group=__APP__ -ExecStart=/var/www/webircgateway/kiwiirc --config=/var/www/webircgateway/config.conf -ExecReload=/usr/bin/kill -USR1 $MAINPID -LimitNOFILE=1048576 - -[Install] -WantedBy=multi-user.target diff --git a/scripts/install b/scripts/install index f06dd46..fb02465 100644 --- a/scripts/install +++ b/scripts/install @@ -31,11 +31,11 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +# final_path=/var/www/$app +# test ! -e "$final_path" || ynh_die --message="This path already contains a folder" -# Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +# # Register (book) web path +# ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST @@ -108,10 +108,10 @@ ynh_add_nginx_config #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 +#ynh_script_progression --message="Configuring a systemd service..." --weight=1 # Create a dedicated systemd config -ynh_add_systemd_config +#ynh_add_systemd_config # #================================================= # # MODIFY A CONFIG FILE From 8bfc4cc4bf67e812de77e0cbfd0e9d721c2dff5d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 19:19:20 +0100 Subject: [PATCH 14/41] Fix --- manifest.json | 6 ------ scripts/install | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/manifest.json b/manifest.json index 836a938..c60def0 100644 --- a/manifest.json +++ b/manifest.json @@ -34,12 +34,6 @@ "type": "domain", "example": "domain.org" }, - { - "name": "path", - "type": "path", - "example": "/kiwiirc", - "default": "/kiwiirc" - }, { "name": "is_public", "type": "boolean", diff --git a/scripts/install b/scripts/install index fb02465..d8f211c 100644 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH +path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME @@ -34,8 +34,8 @@ ynh_script_progression --message="Validating installation parameters..." --weigh # final_path=/var/www/$app # test ! -e "$final_path" || ynh_die --message="This path already contains a folder" -# # Register (book) web path -# ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +# Register (book) web path +ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST From 8a0c75c1132eee4998e3f0dc1c02a8e1e8403aed Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 19:22:11 +0100 Subject: [PATCH 15/41] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index d8f211c..d893956 100644 --- a/scripts/install +++ b/scripts/install @@ -60,7 +60,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port ynh_script_progression --message="Configuring system user..." --weight=3 # Create a system user -ynh_system_user_create --username=$app --home_dir=$final_path +#ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE From 5ca382246f651d4afd251ff81796347c0607d956 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 19:34:23 +0100 Subject: [PATCH 16/41] Fix --- conf/nginx.conf | 5 +++-- manifest.json | 13 +++++------ scripts/_common.sh | 5 ----- scripts/backup | 9 -------- scripts/change_url | 2 -- scripts/install | 54 +--------------------------------------------- scripts/remove | 18 ++-------------- scripts/restore | 28 ------------------------ scripts/upgrade | 45 +++----------------------------------- 9 files changed, 14 insertions(+), 165 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 3512ed3..7cd585c 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,9 +1,10 @@ -location / { +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { index index.html; root /usr/share/kiwiirc/; } -location /webirc/ { +location __PATH__/webirc/ { # Forward incoming requests to local webircgateway socket proxy_pass http://127.0.0.1:__PORT__/webirc/; diff --git a/manifest.json b/manifest.json index ee6da56..7086acd 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Versatile web based messenger using IRC", "fr": "Messagerie Web polyvalente utilisant IRC" }, - "version": "1.5.0~ynh1", + "version": "20.05.24.1~ynh1", "url": "https://github.com/kiwiirc/kiwiirc", "upstream": { "license": "AGPL-3.0-only", @@ -33,13 +33,10 @@ "type": "domain" }, { - "name": "is_public", - "type": "boolean", - "help": { - "en": "If enabled, KiwiIRC will be accessible by people who do not have an account. This can be changed later via the webadmin.", - "fr": "Si cette case est cochée, KiwiIRC sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." - }, - "default": true + "name": "path", + "type": "path", + "example": "/kiwiirc", + "default": "/kiwiirc" } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index d8b7bd0..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,11 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#pkg_dependencies="postgresql apt-transport-https" - -#nodejs_version=12 - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 11f1bbb..bdb4027 100644 --- a/scripts/backup +++ b/scripts/backup @@ -13,9 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ynh_clean_check_starting -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -34,12 +31,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= ynh_print_info --message="Declaring files to be backed up..." -#================================================= -# BACKUP THE APP MAIN DIR -#================================================= - -ynh_backup --src_path="$final_path" - #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/change_url b/scripts/change_url index 554a6f8..6834cfe 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -26,8 +26,6 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Loading installation settings..." --weight=1 -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) #================================================= diff --git a/scripts/install b/scripts/install index a805217..8f98785 100644 --- a/scripts/install +++ b/scripts/install @@ -22,7 +22,6 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" -is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME @@ -31,9 +30,6 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 -# final_path=/var/www/$app -# test ! -e "$final_path" || ynh_die --message="This path already contains a folder" - # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url @@ -54,26 +50,10 @@ ynh_script_progression --message="Finding an available port..." --weight=1 port=$(ynh_find_port --port=7778) ynh_app_setting_set --app=$app --key=port --value=$port -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=3 - -# Create a system user -#ynh_system_user_create --username=$app --home_dir=$final_path - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -# ynh_script_progression --message="Setting up source files..." --weight=2 - -# ynh_app_setting_set --app=$app --key=final_path --value=$final_path -# # Download, check integrity, uncompress and patch the source from app.src -# #ynh_setup_source --dest_dir="$final_path" - -# chmod 750 "$final_path" -# chmod -R o-rwx "$final_path" -# chown -R $app:www-data "$final_path" +ynh_script_progression --message="Setting up source files..." --weight=2 tempdir="$(mktemp -d)" @@ -89,27 +69,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SETUP SYSTEMD -#================================================= -#ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -# Create a dedicated systemd config -#ynh_add_systemd_config - -# #================================================= -# # MODIFY A CONFIG FILE -# #================================================= -# ynh_script_progression --message="Modifying a config file..." - -# ynh_add_config --template="../conf/config.json.example" --destination="$final_path/static/config.json" -# ynh_add_config --template="../conf/config.conf.example" --destination="$webircgateway_path/config.conf" - -chmod 600 "$final_path/static/config.json" -chmod 600 "$webircgateway_path/config.conf" -chown $app:$app "$final_path/static/config.json" -chown $app:$app "$webircgateway_path/config.conf" - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= @@ -125,17 +84,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Configuring permissions..." --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 55b61ec..c49288c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # STANDARD REMOVE @@ -43,13 +42,10 @@ ynh_remove_systemd_config #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing the app main directory..." --weight=6 +ynh_script_progression --message="Removing Kiwiirc..." --weight=6 -# # Remove the app directory securely -# ynh_secure_remove --file="$final_path" - -# ynh_secure_remove --file="/var/www/webircgateway" dpkg --remove kiwiirc + #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -58,16 +54,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated nginx config ynh_remove_nginx_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 65dbec6..14be590 100644 --- a/scripts/restore +++ b/scripts/restore @@ -28,15 +28,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=2 - -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " #================================================= # RESTORE THE NGINX CONFIGURATION @@ -45,25 +36,6 @@ ynh_script_progression --message="Restoring the NGINX configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" - -#================================================= -# RESTORE THE APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring $app main directory..." --weight=60 - -ynh_restore_file --origin_path="$final_path" - -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" - #================================================= # RESTORE SYSTEMD #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 56d12b5..a374e07 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,13 +18,11 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -42,57 +40,20 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -# Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." --weight=3 + tempdir="$(mktemp -d)" - # Create a temporary directory - #tmpdir="$(mktemp -d)" - - # Backup the config file in the temp dir - #cp -a "$final_path/static/config.json" "$tmpdir/config.json" - - # Remove the app directory securely - #ynh_secure_remove --file=$final_path + ynh_setup_source --dest_dir=$tempdir --source_id=app - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir=$final_path --keep="$final_path/static/config.json" + ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb - #Copy the admin saved settings from tmp directory to final path - #cp -a "$tmpdir/config.json" "$final_path/static/config.json" - - # Remove the tmp directory securely - #ynh_secure_remove --file="$tmpdir" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" - #================================================= # NGINX CONFIGURATION #================================================= From b593cbb9b6100707c690ec384e2be489efe38bc9 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Thu, 3 Feb 2022 18:34:30 +0000 Subject: [PATCH 17/41] 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 2a1ca54..b293def 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ A versatile web based messenger using IRC - Extremely versatile via a single JSON config file at runtime -**Shipped version:** 1.5.0~ynh1 +**Shipped version:** 20.05.24.1~ynh1 **Demo:** https://kiwiirc.com/nextclient diff --git a/README_fr.md b/README_fr.md index 46ade42..eb5b699 100644 --- a/README_fr.md +++ b/README_fr.md @@ -23,7 +23,7 @@ A versatile web based messenger using IRC - Extremely versatile via a single JSON config file at runtime -**Version incluse :** 1.5.0~ynh1 +**Version incluse :** 20.05.24.1~ynh1 **Démo :** https://kiwiirc.com/nextclient From 8ed9738bdd67a4a648a2ce43c5e9dd8f689fd42e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 19:34:48 +0100 Subject: [PATCH 18/41] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 8f98785..07009ff 100644 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url="/" +path_url=$YNH_APP_ARG_PATH app=$YNH_APP_INSTANCE_NAME From 5a79a20bd60bbeb29a71a54777b35fdc2f946a2a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 19:36:35 +0100 Subject: [PATCH 19/41] Fix --- conf/nginx.conf | 5 ++--- manifest.json | 6 ------ scripts/install | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 7cd585c..3512ed3 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,10 +1,9 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { +location / { index index.html; root /usr/share/kiwiirc/; } -location __PATH__/webirc/ { +location /webirc/ { # Forward incoming requests to local webircgateway socket proxy_pass http://127.0.0.1:__PORT__/webirc/; diff --git a/manifest.json b/manifest.json index 7086acd..2a285be 100644 --- a/manifest.json +++ b/manifest.json @@ -31,12 +31,6 @@ { "name": "domain", "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/kiwiirc", - "default": "/kiwiirc" } ] } diff --git a/scripts/install b/scripts/install index 07009ff..8f98785 100644 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH +path_url="/" app=$YNH_APP_INSTANCE_NAME From 1243a4612f358827af0826f1bd5952aa0d8c87b2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 19:59:32 +0100 Subject: [PATCH 20/41] Update config.conf.example --- conf/config.conf.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/config.conf.example b/conf/config.conf.example index 81f760a..2ebcfb4 100644 --- a/conf/config.conf.example +++ b/conf/config.conf.example @@ -38,8 +38,8 @@ realname = "I am a webchat user" # The websocket / http server [server.1] -bind = "0.0.0.0" -port = 80 +bind = "127.0.0.1" +port = __PORT__ # Example TLS server #[server.2] From b94197b3a47a4d174c1c71adce47c31121b2c9b8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 20:07:15 +0100 Subject: [PATCH 21/41] Fix --- conf/{config.json.example => client.json.example} | 15 +++++---------- scripts/install | 13 +++++++++++++ 2 files changed, 18 insertions(+), 10 deletions(-) rename conf/{config.json.example => client.json.example} (64%) diff --git a/conf/config.json.example b/conf/client.json.example similarity index 64% rename from conf/config.json.example rename to conf/client.json.example index 9b84d3c..67b365a 100644 --- a/conf/config.json.example +++ b/conf/client.json.example @@ -1,7 +1,7 @@ { "windowTitle": "Kiwi IRC", "startupScreen": "welcome", - "kiwiServer": "https://__DOMAIN____PATH__", + "kiwiServer": "/webirc/kiwiirc/", "restricted": false, "theme": "Default", "themes": [ @@ -16,16 +16,11 @@ { "name": "Elite", "url": "static/themes/elite" } ], "startupOptions" : { - "server": "irc.freenode.net", + "server": "irc.libera.chat", "port": 6697, "tls": true, "channel": "#yunohost", - "nick": "" - }, - "embedly": { - "key": "" - }, - "plugins": [ - { "name": "customise", "url": "static/plugins/customise.html" } - ] + "nick": "web?" + "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.

" + } } diff --git a/scripts/install b/scripts/install index 8f98785..b639d73 100644 --- a/scripts/install +++ b/scripts/install @@ -61,6 +61,19 @@ ynh_setup_source --dest_dir=$tempdir --source_id=app ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb +#================================================= +# ADD A CONFIGURATION +#================================================= +# ynh_script_progression --message="Adding a configuration file..." --weight=1 + +# ynh_add_config --template="../conf/config.conf.example" --destination="/etc/kiwiirc/config.conf" +# ynh_add_config --template="../conf/client.json.example" --destination="/etc/kiwiirc/client.json" + +# chmod 600 "/etc/kiwiirc/config.conf" +# chown root: "/etc/kiwiirc/config.conf" +# chmod 600 "/etc/kiwiirc/client.json" +# chown root: "/etc/kiwiirc/client.json" + #================================================= # NGINX CONFIGURATION #================================================= From 3723011a2d62e912badcb2458b69e3bfa71b4145 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 21:45:10 +0100 Subject: [PATCH 22/41] Fix --- conf/client.json.example | 11 +++++------ conf/config.conf.example | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/conf/client.json.example b/conf/client.json.example index 67b365a..a875a34 100644 --- a/conf/client.json.example +++ b/conf/client.json.example @@ -1,8 +1,8 @@ { - "windowTitle": "Kiwi IRC", + "windowTitle": "Web IRC", "startupScreen": "welcome", "kiwiServer": "/webirc/kiwiirc/", - "restricted": false, + "restricted": true, "theme": "Default", "themes": [ { "name": "Default", "url": "static/themes/default" }, @@ -16,11 +16,10 @@ { "name": "Elite", "url": "static/themes/elite" } ], "startupOptions" : { - "server": "irc.libera.chat", - "port": 6697, - "tls": true, "channel": "#yunohost", - "nick": "web?" + "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.

" } } diff --git a/conf/config.conf.example b/conf/config.conf.example index 2ebcfb4..f3bf5f8 100644 --- a/conf/config.conf.example +++ b/conf/config.conf.example @@ -62,7 +62,7 @@ bind_mode = 0777 # Optional, but handy for serving the Kiwi IRC client if no other webserver is available [fileserving] enabled = true -webroot = www/ +webroot = /usr/share/kiwiirc/ [transports] websocket @@ -89,8 +89,8 @@ kiwiirc # Connections will be sent to a random upstream [upstream.1] hostname = "irc.libera.chat" -port = 6697 -tls = true +port = 6667 +tls = false # Connection timeout in seconds timeout = 5 # Throttle the lines being written by X per second From 3610706cb68d76c8bc4be1f6b42527e200479ab4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 21:56:12 +0100 Subject: [PATCH 23/41] Update install --- scripts/install | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index b639d73..12c68aa 100644 --- a/scripts/install +++ b/scripts/install @@ -64,15 +64,15 @@ ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb #================================================= # ADD A CONFIGURATION #================================================= -# ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression --message="Adding a configuration file..." --weight=1 -# ynh_add_config --template="../conf/config.conf.example" --destination="/etc/kiwiirc/config.conf" -# 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="../conf/client.json.example" --destination="/etc/kiwiirc/client.json" -# chmod 600 "/etc/kiwiirc/config.conf" -# chown root: "/etc/kiwiirc/config.conf" -# chmod 600 "/etc/kiwiirc/client.json" -# chown root: "/etc/kiwiirc/client.json" +chmod 600 "/etc/kiwiirc/config.conf" +chown root: "/etc/kiwiirc/config.conf" +chmod 600 "/etc/kiwiirc/client.json" +chown root: "/etc/kiwiirc/client.json" #================================================= # NGINX CONFIGURATION From 03ee3b81456ea4717f7e2db9232bb40e0e34481a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 21:58:58 +0100 Subject: [PATCH 24/41] Update install --- scripts/install | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 12c68aa..b639d73 100644 --- a/scripts/install +++ b/scripts/install @@ -64,15 +64,15 @@ ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +# ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/config.conf.example" --destination="/etc/kiwiirc/config.conf" -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="../conf/client.json.example" --destination="/etc/kiwiirc/client.json" -chmod 600 "/etc/kiwiirc/config.conf" -chown root: "/etc/kiwiirc/config.conf" -chmod 600 "/etc/kiwiirc/client.json" -chown root: "/etc/kiwiirc/client.json" +# chmod 600 "/etc/kiwiirc/config.conf" +# chown root: "/etc/kiwiirc/config.conf" +# chmod 600 "/etc/kiwiirc/client.json" +# chown root: "/etc/kiwiirc/client.json" #================================================= # NGINX CONFIGURATION From 2c8d8a7510f2a503b245e3e97ff0b9a12248b968 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 22:04:18 +0100 Subject: [PATCH 25/41] Update remove --- scripts/remove | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/remove b/scripts/remove index c49288c..d9bdbca 100644 --- a/scripts/remove +++ b/scripts/remove @@ -46,6 +46,14 @@ ynh_script_progression --message="Removing Kiwiirc..." --weight=6 dpkg --remove kiwiirc +#================================================= +# REMOVE VARIOUS FILES +#================================================= +ynh_script_progression --message="Removing various files..." --time --weight=1 + +# Remove a cron file +ynh_secure_remove --file="/etc/$app" + #================================================= # REMOVE NGINX CONFIGURATION #================================================= From f0ebe33f942a82dab3f45fd11b72ab4f66c413df Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 22:16:44 +0100 Subject: [PATCH 26/41] fix --- scripts/install | 2 +- scripts/remove | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index b639d73..7b44c7d 100644 --- a/scripts/install +++ b/scripts/install @@ -95,7 +95,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="start" --log_path="systemd" +ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" #================================================= # RELOAD NGINX diff --git a/scripts/remove b/scripts/remove index d9bdbca..024bea5 100644 --- a/scripts/remove +++ b/scripts/remove @@ -49,7 +49,7 @@ dpkg --remove kiwiirc #================================================= # REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing various files..." --time --weight=1 +ynh_script_progression --message="Removing various files..." --weight=1 # Remove a cron file ynh_secure_remove --file="/etc/$app" From c527661975b43de1da1d5dada1e8bc53546bbe2a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 23:55:11 +0100 Subject: [PATCH 27/41] Update remove --- scripts/remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index 024bea5..673fe7f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -44,7 +44,7 @@ ynh_remove_systemd_config #================================================= ynh_script_progression --message="Removing Kiwiirc..." --weight=6 -dpkg --remove kiwiirc +dpkg --purge kiwiirc #================================================= # REMOVE VARIOUS FILES From 92f8fd6f5990aed5ed5a3e956836013ec427b79b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 23:56:15 +0100 Subject: [PATCH 28/41] Update install --- scripts/install | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index 7b44c7d..8494f70 100644 --- a/scripts/install +++ b/scripts/install @@ -61,18 +61,18 @@ ynh_setup_source --dest_dir=$tempdir --source_id=app ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb -#================================================= -# ADD A CONFIGURATION -#================================================= -# ynh_script_progression --message="Adding a configuration file..." --weight=1 +================================================= +ADD A CONFIGURATION +================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 -# ynh_add_config --template="../conf/config.conf.example" --destination="/etc/kiwiirc/config.conf" -# 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="../conf/client.json.example" --destination="/etc/kiwiirc/client.json" -# chmod 600 "/etc/kiwiirc/config.conf" -# chown root: "/etc/kiwiirc/config.conf" -# chmod 600 "/etc/kiwiirc/client.json" -# chown root: "/etc/kiwiirc/client.json" +chmod 775 "/etc/kiwiirc/config.conf" +chown root: "/etc/kiwiirc/config.conf" +chmod 775 "/etc/kiwiirc/client.json" +chown root: "/etc/kiwiirc/client.json" #================================================= # NGINX CONFIGURATION From 80da8ca933f3cb49a32620355613daa27f0445aa Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 3 Feb 2022 23:58:23 +0100 Subject: [PATCH 29/41] Update install --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 8494f70..ff48c6f 100644 --- a/scripts/install +++ b/scripts/install @@ -61,9 +61,9 @@ ynh_setup_source --dest_dir=$tempdir --source_id=app ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb -================================================= -ADD A CONFIGURATION -================================================= +#================================================= +# ADD A CONFIGURATION +#================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="../conf/config.conf.example" --destination="/etc/kiwiirc/config.conf" From df0374786b6872483e5d87ac603e72f4632b35fd Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Feb 2022 00:08:12 +0100 Subject: [PATCH 30/41] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index ff48c6f..9280377 100644 --- a/scripts/install +++ b/scripts/install @@ -66,8 +66,8 @@ ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/config.conf.example" --destination="/etc/kiwiirc/config.conf" 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" chmod 775 "/etc/kiwiirc/config.conf" chown root: "/etc/kiwiirc/config.conf" From bba4a50c735a5b801325ae50ec1878add01614e5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Feb 2022 08:16:37 +0100 Subject: [PATCH 31/41] Update install --- scripts/install | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 9280377..9155eb6 100644 --- a/scripts/install +++ b/scripts/install @@ -64,15 +64,15 @@ ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +# 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="../conf/client.json.example" --destination="/etc/kiwiirc/client.json" +# ynh_add_config --template="../conf/config.conf.example" --destination="/etc/kiwiirc/config.conf" -chmod 775 "/etc/kiwiirc/config.conf" -chown root: "/etc/kiwiirc/config.conf" -chmod 775 "/etc/kiwiirc/client.json" -chown root: "/etc/kiwiirc/client.json" +# chmod 775 "/etc/kiwiirc/config.conf" +# chown root: "/etc/kiwiirc/config.conf" +# chmod 775 "/etc/kiwiirc/client.json" +# chown root: "/etc/kiwiirc/client.json" #================================================= # NGINX CONFIGURATION From 42840a1eaee8d7e4f04ec512a7ed3d77f98f3b13 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Feb 2022 08:36:34 +0100 Subject: [PATCH 32/41] Update config.conf.example --- conf/config.conf.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/config.conf.example b/conf/config.conf.example index f3bf5f8..f721721 100644 --- a/conf/config.conf.example +++ b/conf/config.conf.example @@ -55,8 +55,8 @@ port = __PORT__ # Example unix socket server #[server.3] -bind = unix:/tmp/webircgateway.sock -bind_mode = 0777 +#bind = unix:/tmp/webircgateway.sock +#bind_mode = 0777 # Serve static files from a web root folder. # Optional, but handy for serving the Kiwi IRC client if no other webserver is available From a40fc9a3c49f3ed5189925afa95760c9e4e81aad Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Feb 2022 08:49:44 +0100 Subject: [PATCH 33/41] Update install --- scripts/install | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 9155eb6..64fb79c 100644 --- a/scripts/install +++ b/scripts/install @@ -64,15 +64,15 @@ ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb #================================================= # ADD A CONFIGURATION #================================================= -# ynh_script_progression --message="Adding a configuration file..." --weight=1 +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="../conf/client.json.example" --destination="/etc/kiwiirc/client.json" +ynh_add_config --template="../conf/config.conf.example" --destination="/etc/kiwiirc/config.conf" -# chmod 775 "/etc/kiwiirc/config.conf" -# chown root: "/etc/kiwiirc/config.conf" -# chmod 775 "/etc/kiwiirc/client.json" -# chown root: "/etc/kiwiirc/client.json" +chmod 744 "/etc/kiwiirc/config.conf" +chown root: "/etc/kiwiirc/config.conf" +chmod 744 "/etc/kiwiirc/client.json" +chown root: "/etc/kiwiirc/client.json" #================================================= # NGINX CONFIGURATION From 3606e8d08a30cb1257715e665c26c48e91c48fa8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Feb 2022 08:56:19 +0100 Subject: [PATCH 34/41] Update upgrade --- scripts/upgrade | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index a374e07..5eac6af 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -47,11 +47,8 @@ ynh_abort_if_errors if [ "$upgrade_type" == "UPGRADE_APP" ] then tempdir="$(mktemp -d)" - ynh_setup_source --dest_dir=$tempdir --source_id=app - ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb - fi #================================================= @@ -75,7 +72,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="start" --log_path="systemd" +ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" #================================================= # RELOAD NGINX From 6060aa6be92f765232e0e3acd3e6e2f3988da5db Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Feb 2022 09:04:28 +0100 Subject: [PATCH 35/41] Fix --- scripts/backup | 6 ++++++ scripts/restore | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index bdb4027..80984b3 100644 --- a/scripts/backup +++ b/scripts/backup @@ -37,6 +37,12 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# BACKUP THE CONFIGURATION FILE +#================================================= + +ynh_backup --src_path="/etc/kiwiirc" + #================================================= # BACKUP SYSTEMD #================================================= diff --git a/scripts/restore b/scripts/restore index 14be590..f3f2465 100644 --- a/scripts/restore +++ b/scripts/restore @@ -36,6 +36,22 @@ ynh_script_progression --message="Restoring the NGINX configuration..." 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_20.05.24.1-1_amd64.deb + +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX configuration..." + +ynh_restore_file --origin_path="/etc/kiwiirc" + #================================================= # RESTORE SYSTEMD #================================================= @@ -56,7 +72,7 @@ yunohost service add $app --description="Versatile web based messenger using IRC #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" #================================================= # RELOAD NGINX From 5f5df834a00b57d2a02d5b7b60990e7dce1959a8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Feb 2022 09:20:07 +0100 Subject: [PATCH 36/41] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index 5c44f15..d2aa1b0 100644 --- a/check_process +++ b/check_process @@ -6,7 +6,7 @@ is_public=1 ; Checks pkg_linter=1 - setup_sub_dir=1 + setup_sub_dir=0 setup_root=1 setup_nourl=0 setup_private=1 From ddc7472db7d2744b108fe08e14c31420af6dca19 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Feb 2022 09:20:18 +0100 Subject: [PATCH 37/41] Update install --- scripts/install | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/install b/scripts/install index 64fb79c..542e07d 100644 --- a/scripts/install +++ b/scripts/install @@ -56,9 +56,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port 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_20.05.24.1-1_amd64.deb #================================================= From 4199d9abec835bad3caf0577be4dc24d2042ec90 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Feb 2022 09:27:26 +0100 Subject: [PATCH 38/41] Update restore --- scripts/restore | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/restore b/scripts/restore index f3f2465..b7df713 100644 --- a/scripts/restore +++ b/scripts/restore @@ -13,9 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ynh_clean_check_starting -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors From ae302caa55f3a608b7e8f42ad454c0377bd577fa Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Feb 2022 09:29:50 +0100 Subject: [PATCH 39/41] Update backup --- scripts/backup | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/backup b/scripts/backup index 80984b3..d04dac1 100644 --- a/scripts/backup +++ b/scripts/backup @@ -43,12 +43,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/kiwiirc" -#================================================= -# BACKUP SYSTEMD -#================================================= - -ynh_backup --src_path="/etc/systemd/system/$app.service" - #================================================= # END OF SCRIPT #================================================= From ac62592e26c7fe0aa939cbc2e9e2d321c38b6db9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Feb 2022 09:39:04 +0100 Subject: [PATCH 40/41] Fix --- conf/app.src | 2 +- scripts/install | 2 +- scripts/restore | 10 +--------- scripts/upgrade | 2 +- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/conf/app.src b/conf/app.src index 4ca86b2..768a4e4 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,5 +3,5 @@ SOURCE_SUM=c99504c6de678fd91aed357ff0dada16a8df9e932970ed85767b516a9f87df52 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=deb SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=kiwiirc_20.05.24.1-1_amd64.deb +SOURCE_FILENAME=kiwiirc.deb SOURCE_EXTRACT=false diff --git a/scripts/install b/scripts/install index 542e07d..39adbcf 100644 --- a/scripts/install +++ b/scripts/install @@ -57,7 +57,7 @@ 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_20.05.24.1-1_amd64.deb +ynh_exec_warn_less dpkg -i $tempdir/kiwiirc.deb #================================================= # ADD A CONFIGURATION diff --git a/scripts/restore b/scripts/restore index b7df713..2cf32f2 100644 --- a/scripts/restore +++ b/scripts/restore @@ -40,7 +40,7 @@ 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_20.05.24.1-1_amd64.deb +ynh_exec_warn_less dpkg -i $tempdir/kiwiirc.deb #================================================= # RESTORE THE NGINX CONFIGURATION @@ -49,14 +49,6 @@ ynh_script_progression --message="Restoring the NGINX configuration..." ynh_restore_file --origin_path="/etc/kiwiirc" -#================================================= -# RESTORE SYSTEMD -#================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service --quiet - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5eac6af..da0df06 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -48,7 +48,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir --source_id=app - ynh_exec_warn_less dpkg -i $tempdir/kiwiirc_20.05.24.1-1_amd64.deb + ynh_exec_warn_less dpkg -i $tempdir/kiwiirc.deb fi #================================================= From 29dc9c6c2cd643f487dea4ade74b4c2224c56b67 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Feb 2022 09:49:47 +0100 Subject: [PATCH 41/41] Fix --- scripts/backup | 2 ++ scripts/install | 2 +- scripts/remove | 3 +++ scripts/restore | 4 +++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/backup b/scripts/backup index d04dac1..e3ef7e8 100644 --- a/scripts/backup +++ b/scripts/backup @@ -43,6 +43,8 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/kiwiirc" +ynh_backup --file="/var/log/$app.log" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index 39adbcf..489f595 100644 --- a/scripts/install +++ b/scripts/install @@ -85,7 +85,7 @@ ynh_add_nginx_config #================================================= 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/$app.log" +yunohost service add $app --description="Versatile web based messenger using IRC" --log="/var/log/$app.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/remove b/scripts/remove index 673fe7f..873bdbf 100644 --- a/scripts/remove +++ b/scripts/remove @@ -54,6 +54,9 @@ ynh_script_progression --message="Removing various files..." --weight=1 # Remove a cron file ynh_secure_remove --file="/etc/$app" +# Remove the log files +ynh_secure_remove --file="/var/log/$app.log" + #================================================= # REMOVE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index 2cf32f2..270af5a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -45,10 +45,12 @@ ynh_exec_warn_less dpkg -i $tempdir/kiwiirc.deb #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." +ynh_script_progression --message="Restoring various file..." --weight=1 ynh_restore_file --origin_path="/etc/kiwiirc" +ynh_restore_file --origin_path="/var/log/$app.log" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #=================================================