mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-21 19:00:33 +00:00
Compare commits
28 Commits
v13.0.2
...
copilot/im
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b342b0b8d | ||
|
|
d58a34b605 | ||
|
|
44b257a2b5 | ||
|
|
2b78dcc9cc | ||
|
|
11d8050085 | ||
|
|
1c6ca098d5 | ||
|
|
5343353bb5 | ||
|
|
f0fb065dc2 | ||
|
|
b71afd933b | ||
|
|
24f8a126cb | ||
|
|
b0b997ac42 | ||
|
|
fb6112f174 | ||
|
|
ce857a5588 | ||
|
|
6b362f2f5d | ||
|
|
03e3b90ced | ||
|
|
5d85a156b0 | ||
|
|
e0305457fd | ||
|
|
7281c9b7c8 | ||
|
|
cb48bc5db0 | ||
|
|
83129d6a55 | ||
|
|
68df1dd857 | ||
|
|
7598f6534d | ||
|
|
a12f505dcd | ||
|
|
7a825f2025 | ||
|
|
6aa4f8d672 | ||
|
|
5b72d17438 | ||
|
|
7c5abc978d | ||
|
|
f23d8276ff |
6
.github/workflows/playwright-on-push.yml
vendored
6
.github/workflows/playwright-on-push.yml
vendored
@@ -5,14 +5,12 @@ on:
|
||||
paths:
|
||||
- 'php/**'
|
||||
- 'Containers/mastercontainer/*.Caddyfile'
|
||||
- 'Containers/mastercontainer/start.sh'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'php/**'
|
||||
- 'Containers/mastercontainer/*.Caddyfile'
|
||||
- 'Containers/mastercontainer/start.sh'
|
||||
|
||||
concurrency:
|
||||
group: playwright-${{ github.head_ref || github.run_id }}
|
||||
@@ -57,7 +55,7 @@ jobs:
|
||||
rm -r ./session
|
||||
composer install --no-dev
|
||||
composer clear-cache
|
||||
sudo chmod 777 -R ../
|
||||
sudo chmod 777 -R ./
|
||||
|
||||
- name: Start fresh development server
|
||||
run: |
|
||||
@@ -74,7 +72,6 @@ jobs:
|
||||
--volume ./php:/var/www/docker-aio/php \
|
||||
--volume ./Containers/mastercontainer/internal.Caddyfile:/internal.Caddyfile \
|
||||
--volume ./Containers/mastercontainer/headers.Caddyfile:/headers.Caddyfile \
|
||||
--volume ./Containers/mastercontainer/start.sh:/start.sh \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
--env SKIP_DOMAIN_VALIDATION=true \
|
||||
--env APACHE_PORT=11000 \
|
||||
@@ -106,7 +103,6 @@ jobs:
|
||||
--volume ./php:/var/www/docker-aio/php \
|
||||
--volume ./Containers/mastercontainer/internal.Caddyfile:/internal.Caddyfile \
|
||||
--volume ./Containers/mastercontainer/headers.Caddyfile:/headers.Caddyfile \
|
||||
--volume ./Containers/mastercontainer/start.sh:/start.sh \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
--env SKIP_DOMAIN_VALIDATION=false \
|
||||
--env APACHE_PORT=11000 \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
FROM caddy:2.11.2-alpine AS caddy
|
||||
|
||||
# From https://github.com/docker-library/httpd/blob/master/2.4/alpine/Dockerfile
|
||||
FROM httpd:2.4.67-alpine3.23
|
||||
FROM httpd:2.4.66-alpine3.23
|
||||
|
||||
COPY --from=caddy /usr/bin/caddy /usr/bin/caddy
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
nc -z "$NEXTCLOUD_HOST" 9000 || exit 0
|
||||
nc -z 127.0.0.1 8000 || exit 1
|
||||
nc -z 127.0.0.1 "$APACHE_PORT" || exit 1
|
||||
|
||||
@@ -7,7 +7,7 @@ Listen 8000
|
||||
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
|
||||
ErrorLog /proc/self/fd/2
|
||||
ErrorLogFormat "[%t] [%l] [%E] [client: %{X-Forwarded-For}i] [%M] [%{User-Agent}i]"
|
||||
LogLevel ${AIO_LOG_LEVEL}
|
||||
LogLevel warn
|
||||
|
||||
# KeepAlive On: allow the same TCP connection to carry multiple HTTP requests.
|
||||
# Without this each asset (JS, CSS, image) would require a full TCP handshake,
|
||||
|
||||
@@ -1,20 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
if [ -z "$NC_DOMAIN" ]; then
|
||||
echo "NC_DOMAIN and NEXTCLOUD_HOST need to be provided. Exiting!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
export SUPERVISORD_STDOUT=/dev/stdout
|
||||
else
|
||||
export SUPERVISORD_STDOUT=NONE
|
||||
fi
|
||||
|
||||
# Need write access to /mnt/data
|
||||
if ! [ -w /mnt/data ]; then
|
||||
echo "Cannot write to /mnt/data"
|
||||
|
||||
@@ -5,11 +5,11 @@ pidfile=/var/run/supervisord/supervisord.pid
|
||||
childlogdir=/var/log/supervisord/
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=%(ENV_AIO_LOG_LEVEL)s
|
||||
loglevel=error
|
||||
|
||||
[program:apache]
|
||||
# Stdout logging is disabled as otherwise the logs are spammed
|
||||
stdout_logfile=%(ENV_SUPERVISORD_STDOUT)s
|
||||
stdout_logfile=NONE
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=apachectl -DFOREGROUND
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Functions
|
||||
get_start_time(){
|
||||
START_TIME=$(date +%s)
|
||||
@@ -44,7 +40,7 @@ if [ -z "$BORG_REMOTE_REPO" ] && ! mountpoint -q "$MOUNT_DIR"; then
|
||||
fi
|
||||
|
||||
# Check if repo is uninitialized
|
||||
if [ "$BORG_MODE" != backup ] && [ "$BORG_MODE" != test ] && ! borg "$BORG_LOG_LEVEL_FLAG" info > /dev/null; then
|
||||
if [ "$BORG_MODE" != backup ] && [ "$BORG_MODE" != test ] && ! borg info > /dev/null; then
|
||||
if [ -n "$BORG_REMOTE_REPO" ]; then
|
||||
echo "The repository is uninitialized or cannot connect to remote. Cannot perform check or restore."
|
||||
else
|
||||
@@ -127,7 +123,7 @@ if [ "$BORG_MODE" = backup ]; then
|
||||
fi
|
||||
|
||||
# Initialize the repository if can't get info from target
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" info > /dev/null; then
|
||||
if ! borg info > /dev/null; then
|
||||
# Don't initialize if already initialized
|
||||
if [ -f "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config" ]; then
|
||||
if [ -n "$BORG_REMOTE_REPO" ]; then
|
||||
@@ -144,14 +140,14 @@ if [ "$BORG_MODE" = backup ]; then
|
||||
|
||||
echo "Initializing repository..."
|
||||
NEW_REPOSITORY=1
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" init --encryption=repokey-blake2; then
|
||||
if ! borg init --debug --encryption=repokey-blake2; then
|
||||
echo "Could not initialize borg repository."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$BORG_REMOTE_REPO" ]; then
|
||||
# borg config only works for local repos; it's up to the remote to ensure the disk isn't full
|
||||
borg "$BORG_LOG_LEVEL_FLAG" config :: additional_free_space 2G
|
||||
borg config :: additional_free_space 2G
|
||||
|
||||
# Fix too large Borg cache
|
||||
# https://borgbackup.readthedocs.io/en/stable/faq.html#the-borg-cache-eats-way-too-much-disk-space-what-can-i-do
|
||||
@@ -160,7 +156,7 @@ if [ "$BORG_MODE" = backup ]; then
|
||||
touch "/root/.cache/borg/$BORG_ID/chunks.archive.d"
|
||||
fi
|
||||
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" info > /dev/null; then
|
||||
if ! borg info > /dev/null; then
|
||||
echo "Borg can't get info from the repo it created. Something is wrong."
|
||||
exit 1
|
||||
fi
|
||||
@@ -220,9 +216,9 @@ if [ "$BORG_MODE" = backup ]; then
|
||||
# Create the backup
|
||||
echo "Starting the backup..."
|
||||
get_start_time
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" create "${BORG_OPTS[@]}" "${BORG_INCLUDE[@]}" "${BORG_EXCLUDE[@]}" "::$CURRENT_DATE-nextcloud-aio" "/nextcloud_aio_volumes/" --exclude-from /borg_excludes; then
|
||||
if ! borg create "${BORG_OPTS[@]}" "${BORG_INCLUDE[@]}" "${BORG_EXCLUDE[@]}" "::$CURRENT_DATE-nextcloud-aio" "/nextcloud_aio_volumes/" --exclude-from /borg_excludes; then
|
||||
echo "Deleting the failed backup archive..."
|
||||
borg "$BORG_LOG_LEVEL_FLAG" delete --stats "::$CURRENT_DATE-nextcloud-aio"
|
||||
borg delete --stats "::$CURRENT_DATE-nextcloud-aio"
|
||||
echo "Backup failed!"
|
||||
echo "You might want to check the backup integrity via the AIO interface."
|
||||
if [ "$NEW_REPOSITORY" = 1 ]; then
|
||||
@@ -241,14 +237,14 @@ if [ "$BORG_MODE" = backup ]; then
|
||||
|
||||
# Prune archives
|
||||
echo "Pruning the archives..."
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" prune --stats --glob-archives '*_*-nextcloud-aio' "${BORG_PRUNE_OPTS[@]}"; then
|
||||
if ! borg prune --stats --glob-archives '*_*-nextcloud-aio' "${BORG_PRUNE_OPTS[@]}"; then
|
||||
echo "Failed to prune archives!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Compact archives
|
||||
echo "Compacting the archives..."
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" compact; then
|
||||
if ! borg compact; then
|
||||
echo "Failed to compact archives!"
|
||||
exit 1
|
||||
fi
|
||||
@@ -265,19 +261,19 @@ if [ "$BORG_MODE" = backup ]; then
|
||||
fi
|
||||
done
|
||||
echo "Starting the backup for additional volumes..."
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" create "${BORG_OPTS[@]}" "::$CURRENT_DATE-additional-docker-volumes" "/docker_volumes/"; then
|
||||
if ! borg create "${BORG_OPTS[@]}" "::$CURRENT_DATE-additional-docker-volumes" "/docker_volumes/"; then
|
||||
echo "Deleting the failed backup archive..."
|
||||
borg "$BORG_LOG_LEVEL_FLAG" delete --stats "::$CURRENT_DATE-additional-docker-volumes"
|
||||
borg delete --stats "::$CURRENT_DATE-additional-docker-volumes"
|
||||
echo "Backup of additional docker-volumes failed!"
|
||||
exit 1
|
||||
fi
|
||||
echo "Pruning additional volumes..."
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" prune --stats --glob-archives '*_*-additional-docker-volumes' "${BORG_PRUNE_OPTS[@]}"; then
|
||||
if ! borg prune --stats --glob-archives '*_*-additional-docker-volumes' "${BORG_PRUNE_OPTS[@]}"; then
|
||||
echo "Failed to prune additional docker-volumes archives!"
|
||||
exit 1
|
||||
fi
|
||||
echo "Compacting additional volumes..."
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" compact; then
|
||||
if ! borg compact; then
|
||||
echo "Failed to compact additional docker-volume archives!"
|
||||
exit 1
|
||||
fi
|
||||
@@ -295,19 +291,19 @@ if [ "$BORG_MODE" = backup ]; then
|
||||
EXCLUDE_DIRS+=(--exclude "/host_mounts/$directory/")
|
||||
done
|
||||
echo "Starting the backup for additional host mounts..."
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" create "${BORG_OPTS[@]}" "${EXCLUDE_DIRS[@]}" "::$CURRENT_DATE-additional-host-mounts" "/host_mounts/"; then
|
||||
if ! borg create "${BORG_OPTS[@]}" "${EXCLUDE_DIRS[@]}" "::$CURRENT_DATE-additional-host-mounts" "/host_mounts/"; then
|
||||
echo "Deleting the failed backup archive..."
|
||||
borg "$BORG_LOG_LEVEL_FLAG" delete --stats "::$CURRENT_DATE-additional-host-mounts"
|
||||
borg delete --stats "::$CURRENT_DATE-additional-host-mounts"
|
||||
echo "Backup of additional host-mounts failed!"
|
||||
exit 1
|
||||
fi
|
||||
echo "Pruning additional host mounts..."
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" prune --stats --glob-archives '*_*-additional-host-mounts' "${BORG_PRUNE_OPTS[@]}"; then
|
||||
if ! borg prune --stats --glob-archives '*_*-additional-host-mounts' "${BORG_PRUNE_OPTS[@]}"; then
|
||||
echo "Failed to prune additional host-mount archives!"
|
||||
exit 1
|
||||
fi
|
||||
echo "Compacting additional host mounts..."
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" compact; then
|
||||
if ! borg compact; then
|
||||
echo "Failed to compact additional host-mount archives!"
|
||||
exit 1
|
||||
fi
|
||||
@@ -389,7 +385,7 @@ if [ "$BORG_MODE" = restore ]; then
|
||||
|
||||
if [ -z "$BORG_REMOTE_REPO" ]; then
|
||||
mkdir -p /tmp/borg
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" mount "::$SELECTED_ARCHIVE" /tmp/borg; then
|
||||
if ! borg mount "::$SELECTED_ARCHIVE" /tmp/borg; then
|
||||
echo "Could not mount the backup!"
|
||||
exit 1
|
||||
fi
|
||||
@@ -436,7 +432,7 @@ if [ "$BORG_MODE" = restore ]; then
|
||||
#
|
||||
# Older backups may still contain files we've since excluded, so we have to exclude on extract as well.
|
||||
cd / # borg extract has no destination arg and extracts to CWD
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" extract "::$SELECTED_ARCHIVE" --progress --exclude-from /borg_excludes "${ADDITIONAL_BORG_EXCLUDES[@]}" --pattern '+nextcloud_aio_volumes/**'
|
||||
if ! borg extract "::$SELECTED_ARCHIVE" --progress --exclude-from /borg_excludes "${ADDITIONAL_BORG_EXCLUDES[@]}" --pattern '+nextcloud_aio_volumes/**'
|
||||
then
|
||||
RESTORE_FAILED=1
|
||||
echo "Failed to extract backup archive."
|
||||
@@ -468,7 +464,7 @@ if [ "$BORG_MODE" = restore ]; then
|
||||
\) \
|
||||
| LC_ALL=C sort \
|
||||
| LC_ALL=C comm -23 - \
|
||||
<(borg "$BORG_LOG_LEVEL_FLAG" list "::$SELECTED_ARCHIVE" --short --exclude-from /borg_excludes --pattern '+nextcloud_aio_volumes/**' | LC_ALL=C sort) \
|
||||
<(borg list "::$SELECTED_ARCHIVE" --short --exclude-from /borg_excludes --pattern '+nextcloud_aio_volumes/**' | LC_ALL=C sort) \
|
||||
> /tmp/local_files_not_in_backup
|
||||
then
|
||||
RESTORE_FAILED=1
|
||||
@@ -556,7 +552,7 @@ if [ "$BORG_MODE" = check ]; then
|
||||
echo "Checking the backup integrity..."
|
||||
|
||||
# Perform the check
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" check -v --verify-data; then
|
||||
if ! borg check -v --verify-data; then
|
||||
echo "Some errors were found while checking the backup integrity!"
|
||||
echo "Check the AIO interface for advice on how to proceed now!"
|
||||
exit 1
|
||||
@@ -574,7 +570,7 @@ if [ "$BORG_MODE" = "check-repair" ]; then
|
||||
echo "Checking the backup integrity and repairing it..."
|
||||
|
||||
# Perform the check-repair
|
||||
if ! echo YES | borg "$BORG_LOG_LEVEL_FLAG" check -v --repair; then
|
||||
if ! echo YES | borg check -v --repair; then
|
||||
echo "Some errors were found while checking and repairing the backup integrity!"
|
||||
exit 1
|
||||
fi
|
||||
@@ -588,7 +584,7 @@ fi
|
||||
# Do the backup test
|
||||
if [ "$BORG_MODE" = test ]; then
|
||||
if [ -n "$BORG_REMOTE_REPO" ]; then
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" info > /dev/null; then
|
||||
if ! borg info > /dev/null; then
|
||||
echo "Borg could not get info from the remote repo."
|
||||
echo "See the above borg info output for details."
|
||||
exit 1
|
||||
@@ -609,12 +605,12 @@ if [ "$BORG_MODE" = test ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" list >/dev/null; then
|
||||
if ! borg list >/dev/null; then
|
||||
echo "The entered path seems to be valid but could not open the backup archive."
|
||||
echo "Most likely the entered password was wrong so please adjust it accordingly!"
|
||||
exit 1
|
||||
else
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" list | grep "nextcloud-aio"; then
|
||||
if ! borg list | grep "nextcloud-aio"; then
|
||||
echo "The backup archive does not contain a valid Nextcloud AIO backup."
|
||||
echo "Most likely was the archive not created via Nextcloud AIO."
|
||||
exit 1
|
||||
@@ -627,7 +623,7 @@ fi
|
||||
|
||||
if [ "$BORG_MODE" = list ]; then
|
||||
echo "Updating backup list..."
|
||||
if ! borg "$BORG_LOG_LEVEL_FLAG" info > /dev/null; then
|
||||
if ! borg info > /dev/null; then
|
||||
echo "Could not update the backup list."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = "warn" ]; then
|
||||
BORG_LOG_LEVEL_FLAG="--warning"
|
||||
else
|
||||
BORG_LOG_LEVEL_FLAG="--$AIO_LOG_LEVEL"
|
||||
fi
|
||||
export BORG_LOG_LEVEL_FLAG
|
||||
|
||||
# Variables
|
||||
export MOUNT_DIR="/mnt/borgbackup"
|
||||
export BORG_BACKUP_DIRECTORY="$MOUNT_DIR/borg" # necessary even when remote to store the aio-lockfile
|
||||
@@ -59,7 +48,7 @@ fi
|
||||
rm -f "/nextcloud_aio_volumes/nextcloud_aio_database_dump/backup-is-running"
|
||||
|
||||
# Get a list of all available borg archives
|
||||
if borg "$BORG_LOG_LEVEL_FLAG" list &>/dev/null; then
|
||||
if borg list &>/dev/null; then
|
||||
borg list | grep "nextcloud-aio" | awk -F " " '{print $1","$3,$4}' > "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/backup_archives.list"
|
||||
else
|
||||
echo "" > "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/backup_archives.list"
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
if [ "$(echo "PING" | nc 127.0.0.1 3310)" != "PONG" ]; then
|
||||
echo "ERROR: Unable to contact server"
|
||||
exit 1
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Print out clamav version for compliance reasons
|
||||
clamscan --version
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ pidfile=/var/run/supervisord/supervisord.pid
|
||||
childlogdir=/var/log/supervisord/
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=%(ENV_AIO_LOG_LEVEL)s
|
||||
loglevel=error
|
||||
|
||||
[program:freshclam]
|
||||
stdout_logfile=/dev/stdout
|
||||
|
||||
@@ -5,7 +5,6 @@ FROM collabora/code:25.04.9.4.1
|
||||
USER root
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
COPY --chmod=775 start.sh /start.sh
|
||||
COPY --chmod=775 healthcheck.sh /healthcheck.sh
|
||||
|
||||
USER 1001
|
||||
@@ -19,5 +18,3 @@ LABEL com.centurylinklabs.watchtower.enable="false" \
|
||||
org.opencontainers.image.source="https://github.com/nextcloud/all-in-one" \
|
||||
org.opencontainers.image.vendor="Nextcloud" \
|
||||
org.opencontainers.image.documentation="https://github.com/nextcloud/all-in-one/blob/main/readme.md"
|
||||
|
||||
ENTRYPOINT ["/start.sh"]
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = "warn" ]; then
|
||||
COLLABORA_LOG_LEVEL="warning"
|
||||
elif [ "$AIO_LOG_LEVEL" = "info" ]; then
|
||||
COLLABORA_LOG_LEVEL="notice"
|
||||
else
|
||||
COLLABORA_LOG_LEVEL="$AIO_LOG_LEVEL"
|
||||
fi
|
||||
|
||||
# Replace the hardcoded log level in extra_params with the translated one
|
||||
extra_params+=" --o:logging.level=$COLLABORA_LOG_LEVEL --o:logging.level_startup=$COLLABORA_LOG_LEVEL"
|
||||
export extra_params
|
||||
|
||||
exec /start-collabora-online.sh "$@"
|
||||
17
Containers/dnsmasq/Dockerfile
Normal file
17
Containers/dnsmasq/Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
||||
# syntax=docker/dockerfile:latest
|
||||
FROM alpine:3.21
|
||||
|
||||
RUN apk add --no-cache dnsmasq iproute2
|
||||
|
||||
COPY --chmod=755 start.sh /start.sh
|
||||
|
||||
ENTRYPOINT ["/start.sh"]
|
||||
|
||||
LABEL com.centurylinklabs.watchtower.enable="false" \
|
||||
wud.watch="false" \
|
||||
org.opencontainers.image.title="Dnsmasq for Nextcloud AIO" \
|
||||
org.opencontainers.image.description="Lightweight DNS server that resolves NC_DOMAIN to the local server IP for LAN devices" \
|
||||
org.opencontainers.image.url="https://github.com/nextcloud/all-in-one" \
|
||||
org.opencontainers.image.source="https://github.com/nextcloud/all-in-one" \
|
||||
org.opencontainers.image.vendor="Nextcloud" \
|
||||
org.opencontainers.image.documentation="https://github.com/nextcloud/all-in-one/blob/main/community-containers/dnsmasq/readme.md"
|
||||
40
Containers/dnsmasq/start.sh
Normal file
40
Containers/dnsmasq/start.sh
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -z "$NC_DOMAIN" ]; then
|
||||
echo "ERROR: NC_DOMAIN is not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LOCAL_IP=""
|
||||
|
||||
# Determine the server's primary LAN IP - use the source address chosen by the kernel
|
||||
# for a route to a well-known public IP (1.1.1.1 is used purely to query the routing table;
|
||||
# no traffic is sent there).
|
||||
LOCAL_IP=$(ip route get 1.1.1.1 2>/dev/null | awk '{for(i=1;i<=NF;i++) if($i=="src") {print $(i+1); exit}}')
|
||||
|
||||
if [ -z "$LOCAL_IP" ]; then
|
||||
LOCAL_IP=$(hostname -I 2>/dev/null | awk '{print $1}')
|
||||
fi
|
||||
|
||||
if [ -z "$LOCAL_IP" ]; then
|
||||
echo "ERROR: Could not determine local IP address" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Nextcloud AIO dnsmasq: resolving $NC_DOMAIN -> $LOCAL_IP"
|
||||
echo "Configure your router's DHCP to hand out $LOCAL_IP as the DNS server for LAN clients."
|
||||
|
||||
mkdir -p /etc/dnsmasq.d
|
||||
|
||||
cat > /etc/dnsmasq.d/nextcloud-aio.conf << EOF
|
||||
# Auto-generated by Nextcloud AIO dnsmasq container.
|
||||
# Resolves NC_DOMAIN (and all its subdomains) to this server's local IP.
|
||||
address=/$NC_DOMAIN/$LOCAL_IP
|
||||
|
||||
# Bind only to the LAN interface to avoid conflicts with any system DNS resolver.
|
||||
bind-interfaces
|
||||
listen-address=$LOCAL_IP
|
||||
EOF
|
||||
|
||||
exec dnsmasq --no-daemon --log-queries --conf-dir=/etc/dnsmasq.d
|
||||
@@ -1,5 +1,5 @@
|
||||
# syntax=docker/dockerfile:latest
|
||||
FROM haproxy:3.3.8-alpine
|
||||
FROM haproxy:3.3.6-alpine
|
||||
|
||||
# hadolint ignore=DL3002
|
||||
USER root
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
nc -z "$NEXTCLOUD_HOST" 9001 || exit 0
|
||||
nc -z 127.0.0.1 2375 || exit 1
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Only start container if nextcloud is accessible
|
||||
while ! nc -z "$NEXTCLOUD_HOST" 9001; do
|
||||
echo "Waiting for Nextcloud to start..."
|
||||
@@ -22,8 +18,6 @@ else
|
||||
HAPROXYFILE="$(sed "s# || { src NC_IPV6_PLACEHOLDER }##g" /tmp/haproxy.cfg)"
|
||||
fi
|
||||
echo "$HAPROXYFILE" > /tmp/haproxy.cfg
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
|
||||
haproxy -f /tmp/haproxy.cfg -db
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
if [ -z "$INSTANCE_ID" ]; then
|
||||
echo "You need to provide an instance id."
|
||||
exit 1
|
||||
@@ -18,20 +14,6 @@ fi
|
||||
CONF_FILE="$(sed "s|ipv6-placeholder|\[::\]:$APACHE_PORT|" /lighttpd.conf)"
|
||||
echo "$CONF_FILE" > /etc/lighttpd/lighttpd.conf
|
||||
|
||||
# shellcheck disable=SC2235
|
||||
if ([ "$AIO_LOG_LEVEL" = 'debug' ] || [ "$AIO_LOG_LEVEL" = 'info' ]) && ! grep -q debug.log-request-handling /etc/lighttpd/lighttpd.conf; then
|
||||
cat << CONF_FILE >> /etc/lighttpd/lighttpd.conf
|
||||
debug.log-request-handling = "enable"
|
||||
CONF_FILE
|
||||
fi
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ] && ! grep -q debug.log-request-header /etc/lighttpd/lighttpd.conf; then
|
||||
cat << CONF_FILE >> /etc/lighttpd/lighttpd.conf
|
||||
debug.log-request-header = "enable"
|
||||
debug.log-response-header = "enable"
|
||||
CONF_FILE
|
||||
fi
|
||||
|
||||
# Check config file
|
||||
lighttpd -tt -f /etc/lighttpd/lighttpd.conf
|
||||
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
# syntax=docker/dockerfile:latest
|
||||
# Probably from here https://github.com/elastic/dockerfiles/blob/9.3/elasticsearch/Dockerfile
|
||||
FROM elasticsearch:9.4.0
|
||||
# Probably from here https://github.com/elastic/elasticsearch/blob/main/distribution/docker/src/docker/Dockerfile
|
||||
FROM elasticsearch:8.19.14
|
||||
|
||||
USER root
|
||||
|
||||
# hadolint ignore=DL3041
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# hadolint ignore=DL3008
|
||||
RUN set -ex; \
|
||||
\
|
||||
microdnf update -y; \
|
||||
microdnf install -y --setopt=tsflags=nodocs \
|
||||
apt-get update; \
|
||||
apt-get upgrade -y; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
tzdata \
|
||||
; \
|
||||
microdnf clean all;
|
||||
rm -rf /var/lib/apt/lists/*;
|
||||
|
||||
COPY --chmod=775 start.sh /start.sh
|
||||
COPY --chmod=775 healthcheck.sh /healthcheck.sh
|
||||
|
||||
USER 1000:0
|
||||
@@ -28,5 +30,3 @@ LABEL com.centurylinklabs.watchtower.enable="false" \
|
||||
org.opencontainers.image.vendor="Nextcloud" \
|
||||
org.opencontainers.image.documentation="https://github.com/nextcloud/all-in-one/blob/main/readme.md"
|
||||
ENV ES_JAVA_OPTS="-Xms512M -Xmx512M"
|
||||
|
||||
ENTRYPOINT ["/start.sh"]
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
curl -fs "http://127.0.0.1:9200/_cluster/health?filter_path=status" | grep -qE '"status":"(green|yellow)"' || exit 1
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
ELASTIC_LOG_LEVEL="$(echo "$AIO_LOG_LEVEL" | tr '[:lower:]' '[:upper:]')"
|
||||
|
||||
exec env "logger.level=$ELASTIC_LOG_LEVEL" /usr/local/bin/docker-entrypoint.sh "$@"
|
||||
@@ -1,7 +1,7 @@
|
||||
# syntax=docker/dockerfile:latest
|
||||
FROM golang:1.26.2-alpine3.23 AS go
|
||||
|
||||
ENV IMAGINARY_HASH=6a274b488759a896aff02f52afee6e50b5e3a3ee
|
||||
ENV IMAGINARY_HASH=6a274b488759a896aff02f52afee6e50b5e3a3ee
|
||||
|
||||
RUN set -ex; \
|
||||
apk upgrade --no-cache -a; \
|
||||
@@ -33,8 +33,7 @@ COPY --from=go /go/bin/imaginary /usr/local/bin/imaginary
|
||||
COPY --chmod=775 start.sh /start.sh
|
||||
COPY --chmod=775 healthcheck.sh /healthcheck.sh
|
||||
|
||||
ENV PORT=9000 \
|
||||
AIO_LOG_LEVEL=warn
|
||||
ENV PORT=9000
|
||||
|
||||
USER 65534
|
||||
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
nc -z 127.0.0.1 "$PORT" || exit 1
|
||||
|
||||
@@ -1,20 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
GOLANG_LOG="$(case "$AIO_LOG_LEVEL" in
|
||||
debug) printf 'info' ;;
|
||||
info) printf 'info' ;;
|
||||
warn) printf 'warning' ;;
|
||||
error) printf 'error' ;;
|
||||
esac)"
|
||||
export GOLANG_LOG
|
||||
if [ "$AIO_LOG_LEVEL" = "debug" ]; then
|
||||
export DEBUG='*'
|
||||
fi
|
||||
|
||||
echo "Imaginary has started"
|
||||
|
||||
IMAGINARY_ARGS=(-return-size -max-allowed-resolution 222.2)
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
restart_process() {
|
||||
echo "Restarting cron.sh because daily backup time was set, changed or unset."
|
||||
pkill cron.sh
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
while true; do
|
||||
if [ -f "/mnt/docker-aio-config/data/daily_backup_time" ]; then
|
||||
set -x
|
||||
@@ -21,9 +17,7 @@ while true; do
|
||||
else
|
||||
export SEND_SUCCESS_NOTIFICATIONS=0
|
||||
fi
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
if [ -f "/mnt/docker-aio-config/data/daily_backup_running" ]; then
|
||||
export LOCK_FILE_PRESENT=1
|
||||
else
|
||||
@@ -57,6 +51,9 @@ while true; do
|
||||
# Check if AIO is outdated
|
||||
sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/OutdatedNotification.php
|
||||
|
||||
# Update deSEC DNS IP record (no-op when IP is unchanged or deSEC is not configured)
|
||||
sudo -E -u www-data php /var/www/docker-aio/php/src/Cron/UpdateDesecIp.php
|
||||
|
||||
# Remove sessions older than 24h
|
||||
find "/mnt/docker-aio-config/session/" -mindepth 1 -mmin +1440 -delete
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
echo "Daily backup script has started"
|
||||
|
||||
# Check if initial configuration has been done, otherwise this script should do nothing.
|
||||
|
||||
@@ -18,9 +18,9 @@ header {
|
||||
Referrer-Policy "no-referrer" # Tells the browser to never sent a Referer header. See https://developer.mozilla.org/de/docs/Web/HTTP/Reference/Headers/Referrer-Policy
|
||||
X-Robots-Tag "noindex, nofollow" # Tells web crawlers to not index this page. See https://developer.mozilla.org/de/docs/Web/HTTP/Reference/Headers/X-Robots-Tag
|
||||
Origin-Agent-Cluster "?1" # Isolates AIO from other same site pages. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Origin-Agent-Cluster
|
||||
Cross-Origin-Opener-Policy "same-origin" # AIO does not use any popup, still we can isolate its BCG if it is opened as a pop up by another page. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cross-Origin-Opener-Policy
|
||||
Cross-Origin-Embedder-Policy "require-corp" # Harder rules for cross origin embeds. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cross-Origin-Embedder-Policy
|
||||
Cross-Origin-Resource-Policy "same-origin" # Only allow the same origin to load resources. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Cross-Origin_Resource_Policy
|
||||
Cross-Origin-Opener-Policy "same-origin"; # AIO does not use any popup, still we can isolate its BCG if it is opened as a pop up by another page. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cross-Origin-Opener-Policy
|
||||
Cross-Origin-Embedder-Policy "require-corp"; # Harder rules for cross origin embeds. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cross-Origin-Embedder-Policy
|
||||
Cross-Origin-Resource-Policy "same-origin"; # Only allow the same origin to load resources. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Cross-Origin_Resource_Policy
|
||||
|
||||
# Permissions-Policy disables browser features that AIO does not use. Since there is no "deny all" option, all known features need to be listed explicitly. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Permissions-Policy
|
||||
Permissions-Policy "accelerometer=(), ambient-light-sensor=(), aria-notify=(), attribution-reporting=(), autoplay=(), bluetooth=(), browsing-topics=(), camera=(), captured-surface-control=(), ch-ua-high-entropy-values=(), compute-pressure=(), cross-origin-isolated=(), deferred-fetch=(), deferred-fetch-minimal=(), display-capture=(), encrypted-media=(), fullscreen=(), gamepad=(), geolocation=(), gyroscope=(), hid=(), identity-credentials-get=(), idle-detection=(), local-fonts=(), local-network=(), local-network-access=(), loopback-network=(), magnetometer=(), microphone=(), midi=(), on-device-speech-recognition=(), otp-credentials=(), payment=(), picture-in-picture=(), private-state-token-issuance=(), private-state-token-redemption=(), publickey-credentials-create=(), publickey-credentials-get=(), screen-wake-lock=(), serial=(), storage-access=(), summarizer=(), usb=(), web-share=(), window-management=(), xr-spatial-tracking=()"
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
if [ -f "/mnt/docker-aio-config/data/configuration.json" ]; then
|
||||
nc -z 127.0.0.1 80 || exit 1
|
||||
nc -z 127.0.0.1 8080 || exit 1
|
||||
|
||||
@@ -16,10 +16,6 @@ compare_times() {
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
while true; do
|
||||
compare_times
|
||||
sleep 2
|
||||
|
||||
@@ -20,10 +20,6 @@ case "${1}" in
|
||||
esac
|
||||
}
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Check if running as root user
|
||||
if [ "$EUID" != "0" ]; then
|
||||
print_red "Container does not run as root user. This is not supported."
|
||||
@@ -337,22 +333,6 @@ else
|
||||
export NEXTCLOUD_DRI_GID=""
|
||||
fi
|
||||
|
||||
# Log level logics
|
||||
if [ -n "$AIO_LOG_LEVEL" ] && ! echo "$AIO_LOG_LEVEL" | grep -q "^debug$\|^info$\|^warn$\|^error$"; then
|
||||
print_red "AIO_LOG_LEVEL must be one of 'debug', 'info', 'warn' or 'error'.
|
||||
It is set to '$AIO_LOG_LEVEL'".
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$AIO_LOG_LEVEL" ]; then
|
||||
export AIO_LOG_LEVEL="warn"
|
||||
fi
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
export SUPERVISORD_STDOUT=/dev/stdout
|
||||
else
|
||||
export SUPERVISORD_STDOUT=NONE
|
||||
fi
|
||||
|
||||
# Check if ghcr.io is reachable
|
||||
# Solves issues like https://github.com/nextcloud/all-in-one/discussions/5268
|
||||
if ! curl --no-progress-meter https://ghcr.io/v2/ >/dev/null; then
|
||||
|
||||
@@ -5,12 +5,12 @@ pidfile=/var/run/supervisord/supervisord.pid
|
||||
childlogdir=/var/log/supervisord/
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=%(ENV_AIO_LOG_LEVEL)s
|
||||
loglevel=error
|
||||
user=root
|
||||
|
||||
[program:php-fpm]
|
||||
# Stdout logging is disabled as otherwise the logs are spammed
|
||||
stdout_logfile=%(ENV_SUPERVISORD_STDOUT)s
|
||||
stdout_logfile=NONE
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=php-fpm
|
||||
@@ -58,7 +58,7 @@ user=root
|
||||
|
||||
[program:domain-validator]
|
||||
# Logging is disabled as otherwise all attempts will be logged which spams the logs
|
||||
stdout_logfile=%(ENV_SUPERVISORD_STDOUT)s
|
||||
stderr_logfile=%(ENV_SUPERVISORD_STDOUT)s
|
||||
stdout_logfile=NONE
|
||||
stderr_logfile=NONE
|
||||
command=php -S 127.0.0.1:9876 /var/www/docker-aio/php/domain-validator.php
|
||||
user=www-data
|
||||
|
||||
@@ -8,7 +8,7 @@ ENV SOURCE_LOCATION=/usr/src/nextcloud
|
||||
ENV REDIS_DB_INDEX=0
|
||||
|
||||
# AIO settings start # Do not remove or change this line!
|
||||
ENV NEXTCLOUD_VERSION=33.0.3
|
||||
ENV NEXTCLOUD_VERSION=33.0.2
|
||||
ENV AIO_TOKEN=123456
|
||||
ENV AIO_URL=localhost
|
||||
# AIO settings end # Do not remove or change this line!
|
||||
@@ -250,21 +250,6 @@ RUN set -ex; \
|
||||
# We don't actually expect so many children but don't want to limit it artificially because people will report issues otherwise.
|
||||
# Also children will usually be terminated again after the process is done due to the ondemand setting
|
||||
sed -i 's/^pm.max_children =.*/pm.max_children = 5000/' /usr/local/etc/php-fpm.d/www.conf; \
|
||||
# With pm = ondemand, workers are killed after pm.process_idle_timeout seconds
|
||||
# of inactivity. The upstream default is 10 s, which is aggressive: after a
|
||||
# brief quiet period (e.g. desktop-sync clients polling every few seconds), all
|
||||
# workers are reaped and the next request burst must wait for fresh forks. On
|
||||
# a loaded host that spawn latency can push Apache past its FastCGI timeout and
|
||||
# produce a 502. 300 s (5 min) keeps a warm pool through normal sync-client
|
||||
# polling cycles while still reclaiming memory during genuinely idle periods.
|
||||
sed -i 's/^;*pm.process_idle_timeout\s*=.*/pm.process_idle_timeout = 300s/' /usr/local/etc/php-fpm.d/www.conf; \
|
||||
# Set request_terminate_timeout so that PHP-FPM forcibly kills workers that
|
||||
# exceed the wall-clock limit. Without this (default = 0 = disabled) a worker
|
||||
# stuck on a slow DB query, a stalled Redis connection, or a hung syscall is
|
||||
# never reaped. Over time these zombies fill up pm.max_children, leaving no
|
||||
# free slots for legitimate requests and causing Apache to return 502 Bad
|
||||
# Gateway upstream.
|
||||
sed -i "s|^;*request_terminate_timeout = .*|request_terminate_timeout = \${PHP_MAX_TIME}|" /usr/local/etc/php-fpm.d/www.conf; \
|
||||
sed -i 's|access.log = /proc/self/fd/2|access.log = /proc/self/fd/1|' /usr/local/etc/php-fpm.d/docker.conf; \
|
||||
\
|
||||
echo "[ -n \"\$TERM\" ] && [ -f /root.motd ] && cat /root.motd" >> /root/.bashrc; \
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
wait_for_cron() {
|
||||
set -x
|
||||
while [ -n "$(pgrep -f /var/www/html/cron.php)" ]; do
|
||||
|
||||
@@ -10,10 +10,6 @@ directory_empty() {
|
||||
[ -z "$(ls -A "$1/")" ]
|
||||
}
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
run_upgrade_if_needed_due_to_app_update() {
|
||||
if php /var/www/html/occ status | grep maintenance | grep -q true; then
|
||||
php /var/www/html/occ maintenance:mode --off
|
||||
@@ -24,14 +20,6 @@ run_upgrade_if_needed_due_to_app_update() {
|
||||
fi
|
||||
}
|
||||
|
||||
NEXTCLOUD_LOG_LEVEL="$(case "$AIO_LOG_LEVEL" in
|
||||
debug) printf '0' ;;
|
||||
info) printf '1' ;;
|
||||
warn) printf '2' ;;
|
||||
error) printf '3' ;;
|
||||
esac)"
|
||||
export NEXTCLOUD_LOG_LEVEL
|
||||
|
||||
# Create cert bundle
|
||||
if env | grep -q NEXTCLOUD_TRUSTED_CERTIFICATES_; then
|
||||
|
||||
@@ -87,9 +75,7 @@ if env | grep -q NEXTCLOUD_TRUSTED_CERTIFICATES_; then
|
||||
cat "$CERTIFICATE_BUNDLE"
|
||||
|
||||
# Disable debug mode
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
fi
|
||||
|
||||
# Adjust DATABASE_TYPE to by Nextcloud supported value
|
||||
@@ -236,9 +222,7 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||
if grep -q appstoreurl /var/www/html/config/config.php; then
|
||||
set -x
|
||||
APPSTORE_URL="$(grep appstoreurl /var/www/html/config/config.php | grep -oP 'https://.*v[0-9]+')"
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
fi
|
||||
# Default appstoreurl parameter in config.php defaults to 'https://apps.nextcloud.com/api/v1' so we check for the apps.json file stored in there
|
||||
CURL_STATUS="$(curl -LI "$APPSTORE_URL"/apps.json -o /dev/null -w '%{http_code}\n' -s)"
|
||||
@@ -305,9 +289,7 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||
"$SOURCE_LOCATION/custom_apps/" \
|
||||
/var/www/html/custom_apps/
|
||||
done
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
fi
|
||||
|
||||
# Copy these from Nextcloud archive if they don't exist yet (i.e. new install)
|
||||
@@ -460,7 +442,7 @@ EOF
|
||||
# Apply log settings
|
||||
echo "Applying default settings..."
|
||||
mkdir -p /var/www/html/data
|
||||
php /var/www/html/occ config:system:set loglevel --value="$NEXTCLOUD_LOG_LEVEL" --type=integer
|
||||
php /var/www/html/occ config:system:set loglevel --value="2" --type=integer
|
||||
if [ "$NEXTCLOUD_LOG_TYPE" = "errorlog" ]; then
|
||||
php /var/www/html/occ config:system:set log_type --value="errorlog"
|
||||
php /var/www/html/occ config:system:set log_type_audit --value="errorlog"
|
||||
@@ -671,7 +653,6 @@ fi
|
||||
# Adjusting log files to be stored on a volume
|
||||
echo "Adjusting log files..."
|
||||
php /var/www/html/occ config:system:set upgrade.cli-upgrade-link --value="https://github.com/nextcloud/all-in-one/discussions/2726"
|
||||
php /var/www/html/occ config:system:set loglevel --value="$NEXTCLOUD_LOG_LEVEL" --type=integer
|
||||
if [ "$NEXTCLOUD_LOG_TYPE" = "errorlog" ]; then
|
||||
php /var/www/html/occ config:system:set log_type --value="errorlog"
|
||||
php /var/www/html/occ config:system:set log_type_audit --value="errorlog"
|
||||
@@ -783,9 +764,7 @@ if [ "$COLLABORA_ENABLED" = 'yes' ]; then
|
||||
if echo "$COLLABORA_HOST" | grep -q "nextcloud-.*-collabora"; then
|
||||
COLLABORA_HOST="$NC_DOMAIN"
|
||||
fi
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
# Remove richdcoumentscode if it should be incorrectly installed
|
||||
if [ -d "/var/www/html/custom_apps/richdocumentscode" ]; then
|
||||
php /var/www/html/occ app:remove richdocumentscode
|
||||
@@ -906,9 +885,7 @@ if [ "$TALK_ENABLED" = 'yes' ]; then
|
||||
if [ -z "$TURN_DOMAIN" ]; then
|
||||
TURN_DOMAIN="$TALK_HOST"
|
||||
fi
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
if ! [ -d "/var/www/html/custom_apps/spreed" ]; then
|
||||
php /var/www/html/occ app:install spreed
|
||||
elif [ "$(php /var/www/html/occ config:app:get spreed enabled)" != "yes" ]; then
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Set a default value for POSTGRES_PORT
|
||||
if [ -z "$POSTGRES_PORT" ]; then
|
||||
POSTGRES_PORT=5432
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
if [[ "$EUID" = 0 ]]; then
|
||||
COMMAND=(sudo -E -u www-data php /var/www/html/occ)
|
||||
else
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
if [[ "$EUID" = 0 ]]; then
|
||||
COMMAND=(sudo -E -u www-data php /var/www/html/occ)
|
||||
else
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Wait until the apache container is ready
|
||||
while ! nc -z "$APACHE_HOST" "$APACHE_PORT"; do
|
||||
echo "Waiting for $APACHE_HOST to become available..."
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Set a default value for POSTGRES_PORT
|
||||
if [ -z "$POSTGRES_PORT" ]; then
|
||||
POSTGRES_PORT=5432
|
||||
@@ -57,9 +53,7 @@ if ! [ -f "/dev-dri-group-was-added" ] && [ -n "$(find /dev -maxdepth 1 -mindept
|
||||
usermod -aG "$GROUP" www-data
|
||||
touch "/dev-dri-group-was-added"
|
||||
fi
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
|
||||
# Check datadir permissions
|
||||
sudo -E -u www-data touch "$NEXTCLOUD_DATA_DIR/this-is-a-test-file" &>/dev/null
|
||||
@@ -176,8 +170,6 @@ if [ "$THIS_IS_AIO" = "true" ] && [ "$APACHE_PORT" = 443 ]; then
|
||||
sed -i "/^listen.allowed_clients/s/,$//" /usr/local/etc/php-fpm.d/www.conf
|
||||
grep listen.allowed_clients /usr/local/etc/php-fpm.d/www.conf
|
||||
fi
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
|
||||
exec "$@"
|
||||
|
||||
@@ -6,7 +6,7 @@ pidfile=/var/run/supervisord/supervisord.pid
|
||||
childlogdir=/var/log/supervisord/
|
||||
logfile_maxbytes=50MB ; maximum size of logfile before rotation
|
||||
logfile_backups=10 ; number of backed up logfiles
|
||||
loglevel=%(ENV_AIO_LOG_LEVEL)s
|
||||
loglevel=error
|
||||
user=root
|
||||
|
||||
[program:php-fpm]
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
if ! nc -z "$NEXTCLOUD_HOST" 9001; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
export RUST_LOG="$AIO_LOG_LEVEL"
|
||||
|
||||
if [ -z "$NEXTCLOUD_HOST" ]; then
|
||||
echo "NEXTCLOUD_HOST needs to be provided. Exiting!"
|
||||
exit 1
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
nc -z 127.0.0.1 80 || exit 1
|
||||
|
||||
@@ -14,7 +14,6 @@ RUN set -ex; \
|
||||
bash \
|
||||
openssl \
|
||||
shadow \
|
||||
netcat-openbsd \
|
||||
grep; \
|
||||
\
|
||||
# We need to use the same gid and uid as on old installations
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
test -f "/mnt/data/backup-is-running" && exit 0
|
||||
|
||||
# If database import is running, do not continue with the health check
|
||||
if nc -z 127.0.0.1 11000; then
|
||||
exit 0
|
||||
fi
|
||||
PGPASSWORD="$POSTGRES_PASSWORD" psql -h 127.0.0.1 -p 11000 -U "oc_$POSTGRES_USER" -d "$POSTGRES_DB" -c "select now()" && exit 0
|
||||
|
||||
PGPASSWORD="$POSTGRES_PASSWORD" psql -h 127.0.0.1 -p 5432 -U "oc_$POSTGRES_USER" -d "$POSTGRES_DB" -c "select now()" || exit 1
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
set -ex
|
||||
|
||||
touch "$DUMP_DIR/initialization.failed"
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
POSTGRES_LOG_MIN_MESSAGES="$(case "$AIO_LOG_LEVEL" in
|
||||
debug) printf 'debug1' ;;
|
||||
info) printf 'info' ;;
|
||||
warn) printf 'warning' ;;
|
||||
error) printf 'error' ;;
|
||||
esac)"
|
||||
export POSTGRES_LOG_MIN_MESSAGES
|
||||
|
||||
# Variables
|
||||
DATADIR="/var/lib/postgresql/data"
|
||||
export DUMP_DIR="/mnt/data"
|
||||
@@ -178,12 +166,6 @@ if [ -f "/var/lib/postgresql/data/postgresql.conf" ]; then
|
||||
sed -i 's|#log_checkpoints.*|log_checkpoints = off|' "$PGCONF"
|
||||
fi
|
||||
|
||||
if grep -q "^#\?log_min_messages" /var/lib/postgresql/data/postgresql.conf; then
|
||||
sed -i "s|^#\?log_min_messages.*|log_min_messages = $POSTGRES_LOG_MIN_MESSAGES|" /var/lib/postgresql/data/postgresql.conf
|
||||
else
|
||||
echo "log_min_messages = $POSTGRES_LOG_MIN_MESSAGES" >> /var/lib/postgresql/data/postgresql.conf
|
||||
fi
|
||||
|
||||
# Closing idling connections automatically seems to break any logic so was reverted again to default where it is disabled
|
||||
if grep -q "^idle_session_timeout" "$PGCONF"; then
|
||||
sed -i 's|^idle_session_timeout.*|#idle_session_timeout|' "$PGCONF"
|
||||
@@ -241,16 +223,12 @@ do_database_dump() {
|
||||
pg_ctl stop -m fast
|
||||
rm "$DUMP_DIR/export.failed"
|
||||
echo 'Database dump successful!'
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
exit 0
|
||||
else
|
||||
pg_ctl stop -m fast
|
||||
echo "Database dump unsuccessful!"
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# syntax=docker/dockerfile:latest
|
||||
# From https://github.com/redis/docker-library-redis/blob/release/8.2/alpine/Dockerfile
|
||||
FROM redis:8.6.3-alpine
|
||||
FROM redis:8.6.2-alpine
|
||||
|
||||
COPY --chmod=775 start.sh /start.sh
|
||||
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
redis-cli -a "$REDIS_HOST_PASSWORD" PING || exit 1
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Redis only supports [debug, verbose, notice, warning, nothing] as log level
|
||||
if [ "$AIO_LOG_LEVEL" = "warn" ] || [ "$AIO_LOG_LEVEL" = "error" ]; then
|
||||
REDIS_LOG_LEVEL="warning"
|
||||
elif [ "$AIO_LOG_LEVEL" = "info" ]; then
|
||||
REDIS_LOG_LEVEL="notice"
|
||||
else
|
||||
REDIS_LOG_LEVEL="$AIO_LOG_LEVEL"
|
||||
fi
|
||||
export REDIS_LOG_LEVEL
|
||||
|
||||
# Show wiki if vm.overcommit is disabled
|
||||
if [ "$(sysctl -n vm.overcommit_memory)" != "1" ]; then
|
||||
echo "Memory overcommit is disabled but necessary for safe operation"
|
||||
@@ -30,7 +16,7 @@ fi
|
||||
|
||||
# Build the redis-server argument list.
|
||||
REDIS_ARGS=(
|
||||
--loglevel "$REDIS_LOG_LEVEL"
|
||||
--loglevel warning
|
||||
--save "" # Disable RDB persistence (Redis is used as a pure cache/lock store)
|
||||
--maxmemory-policy allkeys-lru # Evict least-recently-used keys when memory is full
|
||||
--lazyfree-lazy-eviction yes # Perform evictions in a background thread
|
||||
|
||||
@@ -4,13 +4,12 @@ FROM python:3.14.3-alpine3.23
|
||||
COPY --chmod=775 start.sh /start.sh
|
||||
COPY --chmod=775 healthcheck.sh /healthcheck.sh
|
||||
|
||||
ENV RECORDING_VERSION=v0.2.1 \
|
||||
ALLOW_ALL=false \
|
||||
HPB_PROTOCOL=https \
|
||||
NC_PROTOCOL=https \
|
||||
SKIP_VERIFY=false \
|
||||
HPB_PATH=/standalone-signaling/ \
|
||||
AIO_LOG_LEVEL=warn
|
||||
ENV RECORDING_VERSION=v0.2.1
|
||||
ENV ALLOW_ALL=false
|
||||
ENV HPB_PROTOCOL=https
|
||||
ENV NC_PROTOCOL=https
|
||||
ENV SKIP_VERIFY=false
|
||||
ENV HPB_PATH=/standalone-signaling/
|
||||
|
||||
RUN set -ex; \
|
||||
apk upgrade --no-cache -a; \
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
nc -z 127.0.0.1 1234 || exit 1
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
TALK_RECORDING_LOG_LEVEL="$(case "$AIO_LOG_LEVEL" in
|
||||
debug) printf '10' ;;
|
||||
info) printf '20' ;;
|
||||
warn) printf '30' ;;
|
||||
error) printf '40' ;;
|
||||
esac)"
|
||||
export TALK_RECORDING_LOG_LEVEL
|
||||
|
||||
# Variables
|
||||
if [ -z "$NC_DOMAIN" ]; then
|
||||
echo "You need to provide the NC_DOMAIN."
|
||||
@@ -61,7 +49,7 @@ fi
|
||||
cat << RECORDING_CONF > "/conf/recording.conf"
|
||||
[logs]
|
||||
# 30 means Warning
|
||||
level = ${TALK_RECORDING_LOG_LEVEL}
|
||||
level = 30
|
||||
|
||||
[http]
|
||||
listen = 0.0.0.0:1234
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# syntax=docker/dockerfile:latest
|
||||
FROM nats:2.14.0-scratch AS nats
|
||||
FROM nats:2.12.7-scratch AS nats
|
||||
FROM eturnal/eturnal:1.12.2-alpine AS eturnal
|
||||
FROM strukturag/nextcloud-spreed-signaling:2.1.1 AS signaling
|
||||
FROM alpine:3.23.4 AS janus
|
||||
@@ -37,8 +37,7 @@ RUN set -ex; \
|
||||
|
||||
FROM alpine:3.23.4
|
||||
ENV ETURNAL_ETC_DIR="/conf"
|
||||
ENV SKIP_CERT_VERIFY=false \
|
||||
AIO_LOG_LEVEL=warn
|
||||
ENV SKIP_CERT_VERIFY=false
|
||||
COPY --from=janus --chmod=777 --chown=1000:1000 /usr/local /usr/local
|
||||
COPY --from=eturnal --chmod=777 --chown=1000:1000 /opt/eturnal /opt/eturnal
|
||||
COPY --from=nats --chmod=777 --chown=1000:1000 /nats-server /usr/local/bin/nats-server
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
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
|
||||
|
||||
@@ -1,23 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = "warn" ]; then
|
||||
ETURNAL_LOG_LEVEL="warning"
|
||||
else
|
||||
ETURNAL_LOG_LEVEL="$AIO_LOG_LEVEL"
|
||||
fi
|
||||
export ETURNAL_LOG_LEVEL
|
||||
JANUS_LOG_LEVEL="$(case "$AIO_LOG_LEVEL" in
|
||||
debug) printf '7' ;;
|
||||
info) printf '4' ;;
|
||||
warn) printf '3' ;;
|
||||
error) printf '1' ;;
|
||||
esac)"
|
||||
export JANUS_LOG_LEVEL
|
||||
|
||||
# Variables
|
||||
if [ -z "$NC_DOMAIN" ]; then
|
||||
echo "You need to provide the NC_DOMAIN."
|
||||
@@ -49,9 +31,7 @@ if mountpoint -q /usr/local/share/ca-certificates; then
|
||||
fi
|
||||
done
|
||||
export SSL_CERT_FILE=/tmp/ca-certificates.crt
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
fi
|
||||
|
||||
set -x
|
||||
@@ -60,9 +40,7 @@ IPv4_ADDRESS_TALK_RELAY="$(hostname -i | grep -oP '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]
|
||||
IPv4_ADDRESS_TALK="$(dig "$TALK_HOST" IN A +short +search | grep '^[0-9.]\+$' | sort | head -n1)"
|
||||
# shellcheck disable=SC2153
|
||||
IPv6_ADDRESS_TALK="$(dig "$TALK_HOST" AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)"
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
|
||||
if [ -n "$IPv4_ADDRESS_TALK" ] && [ "$IPv4_ADDRESS_TALK_RELAY" = "$IPv4_ADDRESS_TALK" ]; then
|
||||
IPv4_ADDRESS_TALK=""
|
||||
@@ -75,9 +53,7 @@ if grep -q "1" /sys/module/ipv6/parameters/disable \
|
||||
|| grep -q "1" /proc/sys/net/ipv6/conf/default/disable_ipv6; then
|
||||
IP_BINDING="0.0.0.0"
|
||||
fi
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
|
||||
# Turn
|
||||
cat << TURN_CONF > "/conf/eturnal.yml"
|
||||
@@ -90,7 +66,7 @@ eturnal:
|
||||
port: $TALK_PORT
|
||||
transport: tcp
|
||||
log_dir: stdout
|
||||
log_level: ${ETURNAL_LOG_LEVEL}
|
||||
log_level: warning
|
||||
secret: "$TURN_SECRET"
|
||||
relay_ipv4_addr: "$IPv4_ADDRESS_TALK_RELAY"
|
||||
relay_ipv6_addr: "$IPv6_ADDRESS_TALK"
|
||||
|
||||
@@ -5,7 +5,7 @@ pidfile=/var/run/supervisord/supervisord.pid
|
||||
childlogdir=/var/log/supervisord/
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=%(ENV_AIO_LOG_LEVEL)s
|
||||
loglevel=error
|
||||
|
||||
[program:nats-server]
|
||||
stdout_logfile=/dev/stdout
|
||||
@@ -30,7 +30,8 @@ stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=janus --config=/conf/janus.jcfg --disable-colors --log-stdout --full-trickle --debug-level %(ENV_JANUS_LOG_LEVEL)s
|
||||
# debug-level 3 means warning
|
||||
command=janus --config=/conf/janus.jcfg --disable-colors --log-stdout --full-trickle --debug-level 3
|
||||
# Start alongside eturnal; signaling connects to Janus via WebSocket
|
||||
priority=20
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Check if socket is available and readable
|
||||
if ! [ -e "/var/run/docker.sock" ]; then
|
||||
echo "Docker socket is not available. Cannot continue."
|
||||
@@ -21,7 +17,7 @@ if [ -f /run/.containerenv ]; then
|
||||
fi
|
||||
|
||||
if [ -n "$CONTAINER_TO_UPDATE" ]; then
|
||||
exec /watchtower --cleanup --log-level "$AIO_LOG_LEVEL" --run-once "$CONTAINER_TO_UPDATE"
|
||||
exec /watchtower --cleanup --debug --run-once "$CONTAINER_TO_UPDATE"
|
||||
else
|
||||
echo "'CONTAINER_TO_UPDATE' is not set. Cannot update anything."
|
||||
exit 1
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
nc -z "$REDIS_HOST" "$REDIS_PORT" || exit 0
|
||||
nc -z 127.0.0.1 3002 || exit 1
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
export LOG_LEVEL="$AIO_LOG_LEVEL"
|
||||
|
||||
# Only start container if nextcloud is accessible
|
||||
while ! nc -z "$REDIS_HOST" "$REDIS_PORT"; do
|
||||
echo "Waiting for redis to start..."
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
"NC_DOMAIN=%NC_DOMAIN%",
|
||||
"APACHE_PORT=%APACHE_PORT%",
|
||||
"APACHE_IP_BINDING=%APACHE_IP_BINDING%",
|
||||
"NEXTCLOUD_EXPORTER_CADDY_PASSWORD=%NEXTCLOUD_EXPORTER_CADDY_PASSWORD%"
|
||||
"NEXTCLOUD_EXPORTER_CADDY_PASSWORD=%NEXTCLOUD_EXPORTER_CADDY_PASSWORD%",
|
||||
"DESEC_TOKEN=%DESEC_TOKEN%"
|
||||
],
|
||||
"volumes": [
|
||||
{
|
||||
|
||||
17
community-containers/dnsmasq/dnsmasq.json
Normal file
17
community-containers/dnsmasq/dnsmasq.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"aio_services_v1": [
|
||||
{
|
||||
"container_name": "nextcloud-aio-dnsmasq",
|
||||
"display_name": "Dnsmasq (Local DNS)",
|
||||
"documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/dnsmasq",
|
||||
"image": "ghcr.io/nextcloud-releases/aio-dnsmasq",
|
||||
"image_tag": "%AIO_CHANNEL%",
|
||||
"internal_port": "host",
|
||||
"restart": "unless-stopped",
|
||||
"environment": [
|
||||
"NC_DOMAIN=%NC_DOMAIN%",
|
||||
"TZ=%TIMEZONE%"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
31
community-containers/dnsmasq/readme.md
Normal file
31
community-containers/dnsmasq/readme.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Dnsmasq (Local DNS) community container
|
||||
|
||||
This container runs [dnsmasq](https://thekelleys.org.uk/dnsmasq/doc.html) pre-configured to resolve your Nextcloud domain (`NC_DOMAIN`) to the server's local LAN IP address.
|
||||
|
||||
## Why is this needed?
|
||||
|
||||
By default, all devices on your LAN reach Nextcloud via the public internet (or require hairpin NAT on your router). With this container, LAN clients can resolve `NC_DOMAIN` directly to the server's private LAN IP, making local access faster and independent of your internet connection.
|
||||
|
||||
This container is automatically enabled when you register a deSEC domain through the AIO interface.
|
||||
|
||||
## How it works
|
||||
|
||||
On startup the container:
|
||||
1. Detects the server's primary LAN IP address automatically.
|
||||
2. Configures dnsmasq to resolve `NC_DOMAIN` (and all its subdomains) to that IP.
|
||||
3. Forwards all other DNS queries to the upstream nameservers from the host's `/etc/resolv.conf`.
|
||||
4. Listens only on the LAN interface to avoid conflicts with any system DNS resolver (e.g. `systemd-resolved`).
|
||||
|
||||
## Required router configuration
|
||||
|
||||
⚠️ **You must change your router's DHCP settings** for this to take effect for LAN clients:
|
||||
|
||||
Set the **DNS server** handed out by DHCP to the **local IP address of this server** (the same IP that is printed in the container logs on startup). After saving the change, LAN devices need to renew their DHCP lease (or be rebooted) before the new DNS setting takes effect.
|
||||
|
||||
Most routers expose this under **DHCP settings → Primary DNS** or **LAN → DNS Server**.
|
||||
|
||||
## Notes
|
||||
|
||||
- The container runs in **host network mode** so it can bind directly to port 53 on the LAN interface. No additional port-forwarding is required.
|
||||
- If `systemd-resolved` (or another DNS resolver) is already listening on port 53 on the LAN IP, there will be a conflict. In that case you need to disable or reconfigure that resolver first.
|
||||
- IPv6 addresses are not handled by this container; extend the dnsmasq configuration manually if needed.
|
||||
@@ -61,8 +61,7 @@ flowchart TD
|
||||
|
||||
## How to use this?
|
||||
Starting with v11 of AIO, the management of Community Containers is done via the AIO interface (it is the last section in the AIO interface, so only visible if you scroll down).
|
||||
|
||||
⚠️⚠️⚠️ Please review the folder for documentation on each of the containers before adding them! Not reviewing the documentation for each of them first might break starting the AIO containers because some containers are not compatible with each other and more.
|
||||
⚠️⚠️⚠️ Please review the folder for documentation on each of the containers before adding them! Not reviewing the documentation for each of them first might break starting the AIO containers because e.g. fail2ban only works on Linux and not on Docker Desktop! **Hint:** If the containers where running already, in order to actually start the added container, you need to click on `Stop containers` and the `Update and start containers` in order to actually start it.
|
||||
|
||||
## How to add containers?
|
||||
Simply submit a PR by creating a new folder in this directory: https://github.com/nextcloud/all-in-one/tree/main/community-containers with the name of your container. It must include a json file with the same name and with correct syntax and a readme.md with additional information. You might get inspired by caddy, fail2ban, local-ai, libretranslate, plex, pi-hole or vaultwarden (subfolders in this directory). For a full-blown example of the json file, see https://github.com/nextcloud/all-in-one/blob/main/php/containers.json. The json-schema that it validates against can be found here: https://github.com/nextcloud/all-in-one/blob/main/php/containers-schema.json.
|
||||
|
||||
@@ -22,7 +22,6 @@ services:
|
||||
# APACHE_IP_BINDING: 127.0.0.1 # Should be set when running behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else) that is running on the same host. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
|
||||
# APACHE_ADDITIONAL_NETWORK: frontend_net # (Optional) Connect the apache container to an additional docker network. Needed when behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else) running in a different docker network on same server. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
|
||||
# BORG_RETENTION_POLICY: --keep-within=7d --keep-weekly=4 --keep-monthly=6 # Allows to adjust borgs retention policy. See https://github.com/nextcloud/all-in-one#how-to-adjust-borgs-retention-policy
|
||||
# AIO_LOG_LEVEL: warn # Allows to globally adjust the log level of the included AIO components. Supported values: debug, info, warn, error. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-log-level-for-aio-components
|
||||
# COLLABORA_SECCOMP_DISABLED: false # Setting this to true allows to disable Collabora's Seccomp feature. See https://github.com/nextcloud/all-in-one#how-to-disable-collaboras-seccomp-feature
|
||||
# DOCKER_API_VERSION: 1.44 # You can adjust the internally used docker api version with this variable. ⚠️⚠️⚠️ Warning: please note that only the default api version (unset this variable) is supported and tested by the maintainers of Nextcloud AIO. So use this on your own risk and things might break without warning. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-internally-used-docker-api-version
|
||||
# FULLTEXTSEARCH_JAVA_OPTIONS: "-Xms1024M -Xmx1024M" # Allows to adjust the fulltextsearch java options. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-fulltextsearch-java-options
|
||||
@@ -42,7 +41,7 @@ services:
|
||||
# WATCHTOWER_DOCKER_SOCKET_PATH: /var/run/docker.sock # Needs to be specified if the docker socket on the host is not located in the default '/var/run/docker.sock'. Otherwise mastercontainer updates will fail. For macos it needs to be '/var/run/docker.sock'
|
||||
|
||||
# # Optional: Caddy reverse proxy. See https://github.com/nextcloud/all-in-one/discussions/575
|
||||
# # Alternatively, use Tailscale if you don't have a domain yet. See https://github.com/nextcloud/all-in-one/discussions/6817
|
||||
# # Alternatively, if you don't have a domain yet, use the built-in deSEC free domain registration in the AIO interface, or use Tailscale. See https://github.com/nextcloud/all-in-one#how-to-get-a-free-domain-via-desec and https://github.com/nextcloud/all-in-one/discussions/6817
|
||||
# # Hint: You need to uncomment APACHE_PORT: 11000 above, adjust cloud.example.com to your domain and uncomment the necessary docker volumes at the bottom of this file in order to make it work
|
||||
# # You can find further examples here: https://github.com/nextcloud/all-in-one/discussions/588
|
||||
# caddy:
|
||||
|
||||
@@ -2,22 +2,25 @@
|
||||
It is possible due to several reasons that you do not want or cannot open Nextcloud to the public internet. Perhaps you were hoping to access AIO directly from an `ip.add.r.ess` (unsupported) or without a valid domain. However, AIO requires a valid certificate to work correctly. Below is discussed how you can achieve both: Having a valid certificate for Nextcloud and only using it locally.
|
||||
|
||||
### Content
|
||||
- [1. Tailscale](#1-tailscale)
|
||||
- [2. Pangolin](#2-pangolin)
|
||||
- [1. deSEC free domain (recommended)](#1-desec-free-domain-recommended)
|
||||
- [2. Tailscale](#2-tailscale)
|
||||
- [3. The normal way](#3-the-normal-way)
|
||||
- [4. Use the ACME DNS-challenge](#4-use-the-acme-dns-challenge)
|
||||
- [5. Use Cloudflare](#5-use-cloudflare)
|
||||
- [6. Buy a certificate and use that](#6-buy-a-certificate-and-use-that)
|
||||
|
||||
## 1. Tailscale
|
||||
This is the recommended way. For a reverse proxy example guide for Tailscale, see this guide by [@Perseus333](https://github.com/Perseus333): https://github.com/nextcloud/all-in-one/discussions/6817
|
||||
## 1. deSEC free domain (recommended)
|
||||
[deSEC](https://desec.io) offers free dynamic-DNS subdomains under `dedyn.io`. AIO can register an account and a subdomain for you automatically — directly from the domain-entry page of the AIO interface. After registration:
|
||||
- The [Caddy](https://github.com/nextcloud/all-in-one/tree/main/community-containers/caddy) community container is enabled automatically as a reverse proxy and handles TLS via Let's Encrypt.
|
||||
- The [dnsmasq](https://github.com/nextcloud/all-in-one/tree/main/community-containers/dnsmasq) community container is enabled automatically so that LAN clients resolve your Nextcloud domain to the server's local IP address — no separate Pi-hole or local DNS server required.
|
||||
- The mastercontainer keeps the DNS record up to date automatically when your public IP changes.
|
||||
|
||||
## 2. Pangolin
|
||||
[Pangolin](https://pangolin.net/) is an open-source, WireGuard-based remote access platform similar in concept to Tailscale. It uses the **Newt** connector to create outbound-only encrypted tunnels — no inbound ports need to be opened on your firewall. Pangolin handles TLS automatically, providing a valid certificate for your Nextcloud domain.
|
||||
**How to set it up:** Open the AIO interface, expand the **"Don't have a domain? Get a free one from deSEC"** section, enter your email and an optional subdomain slug, and click **Register free domain via deSEC**. See the full documentation at [How to get a free domain via deSEC](https://github.com/nextcloud/all-in-one#how-to-get-a-free-domain-via-desec).
|
||||
|
||||
You can use either [Pangolin Cloud](https://app.pangolin.net/) (free tier available) or [self-host your own Pangolin server](https://docs.pangolin.net/self-host/quick-install) on a VPS. For private/local-only access, self-hosting Pangolin on a machine within your local network means that Nextcloud never needs to be exposed to the public internet.
|
||||
After registration, follow the [dnsmasq documentation](https://github.com/nextcloud/all-in-one/tree/main/community-containers/dnsmasq) to point your router's DHCP DNS server to the AIO host so that all LAN devices resolve the domain locally.
|
||||
|
||||
For the reverse proxy configuration details and a step-by-step setup guide, see the [Pangolin section in the reverse proxy documentation](./reverse-proxy.md#pangolin).
|
||||
## 2. Tailscale
|
||||
For a reverse proxy example guide for Tailscale, see this guide by [@Perseus333](https://github.com/Perseus333): https://github.com/nextcloud/all-in-one/discussions/6817
|
||||
|
||||
## 3. The normal way
|
||||
The normal way is the following:
|
||||
|
||||
@@ -25,7 +25,6 @@ APACHE_IP_BINDING=0.0.0.0 # This can be changed to e.g. 127.0.0.1 if yo
|
||||
APACHE_MAX_SIZE=17179869184 # This needs to be an integer and in sync with NEXTCLOUD_UPLOAD_LIMIT
|
||||
APACHE_PORT=443 # Changing this to a different value than 443 will allow you to run it behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else).
|
||||
ADDITIONAL_COLLABORA_OPTIONS=['--o:security.seccomp=true'] # You can add additional collabora options here by using the array syntax.
|
||||
AIO_LOG_LEVEL=warn # Allows to adjust the global AIO log level. Valid values are debug, info, warn and error.
|
||||
COLLABORA_DICTIONARIES="de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru" # You can change this in order to enable other dictionaries for collabora
|
||||
FULLTEXTSEARCH_JAVA_OPTIONS="-Xms512M -Xmx512M" # Allows to adjust the fulltextsearch java options.
|
||||
INSTALL_LATEST_MAJOR=no # Setting this to yes will install the latest Major Nextcloud version upon the first installation
|
||||
|
||||
@@ -100,7 +100,6 @@ sed -i 's|NC_DOMAIN=|NC_DOMAIN=yourdomain.com # TODO! Needs to be chang
|
||||
sed -i 's|NEXTCLOUD_PASSWORD=|NEXTCLOUD_PASSWORD= # TODO! This is the password of the initially created Nextcloud admin with username "admin".|' sample.conf
|
||||
sed -i 's|TIMEZONE=|TIMEZONE=Europe/Berlin # TODO! This is the timezone that your containers will use.|' sample.conf
|
||||
sed -i 's|COLLABORA_SECCOMP_POLICY=|COLLABORA_SECCOMP_POLICY=--o:security.seccomp=true # Changing the value to false allows to disable the seccomp feature of the Collabora container.|' sample.conf
|
||||
sed -i 's|AIO_LOG_LEVEL=|AIO_LOG_LEVEL=warn # Allows to adjust the global AIO log level. Valid values are debug, info, warn and error.|' sample.conf
|
||||
sed -i 's|FULLTEXTSEARCH_JAVA_OPTIONS=|FULLTEXTSEARCH_JAVA_OPTIONS="-Xms512M -Xmx512M" # Allows to adjust the fulltextsearch java options.|' sample.conf
|
||||
sed -i 's|NEXTCLOUD_STARTUP_APPS=|NEXTCLOUD_STARTUP_APPS="deck twofactor_totp tasks calendar contacts notes" # Allows to modify the Nextcloud apps that are installed on starting AIO the first time. You can also disable apps by using a hyphen in front of them. E.g. "-app_api"|' sample.conf
|
||||
sed -i 's|NEXTCLOUD_ADDITIONAL_APKS=|NEXTCLOUD_ADDITIONAL_APKS=imagemagick # This allows to add additional packages to the Nextcloud container permanently. Default is imagemagick but can be overwritten by modifying this value.|' sample.conf
|
||||
|
||||
128
migration.md
128
migration.md
@@ -3,7 +3,7 @@
|
||||
There are basically three ways how to migrate from an already existing Nextcloud installation to Nextcloud AIO (if you ran AIO on the former installation already, you can follow [these steps](https://github.com/nextcloud/all-in-one#how-to-migrate-from-aio-to-aio)):
|
||||
|
||||
1. Migrate only the files which is the easiest way (this excludes all calendar data for example)
|
||||
1. Migrate the files and the database which is much more complicated (with special handling required for former snap installations, see [below](#migrating-from-a-snap-installation))
|
||||
1. Migrate the files and the database which is much more complicated (and doesn't work on former snap installations)
|
||||
1. Use the user_migration app that allows to migrate some of the user's data from a former instance to a new instance but needs to be done manually for each user
|
||||
|
||||
## Migrate only the files
|
||||
@@ -21,7 +21,7 @@ The procedure for migrating only the files works like this:
|
||||
1. If the restored data is older than any clients you want to continue to sync, for example if the server was down for a period of time during migration, you may want to take a look at [Synchronising with clients after migration](/migration.md#synchronising-with-clients-after-migration) below.
|
||||
|
||||
## Migrate the files and the database
|
||||
**Please note**: this is much more complicated than migrating only the files and also not as failproof so be warned! If you are migrating from a snap installation, please first follow the [dedicated snap migration steps](#migrating-from-a-snap-installation) below, which show you how to perform the database conversion using a temporary Docker container. Once done, you can continue from step 5 of this guide.
|
||||
**Please note**: this is much more complicated than migrating only the files and also not as failproof so be warned! Also, this will not work on former snap installations as the snap is read-only and thus you cannot install the necessary `pdo_pgsql` PHP extension. So if migrating from snap, you will need to use one of the other methods. However you could try to ask if the snaps maintainer could add this one small PHP extension to the snap here: https://github.com/nextcloud-snap/nextcloud-snap/issues which would allow for an easy migration.
|
||||
|
||||
The procedure for migrating the files and the database works like this:
|
||||
1. Make sure that your old instance is on exactly the same version like the version used in Nextcloud AIO. (e.g. 23.0.0) You can find the used version here: [click here](https://github.com/nextcloud/all-in-one/search?l=Dockerfile&q=NEXTCLOUD_VERSION&type=). If not, simply upgrade your former installation to that version or wait until the version used in Nextcloud AIO got updated to the same version of your former installation or the other way around.
|
||||
@@ -87,130 +87,6 @@ If not, feel free to restore the AIO instance from backup and start at step 8 ag
|
||||
|
||||
If the restored data is older than any clients you want to continue to sync, for example if the server was down for a period of time during migration, you may want to take a look at [Synchronising with clients after migration](/migration.md#synchronising-with-clients-after-migration) below.
|
||||
|
||||
### Migrating from a snap installation
|
||||
|
||||
**Disclaimer:** it might be possible that the guide below is not working 100% correctly, yet. Improvements to it are very welcome!
|
||||
|
||||
Since the Nextcloud snap is read-only, it is not possible to install the `pdo_pgsql` PHP extension inside the snap to perform the MySQL-to-PostgreSQL database conversion required by AIO. As a workaround, a temporary [nextcloud/docker](https://github.com/nextcloud/docker) container can be used as an intermediate environment that already includes `pdo_pgsql` and can convert the snap's MySQL database to PostgreSQL for you.
|
||||
|
||||
This procedure covers steps 1–3 of the regular migration above (version matching, app updates, and database conversion) and also produces the `database-dump.sql` needed for step 4. Once finished, continue from step 5 of the [Migrate the files and the database](#migrate-the-files-and-the-database) procedure above.
|
||||
|
||||
1. **Create a backup of the snap before doing anything else**, so you can restore the snap to its current state if anything goes wrong:
|
||||
```
|
||||
sudo snap save nextcloud
|
||||
```
|
||||
This creates a snapshot that can be restored later with `sudo snap restore <snapshot-id>`. The snapshot ID is shown in the output of `snap save`. You can also list existing snapshots with `snap saved`.
|
||||
1. Note the exact Nextcloud version of your snap installation:
|
||||
```
|
||||
sudo nextcloud.occ -V
|
||||
```
|
||||
1. Make sure that this version matches exactly the version used in Nextcloud AIO. You can find the AIO version here: [click here](https://github.com/nextcloud/all-in-one/search?l=Dockerfile&q=NEXTCLOUD_VERSION&type=). If they do not match, upgrade your snap with `sudo snap refresh nextcloud --channel=<major-version>/stable` or wait for AIO to be updated to the same version.
|
||||
1. Update all installed Nextcloud apps to their latest versions:
|
||||
```
|
||||
sudo nextcloud.occ app:update --all
|
||||
```
|
||||
1. Retrieve the necessary configuration values from the snap using `nextcloud.occ` and store them in environment variables. Do this **before** stopping the snap, as `nextcloud.occ` requires the snap services to be running:
|
||||
```
|
||||
export INSTANCEID=$(sudo nextcloud.occ config:system:get instanceid)
|
||||
export PASSWORDSALT=$(sudo nextcloud.occ config:system:get passwordsalt)
|
||||
export SECRET=$(sudo nextcloud.occ config:system:get secret)
|
||||
export TABLE_PREFIX=$(sudo nextcloud.occ config:system:get dbtableprefix || echo "oc_")
|
||||
export SNAP_DATA=$(sudo nextcloud.occ config:system:get datadirectory)
|
||||
# Note down SNAP_DATA — you will need it later when copying files
|
||||
echo "Snap data directory: $SNAP_DATA"
|
||||
```
|
||||
1. Export a dump of the snap's MySQL database:
|
||||
```
|
||||
sudo nextcloud.mysqldump > ~/mysql-dump.sql
|
||||
```
|
||||
1. Stop the snap to prevent further writes during the migration:
|
||||
```
|
||||
sudo snap stop nextcloud
|
||||
```
|
||||
1. Set up environment variables for the temporary containers (adjust the version and passwords as needed):
|
||||
```
|
||||
export NEXTCLOUD_VERSION="29.0.0" # Replace with the exact version from step 2
|
||||
export MYSQL_PASSWORD="mysql-temp-password"
|
||||
export PG_USER="ncadmin"
|
||||
export PG_PASSWORD="my-temporary-pg-password"
|
||||
export PG_DATABASE="nextcloud_db"
|
||||
```
|
||||
1. Create a Docker network for the temporary migration containers:
|
||||
```
|
||||
docker network create nextcloud-migration
|
||||
```
|
||||
1. Start a temporary MySQL container and import the snap database dump into it:
|
||||
```
|
||||
docker run -d \
|
||||
--name mysql-migration \
|
||||
--network nextcloud-migration \
|
||||
-e MYSQL_ROOT_PASSWORD="mysql-root-temp" \
|
||||
-e MYSQL_DATABASE="nextcloud" \
|
||||
-e MYSQL_USER="nextcloud" \
|
||||
-e MYSQL_PASSWORD="$MYSQL_PASSWORD" \
|
||||
mysql:8
|
||||
# Wait for MySQL to finish starting up before importing
|
||||
until docker exec mysql-migration mysqladmin ping -h localhost --silent 2>/dev/null; do sleep 1; done
|
||||
docker exec -i mysql-migration mysql -u nextcloud -p"$MYSQL_PASSWORD" nextcloud < ~/mysql-dump.sql
|
||||
```
|
||||
1. Start a temporary PostgreSQL container as the migration target:
|
||||
```
|
||||
docker run -d \
|
||||
--name postgres-migration \
|
||||
--network nextcloud-migration \
|
||||
-e POSTGRES_USER="$PG_USER" \
|
||||
-e POSTGRES_PASSWORD="$PG_PASSWORD" \
|
||||
-e POSTGRES_DB="$PG_DATABASE" \
|
||||
postgres:16
|
||||
```
|
||||
1. Create a temporary config file for the migration container using the values retrieved in step 5:
|
||||
```
|
||||
cat > /tmp/migration-config.php << EOF
|
||||
<?php
|
||||
\$CONFIG = array(
|
||||
'instanceid' => '$INSTANCEID',
|
||||
'passwordsalt' => '$PASSWORDSALT',
|
||||
'secret' => '$SECRET',
|
||||
'dbtype' => 'mysql',
|
||||
'dbname' => 'nextcloud',
|
||||
'dbhost' => 'mysql-migration',
|
||||
'dbport' => '',
|
||||
'dbtableprefix' => '$TABLE_PREFIX',
|
||||
'dbuser' => 'nextcloud',
|
||||
'dbpassword' => '$MYSQL_PASSWORD',
|
||||
'datadirectory' => '$SNAP_DATA',
|
||||
'installed' => true,
|
||||
);
|
||||
EOF
|
||||
```
|
||||
1. Run a temporary nextcloud/docker container to convert the MySQL database to PostgreSQL. Note that the container image version must match the Nextcloud version you noted in step 2, and that `pdo_pgsql` is already included in the `nextcloud` Docker image:
|
||||
```
|
||||
docker run --rm \
|
||||
--network nextcloud-migration \
|
||||
--entrypoint bash \
|
||||
-v /tmp/migration-config.php:/var/www/html/config/config.php:rw \
|
||||
-v "${SNAP_DATA}:${SNAP_DATA}:ro" \
|
||||
nextcloud:${NEXTCLOUD_VERSION}-apache \
|
||||
-c "php /var/www/html/occ db:convert-type --all-apps --password '$PG_PASSWORD' pgsql '$PG_USER' postgres-migration '$PG_DATABASE'"
|
||||
```
|
||||
**Please note:** The `occ` command may print a warning about being run as root — this can be safely ignored for this migration step.
|
||||
1. Export the converted PostgreSQL database:
|
||||
```
|
||||
docker exec postgres-migration pg_dump -U "$PG_USER" "$PG_DATABASE" > ~/database-dump.sql
|
||||
```
|
||||
**Please note:** The exact name of the database export file is important! (`database-dump.sql`)
|
||||
1. Clean up the temporary containers and network:
|
||||
```
|
||||
docker rm -f mysql-migration postgres-migration
|
||||
docker network rm nextcloud-migration
|
||||
```
|
||||
1. You now have a `~/database-dump.sql`. Continue from step 5 of the [Migrate the files and the database](#migrate-the-files-and-the-database) procedure above. When those steps ask for your old data directory path, use the `$SNAP_DATA` value noted in step 5 (typically `/var/snap/nextcloud/common`). If you have opened a new shell session since then, you can retrieve it again with `sudo nextcloud.occ config:system:get datadirectory` (requires the snap to be running) or read it directly from `/var/snap/nextcloud/current/nextcloud/config/config.php`.
|
||||
1. Once you have verified that the migration to AIO was successful and everything is working correctly, you can permanently remove the Nextcloud snap from your system:
|
||||
```
|
||||
sudo snap remove --purge nextcloud
|
||||
```
|
||||
The `--purge` flag removes the snap along with all its saved snapshots and data. Omit it if you want to keep the snap snapshots as a fallback. **Only do this after you are fully satisfied that your AIO instance is working correctly**, as this action cannot be undone.
|
||||
|
||||
## Use the user_migration app
|
||||
A new way since the Nextcloud update to 24 is to use the new [user_migration app](https://apps.nextcloud.com/apps/user_migration#app-gallery). It allows to export the most important data on one instance and import it on a different Nextcloud instance. For that, you need to install and enable the user_migration app on your old instance, trigger the export for the user, create the user on the new instance, log in with that user and import the archive that was created during the export. This then needs to be done for each user that you want to migrate.
|
||||
|
||||
|
||||
32
php/composer.lock
generated
32
php/composer.lock
generated
@@ -1532,7 +1532,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.37.0",
|
||||
"version": "v1.36.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||
@@ -1591,7 +1591,7 @@
|
||||
"portable"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0"
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.36.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1615,7 +1615,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.37.0",
|
||||
"version": "v1.36.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
@@ -1676,7 +1676,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.37.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.36.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1700,7 +1700,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php81",
|
||||
"version": "v1.37.0",
|
||||
"version": "v1.36.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php81.git",
|
||||
@@ -1756,7 +1756,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php81/tree/v1.37.0"
|
||||
"source": "https://github.com/symfony/polyfill-php81/tree/v1.36.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -4284,16 +4284,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-intl-grapheme",
|
||||
"version": "v1.37.0",
|
||||
"version": "v1.36.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
|
||||
"reference": "4864388bfbd3001ce88e234fab652acd91fdc57e"
|
||||
"reference": "ad1b7b9092976d6c948b8a187cec9faaea9ec1df"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/4864388bfbd3001ce88e234fab652acd91fdc57e",
|
||||
"reference": "4864388bfbd3001ce88e234fab652acd91fdc57e",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/ad1b7b9092976d6c948b8a187cec9faaea9ec1df",
|
||||
"reference": "ad1b7b9092976d6c948b8a187cec9faaea9ec1df",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4342,7 +4342,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.37.0"
|
||||
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.36.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -4362,11 +4362,11 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-04-26T13:13:48+00:00"
|
||||
"time": "2026-04-10T16:19:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-intl-normalizer",
|
||||
"version": "v1.37.0",
|
||||
"version": "v1.36.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
|
||||
@@ -4427,7 +4427,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.37.0"
|
||||
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.36.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -4451,7 +4451,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php84",
|
||||
"version": "v1.37.0",
|
||||
"version": "v1.36.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php84.git",
|
||||
@@ -4507,7 +4507,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php84/tree/v1.37.0"
|
||||
"source": "https://github.com/symfony/polyfill-php84/tree/v1.36.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
"COLLABORA_HOST=nextcloud-aio-collabora",
|
||||
"TALK_HOST=nextcloud-aio-talk",
|
||||
"APACHE_PORT=%APACHE_PORT%",
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"ONLYOFFICE_HOST=nextcloud-aio-onlyoffice",
|
||||
"TZ=%TIMEZONE%",
|
||||
"APACHE_MAX_SIZE=%APACHE_MAX_SIZE%",
|
||||
@@ -121,7 +120,6 @@
|
||||
"POSTGRES_PASSWORD=%DATABASE_PASSWORD%",
|
||||
"POSTGRES_DB=nextcloud_database",
|
||||
"POSTGRES_USER=nextcloud",
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"TZ=%TIMEZONE%",
|
||||
"PGTZ=%TIMEZONE%"
|
||||
],
|
||||
@@ -224,7 +222,6 @@
|
||||
"SIGNALING_SECRET=%SIGNALING_SECRET%",
|
||||
"ONLYOFFICE_SECRET=%ONLYOFFICE_SECRET%",
|
||||
"AIO_URL=%AIO_URL%",
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"NC_AIO_VERSION=v%AIO_VERSION%",
|
||||
"NEXTCLOUD_MOUNT=%NEXTCLOUD_MOUNT%",
|
||||
"CLAMAV_ENABLED=%CLAMAV_ENABLED%",
|
||||
@@ -314,7 +311,6 @@
|
||||
],
|
||||
"environment": [
|
||||
"NEXTCLOUD_HOST=nextcloud-aio-nextcloud",
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"TZ=%TIMEZONE%"
|
||||
],
|
||||
"restart": "unless-stopped",
|
||||
@@ -344,7 +340,6 @@
|
||||
"internal_port": "6379",
|
||||
"environment": [
|
||||
"REDIS_HOST_PASSWORD=%REDIS_PASSWORD%",
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"TZ=%TIMEZONE%"
|
||||
],
|
||||
"volumes": [
|
||||
@@ -386,9 +381,8 @@
|
||||
"internal_port": "9980",
|
||||
"environment": [
|
||||
"aliasgroup1=https://%NC_DOMAIN%:443,http://nextcloud-aio-apache.nextcloud-aio:23973",
|
||||
"extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.disable_server_audit=true --o:welcome.enable=false --o:fetch_update_check=0 --o:allow_update_popup=false %COLLABORA_SECCOMP_POLICY% --o:remote_font_config.url=https://%NC_DOMAIN%/apps/richdocuments/settings/fonts.json --o:net.post_allow.host[0]=.+",
|
||||
"extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.disable_server_audit=true --o:logging.level=warning --o:logging.level_startup=warning --o:welcome.enable=false --o:fetch_update_check=0 --o:allow_update_popup=false %COLLABORA_SECCOMP_POLICY% --o:remote_font_config.url=https://%NC_DOMAIN%/apps/richdocuments/settings/fonts.json --o:net.post_allow.host[0]=.+",
|
||||
"dictionaries=%COLLABORA_DICTIONARIES%",
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"TZ=%TIMEZONE%",
|
||||
"server_name=%NC_DOMAIN%",
|
||||
"DONT_GEN_SSL_CERT=1"
|
||||
@@ -459,7 +453,6 @@
|
||||
"TALK_HOST=nextcloud-aio-talk",
|
||||
"TURN_SECRET=%TURN_SECRET%",
|
||||
"SIGNALING_SECRET=%SIGNALING_SECRET%",
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"TZ=%TIMEZONE%",
|
||||
"TALK_PORT=%TALK_PORT%",
|
||||
"INTERNAL_SECRET=%TALK_INTERNAL_SECRET%"
|
||||
@@ -507,7 +500,6 @@
|
||||
"internal_port": "1234",
|
||||
"environment": [
|
||||
"NC_DOMAIN=%NC_DOMAIN%",
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"TZ=%TIMEZONE%",
|
||||
"RECORDING_SECRET=%RECORDING_SECRET%",
|
||||
"INTERNAL_SECRET=%TALK_INTERNAL_SECRET%"
|
||||
@@ -551,7 +543,6 @@
|
||||
"BORG_REMOTE_REPO=%BORGBACKUP_REMOTE_REPO%",
|
||||
"BORG_PASSWORD=%BORGBACKUP_PASSWORD%",
|
||||
"BORG_MODE=%BORGBACKUP_MODE%",
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"SELECTED_RESTORE_TIME=%SELECTED_RESTORE_TIME%",
|
||||
"RESTORE_EXCLUDE_PREVIEWS=%RESTORE_EXCLUDE_PREVIEWS%",
|
||||
"BACKUP_RESTORE_PASSWORD=%BACKUP_RESTORE_PASSWORD%",
|
||||
@@ -619,8 +610,7 @@
|
||||
"image": "ghcr.io/nextcloud-releases/aio-watchtower",
|
||||
"init": true,
|
||||
"environment": [
|
||||
"CONTAINER_TO_UPDATE=nextcloud-aio-mastercontainer",
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%"
|
||||
"CONTAINER_TO_UPDATE=nextcloud-aio-mastercontainer"
|
||||
],
|
||||
"volumes": [
|
||||
{
|
||||
@@ -651,8 +641,7 @@
|
||||
"internal_port": "%APACHE_PORT%",
|
||||
"environment": [
|
||||
"INSTANCE_ID=%INSTANCE_ID%",
|
||||
"APACHE_PORT=%APACHE_PORT%",
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%"
|
||||
"APACHE_PORT=%APACHE_PORT%"
|
||||
],
|
||||
"secrets": [
|
||||
"INSTANCE_ID"
|
||||
@@ -687,7 +676,6 @@
|
||||
],
|
||||
"internal_port": "3310",
|
||||
"environment": [
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"TZ=%TIMEZONE%",
|
||||
"MAX_SIZE=%NEXTCLOUD_UPLOAD_LIMIT%"
|
||||
],
|
||||
@@ -733,8 +721,6 @@
|
||||
],
|
||||
"internal_port": "80",
|
||||
"environment": [
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"TZ=%TIMEZONE%",
|
||||
"JWT_ENABLED=true",
|
||||
"JWT_HEADER=AuthorizationJwt",
|
||||
@@ -778,7 +764,6 @@
|
||||
],
|
||||
"internal_port": "9000",
|
||||
"environment": [
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"TZ=%TIMEZONE%",
|
||||
"IMAGINARY_SECRET=%IMAGINARY_SECRET%"
|
||||
],
|
||||
@@ -820,12 +805,12 @@
|
||||
],
|
||||
"internal_port": "9200",
|
||||
"environment": [
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"TZ=%TIMEZONE%",
|
||||
"ES_JAVA_OPTS=%FULLTEXTSEARCH_JAVA_OPTIONS%",
|
||||
"bootstrap.memory_lock=false",
|
||||
"cluster.name=nextcloud-aio",
|
||||
"discovery.type=single-node",
|
||||
"logger.level=WARN",
|
||||
"http.port=9200",
|
||||
"xpack.license.self_generated.type=basic",
|
||||
"xpack.security.enabled=false",
|
||||
@@ -860,7 +845,6 @@
|
||||
"init": true,
|
||||
"internal_port": "2375",
|
||||
"environment": [
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"TZ=%TIMEZONE%"
|
||||
],
|
||||
"volumes": [
|
||||
@@ -892,6 +876,7 @@
|
||||
"environment": [
|
||||
"HP_SHARED_KEY=%HP_SHARED_KEY%",
|
||||
"NC_INSTANCE_URL=https://%NC_DOMAIN%",
|
||||
"HP_LOG_LEVEL=warning",
|
||||
"HP_FRP_DISABLE_TLS=true",
|
||||
"TZ=%TIMEZONE%"
|
||||
],
|
||||
@@ -943,7 +928,6 @@
|
||||
],
|
||||
"internal_port": "3002",
|
||||
"environment": [
|
||||
"AIO_LOG_LEVEL=%AIO_LOG_LEVEL%",
|
||||
"TZ=%TIMEZONE%",
|
||||
"NEXTCLOUD_URL=https://%NC_DOMAIN%",
|
||||
"JWT_SECRET_KEY=%WHITEBOARD_SECRET%",
|
||||
|
||||
@@ -103,13 +103,13 @@ $app->post('/api/docker/backup-check-repair', AIO\Controller\DockerController::c
|
||||
$app->post('/api/docker/backup-test', AIO\Controller\DockerController::class . ':StartBackupContainerTest');
|
||||
$app->post('/api/docker/restore', AIO\Controller\DockerController::class . ':StartBackupContainerRestore');
|
||||
$app->post('/api/docker/stop', AIO\Controller\DockerController::class . ':StopContainer');
|
||||
$app->post('/api/docker/backup-reset-location', AIO\Controller\DockerController::class . ':DeleteBorgBackupConfig');
|
||||
$app->post('/api/docker/prune', AIO\Controller\DockerController::class . ':SystemPrune');
|
||||
$app->get('/api/docker/logs', AIO\Controller\DockerController::class . ':GetLogs');
|
||||
$app->post('/api/auth/login', AIO\Controller\LoginController::class . ':TryLogin');
|
||||
$app->get('/api/auth/getlogin', AIO\Controller\LoginController::class . ':GetTryLogin');
|
||||
$app->post('/api/auth/logout', AIO\Controller\LoginController::class . ':Logout');
|
||||
$app->post('/api/configuration', \AIO\Controller\ConfigurationController::class . ':SetConfig');
|
||||
$app->post('/api/desec/register', \AIO\Controller\DesecController::class . ':Register');
|
||||
|
||||
// Views
|
||||
$app->get('/containers', function (Request $request, Response $response, array $args) use ($container) {
|
||||
@@ -181,6 +181,10 @@ $app->get('/containers', function (Request $request, Response $response, array $
|
||||
'community_containers' => $configurationManager->listAvailableCommunityContainers(),
|
||||
'community_containers_enabled' => $configurationManager->aioCommunityContainers,
|
||||
'bypass_container_update' => $bypass_container_update,
|
||||
'desec_email' => $configurationManager->desecEmail,
|
||||
'desec_password' => $configurationManager->desecPassword,
|
||||
'is_desec_domain' => $configurationManager->isDesecDomain(),
|
||||
'desec_account_registered' => $configurationManager->isDesecAccountRegistered(),
|
||||
]);
|
||||
})->setName('profile');
|
||||
$app->get('/login', function (Request $request, Response $response, array $args) use ($container) {
|
||||
|
||||
@@ -2,6 +2,6 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
||||
// timezone
|
||||
let timezone = document.getElementById("timezone");
|
||||
if (timezone) {
|
||||
timezone.placeholder = Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
timezone.value = Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,14 +3,16 @@ declare(strict_types=1);
|
||||
|
||||
namespace AIO\Controller;
|
||||
|
||||
use AIO\ContainerDefinitionFetcher;
|
||||
use AIO\Data\ConfigurationManager;
|
||||
use AIO\Data\InvalidSettingConfigurationException;
|
||||
use AIO\Docker\DockerActionManager;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
readonly class ConfigurationController {
|
||||
public function __construct(
|
||||
private ConfigurationManager $configurationManager,
|
||||
private ConfigurationManager $configurationManager
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -130,6 +132,10 @@ readonly class ConfigurationController {
|
||||
$this->configurationManager->collaboraAdditionalOptions = $additionalCollaboraOptions;
|
||||
}
|
||||
|
||||
if (isset($request->getParsedBody()['delete_borg_backup_location_vars'])) {
|
||||
$this->configurationManager->deleteBorgBackupLocationItems();
|
||||
}
|
||||
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
} catch (InvalidSettingConfigurationException $ex) {
|
||||
$response->getBody()->write($ex->getMessage());
|
||||
|
||||
28
php/src/Controller/DesecController.php
Normal file
28
php/src/Controller/DesecController.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace AIO\Controller;
|
||||
|
||||
use AIO\Desec\DesecManager;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
readonly class DesecController {
|
||||
public function __construct(
|
||||
private DesecManager $desecManager,
|
||||
) {
|
||||
}
|
||||
|
||||
public function Register(Request $request, Response $response, array $args): Response {
|
||||
try {
|
||||
$email = (string)($request->getParsedBody()['desec_email'] ?? '');
|
||||
$slug = (string)($request->getParsedBody()['desec_slug'] ?? '');
|
||||
$password = (string)($request->getParsedBody()['desec_password'] ?? '');
|
||||
$this->desecManager->register($email, $slug, $password);
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
} catch (\Exception $ex) {
|
||||
$response->getBody()->write($ex->getMessage());
|
||||
return $response->withStatus(422);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ namespace AIO\Controller;
|
||||
use AIO\Container\Container;
|
||||
use AIO\Container\ContainerState;
|
||||
use AIO\ContainerDefinitionFetcher;
|
||||
use AIO\Desec\DesecManager;
|
||||
use AIO\Docker\DockerActionManager;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
@@ -18,7 +19,8 @@ readonly class DockerController {
|
||||
public function __construct(
|
||||
private DockerActionManager $dockerActionManager,
|
||||
private ContainerDefinitionFetcher $containerDefinitionFetcher,
|
||||
private ConfigurationManager $configurationManager
|
||||
private ConfigurationManager $configurationManager,
|
||||
private DesecManager $desecManager,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -263,6 +265,9 @@ readonly class DockerController {
|
||||
// Stop domaincheck since apache would not be able to start otherwise
|
||||
$this->StopDomaincheckContainer();
|
||||
|
||||
// Refresh the deSEC DNS record with the current public IP before starting containers
|
||||
$this->desecManager->updateIpIfDesecDomain();
|
||||
|
||||
$id = self::TOP_CONTAINER;
|
||||
|
||||
$this->PerformRecursiveContainerStart($id, $pullImage, $addToStreamingResponseBody);
|
||||
@@ -328,11 +333,6 @@ readonly class DockerController {
|
||||
return $nonbufResp;
|
||||
}
|
||||
|
||||
public function DeleteBorgBackupConfig(Request $request, Response $response, array $args) : Response {
|
||||
$this->dockerActionManager->deleteBorgBackupConfig();
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
}
|
||||
|
||||
public function SystemPrune(Request $request, Response $response, array $args) : Response {
|
||||
// Get streaming response start and closure
|
||||
$nonbufResp = $this->startStreamingResponse($response);
|
||||
|
||||
17
php/src/Cron/UpdateDesecIp.php
Normal file
17
php/src/Cron/UpdateDesecIp.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
// increase memory limit to 2GB
|
||||
ini_set('memory_limit', '2048M');
|
||||
|
||||
// Log whole log messages
|
||||
ini_set('log_errors_max_len', '0');
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$container = \AIO\DependencyInjection::GetContainer();
|
||||
|
||||
/** @var \AIO\Desec\DesecManager $desecManager */
|
||||
$desecManager = $container->get(\AIO\Desec\DesecManager::class);
|
||||
|
||||
$desecManager->updateIpIfDesecDomain();
|
||||
@@ -5,11 +5,11 @@ namespace AIO\Data;
|
||||
|
||||
use AIO\Auth\PasswordGenerator;
|
||||
use AIO\Controller\DockerController;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\TransferException;
|
||||
|
||||
class ConfigurationManager
|
||||
{
|
||||
public const string DEDYN_SUFFIX = '.dedyn.io';
|
||||
|
||||
private array $secrets = [];
|
||||
|
||||
private array $config = [];
|
||||
@@ -200,6 +200,43 @@ class ConfigurationManager
|
||||
set { $this->set('turn_domain', $value); }
|
||||
}
|
||||
|
||||
public string $desecEmail {
|
||||
get => $this->get('desec_email', '');
|
||||
set { $this->set('desec_email', $value); }
|
||||
}
|
||||
|
||||
public string $desecToken {
|
||||
get {
|
||||
$s = $this->get('secrets', []);
|
||||
return isset($s['DESEC_TOKEN']) && is_string($s['DESEC_TOKEN']) ? $s['DESEC_TOKEN'] : '';
|
||||
}
|
||||
set {
|
||||
$s = $this->get('secrets', []);
|
||||
$s['DESEC_TOKEN'] = $value;
|
||||
$this->set('secrets', $s);
|
||||
}
|
||||
}
|
||||
|
||||
public string $desecPassword {
|
||||
get {
|
||||
$s = $this->get('secrets', []);
|
||||
return isset($s['DESEC_PASSWORD']) && is_string($s['DESEC_PASSWORD']) ? $s['DESEC_PASSWORD'] : '';
|
||||
}
|
||||
set {
|
||||
$s = $this->get('secrets', []);
|
||||
$s['DESEC_PASSWORD'] = $value;
|
||||
$this->set('secrets', $s);
|
||||
}
|
||||
}
|
||||
|
||||
public function isDesecDomain(): bool {
|
||||
return str_ends_with($this->domain, self::DEDYN_SUFFIX) && $this->desecToken !== '';
|
||||
}
|
||||
|
||||
public function isDesecAccountRegistered(): bool {
|
||||
return $this->desecToken !== '' && $this->desecEmail !== '' && $this->domain === '';
|
||||
}
|
||||
|
||||
public string $apachePort {
|
||||
get => $this->getEnvironmentalVariableOrConfig('APACHE_PORT', 'apache_port', '443');
|
||||
set { $this->set('apache_port', $value); }
|
||||
@@ -255,11 +292,6 @@ class ConfigurationManager
|
||||
set { $this->set('docker_socket_path', $value); }
|
||||
}
|
||||
|
||||
public string $aioLogLevel {
|
||||
get => $this->getEnvironmentalVariableOrConfig('AIO_LOG_LEVEL', 'aio_log_level', 'warn');
|
||||
set { $this->set('aio_log_level', $value); }
|
||||
}
|
||||
|
||||
public string $trustedCacertsDir {
|
||||
get => $this->getEnvironmentalVariableOrConfig('NEXTCLOUD_TRUSTED_CACERTS_DIR', 'trusted_cacerts_dir', '');
|
||||
set { $this->set('trusted_cacerts_dir', $value); }
|
||||
@@ -537,22 +569,23 @@ class ConfigurationManager
|
||||
}
|
||||
|
||||
// Check if response is correct
|
||||
$testUrl = $protocol . $domain . ':443';
|
||||
$errorMessage = '';
|
||||
$guzzleClient = new Client(['connect_timeout' => 10, 'timeout' => 10, 'http_errors' => false]);
|
||||
try {
|
||||
$guzzleResponse = $guzzleClient->get($testUrl);
|
||||
# Get rid of trailing \n
|
||||
$response = str_replace("\n", "", (string)$guzzleResponse->getBody());
|
||||
} catch (TransferException $e) {
|
||||
$response = '';
|
||||
$errorMessage = 'The error message was: ' . $e->getMessage();
|
||||
$ch = curl_init();
|
||||
if ($ch === false) {
|
||||
throw new InvalidSettingConfigurationException('Could not init curl! Please check the logs!');
|
||||
}
|
||||
$testUrl = $protocol . $domain . ':443';
|
||||
curl_setopt($ch, CURLOPT_URL, $testUrl);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
||||
$response = (string)curl_exec($ch);
|
||||
# Get rid of trailing \n
|
||||
$response = str_replace("\n", "", $response);
|
||||
|
||||
if ($response !== $instanceID) {
|
||||
error_log('The response of the connection attempt to "' . $testUrl . '" was: ' . $response);
|
||||
error_log('Expected was: ' . $instanceID);
|
||||
error_log($errorMessage);
|
||||
error_log('The error message was: ' . curl_error($ch));
|
||||
$notice = "Domain does not point to this server or the reverse proxy is not configured correctly. See the mastercontainer logs for more details. ('sudo docker logs -f nextcloud-aio-mastercontainer')";
|
||||
if ($port === '443') {
|
||||
$notice .= " If you should be using Cloudflare, make sure to disable the Cloudflare Proxy feature as it might block the domain validation. Same for any other firewall or service that blocks unencrypted access on port 443.";
|
||||
@@ -1071,7 +1104,6 @@ class ConfigurationManager
|
||||
'NC_DOMAIN' => $this->domain,
|
||||
'NC_BASE_DN' => $this->getBaseDN(),
|
||||
'AIO_TOKEN' => $this->aioToken,
|
||||
'AIO_LOG_LEVEL' => $this->aioLogLevel,
|
||||
'BORGBACKUP_REMOTE_REPO' => $this->borgRemoteRepo,
|
||||
'BORGBACKUP_MODE' => $this->backupMode,
|
||||
'AIO_URL' => $this->aioUrl,
|
||||
@@ -1116,6 +1148,7 @@ class ConfigurationManager
|
||||
'CADDY_IP_ADDRESS' => in_array('caddy', $this->aioCommunityContainers, true) ? gethostbyname('nextcloud-aio-caddy') : '',
|
||||
'WHITEBOARD_ENABLED' => $this->isWhiteboardEnabled ? 'yes' : '',
|
||||
'AIO_VERSION' => $this->getAioVersion(),
|
||||
'DESEC_TOKEN' => $this->desecToken,
|
||||
default => $this->getRegisteredSecret($placeholder),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -35,6 +35,12 @@ class DependencyInjection
|
||||
$container->get(GitHubContainerRegistryManager::class)
|
||||
)
|
||||
);
|
||||
$container->set(
|
||||
\AIO\Desec\DesecManager::class,
|
||||
new \AIO\Desec\DesecManager(
|
||||
$container->get(\AIO\Data\ConfigurationManager::class),
|
||||
)
|
||||
);
|
||||
$container->set(
|
||||
\AIO\Auth\PasswordGenerator::class,
|
||||
new \AIO\Auth\PasswordGenerator()
|
||||
|
||||
310
php/src/Desec/DesecManager.php
Normal file
310
php/src/Desec/DesecManager.php
Normal file
@@ -0,0 +1,310 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace AIO\Desec;
|
||||
|
||||
use AIO\Data\ConfigurationManager;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\TransferException;
|
||||
|
||||
class DesecManager {
|
||||
private const string DESEC_API_BASE = 'https://desec.io/api/v1';
|
||||
private const int MAX_SLUG_ATTEMPTS = 5;
|
||||
private const int SLUG_BYTES = 5; // bin2hex → 10-char slug
|
||||
private const string SLUG_PATTERN = '/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/';
|
||||
|
||||
private Client $guzzleClient;
|
||||
|
||||
public function __construct(
|
||||
private readonly ConfigurationManager $configurationManager,
|
||||
) {
|
||||
$this->guzzleClient = new Client([
|
||||
'timeout' => 15,
|
||||
'connect_timeout' => 10,
|
||||
'http_errors' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Full registration flow: validates inputs, creates an account if needed,
|
||||
* registers the domain, enables required containers, and updates the DNS record.
|
||||
*
|
||||
* When $password is non-empty the user is logging into an existing deSEC account
|
||||
* rather than creating a new one. When $password is empty a new account is created
|
||||
* with a randomly generated password (unless an account was already registered in a
|
||||
* previous attempt).
|
||||
*
|
||||
* @throws \Exception on any validation or API error
|
||||
*/
|
||||
public function register(string $email, string $slug, string $password = ''): void {
|
||||
if ($this->configurationManager->domain !== '') {
|
||||
throw new \Exception('A domain is already configured. Reset the AIO instance first to register a new domain.');
|
||||
}
|
||||
|
||||
$accountAlreadyRegistered = $this->configurationManager->isDesecAccountRegistered();
|
||||
$token = $accountAlreadyRegistered
|
||||
? $this->configurationManager->desecToken
|
||||
: null;
|
||||
|
||||
$validatedSlug = $this->validateSlug($slug);
|
||||
|
||||
if (!$accountAlreadyRegistered) {
|
||||
$validatedEmail = $this->validateEmail($email);
|
||||
$validatedPassword = trim($password);
|
||||
|
||||
if ($validatedPassword !== '') {
|
||||
// The user supplied their existing deSEC password — log in instead of registering.
|
||||
// Store an empty password: the token is all we need; the user's password must not be persisted.
|
||||
$token = $this->loginAccount($validatedEmail, $validatedPassword);
|
||||
$this->saveAccountCredentials($token, '', $validatedEmail);
|
||||
} else {
|
||||
// 24 random bytes → 48-char hex password; satisfies deSEC's minimum length
|
||||
// and lets the user log in at desec.io if they ever need to.
|
||||
$generatedPassword = bin2hex(random_bytes(24));
|
||||
$token = $this->registerAccount($validatedEmail, $generatedPassword);
|
||||
$this->saveAccountCredentials($token, $generatedPassword, $validatedEmail);
|
||||
}
|
||||
}
|
||||
|
||||
$isNewAccount = !$accountAlreadyRegistered && trim($password) === '';
|
||||
|
||||
$domain = $this->registerDomain($token, $validatedSlug);
|
||||
|
||||
if ($isNewAccount) {
|
||||
$this->createWildcardCname($token, $domain);
|
||||
}
|
||||
|
||||
$this->enableDesecContainers();
|
||||
$this->configurationManager->setDomain($domain, true);
|
||||
$this->updateIpIfDesecDomain();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates an email address string.
|
||||
*
|
||||
* @throws \Exception if the email is empty or syntactically invalid
|
||||
*/
|
||||
private function validateEmail(string $email): string {
|
||||
$email = trim($email);
|
||||
if ($email === '' || filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
|
||||
throw new \Exception('Please provide a valid email address.');
|
||||
}
|
||||
return $email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates an optional subdomain slug.
|
||||
* Returns an empty string when the caller wants a randomly generated slug.
|
||||
*
|
||||
* @throws \Exception if the slug is non-empty but does not match the allowed pattern
|
||||
*/
|
||||
private function validateSlug(string $slug): string {
|
||||
$slug = trim($slug);
|
||||
if ($slug !== '' && !preg_match(self::SLUG_PATTERN, $slug)) {
|
||||
throw new \Exception(
|
||||
'The desired subdomain must contain only lowercase letters, digits and hyphens, '
|
||||
. 'be between 1 and 63 characters long, and must not start or end with a hyphen.'
|
||||
);
|
||||
}
|
||||
return $slug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new deSEC account and returns the API token issued for it.
|
||||
*
|
||||
* @throws \Exception on network failure or an unexpected HTTP response
|
||||
*/
|
||||
public function registerAccount(string $email, string $password): string {
|
||||
try {
|
||||
$res = $this->guzzleClient->post(self::DESEC_API_BASE . '/auth/', [
|
||||
'json' => ['email' => $email, 'password' => $password],
|
||||
]);
|
||||
} catch (TransferException $e) {
|
||||
throw new \Exception('Could not reach the deSEC API: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
$code = $res->getStatusCode();
|
||||
$body = $res->getBody()->getContents();
|
||||
|
||||
if ($code === 400) {
|
||||
$data = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
|
||||
if (is_array($data) && isset($data['email'])) {
|
||||
throw new \Exception(
|
||||
'This email address is already registered at deSEC. '
|
||||
. 'If this is your account, please enter your deSEC password in the password field and try again.',
|
||||
);
|
||||
}
|
||||
throw new \Exception('Registration at deSEC failed (HTTP 400): ' . $body);
|
||||
}
|
||||
|
||||
if ($code !== 201) {
|
||||
throw new \Exception('Unexpected response from deSEC during account registration (HTTP ' . $code . '): ' . $body);
|
||||
}
|
||||
|
||||
$data = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
|
||||
if (!is_array($data) || !isset($data['token']['token']) || !is_string($data['token']['token'])) {
|
||||
throw new \Exception('Could not extract the API token from the deSEC response. Please try again.');
|
||||
}
|
||||
|
||||
return $data['token']['token'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticates with an existing deSEC account and returns the API token issued for it.
|
||||
*
|
||||
* @throws \Exception on invalid credentials, network failure, or an unexpected HTTP response
|
||||
*/
|
||||
public function loginAccount(string $email, string $password): string {
|
||||
try {
|
||||
$res = $this->guzzleClient->post(self::DESEC_API_BASE . '/auth/login/', [
|
||||
'json' => ['email' => $email, 'password' => $password],
|
||||
]);
|
||||
} catch (TransferException $e) {
|
||||
throw new \Exception('Could not reach the deSEC API: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
$code = $res->getStatusCode();
|
||||
$body = $res->getBody()->getContents();
|
||||
|
||||
if ($code === 400 || $code === 403) {
|
||||
throw new \Exception('Could not log in to deSEC: invalid email address or password.');
|
||||
}
|
||||
|
||||
if ($code !== 200 && $code !== 201) {
|
||||
throw new \Exception('Unexpected response from deSEC during login (HTTP ' . $code . '): ' . $body);
|
||||
}
|
||||
|
||||
$data = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
|
||||
if (!is_array($data) || !isset($data['token']) || !is_string($data['token'])) {
|
||||
throw new \Exception('Could not extract the API token from the deSEC login response. Please try again.');
|
||||
}
|
||||
|
||||
return $data['token'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a dedyn.io domain for the authenticated account.
|
||||
* When $slug is empty a random 10-character slug is tried up to MAX_SLUG_ATTEMPTS times.
|
||||
*
|
||||
* @return string the fully-qualified domain name that was registered
|
||||
* @throws \Exception if the slug is taken, on network failure, or after exhausting random attempts
|
||||
*/
|
||||
public function registerDomain(string $token, string $slug): string {
|
||||
$random = $slug === '';
|
||||
$attempts = $random ? self::MAX_SLUG_ATTEMPTS : 1;
|
||||
|
||||
for ($i = 0; $i < $attempts; $i++) {
|
||||
$domain = ($random ? bin2hex(random_bytes(self::SLUG_BYTES)) : $slug) . ConfigurationManager::DEDYN_SUFFIX;
|
||||
|
||||
try {
|
||||
$res = $this->guzzleClient->post(self::DESEC_API_BASE . '/domains/', [
|
||||
'headers' => ['Authorization' => 'Token ' . $token],
|
||||
'json' => ['name' => $domain],
|
||||
]);
|
||||
} catch (TransferException $e) {
|
||||
throw new \Exception('Could not reach the deSEC API: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
$code = $res->getStatusCode();
|
||||
|
||||
if ($code === 201) {
|
||||
return $domain;
|
||||
}
|
||||
|
||||
if ($code === 409) {
|
||||
if (!$random) {
|
||||
throw new \Exception('"' . $domain . '" is already taken. Please choose a different subdomain and try again.');
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
throw new \Exception('Unexpected response from deSEC during domain registration (HTTP ' . $code . '): ' . $res->getBody()->getContents());
|
||||
}
|
||||
|
||||
throw new \Exception('Could not register a free dedyn.io domain after ' . self::MAX_SLUG_ATTEMPTS . ' attempts. Please try again.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a wildcard CNAME rrset (*.domain → domain.) for a newly registered domain.
|
||||
* Errors are logged but do not abort the overall registration.
|
||||
*/
|
||||
private function createWildcardCname(string $token, string $domain): void {
|
||||
try {
|
||||
$res = $this->guzzleClient->post(self::DESEC_API_BASE . '/domains/' . $domain . '/rrsets/', [
|
||||
'headers' => ['Authorization' => 'Token ' . $token],
|
||||
'json' => [
|
||||
'subname' => '*',
|
||||
'type' => 'CNAME',
|
||||
'ttl' => 3600,
|
||||
'records' => [$domain . '.'],
|
||||
],
|
||||
]);
|
||||
} catch (TransferException $e) {
|
||||
error_log('Could not create wildcard CNAME for ' . $domain . ': ' . $e->getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
$code = $res->getStatusCode();
|
||||
if ($code !== 201) {
|
||||
error_log('Unexpected response when creating wildcard CNAME for ' . $domain . ' (HTTP ' . $code . '): ' . $res->getBody()->getContents());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Persists deSEC account credentials to the AIO configuration atomically.
|
||||
*/
|
||||
public function saveAccountCredentials(string $token, string $password, string $email): void {
|
||||
$this->configurationManager->startTransaction();
|
||||
$this->configurationManager->desecToken = $token;
|
||||
$this->configurationManager->desecPassword = $password;
|
||||
$this->configurationManager->desecEmail = $email;
|
||||
$this->configurationManager->commitTransaction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures the caddy and dnsmasq community containers are enabled.
|
||||
*/
|
||||
public function enableDesecContainers(): void {
|
||||
$this->configurationManager->startTransaction();
|
||||
$enabled = array_values(array_filter(
|
||||
$this->configurationManager->aioCommunityContainers,
|
||||
fn(string $cc): bool => $cc !== '',
|
||||
));
|
||||
if (!in_array('caddy', $enabled, true)) {
|
||||
$enabled[] = 'caddy';
|
||||
}
|
||||
if (!in_array('dnsmasq', $enabled, true)) {
|
||||
$enabled[] = 'dnsmasq';
|
||||
}
|
||||
$this->configurationManager->aioCommunityContainers = $enabled;
|
||||
$this->configurationManager->commitTransaction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the deSEC dynamic-DNS record with the current public IP.
|
||||
* Does nothing when the configured domain is not a deSEC-managed dedyn.io domain.
|
||||
*/
|
||||
public function updateIpIfDesecDomain(): void {
|
||||
if (!$this->configurationManager->isDesecDomain()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$domain = $this->configurationManager->domain;
|
||||
$token = $this->configurationManager->desecToken;
|
||||
|
||||
try {
|
||||
$res = $this->guzzleClient->get('https://update.dedyn.io/', [
|
||||
'query' => ['hostname' => $domain],
|
||||
'headers' => ['Authorization' => 'Token ' . $token],
|
||||
]);
|
||||
$status = trim($res->getBody()->getContents());
|
||||
if (str_starts_with($status, 'good') || str_starts_with($status, 'nochg')) {
|
||||
error_log('deSEC IP update for ' . $domain . ': ' . $status);
|
||||
} else {
|
||||
error_log('deSEC IP update for ' . $domain . ' returned unexpected response: ' . $status);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
error_log('Could not update deSEC DNS record for ' . $domain . ': ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,27 +145,6 @@ readonly class DockerActionManager {
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteBorgBackupConfig(): void {
|
||||
// Delete the borgbackup container
|
||||
$id = 'nextcloud-aio-borgbackup';
|
||||
$borgbackupContainer = $this->containerDefinitionFetcher->GetContainerById($id);
|
||||
$this->DeleteContainer($borgbackupContainer);
|
||||
|
||||
// Delete the borg cache volume
|
||||
$url = $this->BuildApiUrl('volumes/nextcloud_aio_backup_cache');
|
||||
try {
|
||||
$this->guzzleClient->delete($url);
|
||||
error_log('nextcloud_aio_backup_cache volume deleted successfully.');
|
||||
} catch (RequestException $e) {
|
||||
if ($e->getCode() !== 404) {
|
||||
error_log('Could not delete nextcloud_aio_backup_cache volume: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// Clear the configuration variables and files
|
||||
$this->configurationManager->deleteBorgBackupLocationItems();
|
||||
}
|
||||
|
||||
public function GetLogs(string $id, string $since = ''): string {
|
||||
$url = $this->BuildApiUrl(
|
||||
sprintf(
|
||||
@@ -888,7 +867,15 @@ readonly class DockerActionManager {
|
||||
// Add a secondary alias for domaincheck container, to keep it as similar to actual apache controller as possible.
|
||||
// If a reverse-proxy is relying on container name as hostname this allows it to operate as usual and still validate the domain
|
||||
// The domaincheck container and apache container are never supposed to be active at the same time because they use the same APACHE_PORT anyway, so this doesn't add any new constraints.
|
||||
$alias = ($container->identifier === 'nextcloud-aio-domaincheck') ? 'nextcloud-aio-apache' : '';
|
||||
if ($container->identifier === 'nextcloud-aio-domaincheck') {
|
||||
$alias = 'nextcloud-aio-apache';
|
||||
}
|
||||
|
||||
// Add NC_DOMAIN as a Docker network alias so that intra-network traffic for the Nextcloud
|
||||
// domain is forwarded directly to the aio-caddy container without leaving the Docker network.
|
||||
if ($container->identifier === 'nextcloud-aio-caddy') {
|
||||
$alias = $this->configurationManager->domain;
|
||||
}
|
||||
|
||||
$this->ConnectContainerIdToNetwork($container->identifier, $container->internalPorts, alias: $alias);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<script type="text/javascript" src="second-tab-warning.js"></script>
|
||||
|
||||
{# timezone-prefill #}
|
||||
<script type="text/javascript" src="timezone.js?v1"></script>
|
||||
<script type="text/javascript" src="timezone.js"></script>
|
||||
|
||||
{# js for optional containers and additional containers forms #}
|
||||
<script type="text/javascript" src="containers-form-submit.js?v7"></script>
|
||||
@@ -123,7 +123,7 @@
|
||||
<p>Make sure that this server is reachable on port 443 (port 443/tcp is open/forwarded in your firewall/router and 443/udp as well if you want to enable http3) and that you've correctly set up the DNS config for the domain that you enter (set the A record to your public ipv4-address and if you need ipv6, set the AAAA record to your public ipv6-address. A CNAME record is, of course, also possible). You should see hints on what went wrong in the top right corner if your domain is not accepted.</p>
|
||||
<details>
|
||||
<summary>Click here for further hints</summary>
|
||||
<p>If you do not have a domain yet, you can get one for free e.g. from duckdns.org and others. Recommended is to use <a target="_blank" href="https://github.com/nextcloud/all-in-one/discussions/6817">Tailscale</a></p>
|
||||
<p>If you do not have a domain yet, the easiest option is to use the <strong>deSEC free domain</strong> registration below. You can also get a free domain from duckdns.org or others, or use <a target="_blank" href="https://github.com/nextcloud/all-in-one/discussions/6817">Tailscale</a>.</p>
|
||||
<p>If you have a dynamic public IP-address, you can use e.g. <a target="_blank" href="https://ddclient.net/">DDclient</a> with a compatible domain provider for DNS updates.</p>
|
||||
<p>If you only want to install AIO locally without exposing it to the public internet or if you cannot do so, feel free to follow <a target="_blank" href="https://github.com/nextcloud/all-in-one/blob/main/local-instance.md">this documentation</a>.</p>
|
||||
<p>If you should be using Cloudflare Proxy for your domain, make sure to disable the Proxy feature temporarily as it might block the domain validation attempts.</p>
|
||||
@@ -132,6 +132,7 @@
|
||||
{% endif %}
|
||||
<p><strong>Hint:</strong> If the domain validation fails but you are completely sure that you've configured everything correctly, you may skip the domain validation by following <a target="_blank" href="https://github.com/nextcloud/all-in-one#how-to-skip-the-domain-validation">this documentation</a>.</p>
|
||||
</details>
|
||||
{% include 'includes/desec-register.twig' %}
|
||||
{% endif %}
|
||||
|
||||
<h2>Restore former AIO instance from backup</h2>
|
||||
@@ -375,6 +376,14 @@
|
||||
|
||||
{% if was_start_button_clicked == true %}
|
||||
|
||||
{% if is_desec_domain %}
|
||||
<h2>deSEC account credentials</h2>
|
||||
<p>Your domain <strong>{{ domain }}</strong> is managed via <a target="_blank" href="https://desec.io">deSEC</a>. Below are your deSEC account credentials. You can use them to log in at <a target="_blank" href="https://desec.io">desec.io</a> to manage your domain directly.</p>
|
||||
<p>Email: <strong>{{ desec_email }}</strong></p>
|
||||
<p>Password: <details style="display:inline"><summary>Reveal deSEC password</summary><strong>{{ desec_password }}</strong></details></p>
|
||||
<p>Please save these credentials in a safe place.</p>
|
||||
{% endif %}
|
||||
|
||||
{% if is_backup_section_enabled == false %}
|
||||
<h2>Backup and restore</h2>
|
||||
<p>The backup section is disabled via environmental variable.</p>
|
||||
@@ -566,7 +575,8 @@
|
||||
{% endif %}
|
||||
is wrong or if you want to reset the backup location due to other reasons, you can do so by clicking on the button below.
|
||||
</p>
|
||||
<form method="POST" action="api/docker/backup-reset-location" class="xhr">
|
||||
<form method="POST" action="api/configuration" class="xhr">
|
||||
<input type="hidden" name="delete_borg_backup_location_vars" value="yes"/>
|
||||
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
|
||||
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
|
||||
<input type="submit" value="Reset backup location" data-confirm='Are you sure that you want to reset the backup location?' />
|
||||
|
||||
@@ -1 +1 @@
|
||||
13.0.2
|
||||
13.0.0
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<h2>Community Containers</h2>
|
||||
<p>In this section you can enable or disable optional Community Containers that are not included by default in the main installation. These containers are provided by the community and can be useful for various purposes and are automatically integrated in AIOs backup solution and update mechanisms.</p>
|
||||
<p><strong>⚠️ Caution: </strong>Community Containers are maintained by the community and not officially by Nextcloud. Some containers may not be compatible with your system, may not work as expected or may discontinue. Use them at your own risk. Please read the documentation for each container first before adding any as some are also incompatible between each other! Never add all of them at the same time!</p>
|
||||
{% if is_desec_domain == true %}
|
||||
<p>ℹ️ Your Nextcloud domain (<strong>{{ domain }}</strong>) was registered via deSEC. The <strong>caddy</strong> community container has been automatically enabled as a reverse proxy and the <strong>dnsmasq</strong> container has been automatically enabled so that LAN devices can resolve your Nextcloud domain to the server's local IP address. Please <a target="_blank" href="https://github.com/nextcloud/all-in-one/tree/main/community-containers/dnsmasq"><strong>read the dnsmasq documentation</strong></a> for the required router change.</p>
|
||||
{% endif %}
|
||||
{% if isAnyRunning == true %}
|
||||
<p><strong>Please note:</strong> You can enable or disable the options below only when your containers are stopped.</p>
|
||||
{% else %}
|
||||
|
||||
26
php/templates/includes/desec-register.twig
Normal file
26
php/templates/includes/desec-register.twig
Normal file
@@ -0,0 +1,26 @@
|
||||
<details{% if desec_account_registered %} open{% endif %}>
|
||||
<summary>Don't have a domain? Get a free one from deSEC</summary>
|
||||
<p><a target="_blank" href="https://desec.io">deSEC</a> offers free dynamic DNS subdomains under <strong>dedyn.io</strong>. AIO can register an account and a subdomain for you automatically. The <strong>caddy</strong> community container will be enabled as a reverse proxy, the <strong>dnsmasq</strong> container will be enabled for local DNS resolution, and the mastercontainer will keep your DNS record up to date automatically.</p>
|
||||
{% if desec_account_registered %}
|
||||
<p>Your deSEC account (<strong>{{ desec_email }}</strong>) was registered successfully but the domain could not be registered. Please enter a desired subdomain slug (the part before <code>.dedyn.io</code>) and try again, or leave it blank for a random one.</p>
|
||||
<p>Your deSEC login credentials (for <a target="_blank" href="https://desec.io">desec.io</a>): Email: <strong>{{ desec_email }}</strong>. <details style="display:inline"><summary>Reveal deSEC password</summary><strong>{{ desec_password }}</strong></details>. Please save these in a safe place.</p>
|
||||
<form method="POST" action="api/desec/register" class="xhr">
|
||||
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
|
||||
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
|
||||
<input type="text" name="desec_slug" placeholder="my-nextcloud (optional)" pattern="[a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?" title="Only lowercase letters, digits and hyphens (1–63 characters). No leading or trailing hyphen." />
|
||||
<input type="submit" value="Register free domain via deSEC" />
|
||||
</form>
|
||||
{% else %}
|
||||
<p>Please enter your email address. You can also enter a desired subdomain slug (the part before <code>.dedyn.io</code>); leave it blank for a random one.</p>
|
||||
<p>If you already have a deSEC account for this email address, enter your deSEC password in the optional password field below to log in with it instead of creating a new account.</p>
|
||||
<form method="POST" action="api/desec/register" class="xhr">
|
||||
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
|
||||
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
|
||||
<input type="email" name="desec_email" placeholder="your@email.com" required />
|
||||
<input type="password" name="desec_password" placeholder="deSEC password (only if already registered)" autocomplete="current-password" />
|
||||
<input type="text" name="desec_slug" placeholder="my-nextcloud (optional)" pattern="[a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?" title="Only lowercase letters, digits and hyphens (1–63 characters). No leading or trailing hyphen." />
|
||||
<input type="submit" value="Register free domain via deSEC" />
|
||||
</form>
|
||||
<p><strong>Note:</strong> By submitting this form you agree to the <a target="_blank" href="https://desec.io/terms">deSEC terms of service</a>. The registered domain and your deSEC account credentials are stored in the AIO configuration. After registration, set your router's DHCP DNS server to this machine's local IP address so LAN devices resolve the domain locally (see the <a target="_blank" href="https://github.com/nextcloud/all-in-one/tree/main/community-containers/dnsmasq">dnsmasq documentation</a>). Alternatively adjust the hosts files on your clients so that they can reach the server using the local ip-address.</p>
|
||||
{% endif %}
|
||||
</details>
|
||||
36
readme.md
36
readme.md
@@ -61,6 +61,7 @@ Included are:
|
||||
- [Mail server can be added](https://github.com/nextcloud/all-in-one#mail-server)
|
||||
- Nextcloud can be [accessed locally via the domain](https://github.com/nextcloud/all-in-one#how-can-i-access-nextcloud-locally)
|
||||
- Can [be installed locally](https://github.com/nextcloud/all-in-one/blob/main/local-instance.md) (if you don't want or cannot make the instance publicly reachable)
|
||||
- Free [deSEC](https://desec.io) dynamic-DNS domain (`*.dedyn.io`) can be registered directly from the AIO interface — no external domain needed
|
||||
- [IPv6-ready](https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md)
|
||||
- Can be used with [Docker rootless](https://github.com/nextcloud/all-in-one/blob/main/docker-rootless.md) (good for additional security)
|
||||
- Runs on all platforms Docker supports (e.g. also on Windows and Macos)
|
||||
@@ -248,6 +249,9 @@ https://your-domain-that-points-to-this-server.tld:8443
|
||||
|
||||
5. If you enable Nextcloud Talk, open port `3478/TCP` and `3478/UDP` in your firewall/router for the Talk (TURN) container.
|
||||
|
||||
> [!TIP]
|
||||
> Don't have a domain yet? AIO can register a free dynamic-DNS subdomain under `dedyn.io` for you via [deSEC](https://desec.io) — no external setup needed. Look for the **"Don't have a domain? Get a free one from deSEC"** section on the AIO interface when you are asked to enter your domain. AIO will automatically register the domain, keep the DNS record up to date, and enable the [Caddy](https://github.com/nextcloud/all-in-one/tree/main/community-containers/caddy) community container as a reverse proxy as well as the [dnsmasq](https://github.com/nextcloud/all-in-one/tree/main/community-containers/dnsmasq) container for local DNS resolution.
|
||||
|
||||
# FAQ
|
||||
- [TOC](#faq)
|
||||
- [Where can I find additional documentation?](#where-can-i-find-additional-documentation)
|
||||
@@ -261,6 +265,7 @@ https://your-domain-that-points-to-this-server.tld:8443
|
||||
- [Notes on Cloudflare (proxy/tunnel)](#notes-on-cloudflare-proxytunnel)
|
||||
- [How to run Nextcloud behind a Cloudflare Tunnel?](#how-to-run-nextcloud-behind-a-cloudflare-tunnel)
|
||||
- [How to run Nextcloud via Tailscale?](#how-to-run-nextcloud-via-tailscale)
|
||||
- [How to get a free domain via deSEC?](#how-to-get-a-free-domain-via-desec)
|
||||
- [How to get Nextcloud running using the ACME DNS-challenge?](#how-to-get-nextcloud-running-using-the-acme-dns-challenge)
|
||||
- [How to run Nextcloud locally? No domain wanted, or wanting intranet access within your LAN.](#how-to-run-nextcloud-locally-no-domain-wanted-or-wanting-intranet-access-within-your-lan)
|
||||
- [Can I use an ip-address for Nextcloud instead of a domain?](#can-i-use-an-ip-address-for-nextcloud-instead-of-a-domain)
|
||||
@@ -283,7 +288,6 @@ https://your-domain-that-points-to-this-server.tld:8443
|
||||
- [Are there known problems when SELinux is enabled?](#are-there-known-problems-when-selinux-is-enabled)
|
||||
- [Customization](#customization)
|
||||
- [How to adjust the internally used docker api version?](#how-to-adjust-the-internally-used-docker-api-version)
|
||||
- [How to adjust the log level for AIO components?](#how-to-adjust-the-log-level-for-aio-components)
|
||||
- [How to change the default location of Nextcloud's Datadir?](#how-to-change-the-default-location-of-nextclouds-datadir)
|
||||
- [How to configure custom UID/GID?](#how-to-configure-custom-uidgid)
|
||||
- [How to move the appdata folder from the datadir to an ssd to improve the performance?](#how-to-move-the-appdata-folder-from-the-datadir-to-an-ssd-to-improve-the-performance)
|
||||
@@ -391,7 +395,7 @@ Only those (if you access the Mastercontainer Interface internally via port 8080
|
||||
- `3478/TCP` and `3478/UDP`: will be used by the Turnserver inside the Talk container and needs to be open/forwarded in your firewall/router
|
||||
|
||||
### Notes on Cloudflare (proxy/tunnel)
|
||||
Since Cloudflare Proxy/Tunnel comes with a lot of limitations which are listed below, it is rather recommended to switch to [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817) if possible.
|
||||
Since Cloudflare Proxy/Tunnel comes with a lot of limitations which are listed below, it is rather recommended to use the [built-in deSEC domain registration](#how-to-get-a-free-domain-via-desec) or switch to [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817) if possible.
|
||||
- Cloudflare Proxy and Cloudflare Tunnel both require Cloudflare to perform TLS termination on their side and thus decrypt all the traffic on their infrastructure. This is a privacy concern and you will need to look for other solutions if it's unacceptable for you.
|
||||
- Using Cloudflare Tunnel might potentially slow down Nextcloud since local access via the configured domain is not possible because TLS termination is in that case offloaded to Cloudflare's infrastructure. There is no way to disable this behavior in Cloudflare Tunnel.
|
||||
- It is known that the domain validation may not work correctly behind Cloudflare since Cloudflare might block the validation attempt. You can simply skip it in that case by following: https://github.com/nextcloud/all-in-one#how-to-skip-the-domain-validation
|
||||
@@ -411,6 +415,19 @@ Although it does not seems like it is the case but from AIO perspective a Cloudf
|
||||
### How to run Nextcloud via Tailscale?
|
||||
For a reverse proxy example guide for Tailscale, see this guide by [@Perseus333](https://github.com/Perseus333): https://github.com/nextcloud/all-in-one/discussions/6817
|
||||
|
||||
### How to get a free domain via deSEC?
|
||||
[deSEC](https://desec.io) offers free dynamic-DNS subdomains under `dedyn.io`. AIO integrates the registration process directly:
|
||||
|
||||
1. Open the AIO interface and expand the **"Don't have a domain? Get a free one from deSEC"** section on the domain-entry page.
|
||||
2. Enter your email address and, optionally, a desired subdomain slug (the part before `.dedyn.io`). Leave the slug blank for a random one.
|
||||
3. Click **Register free domain via deSEC**. AIO will create a deSEC account, register the subdomain and store the credentials in its configuration.
|
||||
|
||||
After successful registration:
|
||||
- AIO sets the registered `*.dedyn.io` domain as the Nextcloud domain automatically.
|
||||
- The [Caddy](https://github.com/nextcloud/all-in-one/tree/main/community-containers/caddy) community container is enabled as a reverse proxy.
|
||||
- The [dnsmasq](https://github.com/nextcloud/all-in-one/tree/main/community-containers/dnsmasq) community container is enabled so that LAN devices can resolve the domain to the server's local IP. Follow the [dnsmasq documentation](https://github.com/nextcloud/all-in-one/tree/main/community-containers/dnsmasq) for the required router change.
|
||||
- The mastercontainer keeps the DNS record up to date automatically when your public IP changes.
|
||||
|
||||
### How to get Nextcloud running using the ACME DNS-challenge?
|
||||
You can install AIO behind an external reverse proxy where is also documented how to get it running using the ACME DNS-challenge for getting a valid certificate for AIO. See the [reverse proxy documentation](./reverse-proxy.md). (Meant is the `Caddy with ACME DNS-challenge` section). Also see https://github.com/dani-garcia/vaultwarden/wiki/Running-a-private-vaultwarden-instance-with-Let%27s-Encrypt-certs#getting-a-custom-caddy-build for additional docs on this topic.
|
||||
|
||||
@@ -418,22 +435,22 @@ You can install AIO behind an external reverse proxy where is also documented ho
|
||||
If you do not want to open Nextcloud to the public internet, you may have a look at the following documentation on how to set it up locally: [local-instance.md](./local-instance.md), but keep in mind you're still required to have https working properly.
|
||||
|
||||
### Can I use an ip-address for Nextcloud instead of a domain?
|
||||
No and it will not be added. If you only want to run it locally, you may have a look at the following documentation: [local-instance.md](./local-instance.md). Recommended is to use [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817).
|
||||
No and it will not be added. If you only want to run it locally, you may have a look at the following documentation: [local-instance.md](./local-instance.md). Recommended is to use the [built-in deSEC domain registration](#how-to-get-a-free-domain-via-desec) to get a free domain automatically, or alternatively [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817).
|
||||
|
||||
### Can I run AIO offline or in an airgapped system?
|
||||
No. This is not possible and will not be added due to multiple reasons: update checks, app installs via app-store, downloading additional docker images on demand and more.
|
||||
|
||||
### Are self-signed certificates supported for Nextcloud?
|
||||
No and they will not be. If you want to run it locally, without opening Nextcloud to the public internet, please have a look at the [local instance documentation](./local-instance.md). Recommended is to use [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817).
|
||||
No and they will not be. If you want to run it locally, without opening Nextcloud to the public internet, please have a look at the [local instance documentation](./local-instance.md). Recommended is to use the [built-in deSEC domain registration](#how-to-get-a-free-domain-via-desec) to obtain a free domain with a valid certificate automatically, or alternatively [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817).
|
||||
|
||||
### Can I use AIO with multiple domains?
|
||||
No and it will not be added. However you can use [this feature](https://github.com/nextcloud/all-in-one/blob/main/multiple-instances.md) in order to create multiple AIO instances, one for each domain.
|
||||
|
||||
### Are other ports than the default 443 for Nextcloud supported?
|
||||
No and they will not be. If port 443 and/or 80 is blocked for you, you may use [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817) if you want to publish it online. If you already run a different service on port 443, please use a dedicated domain for Nextcloud and set it up correctly by following the [reverse proxy documentation](./reverse-proxy.md). However in all cases the Nextcloud interface will redirect you to port 443.
|
||||
No and they will not be. If port 443 and/or 80 is blocked for you, you may use the [built-in deSEC domain registration](#how-to-get-a-free-domain-via-desec) (which uses the Caddy community container on port 443) or [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817) if you want to publish it online. If you already run a different service on port 443, please use a dedicated domain for Nextcloud and set it up correctly by following the [reverse proxy documentation](./reverse-proxy.md). However in all cases the Nextcloud interface will redirect you to port 443.
|
||||
|
||||
### Can I run Nextcloud in a subdirectory on my domain?
|
||||
No and it will not be added. Please use a dedicated (sub-)domain for Nextcloud and set it up correctly by following the [reverse proxy documentation](./reverse-proxy.md). Alternatively, you may use [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817) if you want to publish it online.
|
||||
No and it will not be added. Please use a dedicated (sub-)domain for Nextcloud and set it up correctly by following the [reverse proxy documentation](./reverse-proxy.md). If you don't have a domain yet, use the [built-in deSEC domain registration](#how-to-get-a-free-domain-via-desec) to get one for free, or alternatively [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817).
|
||||
|
||||
### How can I access Nextcloud locally?
|
||||
Please note that local access is not possible if you are running AIO behind Cloudflare Tunnel since TLS proxying is in that case offloaded to Cloudflares infrastructure. You can fix this by setting up your own reverse proxy that handles TLS proxying locally and will make the steps below work.
|
||||
@@ -447,6 +464,8 @@ Now that this is out of the way, the recommended way how to access Nextcloud loc
|
||||
- https://dockerlabs.collabnix.com/intermediate/networking/Configuring_DNS.html
|
||||
Apart from that there is now a community container that can be added to the AIO stack: https://github.com/nextcloud/all-in-one/tree/main/community-containers/pi-hole
|
||||
|
||||
If you registered your domain via the built-in [deSEC integration](#how-to-get-a-free-domain-via-desec), the [dnsmasq](https://github.com/nextcloud/all-in-one/tree/main/community-containers/dnsmasq) community container is automatically enabled and resolves your Nextcloud domain to the server's local IP for LAN clients. You only need to point your router's DHCP DNS server to the AIO host — see the [dnsmasq documentation](https://github.com/nextcloud/all-in-one/tree/main/community-containers/dnsmasq) for details.
|
||||
|
||||
### How to overwrite the local DNS resolution for some domains or add extra hosts to the containers?
|
||||
|
||||
For some use cases, you might need to overwrite the local DNS resolution of some domains inside the containers. On Linux, you can do so either by using a local DNS server as described in the section above and add a local DNS entry into the dns server and make your containers use that DNS server.
|
||||
@@ -510,9 +529,6 @@ Yes. If SELinux is enabled, you might need to add the `--security-opt label:disa
|
||||
### How to adjust the internally used docker api version?
|
||||
If you run an outdated or too new docker version, you might run into problems with the by AIO internally used docker api version. To fix this, you can specify the api version manually. You can do so by adding `--env DOCKER_API_VERSION=1.44` to the docker run command of the mastercontainer (but before the last line `ghcr.io/nextcloud-releases/all-in-one:latest`! If it was started already, you will need to stop the mastercontainer, remove it (no data will be lost) and recreate it using the docker run command that you initially used). This variable excepts a string based on the pattern `[0-9].[0-9]+`, so e.g. `1.44`. ⚠️ However please note that only the default api version (unset this variable) is supported and tested by the maintainers of Nextcloud AIO. So use this on your own risk and things might break without warning.
|
||||
|
||||
### How to adjust the log level for AIO components?
|
||||
You can globally adjust the log level of the included AIO components by adding `--env AIO_LOG_LEVEL=warn` to the docker run command of the mastercontainer. This setting is propagated from the mastercontainer to the built-in sibling containers. If it was started already, you will need to stop the mastercontainer, remove it (no data will be lost) and recreate it using the docker run command or compose file that you initially used. For troubleshooting, `debug` and `info` may additionally re-enable some supervisord child stdout or stderr streams that are normally suppressed in order to keep the default logs concise. Allowed values are `error`, `warn`, `info` and `debug`.
|
||||
|
||||
### How to change the default location of Nextcloud's Datadir?
|
||||
> [!WARNING]
|
||||
> Do not set or adjust this value after the initial Nextcloud installation is done! If you still want to do it afterwards, see [this](https://github.com/nextcloud/all-in-one/discussions/890#discussioncomment-3089903) on how to do it.
|
||||
@@ -1287,7 +1303,7 @@ This project values stability over new features. That means that when a new majo
|
||||
AIO ships its own update notifications implementation. It checks if container updates are available. If so, it sends a notification with the title `Container updates available!` on saturdays to Nextcloud users that are part of the `admin` group. If the Nextcloud container image should be older than 90 days (~3 months) and thus badly outdated, AIO sends a notification to all Nextcloud users with the title `AIO is outdated!`. Thus admins should make sure to update the container images at least once every 3 months in order to make sure that the instance gets all security bugfixes as soon as possible.
|
||||
|
||||
### Huge docker logs
|
||||
If you should run into issues with huge docker logs, you can adjust the log size by following https://docs.docker.com/config/containers/logging/local/#usage. You can additionally reduce the verbosity of the included AIO containers by setting `AIO_LOG_LEVEL=error` on the mastercontainer. By default, AIO keeps the existing component-specific log defaults, so this should usually not be needed.
|
||||
If you should run into issues with huge docker logs, you can adjust the log size by following https://docs.docker.com/config/containers/logging/local/#usage. However for the included AIO containers, this should usually not be needed because almost all of them have the log level set to warn so they should not produce many logs.
|
||||
|
||||
<details>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This guide explains how to connect to Nextcloud AIO securely via HTTPS (TLS) usi
|
||||
|
||||
- **Integrated**: AIO's built-in reverse proxy with automatic HTTPS
|
||||
- **External**: An external reverse proxy (such as Caddy or Nginx or Cloudflare Proxy)
|
||||
- **Secure tunnel**: Tunneling services for private network access or public access without port forwarding (such as Tailscale Serve, Cloudflare Tunnel, or Pangolin)
|
||||
- **Secure tunnel**: Tunneling services for private network access or public access without port forwarding (such as Tailscale Serve or Cloudflare Tunnel)
|
||||
|
||||
## Choosing Your Approach
|
||||
|
||||
@@ -23,7 +23,6 @@ This guide explains how to connect to Nextcloud AIO securely via HTTPS (TLS) usi
|
||||
| **Integrated** | Simple setups, single service on port 443 | Public IP, dedicated port 443 | Yes (443) |
|
||||
| **External Reverse Proxy** (including Cloudflare Proxy) | Multiple services, existing web server, or users wanting DDoS protection | Existing reverse proxy, willingness to set one up, or Cloudflare account | Yes (443) |
|
||||
| **Cloudflare Tunnel** | No port forwarding possible/desired, public access | Cloudflare account | No |
|
||||
| **Pangolin** | No port forwarding possible/desired, public or private access, self-hostable tunnel | Pangolin Cloud account or self-hosted Pangolin server | No |
|
||||
| **Tailscale Serve** | Private access (tailnet only) | Tailscale account | No |
|
||||
| **Tailscale Funnel** | Public access via Tailscale | Tailscale account | No |
|
||||
|
||||
@@ -69,32 +68,29 @@ Using an existing external reverse proxy is required in particular if port `443/
|
||||
> [!NOTE]
|
||||
> An external reverse proxy can also facilitate other routing approaches, but Nextcloud AIO only supports having its own dedicated hostname (e.g., `cloud.example.com`). You cannot run it in a subfolder like `example.com/nextcloud/`.[^shared]
|
||||
|
||||
### Secure tunnel: Using AIO with a secure tunneling service (*Tailscale, Cloudflare, Pangolin*)
|
||||
### Secure tunnel: Using AIO with a secure tunneling service (*Tailscale, Cloudflare*)
|
||||
|
||||
Cloudflare, Tailscale, and Pangolin offer secure tunneling services that let you access your Nextcloud without opening ports on your firewall.
|
||||
Cloudflare and Tailscale offer secure tunneling services that let you access your Nextcloud without opening ports on your firewall.
|
||||
|
||||
#### Private network access
|
||||
|
||||
For Nextcloud AIO, you can use:
|
||||
- **Cloudflare Tunnel (`cloudflared`)** - Secure outbound-only tunnels that don't require exposing ports
|
||||
- **Tailscale Serve** - Expose services privately on your Tailscale network (tailnet only)
|
||||
- **Pangolin** - WireGuard-based outbound tunnels using the Newt connector; can be used for both private and public access
|
||||
|
||||
All three options provide private network access to your Nextcloud AIO instance.
|
||||
Both options provide private network access to your Nextcloud AIO instance.
|
||||
|
||||
#### Public Internet access (without port forwarding)
|
||||
|
||||
To make your Nextcloud AIO instance accessible from the public Internet (not just your private network), you can use:
|
||||
- **Cloudflare Tunnel** with public routes enabled (which combines Cloudflare Tunnel with Cloudflare's proxy features)
|
||||
- **Tailscale Funnel** - Expose services to the public Internet via Tailscale's infrastructure
|
||||
- **Pangolin** - Expose services publicly via Pangolin Cloud or a self-hosted Pangolin server
|
||||
|
||||
**Comparison of Cloudflare, Tailscale, and Pangolin options:**
|
||||
**Comparison of Cloudflare and Tailscale options:**
|
||||
|
||||
| Feature | Access Scope | Inbound Ports Required | Use Case |
|
||||
|---------|--------------|----------------|----------|
|
||||
| **Cloudflare Tunnel** | Public Internet | None | Public access without port forwarding |
|
||||
| **Pangolin** | Public Internet or private | None | Public or private access; self-hostable |
|
||||
| **Tailscale Serve** | Your Tailscale network only | None | Private access for you and invited users |
|
||||
| **Tailscale Funnel** | Public Internet | None | Public access through Tailscale |
|
||||
|
||||
@@ -108,7 +104,7 @@ To make your Nextcloud AIO instance accessible from the public Internet (not jus
|
||||
## Configuration and Deployment
|
||||
|
||||
> [!NOTE]
|
||||
> These instructions assume you already have a domain name pointing to your server's public IP address. If you don't have a domain yet, see the recommendations below.
|
||||
> These instructions assume you already have a domain name pointing to your server's public IP address. If you don't have a domain yet, AIO can register a free dynamic-DNS subdomain under `dedyn.io` for you via the built-in [deSEC integration](https://github.com/nextcloud/all-in-one#how-to-get-a-free-domain-via-desec) — no external setup needed. Alternatively, see the recommendations below.
|
||||
|
||||
### Quick overview
|
||||
|
||||
@@ -121,7 +117,7 @@ To run Nextcloud AIO behind an external reverse proxy or secure tunneling/proxyi
|
||||
The sections below provide detailed instructions for each step.
|
||||
|
||||
> [!TIP]
|
||||
> If you don't have a domain yet, we recommend using [an approach using Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817). If you don't have an external reverse proxy yet, we recommend [Caddy](https://github.com/nextcloud/all-in-one/discussions/575).
|
||||
> If you don't have a domain yet, AIO can register a free `*.dedyn.io` subdomain for you via [deSEC](https://desec.io) directly from the AIO interface — see [How to get a free domain via deSEC](https://github.com/nextcloud/all-in-one#how-to-get-a-free-domain-via-desec). This is the recommended option. Alternatively, you can use [Tailscale](https://github.com/nextcloud/all-in-one/discussions/6817). If you don't have an external reverse proxy yet, we recommend [Caddy](https://github.com/nextcloud/all-in-one/discussions/575).
|
||||
|
||||
### Step-by-Step Instructions
|
||||
|
||||
@@ -741,48 +737,6 @@ httpServer.on('upgrade', (req, socket, head) => {
|
||||
|
||||
</details>
|
||||
|
||||
##### Pangolin
|
||||
|
||||
<details>
|
||||
|
||||
<summary>click here to expand</summary>
|
||||
|
||||
[Pangolin](https://pangolin.net/) is an open-source, identity-based remote access platform built on WireGuard that enables secure connectivity to private resources without opening inbound firewall ports. It uses the **Newt** connector as an outbound-only WireGuard tunnel client that runs alongside AIO on your server and connects to a Pangolin server (either Pangolin Cloud or your own self-hosted instance). From AIO's perspective, Pangolin works like a reverse proxy: Pangolin handles TLS and routes public traffic through the tunnel to AIO.
|
||||
|
||||
**Requirements:**
|
||||
- A [Pangolin Cloud](https://app.pangolin.net/) account **or** a [self-hosted Pangolin server](https://docs.pangolin.net/self-host/quick-install)
|
||||
- No open inbound ports required
|
||||
|
||||
**Setup:**
|
||||
|
||||
1. **Set up Pangolin**: Either sign up for a free [Pangolin Cloud](https://app.pangolin.net/) account, or [self-host Pangolin](https://docs.pangolin.net/self-host/quick-install) on a VPS with a public IP address.
|
||||
|
||||
1. **Create a site**: In the Pangolin dashboard, create a new site for the machine that will run AIO. Follow the instructions to generate a **Newt ID** and **Newt secret** for the site.
|
||||
|
||||
1. **Deploy Newt on the AIO host**: Run the Newt connector on the same machine as AIO. You can deploy it as a Docker container alongside AIO:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
newt:
|
||||
image: fosrl/newt
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- PANGOLIN_ENDPOINT=https://app.pangolin.net # For Pangolin Cloud; replace with your self-hosted server URL if self-hosting
|
||||
- NEWT_ID=<your-newt-id>
|
||||
- NEWT_SECRET=<your-newt-secret>
|
||||
```
|
||||
|
||||
Or as a standalone binary — see the [Newt documentation](https://github.com/fosrl/newt) for details.
|
||||
|
||||
1. **Create a resource**: In the Pangolin dashboard, create a new resource for the site. Set the target to `http://private.ip.address.of.server:11000`.<br>
|
||||
⚠️ **Please note:** look into [this](#adapting-the-sample-web-server-configurations-below) to adapt the port and address to match your `APACHE_PORT` and `APACHE_IP_BINDING` settings.
|
||||
|
||||
1. **Configure AIO**: When starting AIO, add `--env SKIP_DOMAIN_VALIDATION=true` to disable domain validation (domain validation is known to not work through Pangolin tunnels). Use the domain assigned by Pangolin as your Nextcloud domain when opening the AIO interface.
|
||||
|
||||
1. Now continue with [point 2](#2-use-this-startup-command).
|
||||
|
||||
</details>
|
||||
|
||||
##### Synology Reverse Proxy
|
||||
|
||||
<details>
|
||||
|
||||
@@ -9,6 +9,13 @@ For the below to work, it is important that you have a domain that you point ont
|
||||
- [ ] Entering `10.0.0.1` should report that ip-addresses are not supported
|
||||
- [ ] Entering `nextcloud.com` should report that the domain does not point to this server
|
||||
- [ ] Entering the domain that does point to your server e.g. `yourdomain.com` should finally redirect you to the next screen (if you did not configure your domain yet or did not open port 443, it should report that to you)
|
||||
- [ ] Below the domain input box there should be a collapsed `<details>` element labelled **"Don't have a domain? Get a free one from deSEC"**
|
||||
- [ ] Expanding it should show a form with fields for email address and an optional subdomain slug, plus a **Register free domain via deSEC** submit button
|
||||
- [ ] Submitting with an empty email should show an error asking for a valid email address
|
||||
- [ ] Submitting with an invalid slug (e.g. `-bad-`) should show a validation error about the allowed slug format
|
||||
- [ ] Submitting with a valid email and no slug should register a random `*.dedyn.io` domain, set it as the Nextcloud domain and redirect to the next screen
|
||||
- [ ] After successful registration, the `caddy` and `dnsmasq` community containers should be listed as enabled in the Community Containers section
|
||||
- [ ] After successful registration, there should be a **deSEC account credentials** section in the AIO interface that shows the registered email and allows revealing the password
|
||||
- [ ] Now you should see a button `Start containers` and an explanation which points out that clicking on the button will start the containers and that this can take a long time.
|
||||
- [ ] Below that you should see a section `Optional addons` which shows a checkbox list with addons that can be enabled or disabled.
|
||||
- [ ] Collabora, Imaginary, Talk and Whiteboard should be enabled, the rest disabled
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
- [ ] Make also sure that reverse proxies work by following https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#reverse-proxy-documentation and following [001-initial-setup.md](./001-initial-setup.md) and [002-new-instance.md](./002-new-instance.md)
|
||||
- [ ] When starting the mastercontainer with `--env SKIP_DOMAIN_VALIDATION=true` on a clean instance, it should skip the domain verification. So it should accept any domain that you type in then.
|
||||
- [ ] When starting the mastercontainer with `--env DOCKER_API_VERSION=1.44` it should use the mentioned docker API version internally for all requests
|
||||
- [ ] When starting the mastercontainer with `--env AIO_LOG_LEVEL=info` on a clean instance, the resulting sibling containers should receive the propagated global log-level variable and the configured components should no longer use their default warning or error levels. This should at least be verified for the mastercontainer, Apache, Nextcloud, Redis and Talk containers. In addition, previously suppressed supervisord stdout or stderr logs should become visible for the affected components.
|
||||
- [ ] When starting the mastercontainer with an invalid `AIO_LOG_LEVEL` value like `warning` or `verbose`, the container startup should fail with a message that only `debug`, `info`, `warn` and `error` are allowed.
|
||||
- [ ] When starting the mastercontainer with `--env NEXTCLOUD_DATADIR="/mnt/testdata"` it should map that location from `/mnt/testdata` to `/mnt/ncdata` inside the Nextcloud container. Not having adjusted the permissions correctly before starting the Nextcloud container the first time will not allow the Nextcloud container to start correctly. See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir for allowed values.
|
||||
- [ ] When starting the mastercontainer with `--env NEXTCLOUD_MOUNT="/mnt/"` it should map `/mnt/` to `/mnt/` inside the Nextcloud container. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host for allowed values.
|
||||
- [ ] When starting the mastercontainer with `--env NEXTCLOUD_UPLOAD_LIMIT=11G` it should change Nextclouds upload limit to 11G. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-upload-limit-for-nextcloud for allowed values.
|
||||
|
||||
Reference in New Issue
Block a user