From ed88a654fe5ed94f3f798a0aba27820bb1e1161f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 31 Mar 2024 23:46:55 +0200 Subject: [PATCH 01/23] TOML style, add toml schemas --- manifest.toml | 35 +++++++++++++++++++++++++++++------ tests.toml | 2 ++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/manifest.toml b/manifest.toml index 5b15a0a..3d240e8 100644 --- a/manifest.toml +++ b/manifest.toml @@ -1,3 +1,5 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + packaging_format = 2 id = "immich" @@ -11,7 +13,7 @@ maintainers = ["ewilly"] [upstream] license = "AGPL-3.0-or-later" -website = "https://www.immich.app" +website = "https://immich.app" admindoc = "https://github.com/immich-app/immich#getting-started" userdoc = "https://github.com/immich-app/immich#getting-started" code = "https://github.com/immich-app/immich" @@ -66,11 +68,32 @@ ram.runtime = "500M" api.protected = true [resources.apt] - packages = ["python3-venv", "python3-dev", "ffmpeg", "postgresql", "wget", "build-essential", "libreadline-dev", "libncursesw5-dev", "libssl-dev", "libsqlite3-dev", "tk-dev", "libgdbm-dev", "libc6-dev", "libbz2-dev", "libffi-dev", "zlib1g-dev", "unzip"] - - extras.postgresql.repo = "deb https://apt.postgresql.org/pub/repos/apt bullseye-pgdg main 16" - extras.postgresql.key = "https://www.postgresql.org/media/keys/ACCC4CF8.asc" - extras.postgresql.packages = ["libllvm13", "libpq5", "libpq-dev" , "postgresql-16", "postgresql-16-pgvector", "postgresql-client-16", "postgresql-common", "postgresql-client-common"] + packages = [ + "python3-venv", + "python3-dev", + "ffmpeg", + "postgresql", + "wget", + "build-essential", + "libreadline-dev", + "libncursesw5-dev", + "libssl-dev", + "libsqlite3-dev", + "tk-dev", + "libgdbm-dev", + "libc6-dev", + "libbz2-dev", + "libffi-dev", + "zlib1g-dev", + "unzip" + ] + + [resources.apt.extras.postgresql] + repo = "deb https://apt.postgresql.org/pub/repos/apt bullseye-pgdg main 16" + key = "https://www.postgresql.org/media/keys/ACCC4CF8.asc" + packages = [ + "libllvm13", "libpq5", "libpq-dev" , "postgresql-16", "postgresql-16-pgvector", "postgresql-client-16", "postgresql-common", "postgresql-client-common" + ] [resources.database] type = "postgresql" diff --git a/tests.toml b/tests.toml index cbbeef1..94abb79 100644 --- a/tests.toml +++ b/tests.toml @@ -1,3 +1,5 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json + test_format = 1.0 [default] From d4c37fd9a8dba4c4ecaa8479b1eaba476183fdec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 31 Mar 2024 23:57:17 +0200 Subject: [PATCH 02/23] Simplify retrieval of app_version and postgresql_version --- scripts/_common.sh | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index cff87f3..4e8e7da 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,28 +4,16 @@ # COMMON VARIABLES #================================================= -if [[ ${BASH_SOURCE[0]} == "../settings/"* ]] -then - manifest_path="../settings/manifest.toml" -else - manifest_path="../manifest.toml" -fi - -# App version -## yq is not a dependencie of yunohost package so tomlq command is not available -## (see https://github.com/YunoHost/yunohost/blob/dev/debian/control) -app_version=$(cat "$manifest_path" 2>/dev/null \ - | grep 'version = ' | cut -d '=' -f 2 \ - | cut -d '~' -f 1 | tr -d ' "') #2024.2.5 -app_version="v$app_version" +app_version="v$(ynh_app_upstream_version)" # v1.98.2 # NodeJS required version nodejs_version=20 # PostgreSQL required version -postgresql_version=$(cat "$manifest_path" 2>/dev/null \ - | grep -o 'postgresql-[0-9][0-9]-pgvector' \ - | head -n1 | cut -d'-' -f2) #16 +postgresql_version=$( + ynh_read_manifest --manifest_key="resources.apt.extras.postgresql.packages" \ + | grep -o 'postgresql-[0-9][0-9]-pgvector' | head -n1 | cut -d'-' -f2 +) # Fail2ban failregex="immich-server.*Failed login attempt for user.+from ip address\s?" From 572030b92a99d5d019b8e759573ec4626a108127 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 31 Mar 2024 21:57:24 +0000 Subject: [PATCH 03/23] Auto-update READMEs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1583c18..b97af42 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Self-hosted photo and video management solution. ## Documentation and resources -- Official app website: +- Official app website: - Official user documentation: - Official admin documentation: - Upstream app code repository: From 5922713a299a88b2edef02f27bd7aefa9e73a2b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 1 Apr 2024 00:10:13 +0200 Subject: [PATCH 04/23] Remove unused app_version variable --- scripts/_common.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 4e8e7da..48d1abf 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,8 +4,6 @@ # COMMON VARIABLES #================================================= -app_version="v$(ynh_app_upstream_version)" # v1.98.2 - # NodeJS required version nodejs_version=20 From a4202015cca98ebc5d894134fecfeb7fbacaeb69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 1 Apr 2024 00:17:55 +0200 Subject: [PATCH 05/23] Redefine postgresql_version as a function because helpers don't exist yet at _common.sh sourcing time --- scripts/_common.sh | 16 ++++++++-------- scripts/install | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 48d1abf..8edb3df 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,12 +7,6 @@ # NodeJS required version nodejs_version=20 -# PostgreSQL required version -postgresql_version=$( - ynh_read_manifest --manifest_key="resources.apt.extras.postgresql.packages" \ - | grep -o 'postgresql-[0-9][0-9]-pgvector' | head -n1 | cut -d'-' -f2 -) - # Fail2ban failregex="immich-server.*Failed login attempt for user.+from ip address\s?" @@ -20,6 +14,12 @@ failregex="immich-server.*Failed login attempt for user.+from ip address\s? Date: Mon, 1 Apr 2024 00:18:26 +0200 Subject: [PATCH 06/23] scripts/remove: Cleanup useless messages --- scripts/remove | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/scripts/remove b/scripts/remove index 094edf5..770c186 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,33 +12,27 @@ source /usr/share/yunohost/helpers ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status "$app-server" >/dev/null -then - ynh_script_progression --message="Removing $app-server service integration..." --weight=1 +if ynh_exec_warn_less yunohost service status "$app-server" >/dev/null; then yunohost service remove "$app-server" fi -if ynh_exec_warn_less yunohost service status "$app-microservices" >/dev/null -then - ynh_script_progression --message="Removing $app-microservices service integration..." --weight=1 +if ynh_exec_warn_less yunohost service status "$app-microservices" >/dev/null; then yunohost service remove "$app-microservices" fi -if ynh_exec_warn_less yunohost service status "$app-machine-learning" >/dev/null -then - ynh_script_progression --message="Removing $app-machine-learning service integration..." --weight=1 +if ynh_exec_warn_less yunohost service status "$app-machine-learning" >/dev/null; then yunohost service remove "$app-machine-learning" fi +# Remove the dedicated systemd config +ynh_remove_systemd_config --service="immich-server" +ynh_remove_systemd_config --service="immich-microservices" +ynh_remove_systemd_config --service="immich-machine-learning" + # Remove the app-specific fail2ban config ynh_remove_fail2ban_config # Remove the app-specific logrotate config ynh_remove_logrotate -# Remove the dedicated systemd config -ynh_remove_systemd_config --service="immich-server" -ynh_remove_systemd_config --service="immich-microservices" -ynh_remove_systemd_config --service="immich-machine-learning" - # Remove the dedicated NGINX config ynh_remove_nginx_config From d0b76fc53f94d32f2443b426afcaf32472162ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 1 Apr 2024 00:18:58 +0200 Subject: [PATCH 07/23] We actually don't really care about the update_type because we might want to *always* rebuild the app. --- scripts/upgrade | 63 ++++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index a0ccd88..f56396c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -6,11 +6,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # STOP SYSTEMD SERVICE #================================================= @@ -26,38 +21,32 @@ ynh_systemd_action --service_name="$app-machine-learning" --action="stop" #ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 #================================================= -# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC) -#================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - #================================================= - # DOWNLOAD, CHECK AND UNPACK SOURCE - #================================================= - ynh_script_progression --message="Upgrading source files..." --weight=1 - tmpdir="$(mktemp --directory)" - ynh_setup_source --source_id="main" --dest_dir="$tmpdir" - - #================================================= - # CHECK PYTHON VERSION AND COMPILE IF NEEDED - #================================================= - ynh_script_progression --message="Check Python version & compile the required one if needed..." --weight=1 - py_required_major=$(cat "$tmpdir/machine-learning/Dockerfile" | grep "FROM python:" | head -n1 | cut -d':' -f2 | cut -d'-' -f1) - myynh_py_latest_from_major --python="$py_required_major" - myynh_install_python --python="$py_required_version" - - #================================================= - # INSTALL NODEJS - #================================================= - ynh_script_progression --message="Installing nodejs..." --weight=1 - ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version" - - #================================================= - # MAKE INSTALL - #================================================= - ynh_script_progression --message="Making install..." --weight=5 - ynh_secure_remove --file="$install_dir" - myynh_install_immich -fi +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_script_progression --message="Upgrading source files..." --weight=1 +tmpdir="$(mktemp --directory)" +ynh_setup_source --source_id="main" --dest_dir="$tmpdir" + +#================================================= +# CHECK PYTHON VERSION AND COMPILE IF NEEDED +#================================================= +ynh_script_progression --message="Check Python version & compile the required one if needed..." --weight=1 +py_required_major=$(cat "$tmpdir/machine-learning/Dockerfile" | grep "FROM python:" | head -n1 | cut -d':' -f2 | cut -d'-' -f1) +myynh_py_latest_from_major --python="$py_required_major" +myynh_install_python --python="$py_required_version" + +#================================================= +# INSTALL NODEJS +#================================================= +ynh_script_progression --message="Installing nodejs..." --weight=1 +ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version" + +#================================================= +# MAKE INSTALL +#================================================= +ynh_script_progression --message="Making install..." --weight=5 +ynh_secure_remove --file="$install_dir" +myynh_install_immich #================================================= # UPDATE A CONFIG FILE From 36dce13106f6141c440d427b6a97dc581bb02a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 1 Apr 2024 00:21:38 +0200 Subject: [PATCH 08/23] Replace tmpdir with source_dir=install_dir/source because /tmp might be too small for sources. We can't be sure. --- scripts/_common.sh | 34 +++++++++++++++++----------------- scripts/install | 6 +++--- scripts/upgrade | 5 +++-- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 8edb3df..68e3abc 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -124,30 +124,30 @@ myynh_install_immich() { ynh_use_nodejs # Install immich-server - cd "$tmpdir/server" + cd "$source_dir/server" ynh_exec_warn_less "$ynh_npm" ci ynh_exec_warn_less "$ynh_npm" run build ynh_exec_warn_less "$ynh_npm" prune --omit=dev --omit=optional - cd "$tmpdir/open-api/typescript-sdk" + cd "$source_dir/open-api/typescript-sdk" ynh_exec_warn_less "$ynh_npm" ci ynh_exec_warn_less "$ynh_npm" run build - cd "$tmpdir/web" + cd "$source_dir/web" ynh_exec_warn_less "$ynh_npm" ci ynh_exec_warn_less "$ynh_npm" run build mkdir -p "$install_dir/app/" - cp -a "$tmpdir/server/node_modules" "$install_dir/app/" - cp -a "$tmpdir/server/dist" "$install_dir/app/" - cp -a "$tmpdir/server/bin" "$install_dir/app/" - cp -a "$tmpdir/web/build" "$install_dir/app/www" - cp -a "$tmpdir/server/resources" "$install_dir/app/" - cp -a "$tmpdir/server/package.json" "$install_dir/app/" - cp -a "$tmpdir/server/package-lock.json" "$install_dir/app/" - cp -a "$tmpdir/server/start-microservices.sh" "$install_dir/app/" - cp -a "$tmpdir/server/start-server.sh" "$install_dir/app/" - cp -a "$tmpdir/LICENSE" "$install_dir/app/" + cp -a "$source_dir/server/node_modules" "$install_dir/app/" + cp -a "$source_dir/server/dist" "$install_dir/app/" + cp -a "$source_dir/server/bin" "$install_dir/app/" + cp -a "$source_dir/web/build" "$install_dir/app/www" + cp -a "$source_dir/server/resources" "$install_dir/app/" + cp -a "$source_dir/server/package.json" "$install_dir/app/" + cp -a "$source_dir/server/package-lock.json" "$install_dir/app/" + cp -a "$source_dir/server/start-microservices.sh" "$install_dir/app/" + cp -a "$source_dir/server/start-server.sh" "$install_dir/app/" + cp -a "$source_dir/LICENSE" "$install_dir/app/" # Install custom start.sh script ynh_add_config --template="immich-server-start.sh" --destination="$install_dir/app/start.sh" chmod +x "$install_dir/app/start.sh" @@ -155,7 +155,7 @@ myynh_install_immich() { ynh_exec_warn_less "$ynh_npm" cache clean --force # Install immich-machine-learning - cd "$tmpdir/machine-learning" + cd "$source_dir/machine-learning" mkdir -p "$install_dir/app/machine-learning" $py_app_version -m venv "$install_dir/app/machine-learning/venv" ( @@ -170,8 +170,8 @@ myynh_install_immich() { # poetry install ynh_exec_warn_less "$install_dir/app/machine-learning/venv/bin/poetry" install --no-root --with dev --with cpu ) - cp -a "$tmpdir/machine-learning/ann" "$install_dir/app/machine-learning/" - cp -a "$tmpdir/machine-learning/app" "$install_dir/app/machine-learning/" + cp -a "$source_dir/machine-learning/ann" "$install_dir/app/machine-learning/" + cp -a "$source_dir/machine-learning/app" "$install_dir/app/machine-learning/" # Install custom start.sh script ynh_add_config --template="immich-machine-learning-start.sh" --destination="$install_dir/app/machine-learning/start.sh" chmod +x "$install_dir/app/machine-learning/start.sh" @@ -191,7 +191,7 @@ myynh_install_immich() { sed -i -e "s@app.listen(port)@app.listen(port, '127.0.0.1')@g" "$install_dir/app/dist/microservices/main.js" # Cleanup - ynh_secure_remove --file="$tmpdir" + ynh_secure_remove --file="$source_dir" # Install geonames wget --output-document="$install_dir/resources/cities500.zip" \ diff --git a/scripts/install b/scripts/install index 1014475..fb2a967 100755 --- a/scripts/install +++ b/scripts/install @@ -13,15 +13,15 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -tmpdir="$(mktemp --directory)" -ynh_setup_source --source_id="main" --dest_dir="$tmpdir" +source_dir="$install_dir/source" +ynh_setup_source --source_id="main" --dest_dir="$source_dir" #================================================= # CHECK PYTHON VERSION AND COMPILE IF NEEDED #================================================= ynh_script_progression --message="Check Python version & compile the required one if needed..." --weight=1 -py_required_major=$(cat "$tmpdir/machine-learning/Dockerfile" | grep "FROM python:" | head -n1 | cut -d':' -f2 | cut -d'-' -f1) +py_required_major=$(cat "$source_dir/machine-learning/Dockerfile" | grep "FROM python:" | head -n1 | cut -d':' -f2 | cut -d'-' -f1) myynh_py_latest_from_major --python="$py_required_major" myynh_install_python --python="$py_required_version" diff --git a/scripts/upgrade b/scripts/upgrade index f56396c..f123f98 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,8 +24,9 @@ ynh_systemd_action --service_name="$app-machine-learning" --action="stop" # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Upgrading source files..." --weight=1 -tmpdir="$(mktemp --directory)" -ynh_setup_source --source_id="main" --dest_dir="$tmpdir" + +source_dir="$install_dir/source" +ynh_setup_source --source_id="main" --dest_dir="$source_dir" #================================================= # CHECK PYTHON VERSION AND COMPILE IF NEEDED From af7928da3ad5ad9da9a002e570e486d134ee5911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 1 Apr 2024 00:22:02 +0200 Subject: [PATCH 09/23] Upgrade script: use --full_replace=1 because we actually want to cleanup the source_dir --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index f123f98..3cb68f0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,7 +26,7 @@ ynh_systemd_action --service_name="$app-machine-learning" --action="stop" ynh_script_progression --message="Upgrading source files..." --weight=1 source_dir="$install_dir/source" -ynh_setup_source --source_id="main" --dest_dir="$source_dir" +ynh_setup_source --source_id="main" --dest_dir="$source_dir" --full_replace=1 #================================================= # CHECK PYTHON VERSION AND COMPILE IF NEEDED From 0c89d8e2b7a73435fc0d93765d8e14a80edc9159 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 1 Apr 2024 10:43:40 +0200 Subject: [PATCH 10/23] Fix upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 3cb68f0..3d5541a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,7 +32,7 @@ ynh_setup_source --source_id="main" --dest_dir="$source_dir" --full_replace=1 # CHECK PYTHON VERSION AND COMPILE IF NEEDED #================================================= ynh_script_progression --message="Check Python version & compile the required one if needed..." --weight=1 -py_required_major=$(cat "$tmpdir/machine-learning/Dockerfile" | grep "FROM python:" | head -n1 | cut -d':' -f2 | cut -d'-' -f1) +py_required_major=$(cat "$source_dir/machine-learning/Dockerfile" | grep "FROM python:" | head -n1 | cut -d':' -f2 | cut -d'-' -f1) myynh_py_latest_from_major --python="$py_required_major" myynh_install_python --python="$py_required_version" From b0d73b60fe3d771eb205e685350ee16a6198fe7d Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 1 Apr 2024 08:43:30 +0000 Subject: [PATCH 11/23] Auto-update READMEs --- ALL_README.md | 2 ++ README_eu.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ README_fr.md | 2 +- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 README_eu.md diff --git a/ALL_README.md b/ALL_README.md index 1394c1a..3eeb161 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,3 +1,5 @@ # All available README files by language - [Read the README in English](README.md) +- [Irakurri README euskaraz](README_eu.md) +- [Lire le README en français](README_fr.md) diff --git a/README_eu.md b/README_eu.md new file mode 100644 index 0000000..50ed96a --- /dev/null +++ b/README_eu.md @@ -0,0 +1,54 @@ + + +# Immich YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/immich.svg)](https://dash.yunohost.org/appci/app/immich) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/immich.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/immich.maintain.svg) + +[![Instalatu Immich YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=immich) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek Immich YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + +Self-hosted photo and video management solution. + +### Features + +- Simple-to-use backup tool with a native mobile app that can view photos and videos efficiently ; +- Easy-to-use and friendly interface ; + + +**Paketatutako bertsioa:** 1.98.2~ynh1 + +## Pantaila-argazkiak + +![Immich(r)en pantaila-argazkia](./doc/screenshots/immich-screenshots.png) + +## Dokumentazioa eta baliabideak + +- Aplikazioaren webgune ofiziala: +- Erabiltzaileen dokumentazio ofiziala: +- Administratzaileen dokumentazio ofiziala: +- Jatorrizko aplikazioaren kode-gordailua: +- YunoHost Denda: +- Eman errore baten berri: + +## Garatzaileentzako informazioa + +Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/immich_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/immich_ynh/tree/testing --debug +edo +sudo yunohost app upgrade immich -u https://github.com/YunoHost-Apps/immich_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_fr.md b/README_fr.md index af530b6..ad5f267 100644 --- a/README_fr.md +++ b/README_fr.md @@ -32,7 +32,7 @@ Solution d'autohébergement pour a gestion de vos photos et vidéos. ## Documentations et ressources -- Site officiel de l’app : +- Site officiel de l’app : - Documentation officielle utilisateur : - Documentation officielle de l’admin : - Dépôt de code officiel de l’app : From 078aae8a32a79628381654b3cd87f4a282e98f4d Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 1 Apr 2024 20:43:52 +0200 Subject: [PATCH 12/23] Fix upgrade --- scripts/upgrade | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 3d5541a..b0aefd7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,6 +32,7 @@ ynh_setup_source --source_id="main" --dest_dir="$source_dir" --full_replace=1 # CHECK PYTHON VERSION AND COMPILE IF NEEDED #================================================= ynh_script_progression --message="Check Python version & compile the required one if needed..." --weight=1 + py_required_major=$(cat "$source_dir/machine-learning/Dockerfile" | grep "FROM python:" | head -n1 | cut -d':' -f2 | cut -d'-' -f1) myynh_py_latest_from_major --python="$py_required_major" myynh_install_python --python="$py_required_version" @@ -40,13 +41,14 @@ myynh_install_python --python="$py_required_version" # INSTALL NODEJS #================================================= ynh_script_progression --message="Installing nodejs..." --weight=1 + ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version" #================================================= # MAKE INSTALL #================================================= ynh_script_progression --message="Making install..." --weight=5 -ynh_secure_remove --file="$install_dir" + myynh_install_immich #================================================= From 4fa6086f2a5262a69d9714d9735c116c6ba6265c Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 2 Apr 2024 08:35:30 +0200 Subject: [PATCH 13/23] Add geonames files to app sources --- manifest.toml | 12 ++++++++++++ scripts/_common.sh | 15 ++++----------- scripts/install | 3 +++ scripts/upgrade | 3 +++ 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/manifest.toml b/manifest.toml index 3d240e8..a66eef1 100644 --- a/manifest.toml +++ b/manifest.toml @@ -47,6 +47,18 @@ ram.runtime = "500M" autoupdate.strategy = "latest_github_release" + [resources.sources.geonames_cities] + url = "https://download.geonames.org/export/dump/cities500.zip" + sha256 = "6f11390524953d068439b0a55dab36f5bf86f4e5615da4ac00d724c1d167f847" + + [resources.sources.geonames_divisions] + url = "https://download.geonames.org/export/dump/admin1CodesASCII.txt" + sha256 = "6eace8b269cd4c9635d8f8631857c0be2cb3fb6362495f77f17f266ef7328f11" + + [resources.sources.geonames_subdivisions] + url = "https://download.geonames.org/export/dump/admin2Codes.txt" + sha256 = "defbd99329530fa6b06e154662fb16a51a0c12caf41636be17597c58c5374f1c" + [resources.ports] main.default = 3001 microservices.default = 3002 diff --git a/scripts/_common.sh b/scripts/_common.sh index 68e3abc..6d6a3aa 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -190,20 +190,13 @@ myynh_install_immich() { # Use 127.0.0.1 for microservices sed -i -e "s@app.listen(port)@app.listen(port, '127.0.0.1')@g" "$install_dir/app/dist/microservices/main.js" - # Cleanup - ynh_secure_remove --file="$source_dir" - # Install geonames - wget --output-document="$install_dir/resources/cities500.zip" \ - "https://download.geonames.org/export/dump/cities500.zip" 2>&1 - unzip "$install_dir/resources/cities500.zip" -d "$install_dir/resources/" - ynh_secure_remove --file="$install_dir/resources/cities500.zip" - wget --output-document="$install_dir/resources/admin1CodesASCII.txt" \ - "https://download.geonames.org/export/dump/admin1CodesASCII.txt" 2>&1 - wget --output-document="$install_dir/resources/admin2Codes.txt" \ - "https://download.geonames.org/export/dump/admin2Codes.txt" 2>&1 + cp -a "$source_dir/resources/*.txt" "$install_dir/resources/" date --iso-8601=seconds | tr -d "\n" > "$install_dir/resources/geodata-date.txt" + # Cleanup + ynh_secure_remove --file="$source_dir" + # Fix permissisons chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" diff --git a/scripts/install b/scripts/install index fb2a967..74a5cd5 100755 --- a/scripts/install +++ b/scripts/install @@ -15,6 +15,9 @@ ynh_script_progression --message="Setting up source files..." --weight=1 source_dir="$install_dir/source" ynh_setup_source --source_id="main" --dest_dir="$source_dir" +ynh_setup_source --source_id="geonames_cities" --dest_dir="$source_dir/resources/" +ynh_setup_source --source_id="geonames_divisions" --dest_dir="$source_dir/resources/" +ynh_setup_source --source_id="geonames_subdivisions" --dest_dir="$source_dir/resources/" #================================================= # CHECK PYTHON VERSION AND COMPILE IF NEEDED diff --git a/scripts/upgrade b/scripts/upgrade index b0aefd7..68763ab 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,9 @@ ynh_script_progression --message="Upgrading source files..." --weight=1 source_dir="$install_dir/source" ynh_setup_source --source_id="main" --dest_dir="$source_dir" --full_replace=1 +ynh_setup_source --source_id="geonames_cities" --dest_dir="$source_dir/resources/" --full_replace=1 +ynh_setup_source --source_id="geonames_divisions" --dest_dir="$source_dir/resources/" --full_replace=1 +ynh_setup_source --source_id="geonames_subdivisions" --dest_dir="$source_dir/resources/" --full_replace=1 #================================================= # CHECK PYTHON VERSION AND COMPILE IF NEEDED From 4be0dd0674b2de3f0f4cabd838e64a772f4e71f9 Mon Sep 17 00:00:00 2001 From: ewilly Date: Tue, 2 Apr 2024 17:57:43 +0200 Subject: [PATCH 14/23] Update manifest.toml --- manifest.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.toml b/manifest.toml index a66eef1..4874e7e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -50,6 +50,7 @@ ram.runtime = "500M" [resources.sources.geonames_cities] url = "https://download.geonames.org/export/dump/cities500.zip" sha256 = "6f11390524953d068439b0a55dab36f5bf86f4e5615da4ac00d724c1d167f847" + in_subdir = false [resources.sources.geonames_divisions] url = "https://download.geonames.org/export/dump/admin1CodesASCII.txt" From 68401cf336f9731e8acf415a6429e9bbb282679c Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 2 Apr 2024 15:57:47 +0000 Subject: [PATCH 15/23] Auto-update READMEs --- ALL_README.md | 1 + README_gl.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ALL_README.md b/ALL_README.md index 3eeb161..77b7509 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -3,3 +3,4 @@ - [Read the README in English](README.md) - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) +- [Le o README en galego](README_gl.md) diff --git a/README_gl.md b/README_gl.md index e446965..a1d5153 100644 --- a/README_gl.md +++ b/README_gl.md @@ -32,7 +32,7 @@ Self-hosted photo and video management solution. ## Documentación e recursos -- Web oficial da app: +- Web oficial da app: - Documentación oficial para usuarias: - Documentación oficial para admin: - Repositorio de orixe do código: From 0851514f6a6f7f631416d9b0979a51270a342c03 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 2 Apr 2024 21:09:15 +0200 Subject: [PATCH 16/23] Fix #23 --- conf/env | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/env b/conf/env index b454c36..95412fb 100644 --- a/conf/env +++ b/conf/env @@ -9,6 +9,7 @@ SERVER_PORT=__PORT__ MICROSERVICES_PORT=__PORT_MICROSERVICES__ MACHINE_LEARNING_HOST=127.0.0.1 MACHINE_LEARNING_PORT=__PORT_MACHINELEARNING__ +IMMICH_MACHINE_LEARNING_URL=127.0.0.1:__PORT_MACHINELEARNING__ ## Database DB_HOSTNAME=127.0.0.1 From 92c555dc74e9014257d9e5a2d823cfb2191d66f1 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 2 Apr 2024 21:09:51 +0200 Subject: [PATCH 17/23] Fix & Update to 1.100 --- manifest.toml | 8 +++++--- scripts/_common.sh | 6 ++++-- scripts/install | 6 +++--- scripts/upgrade | 6 +++--- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/manifest.toml b/manifest.toml index 4874e7e..4b233c3 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Immich" description.en = "Photo and video backup solution directly from your mobile phone" description.fr = "Sauvegarde de photos et de vidéos directement depuis votre mobile" -version = "1.98.2~ynh1" +version = "1.100.0~ynh1" maintainers = ["ewilly"] @@ -42,8 +42,8 @@ ram.runtime = "500M" [resources.sources] [resources.sources.main] - url = "https://github.com/immich-app/immich/archive/refs/tags/v1.98.2.tar.gz" - sha256 = "3fd79057b41a235518dde50ce62a2314758329c20360f462f77bba949f35d306" + url = "https://github.com/immich-app/immich/archive/refs/tags/v1.100.0.tar.gz" + sha256 = "13f00122d97f75293d4b1ac3385d40ebf07278f3b14ac2c7898138d9cf446fbb" autoupdate.strategy = "latest_github_release" @@ -55,10 +55,12 @@ ram.runtime = "500M" [resources.sources.geonames_divisions] url = "https://download.geonames.org/export/dump/admin1CodesASCII.txt" sha256 = "6eace8b269cd4c9635d8f8631857c0be2cb3fb6362495f77f17f266ef7328f11" + rename = "admin1CodesASCII.txt" [resources.sources.geonames_subdivisions] url = "https://download.geonames.org/export/dump/admin2Codes.txt" sha256 = "defbd99329530fa6b06e154662fb16a51a0c12caf41636be17597c58c5374f1c" + rename = "admin2Codes.txt" [resources.ports] main.default = 3001 diff --git a/scripts/_common.sh b/scripts/_common.sh index 6d6a3aa..9b36bc4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -188,10 +188,12 @@ myynh_install_immich() { ynh_exec_warn_less "$ynh_npm" install sharp # Use 127.0.0.1 for microservices - sed -i -e "s@app.listen(port)@app.listen(port, '127.0.0.1')@g" "$install_dir/app/dist/microservices/main.js" + sed -i -e "s@app.listen(port)@app.listen(port, '127.0.0.1')@g" "$install_dir/app/dist/main.js" # Install geonames - cp -a "$source_dir/resources/*.txt" "$install_dir/resources/" + cp -a "$source_dir/geonames_cities/cities500.txt" "$install_dir/resources/" + cp -a "$source_dir/geonames_divisions/admin1CodesASCII.txt" "$install_dir/resources/" + cp -a "$source_dir/geonames_subdivisions/admin2Codes.txt" "$install_dir/resources/" date --iso-8601=seconds | tr -d "\n" > "$install_dir/resources/geodata-date.txt" # Cleanup diff --git a/scripts/install b/scripts/install index 74a5cd5..e6d06bc 100755 --- a/scripts/install +++ b/scripts/install @@ -15,9 +15,9 @@ ynh_script_progression --message="Setting up source files..." --weight=1 source_dir="$install_dir/source" ynh_setup_source --source_id="main" --dest_dir="$source_dir" -ynh_setup_source --source_id="geonames_cities" --dest_dir="$source_dir/resources/" -ynh_setup_source --source_id="geonames_divisions" --dest_dir="$source_dir/resources/" -ynh_setup_source --source_id="geonames_subdivisions" --dest_dir="$source_dir/resources/" +ynh_setup_source --source_id="geonames_cities" --dest_dir="$source_dir/geonames_cities/" +ynh_setup_source --source_id="geonames_divisions" --dest_dir="$source_dir/geonames_divisions/" +ynh_setup_source --source_id="geonames_subdivisions" --dest_dir="$source_dir/geonames_subdivisions/" #================================================= # CHECK PYTHON VERSION AND COMPILE IF NEEDED diff --git a/scripts/upgrade b/scripts/upgrade index 68763ab..33818a5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,9 +27,9 @@ ynh_script_progression --message="Upgrading source files..." --weight=1 source_dir="$install_dir/source" ynh_setup_source --source_id="main" --dest_dir="$source_dir" --full_replace=1 -ynh_setup_source --source_id="geonames_cities" --dest_dir="$source_dir/resources/" --full_replace=1 -ynh_setup_source --source_id="geonames_divisions" --dest_dir="$source_dir/resources/" --full_replace=1 -ynh_setup_source --source_id="geonames_subdivisions" --dest_dir="$source_dir/resources/" --full_replace=1 +ynh_setup_source --source_id="geonames_cities" --dest_dir="$source_dir/geonames_cities/" --full_replace=1 +ynh_setup_source --source_id="geonames_divisions" --dest_dir="$source_dir/geonames_divisions/" --full_replace=1 +ynh_setup_source --source_id="geonames_subdivisions" --dest_dir="$source_dir/geonames_subdivisions/" --full_replace=1 #================================================= # CHECK PYTHON VERSION AND COMPILE IF NEEDED From bb33f3400513d599aeb4c954268a6d82f76d86e5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 2 Apr 2024 19:09:41 +0000 Subject: [PATCH 18/23] Auto-update READMEs --- README.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b97af42..20ab823 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Self-hosted photo and video management solution. - Easy-to-use and friendly interface ; -**Shipped version:** 1.98.2~ynh1 +**Shipped version:** 1.100.0~ynh1 ## Screenshots diff --git a/README_eu.md b/README_eu.md index 50ed96a..acf1895 100644 --- a/README_eu.md +++ b/README_eu.md @@ -24,7 +24,7 @@ Self-hosted photo and video management solution. - Easy-to-use and friendly interface ; -**Paketatutako bertsioa:** 1.98.2~ynh1 +**Paketatutako bertsioa:** 1.100.0~ynh1 ## Pantaila-argazkiak diff --git a/README_fr.md b/README_fr.md index ad5f267..7053109 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,7 +24,7 @@ Solution d'autohébergement pour a gestion de vos photos et vidéos. - Interface conviviale et egronomique ; -**Version incluse :** 1.98.2~ynh1 +**Version incluse :** 1.100.0~ynh1 ## Captures d’écran diff --git a/README_gl.md b/README_gl.md index a1d5153..3654535 100644 --- a/README_gl.md +++ b/README_gl.md @@ -24,7 +24,7 @@ Self-hosted photo and video management solution. - Easy-to-use and friendly interface ; -**Versión proporcionada:** 1.98.2~ynh1 +**Versión proporcionada:** 1.100.0~ynh1 ## Capturas de pantalla From 0f29da3a0aa8f3b936c00b457372970ed2727e25 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 2 Apr 2024 21:42:06 +0200 Subject: [PATCH 19/23] Customize some settings in db --- scripts/_common.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 9b36bc4..3914927 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -234,6 +234,9 @@ myynh_create_psql_db() { myynh_execute_psql_as_root --sql="CREATE USER $app WITH ENCRYPTED PASSWORD '$db_pwd';" --database="$app" myynh_execute_psql_as_root --sql="GRANT ALL PRIVILEGES ON DATABASE $app TO $app;" --database="$app" myynh_execute_psql_as_root --sql="ALTER USER $app WITH SUPERUSER;" --database="$app" + + myynh_execute_psql_as_root --sql="INSERT INTO system_config (key, value) VALUES ('newVersionCheck.enabled', false);" --database="$app" + myynh_execute_psql_as_root --sql="INSERT INTO system_config (key, value) VALUES ('machineLearning.url', '127.0.0.1:$port_machinelearning');" --database="$app" } # Remove the database From 88334d02cdf6d42ea18863dd42b885ab5aff0780 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 2 Apr 2024 21:55:49 +0200 Subject: [PATCH 20/23] Build venv with immich user --- scripts/_common.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 3914927..2f1d7cd 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -157,18 +157,24 @@ myynh_install_immich() { # Install immich-machine-learning cd "$source_dir/machine-learning" mkdir -p "$install_dir/app/machine-learning" - $py_app_version -m venv "$install_dir/app/machine-learning/venv" + chmod 750 "$install_dir/app/machine-learning" + chmod -R o-rwx "$install_dir/app/machine-learning" + chown -R $app:$app "$install_dir/app/machine-learning" + ynh_exec_as $app $py_app_version -m venv "$install_dir/app/machine-learning/venv" ( # activate the virtual environment set +o nounset source "$install_dir/app/machine-learning/venv/bin/activate" set -o nounset + # add pip + ynh_exec_as $app "$install_dir/bin/python3" -m ensurepip + # add poetry - ynh_exec_warn_less "$install_dir/app/machine-learning/venv/bin/pip3" install --upgrade poetry + ynh_exec_warn_less ynh_exec_as $app "$install_dir/app/machine-learning/venv/bin/pip3" install --upgrade poetry # poetry install - ynh_exec_warn_less "$install_dir/app/machine-learning/venv/bin/poetry" install --no-root --with dev --with cpu + ynh_exec_warn_less ynh_exec_as $app "$install_dir/app/machine-learning/venv/bin/poetry" install --no-root --with dev --with cpu ) cp -a "$source_dir/machine-learning/ann" "$install_dir/app/machine-learning/" cp -a "$source_dir/machine-learning/app" "$install_dir/app/machine-learning/" From 9d9fed376c43050525b774c653143e91bfd69c29 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 2 Apr 2024 22:28:57 +0200 Subject: [PATCH 21/23] Revert Customize some settings in db --- scripts/_common.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 2f1d7cd..11d2c9c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -240,9 +240,6 @@ myynh_create_psql_db() { myynh_execute_psql_as_root --sql="CREATE USER $app WITH ENCRYPTED PASSWORD '$db_pwd';" --database="$app" myynh_execute_psql_as_root --sql="GRANT ALL PRIVILEGES ON DATABASE $app TO $app;" --database="$app" myynh_execute_psql_as_root --sql="ALTER USER $app WITH SUPERUSER;" --database="$app" - - myynh_execute_psql_as_root --sql="INSERT INTO system_config (key, value) VALUES ('newVersionCheck.enabled', false);" --database="$app" - myynh_execute_psql_as_root --sql="INSERT INTO system_config (key, value) VALUES ('machineLearning.url', '127.0.0.1:$port_machinelearning');" --database="$app" } # Remove the database From a0737899a9cd827555dd8391699dc0fe70d6ef5b Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 2 Apr 2024 22:47:56 +0200 Subject: [PATCH 22/23] Fix venv --- scripts/_common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 11d2c9c..b539637 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -160,6 +160,7 @@ myynh_install_immich() { chmod 750 "$install_dir/app/machine-learning" chmod -R o-rwx "$install_dir/app/machine-learning" chown -R $app:$app "$install_dir/app/machine-learning" + ynh_exec_as $app $py_app_version -m venv "$install_dir/app/machine-learning/venv" ( # activate the virtual environment @@ -168,7 +169,7 @@ myynh_install_immich() { set -o nounset # add pip - ynh_exec_as $app "$install_dir/bin/python3" -m ensurepip + ynh_exec_as $app "$install_dir/app/machine-learning/venv/bin/python3" -m ensurepip # add poetry ynh_exec_warn_less ynh_exec_as $app "$install_dir/app/machine-learning/venv/bin/pip3" install --upgrade poetry From 9b23c02a5461d1306c3774d15d00895f2bcbcb99 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 2 Apr 2024 23:15:32 +0200 Subject: [PATCH 23/23] Revert Build venv with immich user --- scripts/_common.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index b539637..9b36bc4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -157,25 +157,18 @@ myynh_install_immich() { # Install immich-machine-learning cd "$source_dir/machine-learning" mkdir -p "$install_dir/app/machine-learning" - chmod 750 "$install_dir/app/machine-learning" - chmod -R o-rwx "$install_dir/app/machine-learning" - chown -R $app:$app "$install_dir/app/machine-learning" - - ynh_exec_as $app $py_app_version -m venv "$install_dir/app/machine-learning/venv" + $py_app_version -m venv "$install_dir/app/machine-learning/venv" ( # activate the virtual environment set +o nounset source "$install_dir/app/machine-learning/venv/bin/activate" set -o nounset - # add pip - ynh_exec_as $app "$install_dir/app/machine-learning/venv/bin/python3" -m ensurepip - # add poetry - ynh_exec_warn_less ynh_exec_as $app "$install_dir/app/machine-learning/venv/bin/pip3" install --upgrade poetry + ynh_exec_warn_less "$install_dir/app/machine-learning/venv/bin/pip3" install --upgrade poetry # poetry install - ynh_exec_warn_less ynh_exec_as $app "$install_dir/app/machine-learning/venv/bin/poetry" install --no-root --with dev --with cpu + ynh_exec_warn_less "$install_dir/app/machine-learning/venv/bin/poetry" install --no-root --with dev --with cpu ) cp -a "$source_dir/machine-learning/ann" "$install_dir/app/machine-learning/" cp -a "$source_dir/machine-learning/app" "$install_dir/app/machine-learning/"