diff --git a/ALL_README.md b/ALL_README.md index 1394c1a..77b7509 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,3 +1,6 @@ # 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) +- [Le o README en galego](README_gl.md) diff --git a/README.md b/README.md index 1583c18..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 @@ -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: diff --git a/README_eu.md b/README_eu.md new file mode 100644 index 0000000..acf1895 --- /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.100.0~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..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 @@ -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 : diff --git a/README_gl.md b/README_gl.md index e446965..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 @@ -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: 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 diff --git a/manifest.toml b/manifest.toml index 5b15a0a..4b233c3 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" @@ -5,13 +7,13 @@ 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"] [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" @@ -40,11 +42,26 @@ 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" + [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" + 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 microservices.default = 3002 @@ -66,11 +83,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/scripts/_common.sh b/scripts/_common.sh index cff87f3..9b36bc4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,29 +4,9 @@ # 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" - # 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 - # Fail2ban failregex="immich-server.*Failed login attempt for user.+from ip address\s?" @@ -34,6 +14,12 @@ failregex="immich-server.*Failed login attempt for user.+from ip address\s?&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/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 + ynh_secure_remove --file="$source_dir" + # Fix permissisons chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" @@ -244,7 +225,7 @@ myynh_execute_psql_as_root() { fi sudo --login --user=postgres PGUSER=postgres PGPASSWORD="$(cat $PSQL_ROOT_PWD_FILE)" \ - psql --cluster="$postgresql_version/main" "$database" --command="$sql" + psql --cluster="$(postgresql_version)/main" "$database" --command="$sql" } # Install the database @@ -278,7 +259,7 @@ myynh_restore_psql_db() { --replace_string="SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);" --target_file="db.sql" sudo --login --user=postgres PGUSER=postgres PGPASSWORD="$(cat $PSQL_ROOT_PWD_FILE)" \ - psql --cluster="$postgresql_version/main" --dbname="$app" < ./db.sql + psql --cluster="$(postgresql_version)/main" --dbname="$app" < ./db.sql } #================================================= diff --git a/scripts/install b/scripts/install index f0bf438..e6d06bc 100755 --- a/scripts/install +++ b/scripts/install @@ -13,15 +13,18 @@ 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" +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 #================================================= 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" @@ -41,7 +44,7 @@ db_pwd=$(ynh_string_random) myynh_create_psql_db db_port=$(myynh_execute_psql_as_root --sql="\conninfo" | cut -d'"' -f8) ynh_app_setting_set --app="$app" --key=psql_pwd --value="$db_pwd" -ynh_app_setting_set --app="$app" --key=psql_version --value="$postgresql_version" +ynh_app_setting_set --app="$app" --key=psql_version --value="$(postgresql_version)" ynh_app_setting_set --app="$app" --key=psql_port --value="$db_port" #================================================= 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 diff --git a/scripts/upgrade b/scripts/upgrade index a0ccd88..33818a5 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,38 @@ 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 + +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/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 +#================================================= +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" + +#================================================= +# 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 + +myynh_install_immich #================================================= # UPDATE A CONFIG FILE 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]