mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-02-27 15:25:40 +08:00
Merge pull request #758 from nextcloud/fix/750/caddyfile-permissions
fix writing to the caddyfile
This commit is contained in:
commit
8764824870
2 changed files with 5 additions and 4 deletions
|
@ -65,8 +65,7 @@ COPY start.sh /usr/bin/
|
||||||
COPY supervisord.conf /
|
COPY supervisord.conf /
|
||||||
RUN chmod +x /usr/bin/start.sh; \
|
RUN chmod +x /usr/bin/start.sh; \
|
||||||
chmod +r /supervisord.conf; \
|
chmod +r /supervisord.conf; \
|
||||||
chmod a+w /Caddyfile; \
|
chown www-data:www-data /Caddyfile; \
|
||||||
chmod 777 /; \
|
|
||||||
chmod +r -R /etc/apache2
|
chmod +r -R /etc/apache2
|
||||||
|
|
||||||
# Give root a random password
|
# Give root a random password
|
||||||
|
|
|
@ -21,14 +21,16 @@ if [ -z "$APACHE_PORT" ]; then
|
||||||
export APACHE_PORT="443"
|
export APACHE_PORT="443"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Change the Caddyfile
|
||||||
if [ "$APACHE_PORT" != '443' ]; then
|
if [ "$APACHE_PORT" != '443' ]; then
|
||||||
export PROTOCOL="http"
|
export PROTOCOL="http"
|
||||||
export NC_DOMAIN=""
|
export NC_DOMAIN=""
|
||||||
sed -i 's|auto_https.*|auto_https off|' /Caddyfile
|
CADDYFILE="$(sed 's|auto_https.*|auto_https off|' /Caddyfile)"
|
||||||
else
|
else
|
||||||
export PROTOCOL="https"
|
export PROTOCOL="https"
|
||||||
sed -i 's|auto_https.*|auto_https disable_redirects|' /Caddyfile
|
CADDYFILE="$(sed 's|auto_https.*|auto_https disable_redirects|' /Caddyfile)"
|
||||||
fi
|
fi
|
||||||
|
echo "$CADDYFILE" > /Caddyfile
|
||||||
|
|
||||||
# Add caddy path
|
# Add caddy path
|
||||||
mkdir -p /mnt/data/caddy/
|
mkdir -p /mnt/data/caddy/
|
||||||
|
|
Loading…
Reference in a new issue