From 16ae8c56b05ea4c80f25dc154e25d08d83f3ce4e Mon Sep 17 00:00:00 2001 From: Juhyung Park Date: Tue, 1 Apr 2025 13:44:28 +0900 Subject: [PATCH] Remove localhost patch and update instruction Since the immich-native project was born, upstream now properly reads and honors IMMICH_HOST. Signed-off-by: Juhyung Park --- README.md | 2 +- install.sh | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/README.md b/README.md index de70be6..c50faa8 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ In summary, the `install.sh` script does the following: * Replaces `/usr/src` to `/var/lib/immich`. - * Limits listening host from 0.0.0.0 to 127.0.0.1. If you do not want this to happen (make sure you fully understand the security risks!), comment out the `sed` command in `install.sh`'s "Use 127.0.0.1" part. + * Limits listening host from 0.0.0.0 to 127.0.0.1. If you do not want this to happen (make sure you fully understand the security risks!), change `IMMICH_HOST=127.0.0.1` to `IMMICH_HOST=0.0.0.0` from the `env` file. ## Done! diff --git a/install.sh b/install.sh index 5e8cf89..dba3202 100755 --- a/install.sh +++ b/install.sh @@ -60,15 +60,6 @@ cd $TMP git reset --hard $REV rm -rf .git -# Use 127.0.0.1 -find . -type f \( -name '*.ts' -o -name '*.js' \) -exec grep app.listen {} + | \ - sed 's/.*app.listen//' | grep -v '()' | grep '^(' | \ - tr -d "[:blank:]" | awk -F"[(),]" '{print $2}' | sort | uniq | while read port; do - find . -type f \( -name '*.ts' -o -name '*.js' \) -exec sed -i -e "s@app.listen(${port})@app.listen(${port}, '127.0.0.1')@g" {} + -done -find . -type f \( -name '*.ts' -o -name '*.js' \) -exec sed -i -e "s@PrometheusExporter({ port })@PrometheusExporter({ host: '127.0.0.1', port: port })@g" {} + -grep -RlE "\"0\.0\.0\.0\"|'0\.0\.0\.0'" | xargs -n1 sed -i -e "s@'0\.0\.0\.0'@'127.0.0.1'@g" -e 's@"0\.0\.0\.0"@"127.0.0.1"@g' - # Replace /usr/src grep -Rl /usr/src | xargs -n1 sed -i -e "s@/usr/src@$IMMICH_PATH@g" mkdir -p $IMMICH_PATH/cache