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