mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
replace apache with a second caddy
Signed-off-by: Zoey <zoey@z0ey.de>
This commit is contained in:
parent
1a4c4bd89b
commit
bf02678920
9 changed files with 92 additions and 196 deletions
|
|
@ -331,36 +331,6 @@ chown www-data:www-data -R /mnt/docker-aio-config/session/
|
|||
chown www-data:www-data -R /mnt/docker-aio-config/caddy/
|
||||
chown root:root -R /mnt/docker-aio-config/certs/
|
||||
|
||||
# Don't allow access to the AIO interface from the Nextcloud container
|
||||
# Probably more cosmetic than anything but at least an attempt
|
||||
if ! grep -q '# nextcloud-aio-block' /etc/apache2/httpd.conf; then
|
||||
cat << APACHE_CONF >> /etc/apache2/httpd.conf
|
||||
# nextcloud-aio-block-start
|
||||
<Location />
|
||||
order allow,deny
|
||||
deny from nextcloud-aio-nextcloud.nextcloud-aio
|
||||
allow from all
|
||||
</Location>
|
||||
# nextcloud-aio-block-end
|
||||
APACHE_CONF
|
||||
fi
|
||||
|
||||
# Adjust certs
|
||||
GENERATED_CERTS="/mnt/docker-aio-config/certs"
|
||||
TMP_CERTS="/etc/apache2/certs"
|
||||
mkdir -p "$GENERATED_CERTS"
|
||||
cd "$GENERATED_CERTS" || exit 1
|
||||
if ! [ -f ./ssl.crt ] && ! [ -f ./ssl.key ]; then
|
||||
openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -subj "/C=DE/ST=BE/L=Local/O=Dev/CN=nextcloud.local" -keyout ./ssl.key -out ./ssl.crt
|
||||
fi
|
||||
if [ -f ./ssl.crt ] && [ -f ./ssl.key ]; then
|
||||
cd "$TMP_CERTS" || exit 1
|
||||
rm ./ssl.crt
|
||||
rm ./ssl.key
|
||||
cp "$GENERATED_CERTS/ssl.crt" ./
|
||||
cp "$GENERATED_CERTS/ssl.key" ./
|
||||
fi
|
||||
|
||||
print_green "Initial startup of Nextcloud All-in-One complete!
|
||||
You should be able to open the Nextcloud AIO Interface now on port 8080 of this server!
|
||||
E.g. https://internal.ip.of.this.server:8080
|
||||
|
|
@ -372,16 +342,14 @@ https://your-domain-that-points-to-this-server.tld:8443"
|
|||
# Set the timezone to Etc/UTC
|
||||
export TZ=Etc/UTC
|
||||
|
||||
# Fix apache startup
|
||||
rm -f /var/run/apache2/httpd.pid
|
||||
|
||||
# Fix caddy startup
|
||||
if [ -d "/mnt/docker-aio-config/caddy/locks" ]; then
|
||||
rm -rf /mnt/docker-aio-config/caddy/locks/*
|
||||
fi
|
||||
|
||||
# Fix the Caddyfile format
|
||||
caddy fmt --overwrite /Caddyfile
|
||||
caddy fmt --overwrite /acme.Caddyfile
|
||||
caddy fmt --overwrite /internal.Caddyfile
|
||||
|
||||
# Fix caddy log
|
||||
chmod 777 /root
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue