diff --git a/README.md b/README.md
index 43bce3d..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.28~ynh1
+**Shipped version:** 2.20240427~ynh1
**Demo:**
diff --git a/README_eu.md b/README_eu.md
index 2f0ef25..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.28~ynh1
+**Paketatutako bertsioa:** 2.20240427~ynh1
**Demoa:**
diff --git a/README_fr.md b/README_fr.md
index 9308f7e..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.28~ynh1
+**Version incluse :** 2.20240427~ynh1
**Démo :**
diff --git a/README_gl.md b/README_gl.md
index a0e9711..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.28~ynh1
+**Versión proporcionada:** 2.20240427~ynh1
**Demo:**
diff --git a/README_zh_Hans.md b/README_zh_Hans.md
index 039021e..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.28~ynh1
+**分发版本:** 2.20240427~ynh1
**演示:**
diff --git a/manifest.toml b/manifest.toml
index dfe6c05..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.28~ynh1"
+version = "2.20240427~ynh1"
maintainers = []
@@ -48,6 +48,14 @@ 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"
+
+ autoupdate.strategy = "latest_github_release"
+ autoupdate.version_regex = "^v(.*)$" # v
+
[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..98ff55d 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"
@@ -78,9 +65,10 @@ chown "$app:$app" "$install_dir/config/config.yml"
#=================================================
# INSTALL INVIDIOUS
#=================================================
-ynh_script_progression --message="Building Invidious.. (this will take some time and resources!)" --weight=60
+ynh_script_progression --message="Building Invidious... (this will take some time and resources!)" --weight=60
pushd "$install_dir"
+ make
./invidious --migrate
popd
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"
#=================================================