Skip to content

fix notify-push trusted proxies #3181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Containers/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN set -ex; \
tzdata \
ca-certificates \
openssl \
bind-tools \
netcat-openbsd; \
\
sed -i \
Expand Down
8 changes: 7 additions & 1 deletion Containers/apache/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ while ! nc -z "$NEXTCLOUD_HOST" 9000; do
sleep 5
done

# Get ipv4-address of Apache
IPv4_ADDRESS="$(dig nextcloud-aio-apache A +short | head -1)"
# Bring it in CIDR notation
# shellcheck disable=SC2001
IPv4_ADDRESS="$(echo "$IPv4_ADDRESS" | sed 's|[0-9]\+$|1/32|')"

if [ -z "$APACHE_PORT" ]; then
export APACHE_PORT="443"
fi
Expand All @@ -41,7 +47,7 @@ echo "$CADDYFILE" > /tmp/Caddyfile
if [ "$APACHE_PORT" != '443' ]; then
CADDYFILE="$(sed 's|# trusted_proxies placeholder|trusted_proxies static private_ranges|' /tmp/Caddyfile)"
else
CADDYFILE="$(sed 's|trusted_proxies.*private_ranges|# trusted_proxies placeholder|' /tmp/Caddyfile)"
CADDYFILE="$(sed "s|# trusted_proxies placeholder|trusted_proxies static $IPv4_ADDRESS|" /tmp/Caddyfile)"
fi
echo "$CADDYFILE" > /tmp/Caddyfile

Expand Down