mirror of
https://github.com/YunoHost-Apps/immich_ynh.git
synced 2024-09-03 20:36:24 +02:00
Merge pull request #21 from YunoHost-Apps/testing
Testing - simplification
This commit is contained in:
commit
9c8e0fac60
12 changed files with 186 additions and 115 deletions
|
@ -1,3 +1,6 @@
|
||||||
# All available README files by language
|
# All available README files by language
|
||||||
|
|
||||||
- [Read the README in English](README.md)
|
- [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)
|
||||||
|
|
|
@ -24,7 +24,7 @@ Self-hosted photo and video management solution.
|
||||||
- Easy-to-use and friendly interface ;
|
- Easy-to-use and friendly interface ;
|
||||||
|
|
||||||
|
|
||||||
**Shipped version:** 1.98.2~ynh1
|
**Shipped version:** 1.100.0~ynh1
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ Self-hosted photo and video management solution.
|
||||||
|
|
||||||
## Documentation and resources
|
## Documentation and resources
|
||||||
|
|
||||||
- Official app website: <https://www.immich.app>
|
- Official app website: <https://immich.app>
|
||||||
- Official user documentation: <https://github.com/immich-app/immich#getting-started>
|
- Official user documentation: <https://github.com/immich-app/immich#getting-started>
|
||||||
- Official admin documentation: <https://github.com/immich-app/immich#getting-started>
|
- Official admin documentation: <https://github.com/immich-app/immich#getting-started>
|
||||||
- Upstream app code repository: <https://github.com/immich-app/immich>
|
- Upstream app code repository: <https://github.com/immich-app/immich>
|
||||||
|
|
54
README_eu.md
Normal file
54
README_eu.md
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
<!--
|
||||||
|
Ohart ongi: README hau automatikoki sortu da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>ri esker
|
||||||
|
EZ editatu eskuz.
|
||||||
|
-->
|
||||||
|
|
||||||
|
# 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: <https://immich.app>
|
||||||
|
- Erabiltzaileen dokumentazio ofiziala: <https://github.com/immich-app/immich#getting-started>
|
||||||
|
- Administratzaileen dokumentazio ofiziala: <https://github.com/immich-app/immich#getting-started>
|
||||||
|
- Jatorrizko aplikazioaren kode-gordailua: <https://github.com/immich-app/immich>
|
||||||
|
- YunoHost Denda: <https://apps.yunohost.org/app/immich>
|
||||||
|
- Eman errore baten berri: <https://github.com/YunoHost-Apps/immich_ynh/issues>
|
||||||
|
|
||||||
|
## 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:** <https://yunohost.org/packaging_apps>
|
|
@ -24,7 +24,7 @@ Solution d'autohébergement pour a gestion de vos photos et vidéos.
|
||||||
- Interface conviviale et egronomique ;
|
- Interface conviviale et egronomique ;
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 1.98.2~ynh1
|
**Version incluse :** 1.100.0~ynh1
|
||||||
|
|
||||||
## Captures d’écran
|
## Captures d’écran
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ Solution d'autohébergement pour a gestion de vos photos et vidéos.
|
||||||
|
|
||||||
## Documentations et ressources
|
## Documentations et ressources
|
||||||
|
|
||||||
- Site officiel de l’app : <https://www.immich.app>
|
- Site officiel de l’app : <https://immich.app>
|
||||||
- Documentation officielle utilisateur : <https://github.com/immich-app/immich#getting-started>
|
- Documentation officielle utilisateur : <https://github.com/immich-app/immich#getting-started>
|
||||||
- Documentation officielle de l’admin : <https://github.com/immich-app/immich#getting-started>
|
- Documentation officielle de l’admin : <https://github.com/immich-app/immich#getting-started>
|
||||||
- Dépôt de code officiel de l’app : <https://github.com/immich-app/immich>
|
- Dépôt de code officiel de l’app : <https://github.com/immich-app/immich>
|
||||||
|
|
|
@ -24,7 +24,7 @@ Self-hosted photo and video management solution.
|
||||||
- Easy-to-use and friendly interface ;
|
- Easy-to-use and friendly interface ;
|
||||||
|
|
||||||
|
|
||||||
**Versión proporcionada:** 1.98.2~ynh1
|
**Versión proporcionada:** 1.100.0~ynh1
|
||||||
|
|
||||||
## Capturas de pantalla
|
## Capturas de pantalla
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ Self-hosted photo and video management solution.
|
||||||
|
|
||||||
## Documentación e recursos
|
## Documentación e recursos
|
||||||
|
|
||||||
- Web oficial da app: <https://www.immich.app>
|
- Web oficial da app: <https://immich.app>
|
||||||
- Documentación oficial para usuarias: <https://github.com/immich-app/immich#getting-started>
|
- Documentación oficial para usuarias: <https://github.com/immich-app/immich#getting-started>
|
||||||
- Documentación oficial para admin: <https://github.com/immich-app/immich#getting-started>
|
- Documentación oficial para admin: <https://github.com/immich-app/immich#getting-started>
|
||||||
- Repositorio de orixe do código: <https://github.com/immich-app/immich>
|
- Repositorio de orixe do código: <https://github.com/immich-app/immich>
|
||||||
|
|
1
conf/env
1
conf/env
|
@ -9,6 +9,7 @@ SERVER_PORT=__PORT__
|
||||||
MICROSERVICES_PORT=__PORT_MICROSERVICES__
|
MICROSERVICES_PORT=__PORT_MICROSERVICES__
|
||||||
MACHINE_LEARNING_HOST=127.0.0.1
|
MACHINE_LEARNING_HOST=127.0.0.1
|
||||||
MACHINE_LEARNING_PORT=__PORT_MACHINELEARNING__
|
MACHINE_LEARNING_PORT=__PORT_MACHINELEARNING__
|
||||||
|
IMMICH_MACHINE_LEARNING_URL=127.0.0.1:__PORT_MACHINELEARNING__
|
||||||
|
|
||||||
## Database
|
## Database
|
||||||
DB_HOSTNAME=127.0.0.1
|
DB_HOSTNAME=127.0.0.1
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
|
||||||
|
|
||||||
packaging_format = 2
|
packaging_format = 2
|
||||||
|
|
||||||
id = "immich"
|
id = "immich"
|
||||||
|
@ -5,13 +7,13 @@ name = "Immich"
|
||||||
description.en = "Photo and video backup solution directly from your mobile phone"
|
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"
|
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"]
|
maintainers = ["ewilly"]
|
||||||
|
|
||||||
[upstream]
|
[upstream]
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
website = "https://www.immich.app"
|
website = "https://immich.app"
|
||||||
admindoc = "https://github.com/immich-app/immich#getting-started"
|
admindoc = "https://github.com/immich-app/immich#getting-started"
|
||||||
userdoc = "https://github.com/immich-app/immich#getting-started"
|
userdoc = "https://github.com/immich-app/immich#getting-started"
|
||||||
code = "https://github.com/immich-app/immich"
|
code = "https://github.com/immich-app/immich"
|
||||||
|
@ -40,11 +42,26 @@ ram.runtime = "500M"
|
||||||
[resources.sources]
|
[resources.sources]
|
||||||
|
|
||||||
[resources.sources.main]
|
[resources.sources.main]
|
||||||
url = "https://github.com/immich-app/immich/archive/refs/tags/v1.98.2.tar.gz"
|
url = "https://github.com/immich-app/immich/archive/refs/tags/v1.100.0.tar.gz"
|
||||||
sha256 = "3fd79057b41a235518dde50ce62a2314758329c20360f462f77bba949f35d306"
|
sha256 = "13f00122d97f75293d4b1ac3385d40ebf07278f3b14ac2c7898138d9cf446fbb"
|
||||||
|
|
||||||
autoupdate.strategy = "latest_github_release"
|
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]
|
[resources.ports]
|
||||||
main.default = 3001
|
main.default = 3001
|
||||||
microservices.default = 3002
|
microservices.default = 3002
|
||||||
|
@ -66,11 +83,32 @@ ram.runtime = "500M"
|
||||||
api.protected = true
|
api.protected = true
|
||||||
|
|
||||||
[resources.apt]
|
[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"]
|
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"
|
[resources.apt.extras.postgresql]
|
||||||
extras.postgresql.key = "https://www.postgresql.org/media/keys/ACCC4CF8.asc"
|
repo = "deb https://apt.postgresql.org/pub/repos/apt bullseye-pgdg main 16"
|
||||||
extras.postgresql.packages = ["libllvm13", "libpq5", "libpq-dev" , "postgresql-16", "postgresql-16-pgvector", "postgresql-client-16", "postgresql-common", "postgresql-client-common"]
|
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]
|
[resources.database]
|
||||||
type = "postgresql"
|
type = "postgresql"
|
||||||
|
|
|
@ -4,29 +4,9 @@
|
||||||
# COMMON VARIABLES
|
# 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 required version
|
||||||
nodejs_version=20
|
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
|
# Fail2ban
|
||||||
failregex="immich-server.*Failed login attempt for user.+from ip address\s?<ADDR>"
|
failregex="immich-server.*Failed login attempt for user.+from ip address\s?<ADDR>"
|
||||||
|
|
||||||
|
@ -34,6 +14,12 @@ failregex="immich-server.*Failed login attempt for user.+from ip address\s?<ADDR
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
# 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
|
||||||
|
}
|
||||||
|
|
||||||
# Retrieve full latest python version from major version
|
# Retrieve full latest python version from major version
|
||||||
# usage: py_latest_from_major --python="3.8"
|
# usage: py_latest_from_major --python="3.8"
|
||||||
# | arg: -p, --python= - the major python version
|
# | arg: -p, --python= - the major python version
|
||||||
|
@ -138,30 +124,30 @@ myynh_install_immich() {
|
||||||
ynh_use_nodejs
|
ynh_use_nodejs
|
||||||
|
|
||||||
# Install immich-server
|
# Install immich-server
|
||||||
cd "$tmpdir/server"
|
cd "$source_dir/server"
|
||||||
ynh_exec_warn_less "$ynh_npm" ci
|
ynh_exec_warn_less "$ynh_npm" ci
|
||||||
ynh_exec_warn_less "$ynh_npm" run build
|
ynh_exec_warn_less "$ynh_npm" run build
|
||||||
ynh_exec_warn_less "$ynh_npm" prune --omit=dev --omit=optional
|
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" ci
|
||||||
ynh_exec_warn_less "$ynh_npm" run build
|
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" ci
|
||||||
ynh_exec_warn_less "$ynh_npm" run build
|
ynh_exec_warn_less "$ynh_npm" run build
|
||||||
|
|
||||||
mkdir -p "$install_dir/app/"
|
mkdir -p "$install_dir/app/"
|
||||||
cp -a "$tmpdir/server/node_modules" "$install_dir/app/"
|
cp -a "$source_dir/server/node_modules" "$install_dir/app/"
|
||||||
cp -a "$tmpdir/server/dist" "$install_dir/app/"
|
cp -a "$source_dir/server/dist" "$install_dir/app/"
|
||||||
cp -a "$tmpdir/server/bin" "$install_dir/app/"
|
cp -a "$source_dir/server/bin" "$install_dir/app/"
|
||||||
cp -a "$tmpdir/web/build" "$install_dir/app/www"
|
cp -a "$source_dir/web/build" "$install_dir/app/www"
|
||||||
cp -a "$tmpdir/server/resources" "$install_dir/app/"
|
cp -a "$source_dir/server/resources" "$install_dir/app/"
|
||||||
cp -a "$tmpdir/server/package.json" "$install_dir/app/"
|
cp -a "$source_dir/server/package.json" "$install_dir/app/"
|
||||||
cp -a "$tmpdir/server/package-lock.json" "$install_dir/app/"
|
cp -a "$source_dir/server/package-lock.json" "$install_dir/app/"
|
||||||
cp -a "$tmpdir/server/start-microservices.sh" "$install_dir/app/"
|
cp -a "$source_dir/server/start-microservices.sh" "$install_dir/app/"
|
||||||
cp -a "$tmpdir/server/start-server.sh" "$install_dir/app/"
|
cp -a "$source_dir/server/start-server.sh" "$install_dir/app/"
|
||||||
cp -a "$tmpdir/LICENSE" "$install_dir/app/"
|
cp -a "$source_dir/LICENSE" "$install_dir/app/"
|
||||||
# Install custom start.sh script
|
# Install custom start.sh script
|
||||||
ynh_add_config --template="immich-server-start.sh" --destination="$install_dir/app/start.sh"
|
ynh_add_config --template="immich-server-start.sh" --destination="$install_dir/app/start.sh"
|
||||||
chmod +x "$install_dir/app/start.sh"
|
chmod +x "$install_dir/app/start.sh"
|
||||||
|
@ -169,7 +155,7 @@ myynh_install_immich() {
|
||||||
ynh_exec_warn_less "$ynh_npm" cache clean --force
|
ynh_exec_warn_less "$ynh_npm" cache clean --force
|
||||||
|
|
||||||
# Install immich-machine-learning
|
# Install immich-machine-learning
|
||||||
cd "$tmpdir/machine-learning"
|
cd "$source_dir/machine-learning"
|
||||||
mkdir -p "$install_dir/app/machine-learning"
|
mkdir -p "$install_dir/app/machine-learning"
|
||||||
$py_app_version -m venv "$install_dir/app/machine-learning/venv"
|
$py_app_version -m venv "$install_dir/app/machine-learning/venv"
|
||||||
(
|
(
|
||||||
|
@ -184,8 +170,8 @@ myynh_install_immich() {
|
||||||
# poetry install
|
# 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 "$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 "$source_dir/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/app" "$install_dir/app/machine-learning/"
|
||||||
# Install custom start.sh script
|
# Install custom start.sh script
|
||||||
ynh_add_config --template="immich-machine-learning-start.sh" --destination="$install_dir/app/machine-learning/start.sh"
|
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"
|
chmod +x "$install_dir/app/machine-learning/start.sh"
|
||||||
|
@ -202,22 +188,17 @@ myynh_install_immich() {
|
||||||
ynh_exec_warn_less "$ynh_npm" install sharp
|
ynh_exec_warn_less "$ynh_npm" install sharp
|
||||||
|
|
||||||
# Use 127.0.0.1 for microservices
|
# 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"
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
ynh_secure_remove --file="$tmpdir"
|
|
||||||
|
|
||||||
# Install geonames
|
# Install geonames
|
||||||
wget --output-document="$install_dir/resources/cities500.zip" \
|
cp -a "$source_dir/geonames_cities/cities500.txt" "$install_dir/resources/"
|
||||||
"https://download.geonames.org/export/dump/cities500.zip" 2>&1
|
cp -a "$source_dir/geonames_divisions/admin1CodesASCII.txt" "$install_dir/resources/"
|
||||||
unzip "$install_dir/resources/cities500.zip" -d "$install_dir/resources/"
|
cp -a "$source_dir/geonames_subdivisions/admin2Codes.txt" "$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
|
|
||||||
date --iso-8601=seconds | tr -d "\n" > "$install_dir/resources/geodata-date.txt"
|
date --iso-8601=seconds | tr -d "\n" > "$install_dir/resources/geodata-date.txt"
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
ynh_secure_remove --file="$source_dir"
|
||||||
|
|
||||||
# Fix permissisons
|
# Fix permissisons
|
||||||
chmod 750 "$install_dir"
|
chmod 750 "$install_dir"
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
|
@ -244,7 +225,7 @@ myynh_execute_psql_as_root() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo --login --user=postgres PGUSER=postgres PGPASSWORD="$(cat $PSQL_ROOT_PWD_FILE)" \
|
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
|
# 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"
|
--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)" \
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -13,15 +13,18 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..." --weight=1
|
ynh_script_progression --message="Setting up source files..." --weight=1
|
||||||
|
|
||||||
tmpdir="$(mktemp --directory)"
|
source_dir="$install_dir/source"
|
||||||
ynh_setup_source --source_id="main" --dest_dir="$tmpdir"
|
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
|
# CHECK PYTHON VERSION AND COMPILE IF NEEDED
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Check Python version & compile the required one if needed..." --weight=1
|
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_py_latest_from_major --python="$py_required_major"
|
||||||
myynh_install_python --python="$py_required_version"
|
myynh_install_python --python="$py_required_version"
|
||||||
|
|
||||||
|
@ -41,7 +44,7 @@ db_pwd=$(ynh_string_random)
|
||||||
myynh_create_psql_db
|
myynh_create_psql_db
|
||||||
db_port=$(myynh_execute_psql_as_root --sql="\conninfo" | cut -d'"' -f8)
|
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_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"
|
ynh_app_setting_set --app="$app" --key=psql_port --value="$db_port"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -12,33 +12,27 @@ source /usr/share/yunohost/helpers
|
||||||
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
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`)
|
# 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
|
if ynh_exec_warn_less yunohost service status "$app-server" >/dev/null; then
|
||||||
then
|
|
||||||
ynh_script_progression --message="Removing $app-server service integration..." --weight=1
|
|
||||||
yunohost service remove "$app-server"
|
yunohost service remove "$app-server"
|
||||||
fi
|
fi
|
||||||
if ynh_exec_warn_less yunohost service status "$app-microservices" >/dev/null
|
if ynh_exec_warn_less yunohost service status "$app-microservices" >/dev/null; then
|
||||||
then
|
|
||||||
ynh_script_progression --message="Removing $app-microservices service integration..." --weight=1
|
|
||||||
yunohost service remove "$app-microservices"
|
yunohost service remove "$app-microservices"
|
||||||
fi
|
fi
|
||||||
if ynh_exec_warn_less yunohost service status "$app-machine-learning" >/dev/null
|
if ynh_exec_warn_less yunohost service status "$app-machine-learning" >/dev/null; then
|
||||||
then
|
|
||||||
ynh_script_progression --message="Removing $app-machine-learning service integration..." --weight=1
|
|
||||||
yunohost service remove "$app-machine-learning"
|
yunohost service remove "$app-machine-learning"
|
||||||
fi
|
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
|
# Remove the app-specific fail2ban config
|
||||||
ynh_remove_fail2ban_config
|
ynh_remove_fail2ban_config
|
||||||
|
|
||||||
# Remove the app-specific logrotate config
|
# Remove the app-specific logrotate config
|
||||||
ynh_remove_logrotate
|
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
|
# Remove the dedicated NGINX config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,6 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK VERSION
|
|
||||||
#=================================================
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP SYSTEMD SERVICE
|
# STOP SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -25,23 +20,23 @@ ynh_systemd_action --service_name="$app-machine-learning" --action="stop"
|
||||||
#=================================================
|
#=================================================
|
||||||
#ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
#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
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
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" --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
|
# CHECK PYTHON VERSION AND COMPILE IF NEEDED
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Check Python version & compile the required one if needed..." --weight=1
|
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_py_latest_from_major --python="$py_required_major"
|
||||||
myynh_install_python --python="$py_required_version"
|
myynh_install_python --python="$py_required_version"
|
||||||
|
|
||||||
|
@ -49,15 +44,15 @@ then
|
||||||
# INSTALL NODEJS
|
# INSTALL NODEJS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing nodejs..." --weight=1
|
ynh_script_progression --message="Installing nodejs..." --weight=1
|
||||||
|
|
||||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
|
ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MAKE INSTALL
|
# MAKE INSTALL
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Making install..." --weight=5
|
ynh_script_progression --message="Making install..." --weight=5
|
||||||
ynh_secure_remove --file="$install_dir"
|
|
||||||
myynh_install_immich
|
myynh_install_immich
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE A CONFIG FILE
|
# UPDATE A CONFIG FILE
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
|
||||||
|
|
||||||
test_format = 1.0
|
test_format = 1.0
|
||||||
|
|
||||||
[default]
|
[default]
|
||||||
|
|
Loading…
Reference in a new issue