1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/immich_ynh.git synced 2024-09-03 20:36:24 +02:00

Add geonames files to app sources

This commit is contained in:
Sylvain 2024-04-02 08:35:30 +02:00
parent 078aae8a32
commit 4fa6086f2a
4 changed files with 22 additions and 11 deletions

View file

@ -47,6 +47,18 @@ ram.runtime = "500M"
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"
[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] [resources.ports]
main.default = 3001 main.default = 3001
microservices.default = 3002 microservices.default = 3002

View file

@ -190,20 +190,13 @@ myynh_install_immich() {
# 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/microservices/main.js"
# Install geonames
cp -a "$source_dir/resources/*.txt" "$install_dir/resources/"
date --iso-8601=seconds | tr -d "\n" > "$install_dir/resources/geodata-date.txt"
# Cleanup # Cleanup
ynh_secure_remove --file="$source_dir" 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
date --iso-8601=seconds | tr -d "\n" > "$install_dir/resources/geodata-date.txt"
# Fix permissisons # Fix permissisons
chmod 750 "$install_dir" chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"

View file

@ -15,6 +15,9 @@ ynh_script_progression --message="Setting up source files..." --weight=1
source_dir="$install_dir/source" 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"
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 # CHECK PYTHON VERSION AND COMPILE IF NEEDED

View file

@ -27,6 +27,9 @@ ynh_script_progression --message="Upgrading source files..." --weight=1
source_dir="$install_dir/source" source_dir="$install_dir/source"
ynh_setup_source --source_id="main" --dest_dir="$source_dir" --full_replace=1 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 # CHECK PYTHON VERSION AND COMPILE IF NEEDED