From e927b7ec4454406b6f9ba0315c07f2ac0a8d7358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 May 2024 11:21:26 +0200 Subject: [PATCH 1/6] extract from release --- manifest.toml | 7 ++++++- scripts/_common.sh | 2 -- scripts/install | 19 +++---------------- scripts/remove | 5 ----- scripts/restore | 11 ++--------- scripts/upgrade | 29 +++++------------------------ 6 files changed, 16 insertions(+), 57 deletions(-) diff --git a/manifest.toml b/manifest.toml index dfe6c05..47604c2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Invidious" description.en = "Alternative front-end to YouTube" description.fr = "Front-end alternatif à YouTube" -version = "24.04.28~ynh1" +version = "24.04.27~ynh1" maintainers = [] @@ -48,6 +48,11 @@ ram.runtime = "50M" default = "fr" [resources] + + [resources.sources.main] + url = "https://github.com/iv-org/invidious/archive/refs/tags/v2.20240427.tar.gz" + sha256 = "0f290de213eda898f95fd0108652738f88bb6d09289e0cea86c178050271660d" + [resources.system_user] [resources.install_dir] diff --git a/scripts/_common.sh b/scripts/_common.sh index 60e5406..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,8 +4,6 @@ # COMMON VARIABLES #================================================= -version_commit=eda7444ca46dbc3941205316baba8030fe0b2989 - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index ec40918..a145ac3 100644 --- a/scripts/install +++ b/scripts/install @@ -42,23 +42,10 @@ ynh_exec_warn_less curl -fsSL https://crystal-lang.org/install.sh | bash -s -- - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=4 +ynh_script_progression --message="Setting up source files..." --weight=1 -mkdir -p "$install_dir" -chown -R "$app:www-data" "$install_dir" - -git config --system --add safe.directory "$install_dir" - -# Download, check integrity, uncompress and patch the source from GitHub -# note: we can't use resources.sources instead of git because Invidious is -# expecting to be in a git environment for the building step... -# see: https://github.com/YunoHost-Apps/invidious_ynh/pull/127 -git clone https://github.com/iv-org/invidious "$install_dir" --quiet - -pushd "$install_dir" - git reset --hard --quiet "$version_commit" - make -popd +# Download, check integrity, uncompress and patch the source from manifest.toml +ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" diff --git a/scripts/remove b/scripts/remove index ca7f10d..3406a71 100644 --- a/scripts/remove +++ b/scripts/remove @@ -22,11 +22,6 @@ then yunohost service remove "$app" fi -#================================================= -# REMOVE SYSTEM CONFIGURATIONS -#================================================= -ynh_script_progression --message="Removing system configurations related to $app..." --weight=10 - dpkg --remove crystal # Remove the dedicated systemd config diff --git a/scripts/restore b/scripts/restore index 5fbbb2a..b6dca6e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -9,15 +9,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -49,6 +40,8 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" #================================================= 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" + ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable "$app.service" --quiet diff --git a/scripts/upgrade b/scripts/upgrade index f8bb121..ca53700 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,12 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -69,26 +63,13 @@ ynh_exec_warn_less curl -fsSL https://crystal-lang.org/install.sh | bash -s -- - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=1 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=5 +# Download, check integrity, uncompress and patch the source from manifest.toml +ynh_setup_source --dest_dir="$install_dir" +ynh_exec_warn_less shards install --production +ynh_exec_warn_less crystal build "$install_dir/src/invidious.cr" --release - pushd "$install_dir" - chown -R "$app:www-data" "$install_dir" - git config --system --add safe.directory "$install_dir" - ynh_exec_as "$app" git config pull.rebase false - - ynh_exec_as "$app" git fetch - #git checkout master - ynh_exec_as "$app" git reset --hard --quiet "$version_commit" - ynh_exec_as "$app" git pull - ynh_exec_warn_less shards install --production - ynh_exec_warn_less crystal build "$install_dir/src/invidious.cr" --release - popd -fi - -chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" #================================================= From 7882044dc461146fadd9f2212822e9b7d8e6465f Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 2 May 2024 09:21:31 +0000 Subject: [PATCH 2/6] Auto-update READMEs --- README.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_zh_Hans.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 43bce3d..4b33422 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ In addition to constituting an advantage in terms of confidentiality (the data d - Ability to subscribe to channels without creating a Google account -**Shipped version:** 24.04.28~ynh1 +**Shipped version:** 24.04.27~ynh1 **Demo:** diff --git a/README_eu.md b/README_eu.md index 2f0ef25..9f895af 100644 --- a/README_eu.md +++ b/README_eu.md @@ -27,7 +27,7 @@ In addition to constituting an advantage in terms of confidentiality (the data d - Ability to subscribe to channels without creating a Google account -**Paketatutako bertsioa:** 24.04.28~ynh1 +**Paketatutako bertsioa:** 24.04.27~ynh1 **Demoa:** diff --git a/README_fr.md b/README_fr.md index 9308f7e..828f72b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -26,7 +26,7 @@ En plus de constituer un avantage sur le plan de la confidentialité (les donné - Possibilité d'afficher les commentaires Reddit plutôt que les commentaires YouTube, - Possibilité de s'abonner aux chaines sans créer de compte Google -**Version incluse :** 24.04.28~ynh1 +**Version incluse :** 24.04.27~ynh1 **Démo :** diff --git a/README_gl.md b/README_gl.md index a0e9711..0029914 100644 --- a/README_gl.md +++ b/README_gl.md @@ -27,7 +27,7 @@ In addition to constituting an advantage in terms of confidentiality (the data d - Ability to subscribe to channels without creating a Google account -**Versión proporcionada:** 24.04.28~ynh1 +**Versión proporcionada:** 24.04.27~ynh1 **Demo:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 039021e..fe39889 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -27,7 +27,7 @@ In addition to constituting an advantage in terms of confidentiality (the data d - Ability to subscribe to channels without creating a Google account -**分发版本:** 24.04.28~ynh1 +**分发版本:** 24.04.27~ynh1 **演示:** From 0cdb28dbfa6d2c45fb779c6814b691838a1c8001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 May 2024 11:39:43 +0200 Subject: [PATCH 3/6] Update install --- scripts/install | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/install b/scripts/install index a145ac3..f3685b3 100644 --- a/scripts/install +++ b/scripts/install @@ -50,6 +50,18 @@ ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" +#================================================= +# SPECIFIC SETUP +#================================================= +# INSTALL INVIDIOUS +#================================================= +ynh_script_progression --message="Building Invidious.. (this will take some time and resources!)" --weight=60 + +pushd "$install_dir" + make + ./invidious --migrate +popd + #================================================= # MODIFY A CONFIG FILE #================================================= @@ -60,17 +72,6 @@ ynh_add_config --template="config.yml" --destination="$install_dir/config/config chmod 600 "$install_dir/config/config.yml" chown "$app:$app" "$install_dir/config/config.yml" -#================================================= -# SPECIFIC SETUP -#================================================= -# INSTALL INVIDIOUS -#================================================= -ynh_script_progression --message="Building Invidious.. (this will take some time and resources!)" --weight=60 - -pushd "$install_dir" - ./invidious --migrate -popd - #================================================= # SYSTEM CONFIGURATION #================================================= From 4a1403b3976d02d4e3465ce278b2f89ca491ab1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 May 2024 11:40:51 +0200 Subject: [PATCH 4/6] Update install --- scripts/install | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/install b/scripts/install index f3685b3..98ff55d 100644 --- a/scripts/install +++ b/scripts/install @@ -50,18 +50,6 @@ ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" -#================================================= -# SPECIFIC SETUP -#================================================= -# INSTALL INVIDIOUS -#================================================= -ynh_script_progression --message="Building Invidious.. (this will take some time and resources!)" --weight=60 - -pushd "$install_dir" - make - ./invidious --migrate -popd - #================================================= # MODIFY A CONFIG FILE #================================================= @@ -72,6 +60,18 @@ ynh_add_config --template="config.yml" --destination="$install_dir/config/config chmod 600 "$install_dir/config/config.yml" chown "$app:$app" "$install_dir/config/config.yml" +#================================================= +# SPECIFIC SETUP +#================================================= +# INSTALL INVIDIOUS +#================================================= +ynh_script_progression --message="Building Invidious... (this will take some time and resources!)" --weight=60 + +pushd "$install_dir" + make + ./invidious --migrate +popd + #================================================= # SYSTEM CONFIGURATION #================================================= From 471abb0e4f8942b6127b5b80481edaa037435a06 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Thu, 2 May 2024 20:41:00 +0200 Subject: [PATCH 5/6] autoupdater + use the new version number --- manifest.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 47604c2..e58c77d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Invidious" description.en = "Alternative front-end to YouTube" description.fr = "Front-end alternatif à YouTube" -version = "24.04.27~ynh1" +version = "2.20240427~ynh1" maintainers = [] @@ -53,6 +53,9 @@ ram.runtime = "50M" url = "https://github.com/iv-org/invidious/archive/refs/tags/v2.20240427.tar.gz" sha256 = "0f290de213eda898f95fd0108652738f88bb6d09289e0cea86c178050271660d" + autoupdate.strategy = "latest_github_release" + autoupdate.version_regex = "^v(.*)$" # v
+ [resources.system_user] [resources.install_dir] From fc0c75cf07e90507db016f7492d646dfe5ab7e61 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 2 May 2024 18:41:47 +0000 Subject: [PATCH 6/6] Auto-update READMEs --- README.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_zh_Hans.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4b33422..e6d187c 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ In addition to constituting an advantage in terms of confidentiality (the data d - Ability to subscribe to channels without creating a Google account -**Shipped version:** 24.04.27~ynh1 +**Shipped version:** 2.20240427~ynh1 **Demo:** diff --git a/README_eu.md b/README_eu.md index 9f895af..da0ac28 100644 --- a/README_eu.md +++ b/README_eu.md @@ -27,7 +27,7 @@ In addition to constituting an advantage in terms of confidentiality (the data d - Ability to subscribe to channels without creating a Google account -**Paketatutako bertsioa:** 24.04.27~ynh1 +**Paketatutako bertsioa:** 2.20240427~ynh1 **Demoa:** diff --git a/README_fr.md b/README_fr.md index 828f72b..3b4bf54 100644 --- a/README_fr.md +++ b/README_fr.md @@ -26,7 +26,7 @@ En plus de constituer un avantage sur le plan de la confidentialité (les donné - Possibilité d'afficher les commentaires Reddit plutôt que les commentaires YouTube, - Possibilité de s'abonner aux chaines sans créer de compte Google -**Version incluse :** 24.04.27~ynh1 +**Version incluse :** 2.20240427~ynh1 **Démo :** diff --git a/README_gl.md b/README_gl.md index 0029914..c07380e 100644 --- a/README_gl.md +++ b/README_gl.md @@ -27,7 +27,7 @@ In addition to constituting an advantage in terms of confidentiality (the data d - Ability to subscribe to channels without creating a Google account -**Versión proporcionada:** 24.04.27~ynh1 +**Versión proporcionada:** 2.20240427~ynh1 **Demo:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index fe39889..f1b146a 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -27,7 +27,7 @@ In addition to constituting an advantage in terms of confidentiality (the data d - Ability to subscribe to channels without creating a Google account -**分发版本:** 24.04.27~ynh1 +**分发版本:** 2.20240427~ynh1 **演示:**