Skip to content

Commit

Permalink
Merge pull request #4724 from nextcloud/enh/noid/localhost
Browse files Browse the repository at this point in the history
use `127.0.0.1` instead of `localhost`
  • Loading branch information
szaimen authored Jun 6, 2024
2 parents 59da067 + 414716e commit 813cfc2
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Containers/apache/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ https://{$ADDITIONAL_TRUSTED_DOMAIN}:443,
rewrite /.well-known/carddav /remote.php/dav/
rewrite /.well-known/caldav /remote.php/dav/
header Strict-Transport-Security max-age=31536000;
reverse_proxy localhost:8000
reverse_proxy 127.0.0.1:8000
}

# TLS options
Expand Down
4 changes: 2 additions & 2 deletions Containers/apache/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

nc -z "$NEXTCLOUD_HOST" 9000 || exit 0
nc -z localhost 8000 || exit 1
nc -z localhost "$APACHE_PORT" || exit 1
nc -z 127.0.0.1 8000 || exit 1
nc -z 127.0.0.1 "$APACHE_PORT" || exit 1
if ! nc -z "$NC_DOMAIN" 443; then
echo "Could not reach $NC_DOMAIN on port 443."
exit 1
Expand Down
2 changes: 1 addition & 1 deletion Containers/collabora/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ RUN set -ex; \

USER 100

HEALTHCHECK CMD nc -z localhost 9980 || exit 1
HEALTHCHECK CMD nc -z 127.0.0.1 9980 || exit 1
LABEL com.centurylinklabs.watchtower.enable="false"
2 changes: 1 addition & 1 deletion Containers/docker-socket-proxy/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

nc -z "$NEXTCLOUD_HOST" 9001 || exit 0
nc -z localhost 2375 || exit 1
nc -z 127.0.0.1 2375 || exit 1
2 changes: 1 addition & 1 deletion Containers/domaincheck/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ COPY --chmod=775 start.sh /start.sh
USER www-data
ENTRYPOINT ["/start.sh"]

HEALTHCHECK CMD nc -z localhost $APACHE_PORT || exit 1
HEALTHCHECK CMD nc -z 127.0.0.1 $APACHE_PORT || exit 1
LABEL com.centurylinklabs.watchtower.enable="false"
2 changes: 1 addition & 1 deletion Containers/fulltextsearch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ RUN set -ex; \

USER 1000:0

HEALTHCHECK CMD nc -z localhost 9200 || exit 1
HEALTHCHECK CMD nc -z 127.0.0.1 9200 || exit 1
LABEL com.centurylinklabs.watchtower.enable="false"
4 changes: 2 additions & 2 deletions Containers/imaginary/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:latest
FROM golang:1.22.3-alpine3.18 as go

ENV IMAGINARY_HASH 6cd9edd1d3fb151eb773c14552886e4fc8e50138
ENV IMAGINARY_HASH 6cd9edd1d3fb151eb773c14552886e4fc8e50138

RUN set -ex; \
apk add --no-cache \
Expand Down Expand Up @@ -38,5 +38,5 @@ USER nobody
ENV MALLOC_ARENA_MAX=2
ENTRYPOINT ["/start.sh"]

HEALTHCHECK CMD nc -z localhost "$PORT" || exit 1
HEALTHCHECK CMD nc -z 127.0.0.1 "$PORT" || exit 1
LABEL com.centurylinklabs.watchtower.enable="false"
4 changes: 2 additions & 2 deletions Containers/mastercontainer/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}

on_demand_tls {
ask http://localhost:9876/
ask http://127.0.0.1:9876/
}
}

Expand All @@ -26,7 +26,7 @@ http://:80 {

https://:8443 {

reverse_proxy localhost:8000
reverse_proxy 127.0.0.1:8000

