From cc67ea25624b26c76abf7c19718c5b79ca976d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 10 Jan 2024 21:31:08 +0100 Subject: [PATCH 1/7] add change url --- scripts/change_url | 58 ++++++++++++++++++++++++++++++++++++++++++++++ tests.toml | 2 -- 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 scripts/change_url diff --git a/scripts/change_url b/scripts/change_url new file mode 100644 index 0000000..5530b03 --- /dev/null +++ b/scripts/change_url @@ -0,0 +1,58 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# STANDARD MODIFICATIONS +#================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Stopping a systemd service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" + +#================================================= +# MODIFY URL IN NGINX CONF +#================================================= +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 + +ynh_change_url_nginx_config + +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding peertube configuration file..." + +ynh_replace_string --match_string="hostname: '$old_domain'" --replace_string="hostname: '$new_domain'" --target_file="$install_dir/config/production.yaml" + +#================================================= +# SPECIFIC MODIFICATIONS +#================================================= +ynh_script_progression --message="updating host..." + +pushd "$install_dir" + ynh_use_nodejs + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run update-host +popd + +#================================================= +# GENERIC FINALISATION +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP server listening on 127.0.0.1" + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/tests.toml b/tests.toml index 4fbe1fb..16af213 100644 --- a/tests.toml +++ b/tests.toml @@ -5,8 +5,6 @@ test_format = 1.0 # ------------ # Tests to run # ------------ - - exclude = ["change_url"] # ------------------------------- # Commits to test upgrade from From bc38ae2fcc33281790db97716bd9281c1f12e42e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 10 Jan 2024 21:32:03 +0100 Subject: [PATCH 2/7] fix path --- doc/ADMIN.md | 2 +- doc/ADMIN_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ADMIN.md b/doc/ADMIN.md index 855a896..d06df62 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -1 +1 @@ -Do not modify the `__INSTALL_DIR__/conf/production.yaml` file, because it will be overridden in the next upgrade. Please instead either change them though the web interface, which stores specific local settings in a separate configuration file. +Do not modify the `__INSTALL_DIR__/config/production.yaml` file, because it will be overridden in the next upgrade. Please instead either change them though the web interface, which stores specific local settings in a separate configuration file. diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index 43f96eb..cb6f36c 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -1 +1 @@ -Ne modifiez pas les paramètres dans le fichier `__INSTALL_DIR__/conf/production.yaml`, car il sera remplacé lors de la prochaine mise à niveau. Veuillez plutôt modifier la configuration via l'interface Web, qui stocke les paramètres locaux spécifiques dans un fichier de configuration distinct. \ No newline at end of file +Ne modifiez pas les paramètres dans le fichier `__INSTALL_DIR__/config/production.yaml`, car il sera remplacé lors de la prochaine mise à niveau. Veuillez plutôt modifier la configuration via l'interface Web, qui stocke les paramètres locaux spécifiques dans un fichier de configuration distinct. \ No newline at end of file From c11b738d5edbe56feb96ffd7f4a57d1d84e89d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 10 Jan 2024 21:55:28 +0100 Subject: [PATCH 3/7] Update _common.sh --- scripts/_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 92a1565..f4f7f3a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,6 +5,7 @@ #================================================= nodejs_version=18 + # Obtain the (empty string), __2, __3, cf the DB suffix in production.yaml... db_suffix="$(echo $app | sed 's/peertube//g')" From 5787f781b7314af614f32200f4bb19a69b6d3f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:37:36 +0100 Subject: [PATCH 4/7] remove change URL --- scripts/change_url | 58 ---------------------------------------------- tests.toml | 2 ++ 2 files changed, 2 insertions(+), 58 deletions(-) delete mode 100644 scripts/change_url diff --git a/scripts/change_url b/scripts/change_url deleted file mode 100644 index 5530b03..0000000 --- a/scripts/change_url +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source _common.sh -source /usr/share/yunohost/helpers - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# STOP SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" - -#================================================= -# MODIFY URL IN NGINX CONF -#================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 - -ynh_change_url_nginx_config - -#================================================= -# ADD A CONFIGURATION -#================================================= -ynh_script_progression --message="Adding peertube configuration file..." - -ynh_replace_string --match_string="hostname: '$old_domain'" --replace_string="hostname: '$new_domain'" --target_file="$install_dir/config/production.yaml" - -#================================================= -# SPECIFIC MODIFICATIONS -#================================================= -ynh_script_progression --message="updating host..." - -pushd "$install_dir" - ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_npm run update-host -popd - -#================================================= -# GENERIC FINALISATION -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP server listening on 127.0.0.1" - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/tests.toml b/tests.toml index 16af213..f9475b1 100644 --- a/tests.toml +++ b/tests.toml @@ -6,6 +6,8 @@ test_format = 1.0 # Tests to run # ------------ + exclude = ["change_url"] + # ------------------------------- # Commits to test upgrade from # ------------------------------- From ee41ca96e2b8bc457eba11819f46c486c23d1b22 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 18 Jan 2024 17:18:00 +0100 Subject: [PATCH 5/7] Upgrade to v6.0.3 --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 42dc771..ea0fd0f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "PeerTube" description.en = "Federated video streaming platform using P2P directly in the web browser" description.fr = "Plateforme fédéralisé de diffusion vidéo par P2P directement dans le navigateur" -version = "6.0.2~ynh3" +version = "6.0.3~ynh1" maintainers = ["yalh76"] @@ -42,8 +42,8 @@ ram.runtime = "1G" [resources] [resources.sources.main] - url = "https://github.com/Chocobozzz/PeerTube/releases/download/v6.0.2/peertube-v6.0.2.tar.xz" - sha256 = "9313591f911f3951ec15a9d1102b8aa4158d4cf5af74e9f0e71c0ee4e4dca2a2" + url = "https://github.com/Chocobozzz/PeerTube/archive/refs/tags/v6.0.3.tar.gz" + sha256 = "a88342346c089f3ef3a76daa09e0ac85fbfebd270f967f55a395e1024008d218" autoupdate.strategy = "latest_github_tag" [resources.ports] From 7428b3168c9a02686e51834c6a0d359fdf5105e9 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 18 Jan 2024 16:18:03 +0000 Subject: [PATCH 6/7] 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 92fdb38..d981c3f 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in PeerTube is a decentralized and federated video hosting software. To publish videos, the user must register with a host (called an instance). Each host has its own conditions of use (storage space per user, moderation rules, themes, etc.). Thanks to WebTorrent, if several people view the same video, fragments of it are exchanged between people so as not to overload the instance. Decentralized: Each instance can follow one or more other PeerTube instances in order to allow its users to view their videos. Federated: Via the ActivityPub protocol, Peertube can interact with other software that is part of the Fediverse, such as Mastodon for example. -**Shipped version:** 6.0.2~ynh3 +**Shipped version:** 6.0.3~ynh1 **Demo:** http://peertube.cpy.re diff --git a/README_fr.md b/README_fr.md index 9e12181..f08407e 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po PeerTube est un logiciel décentralisé et fédéré d’hébergement de vidéos. Pour publier des vidéos, l’utilisateur doit s’inscrire chez un hébergeur (nommé instance). Chaque hébergeur possède ses conditions d’utilisation (espace de stockage par utilisateur, règles de modération, thématiques, etc.). Grâce à WebTorrent, si plusieurs personnes consultent une même vidéo, des fragments de celle-ci sont échangés entre les personnes afin de ne pas surcharger l’instance. Décentralisé : Chaque instance peut suivre une ou plusieurs autres instances PeerTube afin de permettre à ses utilisateurs de visionner les vidéos de celles-ci. Fédéré : Via le protocole ActivityPub, Peertube peut interagir avec d’autres logiciels qui font partie du Fediverse, comme Mastodon par exemple. -**Version incluse :** 6.0.2~ynh3 +**Version incluse :** 6.0.3~ynh1 **Démo :** http://peertube.cpy.re From aa0ada933cdab19ba1d37195687e63350d3ab066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 18 Jan 2024 18:42:37 +0100 Subject: [PATCH 7/7] fix --- conf/nginx.conf | 2 +- manifest.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index af5d78f..84e76a4 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -144,7 +144,7 @@ location ~ ^/client/(.*\.(js|css|png|svg|woff2|otf|ttf|woff|eot))$ { alias __INSTALL_DIR__/client/dist/$1; } -location ~ ^(/static/(webseed|web-videos|streaming-playlists)/private/)|^/download { +location ~ ^(/static/(webseed|web-videos|streaming-playlists/hls)/private/)|^/download { # We can't rate limit a try_files directive, so we need to duplicate @api proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/manifest.toml b/manifest.toml index ea0fd0f..655d3c9 100644 --- a/manifest.toml +++ b/manifest.toml @@ -42,8 +42,8 @@ ram.runtime = "1G" [resources] [resources.sources.main] - url = "https://github.com/Chocobozzz/PeerTube/archive/refs/tags/v6.0.3.tar.gz" - sha256 = "a88342346c089f3ef3a76daa09e0ac85fbfebd270f967f55a395e1024008d218" + url = "https://github.com/Chocobozzz/PeerTube/releases/download/v6.0.3/peertube-v6.0.3.tar.xz" + sha256 = "9a88899a4777c340df41e763ecdf8656edf3ef75f54b4de9be05aa309697a211" autoupdate.strategy = "latest_github_tag" [resources.ports]