From 0b60b00597567fb2bbd114ff9c26af84cfa6ae51 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Thu, 28 Mar 2024 21:31:12 +0100 Subject: [PATCH] Add geonames --- manifest.toml | 2 +- scripts/_common.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 087c621..7fbee9e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -66,7 +66,7 @@ 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"] + 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" diff --git a/scripts/_common.sh b/scripts/_common.sh index 4f6012a..cff87f3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -207,6 +207,17 @@ myynh_install_immich() { # Cleanup ynh_secure_remove --file="$tmpdir" + # 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 + date --iso-8601=seconds | tr -d "\n" > "$install_dir/resources/geodata-date.txt" + # Fix permissisons chmod 750 "$install_dir" chmod -R o-rwx "$install_dir"