tls {
on_demand
Expand Down
12 changes: 6 additions & 6 deletions Containers/mastercontainer/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

if [ -f "/mnt/docker-aio-config/data/configuration.json" ]; then
nc -z localhost 80 || exit 1
nc -z localhost 8000 || exit 1
nc -z localhost 8080 || exit 1
nc -z localhost 8443 || exit 1
nc -z localhost 9000 || exit 1
nc -z localhost 9876 || exit 1
nc -z 127.0.0.1 80 || exit 1
nc -z 127.0.0.1 8000 || exit 1
nc -z 127.0.0.1 8080 || exit 1
nc -z 127.0.0.1 8443 || exit 1
nc -z 127.0.0.1 9000 || exit 1
nc -z 127.0.0.1 9876 || exit 1
fi
6 changes: 3 additions & 3 deletions Containers/mastercontainer/mastercontainer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Listen 8080

# PHP match
<FilesMatch "\.php$">
SetHandler "proxy:fcgi://localhost:9000"
SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>
# Master dir
DocumentRoot /var/www/docker-aio/php/public/
Expand All @@ -41,8 +41,8 @@ Listen 8080
# Https host
<VirtualHost *:8080>
# Proxy to https
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/
ProxyPreserveHost On
# SSL
SSLCertificateKeyFile /etc/apache2/certs/ssl.key
Expand Down
2 changes: 1 addition & 1 deletion Containers/nextcloud/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ fi
# shellcheck disable=SC2153
nc -z "$POSTGRES_HOST" "$POSTGRES_PORT" || exit 0

if ! nc -z localhost 9000; then
if ! nc -z 127.0.0.1 9000; then
exit 1
fi
2 changes: 1 addition & 1 deletion Containers/notify-push/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ if ! nc -z "$NEXTCLOUD_HOST" 9001; then
exit 0
fi

nc -z localhost 7867 || exit 1
nc -z 127.0.0.1 7867 || exit 1
2 changes: 1 addition & 1 deletion Containers/onlyoffice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ FROM onlyoffice/documentserver:8.0.1.1

# USER root is probably used

HEALTHCHECK CMD nc -z localhost 80 || exit 1
HEALTHCHECK CMD nc -z 127.0.0.1 80 || exit 1
LABEL com.centurylinklabs.watchtower.enable="false"
2 changes: 1 addition & 1 deletion Containers/postgresql/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

test -f "/mnt/data/backup-is-running" && exit 0

psql -d "postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" -c "select now()" || exit 1
psql -d "postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1:5432/$POSTGRES_DB" -c "select now()" || exit 1
2 changes: 1 addition & 1 deletion Containers/postgresql/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if ( [ -f "$DATADIR/PG_VERSION" ] && [ "$PG_MAJOR" != "$(cat "$DATADIR/PG_VERSIO
exec docker-entrypoint.sh postgres &

# Wait for creation
while ! psql -d "postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:11000/$POSTGRES_DB" -c "select now()"; do
while ! psql -d "postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1:11000/$POSTGRES_DB" -c "select now()"; do
echo "Waiting for the database to start."
sleep 5
done
Expand Down
2 changes: 1 addition & 1 deletion Containers/talk-recording/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ USER recording
ENTRYPOINT ["/start.sh"]
CMD ["python", "-m", "nextcloud.talk.recording", "--config", "/conf/recording.conf"]

HEALTHCHECK CMD nc -z localhost 1234 || exit 1
HEALTHCHECK CMD nc -z 127.0.0.1 1234 || exit 1
LABEL com.centurylinklabs.watchtower.enable="false"
8 changes: 4 additions & 4 deletions Containers/talk/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

nc -z localhost 8081 || exit 1
nc -z localhost 8188 || exit 1
nc -z localhost 4222 || exit 1
nc -z localhost "$TALK_PORT" || exit 1
nc -z 127.0.0.1 8081 || exit 1
nc -z 127.0.0.1 8188 || exit 1
nc -z 127.0.0.1 4222 || exit 1
nc -z 127.0.0.1 "$TALK_PORT" || exit 1
eturnalctl status || exit 1
if ! nc -z "$NC_DOMAIN" "$TALK_PORT"; then
echo "Could not reach $NC_DOMAIN on port $TALK_PORT."
Expand Down
2 changes: 1 addition & 1 deletion php/src/Docker/DockerActionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(
}

private function BuildApiUrl(string $url) : string {
return sprintf('http://localhost/%s/%s', self::API_VERSION, $url);
return sprintf('http://127.0.0.1/%s/%s', self::API_VERSION, $url);
}

private function BuildImageName(Container $container) : string {
Expand Down

0 comments on commit 813cfc2

Please sign in to comment.