mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-21 10:50:10 +00:00
Compare commits
104 Commits
copilot/me
...
7281c9b7c8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7281c9b7c8 | ||
|
|
cb48bc5db0 | ||
|
|
83129d6a55 | ||
|
|
68df1dd857 | ||
|
|
7598f6534d | ||
|
|
a12f505dcd | ||
|
|
7a825f2025 | ||
|
|
6aa4f8d672 | ||
|
|
5b72d17438 | ||
|
|
7c5abc978d | ||
|
|
f23d8276ff | ||
|
|
39f30a6609 | ||
|
|
5cf4580a86 | ||
|
|
da88c7d25b | ||
|
|
f113f2c155 | ||
|
|
f1dacad6b3 | ||
|
|
30cb79bb62 | ||
|
|
c20bae5a0f | ||
|
|
e76ccf4f3c | ||
|
|
14dc5b7729 | ||
|
|
d46b222c4e | ||
|
|
5e0ee16b9e | ||
|
|
fadbdc5c78 | ||
|
|
f8274028ea | ||
|
|
e05bdaeca0 | ||
|
|
7699ac9c12 | ||
|
|
84d8d78106 | ||
|
|
546474346f | ||
|
|
54ca36ec46 | ||
|
|
8a5440134b | ||
|
|
177c093dd9 | ||
|
|
2eee2eac53 | ||
|
|
7bf5b18d5e | ||
|
|
9d33eb29d2 | ||
|
|
b2e02da46b | ||
|
|
954f250ac8 | ||
|
|
0cea791a64 | ||
|
|
49afd85adc | ||
|
|
9f6b0c2fe9 | ||
|
|
8de44cf6aa | ||
|
|
45a1cd73b6 | ||
|
|
304dc97ad6 | ||
|
|
0af87295a6 | ||
|
|
b71408af98 | ||
|
|
d6e4b83c51 | ||
|
|
563a047a9a | ||
|
|
7c40f57f36 | ||
|
|
f91d26115b | ||
|
|
180ea67cbb | ||
|
|
ce2b4c6b87 | ||
|
|
953a5fdf1e | ||
|
|
bce78168e4 | ||
|
|
7031310257 | ||
|
|
301f42d2a0 | ||
|
|
5fe6adc62a | ||
|
|
5c016d5d35 | ||
|
|
d7030396cb | ||
|
|
8a9c3c4512 | ||
|
|
49a24272f6 | ||
|
|
7bae058dbe | ||
|
|
66236c1a2e | ||
|
|
091fb8e814 | ||
|
|
ee4088744c | ||
|
|
ac38ea38b7 | ||
|
|
ada407751a | ||
|
|
845d08ba09 | ||
|
|
65a3244a2f | ||
|
|
7c8433d07a | ||
|
|
7e628b1200 | ||
|
|
8ebd624aa8 | ||
|
|
fceec6f23e | ||
|
|
ff86c6d066 | ||
|
|
ed672fb99c | ||
|
|
ef87e82f13 | ||
|
|
144c91ae02 | ||
|
|
5ead361c04 | ||
|
|
2b5998e57d | ||
|
|
3c17a6af36 | ||
|
|
a465baa259 | ||
|
|
457f7bfee9 | ||
|
|
aade77437c | ||
|
|
ccda322888 | ||
|
|
c428bc3b71 | ||
|
|
479f68d69e | ||
|
|
e1ae6444e5 | ||
|
|
47ee453719 | ||
|
|
e378f7faca | ||
|
|
4679c6c38d | ||
|
|
91e9e58c39 | ||
|
|
5624dde376 | ||
|
|
d0b0bde4c8 | ||
|
|
310429c5fd | ||
|
|
98a8861690 | ||
|
|
29bac9dbf9 | ||
|
|
7cd0450dae | ||
|
|
b5dad7927a | ||
|
|
fcc4d9502d | ||
|
|
80ea0c1151 | ||
|
|
fed44e0010 | ||
|
|
47733776b9 | ||
|
|
44148ba4a3 | ||
|
|
f99a59fb58 | ||
|
|
a79f637251 | ||
|
|
640b5b7d6d |
2
.github/workflows/fail-on-prerelease.yml
vendored
2
.github/workflows/fail-on-prerelease.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Check latest published release isn't a prerelease"
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v6
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v6
|
||||
with:
|
||||
script: |
|
||||
const tags = await github.rest.repos.listTags({
|
||||
|
||||
2
.github/workflows/helm-release.yml
vendored
2
.github/workflows/helm-release.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
||||
|
||||
# See https://github.com/helm/chart-releaser-action/issues/6
|
||||
- name: Set up Helm
|
||||
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4
|
||||
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
|
||||
with:
|
||||
version: v3.6.3
|
||||
|
||||
|
||||
2
.github/workflows/lint-helm.yml
vendored
2
.github/workflows/lint-helm.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Helm
|
||||
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4
|
||||
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
|
||||
with:
|
||||
version: v3.11.1
|
||||
|
||||
|
||||
2
.github/workflows/lint-yaml.yml
vendored
2
.github/workflows/lint-yaml.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
||||
line-length: warning
|
||||
|
||||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
||||
|
||||
- name: Check GitHub actions
|
||||
run: uvx zizmor --min-severity medium .github/workflows/*.yml
|
||||
|
||||
@@ -4,9 +4,9 @@ FROM alpine:3.23.4
|
||||
RUN set -ex; \
|
||||
apk upgrade --no-cache -a
|
||||
|
||||
LABEL org.opencontainers.image.title="Alpine for Nextcloud AIO"
|
||||
org.opencontainers.image.description="Minimal Alpine Linux base image for Nextcloud All-in-One"
|
||||
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"
|
||||
LABEL org.opencontainers.image.title="Alpine for Nextcloud AIO" \
|
||||
org.opencontainers.image.description="Minimal Alpine Linux image for Nextcloud All-in-One" \
|
||||
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/readme.md"
|
||||
|
||||
@@ -60,6 +60,19 @@ RUN set -ex; \
|
||||
grep -q '<IfModule mpm_event_module>' /usr/local/apache2/conf/extra/httpd-mpm.conf; \
|
||||
# ServerLimit needs to be set to MaxRequestWorkers divided by ThreadsPerChild which is set to 25 by default
|
||||
sed -i '/<IfModule mpm_event_module>/a\ \ \ \ ServerLimit 200' /usr/local/apache2/conf/extra/httpd-mpm.conf; \
|
||||
# Pin ThreadsPerChild so the value is deterministic regardless of the httpd base-image
|
||||
# defaults; 25 threads per process balances concurrency against per-process memory use.
|
||||
sed -i 's|ThreadsPerChild.*|ThreadsPerChild 25|' /usr/local/apache2/conf/extra/httpd-mpm.conf; \
|
||||
# Start two server processes on boot to absorb the first requests without spawning
|
||||
# new processes on the critical path, while avoiding unnecessary memory overhead.
|
||||
sed -i 's|StartServers.*|StartServers 2|' /usr/local/apache2/conf/extra/httpd-mpm.conf; \
|
||||
# Keep at least 25 idle threads (one full process worth) so traffic bursts can be
|
||||
# absorbed immediately without triggering new process creation.
|
||||
sed -i 's|MinSpareThreads.*|MinSpareThreads 25|' /usr/local/apache2/conf/extra/httpd-mpm.conf; \
|
||||
# Retire idle threads above 50 to reclaim memory during quiet periods. 50 is the
|
||||
# minimum valid value (MinSpareThreads + ThreadsPerChild = 25 + 25) and is enough
|
||||
# to absorb typical bursts without respawning a new process.
|
||||
sed -i 's|MaxSpareThreads.*|MaxSpareThreads 50|' /usr/local/apache2/conf/extra/httpd-mpm.conf; \
|
||||
\
|
||||
rm -rf /usr/local/apache2/conf/original /var/www; \
|
||||
mkdir -p /var/www; \
|
||||
|
||||
@@ -9,6 +9,34 @@ Listen 8000
|
||||
ErrorLogFormat "[%t] [%l] [%E] [client: %{X-Forwarded-For}i] [%M] [%{User-Agent}i]"
|
||||
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,
|
||||
# which is especially expensive on TLS connections and noticeably slows down
|
||||
# Nextcloud's login page and file manager that load dozens of resources at once.
|
||||
KeepAlive On
|
||||
# KeepAliveTimeout: close an idle keep-alive connection after 5 seconds.
|
||||
# A short timeout frees Apache worker threads quickly so they are available
|
||||
# for new requests; 5 s is long enough to cover the gap between requests
|
||||
# that a browser issues while rendering a page (typically < 1 s), yet short
|
||||
# enough to avoid holding threads open for idle or slow clients.
|
||||
KeepAliveTimeout 5
|
||||
# MaxKeepAliveRequests: allow at most 500 requests per persistent connection.
|
||||
# 100 (the Apache default) is too low for Nextcloud: the desktop and mobile
|
||||
# sync clients issue many small API calls (PROPFIND, GET, PUT, checksums …)
|
||||
# per sync cycle and routinely exceed 100 requests on a single connection.
|
||||
# Hitting the limit forces a new TCP/TLS handshake, adding latency and CPU
|
||||
# overhead. 500 gives sync clients enough headroom while still periodically
|
||||
# recycling threads to contain per-process memory growth.
|
||||
MaxKeepAliveRequests 500
|
||||
|
||||
# sendfile(2) is disabled because it bypasses Apache's output-filter chain: with
|
||||
# it enabled, mod_brotli is silently skipped for static files (JS, CSS, SVG),
|
||||
# negating the compression configured below. MMAP is also
|
||||
# disabled because files can be replaced by Nextcloud at any time and mmap'd
|
||||
# pages could serve stale data.
|
||||
EnableSendfile Off
|
||||
EnableMMAP Off
|
||||
|
||||
# PHP match
|
||||
<FilesMatch "\.php$">
|
||||
SetHandler "proxy:fcgi://${NEXTCLOUD_HOST}:9000"
|
||||
@@ -17,20 +45,25 @@ Listen 8000
|
||||
<Proxy "fcgi://${NEXTCLOUD_HOST}:9000" flushpackets=on>
|
||||
</Proxy>
|
||||
|
||||
# Enable Brotli compression for js, css and svg files - other plain files are compressed by Nextcloud by default
|
||||
# Compress JS, CSS and SVG responses with Brotli (quality 4 gives good
|
||||
# compression with reasonable CPU cost; the default of 0 barely compresses).
|
||||
# Other plain-text files are already compressed by Nextcloud itself.
|
||||
# No deflate fallback is needed: every browser that Nextcloud supports
|
||||
# (Chrome 49+, Firefox 44+, Safari 11+, Edge 15+ — all from 2016-2017)
|
||||
# supports Brotli. Internet Explorer, the only browser that never gained
|
||||
# Brotli support, was dropped by Nextcloud with NC15 (2019).
|
||||
# Desktop and mobile sync clients never request JS/CSS/SVG assets.
|
||||
<IfModule mod_brotli.c>
|
||||
AddOutputFilterByType BROTLI_COMPRESS text/javascript application/javascript application/x-javascript text/css image/svg+xml
|
||||
BrotliCompressionQuality 0
|
||||
BrotliCompressionQuality 4
|
||||
</IfModule>
|
||||
|
||||
# Nextcloud dir
|
||||
DocumentRoot /var/www/html/
|
||||
<Directory /var/www/html/>
|
||||
Options Indexes FollowSymLinks
|
||||
Options FollowSymLinks MultiViews
|
||||
Require all granted
|
||||
AllowOverride All
|
||||
Options FollowSymLinks MultiViews
|
||||
Satisfy Any
|
||||
<IfModule mod_dav.c>
|
||||
Dav off
|
||||
</IfModule>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
nodaemon=true
|
||||
logfile=/var/log/supervisord/supervisord.log
|
||||
pidfile=/var/run/supervisord/supervisord.pid
|
||||
childlogdir=/var/log/supervisord/
|
||||
|
||||
@@ -13,6 +13,15 @@ RUN set -ex; \
|
||||
sed -i "s|#\?PCREMaxFileSize.*|PCREMaxFileSize 2000M|g" /etc/clamav/clamd.conf; \
|
||||
# StreamMaxLength must be synced with av_stream_max_length inside the Nextcloud files_antivirus plugin
|
||||
sed -i "s|#\?StreamMaxLength.*|StreamMaxLength 2000M|g" /etc/clamav/clamd.conf; \
|
||||
# By default clamd keeps the old signature database in RAM while loading the new one,
|
||||
# briefly doubling memory usage (~1 GB extra) during each freshclam update cycle.
|
||||
# Setting ConcurrentDatabaseReload to "no" makes clamd unload the old database first,
|
||||
# eliminating that transient peak and significantly reducing maximum RAM consumption.
|
||||
sed -i "s|#\?ConcurrentDatabaseReload.*|ConcurrentDatabaseReload no|g" /etc/clamav/clamd.conf; \
|
||||
# The default thread pool is 10-12 threads, each reserving its own stack and scan buffers.
|
||||
# The Nextcloud antivirus plugin sends one file at a time, so 2 threads are sufficient
|
||||
# and avoids the idle per-thread memory overhead of the larger default pool.
|
||||
sed -i "s|#\?MaxThreads.*|MaxThreads 2|g" /etc/clamav/clamd.conf; \
|
||||
sed -i "s|#\?TCPSocket|TCPSocket|g" /etc/clamav/clamd.conf; \
|
||||
sed -i "s|^LocalSocket .*|LocalSocket /tmp/clamd.sock|g" /etc/clamav/clamd.conf; \
|
||||
sed -i "s|Example| |g" /etc/clamav/clamav-milter.conf; \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
nodaemon=true
|
||||
logfile=/var/log/supervisord/supervisord.log
|
||||
pidfile=/var/run/supervisord/supervisord.pid
|
||||
childlogdir=/var/log/supervisord/
|
||||
|
||||
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,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
nc -z 127.0.0.1 9200 || exit 1
|
||||
curl -fs "http://127.0.0.1:9200/_cluster/health?filter_path=status" | grep -qE '"status":"(green|yellow)"' || exit 1
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Imaginary has started"
|
||||
if [ -z "$IMAGINARY_SECRET" ]; then
|
||||
imaginary -return-size -max-allowed-resolution 222.2 "$@"
|
||||
else
|
||||
imaginary -return-size -max-allowed-resolution 222.2 -key "$IMAGINARY_SECRET" "$@"
|
||||
|
||||
IMAGINARY_ARGS=(-return-size -max-allowed-resolution 222.2)
|
||||
|
||||
if [ -n "$IMAGINARY_SECRET" ]; then
|
||||
IMAGINARY_ARGS+=(-key "$IMAGINARY_SECRET")
|
||||
fi
|
||||
|
||||
exec imaginary "${IMAGINARY_ARGS[@]}" "$@"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# syntax=docker/dockerfile:latest
|
||||
# Docker CLI is a requirement
|
||||
FROM docker:29.4.0-cli AS docker
|
||||
FROM docker:29.4.1-cli AS docker
|
||||
|
||||
ARG CADDY_REMOTE_HOST_HASH=b21775afa730ffb52a24ddff310c8a6d1fd37276
|
||||
|
||||
@@ -53,6 +53,16 @@ RUN set -ex; \
|
||||
build-base; \
|
||||
pecl install APCu-5.1.28; \
|
||||
docker-php-ext-enable apcu; \
|
||||
{ \
|
||||
echo 'apc.shm_size=32M'; \
|
||||
} >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||
{ \
|
||||
echo 'opcache.enable=1'; \
|
||||
echo 'opcache.memory_consumption=32'; \
|
||||
echo 'opcache.interned_strings_buffer=8'; \
|
||||
echo 'opcache.max_accelerated_files=4000'; \
|
||||
echo 'opcache.validate_timestamps=0'; \
|
||||
} > /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini; \
|
||||
rm -r /tmp/pear; \
|
||||
runDeps="$( \
|
||||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
|
||||
|
||||
@@ -51,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
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ header {
|
||||
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=(), autoplay=(), battery=(), camera=(), display-capture=(), document-domain=(), encrypted-media=(), execution-while-not-rendered=(), execution-while-out-of-viewport=(), fullscreen=(), gamepad=(), geolocation=(), gyroscope=(), hid=(), identity-credentials-get=(), idle-detection=(), local-fonts=(), magnetometer=(), microphone=(), midi=(), otp-credentials=(), payment=(), picture-in-picture=(), publickey-credentials-create=(), publickey-credentials-get=(), screen-wake-lock=(), serial=(), speaker-selection=(), storage-access=(), usb=(), web-share=(), window-management=(), xr-spatial-tracking=()"
|
||||
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=()"
|
||||
|
||||
-Server
|
||||
-X-Powered-By
|
||||
|
||||
@@ -423,5 +423,11 @@ caddy fmt --overwrite /internal.Caddyfile
|
||||
# Fix caddy log
|
||||
chmod 777 /root
|
||||
|
||||
# Create Twig template cache directory (path must match TWIG_CACHE_PATH in php/public/index.php)
|
||||
mkdir -p /tmp/twig-cache
|
||||
rm -rf /tmp/twig-cache/*
|
||||
chown www-data:www-data /tmp/twig-cache
|
||||
chmod 770 /tmp/twig-cache
|
||||
|
||||
# Start supervisord
|
||||
exec /usr/bin/supervisord -c /supervisord.conf
|
||||
|
||||
@@ -114,18 +114,18 @@ RUN set -ex; \
|
||||
# set recommended PHP.ini settings
|
||||
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/server_tuning.html#enable-php-opcache and below
|
||||
{ \
|
||||
echo 'opcache.max_accelerated_files=10000'; \
|
||||
echo 'opcache.max_accelerated_files=20000'; \
|
||||
echo 'opcache.memory_consumption=256'; \
|
||||
echo 'opcache.interned_strings_buffer=64'; \
|
||||
echo 'opcache.save_comments=1'; \
|
||||
echo 'opcache.revalidate_freq=60'; \
|
||||
echo 'opcache.jit=1255'; \
|
||||
echo 'opcache.jit_buffer_size=8M'; \
|
||||
echo 'opcache.jit_buffer_size=128M'; \
|
||||
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||
\
|
||||
{ \
|
||||
echo 'apc.enable_cli=1'; \
|
||||
echo 'apc.shm_size=64M'; \
|
||||
echo 'apc.shm_size=128M'; \
|
||||
} >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||
\
|
||||
{ \
|
||||
@@ -135,14 +135,20 @@ RUN set -ex; \
|
||||
echo 'max_execution_time=${PHP_MAX_TIME}'; \
|
||||
echo 'max_input_time=-1'; \
|
||||
echo 'default_socket_timeout=${PHP_MAX_TIME}'; \
|
||||
echo 'output_buffering=0'; \
|
||||
echo 'realpath_cache_size=8M'; \
|
||||
echo 'realpath_cache_ttl=600'; \
|
||||
} > /usr/local/etc/php/conf.d/nextcloud.ini; \
|
||||
\
|
||||
{ \
|
||||
echo 'session.save_handler = redis'; \
|
||||
echo 'session.save_path = "tcp://${REDIS_HOST}:${REDIS_PORT}?database=${REDIS_DB_INDEX}${REDIS_USER_AUTH}&auth[]=${REDIS_HOST_PASSWORD}"'; \
|
||||
echo 'session.save_path = "tcp://${REDIS_HOST}:${REDIS_PORT}?database=${REDIS_DB_INDEX}${REDIS_USER_AUTH}&auth[]=${REDIS_HOST_PASSWORD}&timeout=3.0&read_timeout=10.0"'; \
|
||||
echo 'redis.session.locking_enabled = 1'; \
|
||||
echo 'redis.session.lock_retries = -1'; \
|
||||
echo 'redis.session.lock_wait_time = 10000'; \
|
||||
echo '; 100ms in microseconds - prevents timeout on long requests such as large file uploads'; \
|
||||
echo 'redis.session.lock_wait_time = 100000'; \
|
||||
echo '; prevents stale locks from crashed workers (seconds)'; \
|
||||
echo 'redis.session.lock_expire = 60'; \
|
||||
echo 'session.gc_maxlifetime = 86400'; \
|
||||
} > /usr/local/etc/php/conf.d/redis-session.ini; \
|
||||
\
|
||||
|
||||
@@ -16,6 +16,12 @@ $CONFIG = array (
|
||||
if (getenv('APPS_ALLOWLIST')) {
|
||||
$CONFIG['appsallowlist'] = explode(" ", getenv('APPS_ALLOWLIST'));
|
||||
}
|
||||
if (getenv('NEXTCLOUD_APP_STORE_URL')) {
|
||||
$CONFIG['appstoreurl'] = getenv('NEXTCLOUD_APP_STORE_URL');
|
||||
|
||||
$appStoreUrl = getenv('NEXTCLOUD_APP_STORE_URL');
|
||||
if ($appStoreUrl) {
|
||||
if ($appStoreUrl === 'no') {
|
||||
$CONFIG['appstoreenabled '] = false;
|
||||
} else {
|
||||
$CONFIG['appstoreurl'] = getenv('NEXTCLOUD_APP_STORE_URL');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ if (getenv('REDIS_MODE') !== 'rediscluster') {
|
||||
|
||||
if (getenv('REDIS_HOST')) {
|
||||
$CONFIG['redis']['host'] = (string) getenv('REDIS_HOST');
|
||||
$CONFIG['redis']['timeout'] = 3.0;
|
||||
$CONFIG['redis']['read_timeout'] = 10.0;
|
||||
}
|
||||
|
||||
if (getenv('REDIS_HOST_PASSWORD')) {
|
||||
@@ -21,6 +23,10 @@ if (getenv('REDIS_MODE') !== 'rediscluster') {
|
||||
$CONFIG['redis']['dbindex'] = (int) getenv('REDIS_DB_INDEX');
|
||||
}
|
||||
|
||||
if (getenv('REDIS_PREFIX')) {
|
||||
$CONFIG['redis']['memcache_customprefix'] = getenv('REDIS_PREFIX');
|
||||
}
|
||||
|
||||
if (getenv('REDIS_USER_AUTH')) {
|
||||
$CONFIG['redis']['user'] = str_replace("&auth[]=", "", getenv('REDIS_USER_AUTH'));
|
||||
}
|
||||
@@ -58,6 +64,10 @@ if (getenv('REDIS_MODE') !== 'rediscluster') {
|
||||
$CONFIG['redis.cluster']['user'] = str_replace("&auth[]=", "", getenv('REDIS_USER_AUTH'));
|
||||
}
|
||||
|
||||
if (getenv('REDIS_PREFIX')) {
|
||||
$CONFIG['redis.cluster']['memcache_customprefix'] = getenv('REDIS_PREFIX');
|
||||
}
|
||||
|
||||
if (getenv('NEXTCLOUD_TRUSTED_CERTIFICATES_REDIS')) {
|
||||
$CONFIG['redis.cluster']['ssl_context']['cafile'] = '/var/www/html/data/certificates/ca-bundle.crt';
|
||||
}
|
||||
|
||||
@@ -115,6 +115,11 @@ rm -f "$test_file"
|
||||
if [ -f /var/www/html/version.php ]; then
|
||||
# shellcheck disable=SC2016
|
||||
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
||||
if [ -z "$installed_version" ]; then
|
||||
echo "Could not determine the installed Nextcloud version via php -r. The PHP installation might be broken."
|
||||
echo "Please check the container logs and your PHP installation."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
installed_version="0.0.0.0"
|
||||
fi
|
||||
@@ -438,11 +443,19 @@ EOF
|
||||
echo "Applying default settings..."
|
||||
mkdir -p /var/www/html/data
|
||||
php /var/www/html/occ config:system:set loglevel --value="2" --type=integer
|
||||
php /var/www/html/occ config:system:set log_type --value="file"
|
||||
php /var/www/html/occ config:system:set logfile --value="/var/www/html/data/nextcloud.log"
|
||||
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"
|
||||
php /var/www/html/occ app:disable logreader
|
||||
else
|
||||
php /var/www/html/occ config:system:set log_type --value="file"
|
||||
php /var/www/html/occ config:system:set log_type_audit --value="file"
|
||||
php /var/www/html/occ app:enable logreader
|
||||
php /var/www/html/occ config:system:set logfile --value="/var/www/html/data/nextcloud.log"
|
||||
php /var/www/html/occ config:system:set logfile_audit --value="/var/www/html/data/audit.log"
|
||||
fi
|
||||
php /var/www/html/occ config:system:set log_rotate_size --value="10485760" --type=integer
|
||||
php /var/www/html/occ app:enable admin_audit
|
||||
php /var/www/html/occ config:app:set admin_audit logfile --value="/var/www/html/data/audit.log"
|
||||
php /var/www/html/occ config:system:set log.condition apps 0 --value="admin_audit"
|
||||
|
||||
# Apply preview settings
|
||||
@@ -640,8 +653,17 @@ 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 logfile --value="/var/www/html/data/nextcloud.log"
|
||||
php /var/www/html/occ config:app:set admin_audit logfile --value="/var/www/html/data/audit.log"
|
||||
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"
|
||||
php /var/www/html/occ app:disable logreader
|
||||
else
|
||||
php /var/www/html/occ config:system:set log_type --value="file"
|
||||
php /var/www/html/occ config:system:set log_type_audit --value="file"
|
||||
php /var/www/html/occ app:enable logreader
|
||||
php /var/www/html/occ config:system:set logfile --value="/var/www/html/data/nextcloud.log"
|
||||
php /var/www/html/occ config:system:set logfile_audit --value="/var/www/html/data/audit.log"
|
||||
fi
|
||||
php /var/www/html/occ config:system:set updatedirectory --value="/nc-updater"
|
||||
if [ -n "$NEXTCLOUD_SKELETON_DIRECTORY" ]; then
|
||||
if [ "$NEXTCLOUD_SKELETON_DIRECTORY" = "empty" ]; then
|
||||
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
# Fix false database connection on old instances
|
||||
if [ -f "/var/www/html/config/config.php" ]; then
|
||||
sleep 2
|
||||
while ! sudo -E -u www-data psql -d "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB" -c "select now()"; do
|
||||
while ! sudo -E -u www-data env PGPASSWORD="$POSTGRES_PASSWORD" psql -h "$POSTGRES_HOST" -p "$POSTGRES_PORT" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "select now()"; do
|
||||
echo "Waiting for the database to start..."
|
||||
sleep 5
|
||||
done
|
||||
|
||||
@@ -25,6 +25,14 @@ stderr_logfile_maxbytes=0
|
||||
command=/cron.sh
|
||||
user=www-data
|
||||
|
||||
[program:taskprocessing-worker]
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=php /var/www/html/occ taskprocessing:worker --timeout 300
|
||||
user=www-data
|
||||
|
||||
[program:run-exec-commands]
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
|
||||
@@ -39,8 +39,6 @@ fi
|
||||
echo "notify-push was started"
|
||||
|
||||
# Run it
|
||||
/var/www/html/custom_apps/notify_push/bin/"$CPU_ARCH"/notify_push \
|
||||
exec /var/www/html/custom_apps/notify_push/bin/"$CPU_ARCH"/notify_push \
|
||||
--port 7867 \
|
||||
/var/www/html/config/config.php
|
||||
|
||||
exec "$@"
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
test -f "/mnt/data/backup-is-running" && exit 0
|
||||
|
||||
psql -d "postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1:11000/$POSTGRES_DB" -c "select now()" && exit 0
|
||||
PGPASSWORD="$POSTGRES_PASSWORD" psql -h 127.0.0.1 -p 11000 -U "oc_$POSTGRES_USER" -d "$POSTGRES_DB" -c "select now()" && exit 0
|
||||
|
||||
psql -d "postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1:5432/$POSTGRES_DB" -c "select now()" || exit 1
|
||||
PGPASSWORD="$POSTGRES_PASSWORD" psql -h 127.0.0.1 -p 5432 -U "oc_$POSTGRES_USER" -d "$POSTGRES_DB" -c "select now()" || exit 1
|
||||
|
||||
@@ -3,8 +3,9 @@ set -ex
|
||||
|
||||
touch "$DUMP_DIR/initialization.failed"
|
||||
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
||||
CREATE USER "oc_$POSTGRES_USER" WITH PASSWORD '$POSTGRES_PASSWORD' CREATEDB;
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" \
|
||||
-v "pg_new_password=$POSTGRES_PASSWORD" <<-EOSQL
|
||||
CREATE USER "oc_$POSTGRES_USER" WITH PASSWORD :'pg_new_password' CREATEDB;
|
||||
ALTER DATABASE "$POSTGRES_DB" OWNER TO "oc_$POSTGRES_USER";
|
||||
GRANT ALL PRIVILEGES ON DATABASE "$POSTGRES_DB" TO "oc_$POSTGRES_USER";
|
||||
GRANT ALL PRIVILEGES ON SCHEMA public TO "oc_$POSTGRES_USER";
|
||||
|
||||
@@ -85,7 +85,7 @@ if ( [ -f "$DATADIR/PG_VERSION" ] && [ "$PG_MAJOR" != "$(cat "$DATADIR/PG_VERSIO
|
||||
exec docker-entrypoint.sh postgres &
|
||||
|
||||
# Wait for creation
|
||||
while ! psql -d "postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1:11000/$POSTGRES_DB" -c "select now()"; do
|
||||
while ! psql -h 127.0.0.1 -p 11000 -U "oc_$POSTGRES_USER" -d "$POSTGRES_DB" -c "select now()"; do
|
||||
echo "Waiting for the database to start."
|
||||
sleep 5
|
||||
done
|
||||
@@ -107,8 +107,9 @@ if ( [ -f "$DATADIR/PG_VERSION" ] && [ "$PG_MAJOR" != "$(cat "$DATADIR/PG_VERSIO
|
||||
exit 1
|
||||
elif [ "$DB_OWNER" != "oc_$POSTGRES_USER" ]; then
|
||||
DIFFERENT_DB_OWNER=1
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
||||
CREATE USER "$DB_OWNER" WITH PASSWORD '$POSTGRES_PASSWORD' CREATEDB;
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" \
|
||||
-v "pg_new_password=$POSTGRES_PASSWORD" <<-EOSQL
|
||||
CREATE USER "$DB_OWNER" WITH PASSWORD :'pg_new_password' CREATEDB;
|
||||
ALTER DATABASE "$POSTGRES_DB" OWNER TO "$DB_OWNER";
|
||||
GRANT ALL PRIVILEGES ON DATABASE "$POSTGRES_DB" TO "$DB_OWNER";
|
||||
GRANT ALL PRIVILEGES ON SCHEMA public TO "$DB_OWNER";
|
||||
@@ -151,23 +152,65 @@ fi
|
||||
# Modify postgresql.conf
|
||||
if [ -f "/var/lib/postgresql/data/postgresql.conf" ]; then
|
||||
echo "Setting postgres values..."
|
||||
PGCONF="/var/lib/postgresql/data/postgresql.conf"
|
||||
|
||||
# Sync this with max pm.max_children and MaxRequestWorkers
|
||||
# 5000 connections is apparently the highest possible value with postgres so set it to that so that we don't run into a limit here.
|
||||
# We don't actually expect so many connections but don't want to limit it artificially because people will report issues otherwise
|
||||
# Also connections should usually be closed again after the process is done
|
||||
# If we should actually exceed this limit, it is definitely a bug in Nextcloud server or some of its apps that does not close connections correctly and not a bug in AIO
|
||||
sed -i "s|^max_connections =.*|max_connections = 5000|" "/var/lib/postgresql/data/postgresql.conf"
|
||||
sed -i "s|^max_connections =.*|max_connections = 5000|" "$PGCONF"
|
||||
|
||||
# Do not log checkpoints
|
||||
if grep -q "#log_checkpoints" /var/lib/postgresql/data/postgresql.conf; then
|
||||
sed -i 's|#log_checkpoints.*|log_checkpoints = off|' /var/lib/postgresql/data/postgresql.conf
|
||||
if grep -q "#log_checkpoints" "$PGCONF"; then
|
||||
sed -i 's|#log_checkpoints.*|log_checkpoints = off|' "$PGCONF"
|
||||
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" /var/lib/postgresql/data/postgresql.conf; then
|
||||
sed -i 's|^idle_session_timeout.*|#idle_session_timeout|' /var/lib/postgresql/data/postgresql.conf
|
||||
if grep -q "^idle_session_timeout" "$PGCONF"; then
|
||||
sed -i 's|^idle_session_timeout.*|#idle_session_timeout|' "$PGCONF"
|
||||
fi
|
||||
|
||||
# Increase shared_buffers from the 128MB default for better data caching
|
||||
sed -i "s|^#shared_buffers = .*|shared_buffers = 256MB|" "$PGCONF"
|
||||
sed -i "s|^shared_buffers = .*|shared_buffers = 256MB|" "$PGCONF"
|
||||
|
||||
# Hint to the query planner about available OS page cache (does not allocate memory)
|
||||
sed -i "s|^#effective_cache_size = .*|effective_cache_size = 1GB|" "$PGCONF"
|
||||
sed -i "s|^effective_cache_size = .*|effective_cache_size = 1GB|" "$PGCONF"
|
||||
|
||||
# Increase per-operation sort/hash memory to reduce disk spills for file listing and share queries.
|
||||
# Note: this is allocated per sort/hash operation, not per connection, so the theoretical worst-case
|
||||
# (max_connections × work_mem) is rarely approached in practice.
|
||||
sed -i "s|^#work_mem = .*|work_mem = 16MB|" "$PGCONF"
|
||||
sed -i "s|^work_mem = .*|work_mem = 16MB|" "$PGCONF"
|
||||
|
||||
# Increase memory for VACUUM, CREATE INDEX, and other maintenance operations
|
||||
sed -i "s|^#maintenance_work_mem = .*|maintenance_work_mem = 256MB|" "$PGCONF"
|
||||
sed -i "s|^maintenance_work_mem = .*|maintenance_work_mem = 256MB|" "$PGCONF"
|
||||
|
||||
# Increase WAL buffers to reduce WAL write latency under concurrent write load
|
||||
sed -i "s|^#wal_buffers = .*|wal_buffers = 16MB|" "$PGCONF"
|
||||
sed -i "s|^wal_buffers = .*|wal_buffers = 16MB|" "$PGCONF"
|
||||
|
||||
# Spread checkpoint I/O over a longer window to reduce spikes
|
||||
sed -i "s|^#checkpoint_timeout = .*|checkpoint_timeout = 15min|" "$PGCONF"
|
||||
sed -i "s|^checkpoint_timeout = .*|checkpoint_timeout = 15min|" "$PGCONF"
|
||||
|
||||
# Tune for SSD storage: random reads are nearly as fast as sequential reads
|
||||
sed -i "s|^#random_page_cost = .*|random_page_cost = 1.1|" "$PGCONF"
|
||||
sed -i "s|^random_page_cost = .*|random_page_cost = 1.1|" "$PGCONF"
|
||||
|
||||
# Allow the kernel to issue more concurrent I/O prefetch requests (suitable for SSDs)
|
||||
sed -i "s|^#effective_io_concurrency = .*|effective_io_concurrency = 200|" "$PGCONF"
|
||||
sed -i "s|^effective_io_concurrency = .*|effective_io_concurrency = 200|" "$PGCONF"
|
||||
|
||||
# Trigger autovacuum earlier on large Nextcloud tables (e.g. oc_filecache, oc_activity)
|
||||
# to prevent table bloat accumulating before the default 20% threshold is reached
|
||||
sed -i "s|^#autovacuum_vacuum_scale_factor = .*|autovacuum_vacuum_scale_factor = 0.05|" "$PGCONF"
|
||||
sed -i "s|^autovacuum_vacuum_scale_factor = .*|autovacuum_vacuum_scale_factor = 0.05|" "$PGCONF"
|
||||
sed -i "s|^#autovacuum_analyze_scale_factor = .*|autovacuum_analyze_scale_factor = 0.02|" "$PGCONF"
|
||||
sed -i "s|^autovacuum_analyze_scale_factor = .*|autovacuum_analyze_scale_factor = 0.02|" "$PGCONF"
|
||||
fi
|
||||
|
||||
do_database_dump() {
|
||||
|
||||
@@ -6,12 +6,31 @@ if [ "$(sysctl -n vm.overcommit_memory)" != "1" ]; then
|
||||
echo "See https://github.com/nextcloud/all-in-one/discussions/1731 how to enable overcommit"
|
||||
fi
|
||||
|
||||
# Run redis with a password if provided
|
||||
echo "Redis has started"
|
||||
if [ -n "$REDIS_HOST_PASSWORD" ]; then
|
||||
exec redis-server --requirepass "$REDIS_HOST_PASSWORD" --loglevel warning
|
||||
else
|
||||
exec redis-server --loglevel warning
|
||||
# Warn if Transparent Huge Pages are enabled (causes latency spikes)
|
||||
if [ -f /sys/kernel/mm/transparent_hugepage/enabled ]; then
|
||||
if grep -q '\[always\]' /sys/kernel/mm/transparent_hugepage/enabled; then
|
||||
echo "WARNING: Transparent Huge Pages (THP) are enabled. This can cause latency and memory issues with Redis."
|
||||
echo "Consider disabling THP by running: echo never > /sys/kernel/mm/transparent_hugepage/enabled"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
# Build the redis-server argument list.
|
||||
REDIS_ARGS=(
|
||||
--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
|
||||
--lazyfree-lazy-expire yes # Expire keys in a background thread
|
||||
--lazyfree-lazy-server-del yes # DEL/UNLINK in background thread
|
||||
--replica-lazy-flush yes # Flush replica dataset in background thread
|
||||
--activedefrag yes # Reclaim fragmented memory without restart
|
||||
--hz 15 # Run background tasks 15×/s (default 10) for faster key expiry
|
||||
)
|
||||
|
||||
if [ -n "$REDIS_HOST_PASSWORD" ]; then
|
||||
REDIS_ARGS+=(--requirepass "$REDIS_HOST_PASSWORD")
|
||||
fi
|
||||
|
||||
# Run redis with a password if provided
|
||||
echo "Redis has started"
|
||||
exec redis-server "${REDIS_ARGS[@]}"
|
||||
|
||||
@@ -4,7 +4,7 @@ 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
|
||||
|
||||
ARG JANUS_VERSION=v1.4.0
|
||||
ARG JANUS_VERSION=v1.4.1
|
||||
WORKDIR /src
|
||||
RUN set -ex; \
|
||||
apk upgrade --no-cache -a; \
|
||||
@@ -82,7 +82,9 @@ RUN set -ex; \
|
||||
touch \
|
||||
/etc/nats.conf \
|
||||
/etc/eturnal.yml; \
|
||||
echo "listen: 127.0.0.1:4222" | tee /etc/nats.conf; \
|
||||
# write_deadline: "10s" — without a write deadline, a lagging subscriber can stall the broker indefinitely, blocking all other signaling messages.
|
||||
# max_payload: 8MB — the default is 1 MB; signaling payloads in large meetings (many participants, ICE candidates) can exceed this, causing dropped messages.
|
||||
printf 'listen: 127.0.0.1:4222\nwrite_deadline: "10s"\nmax_payload: 8MB\n' | tee /etc/nats.conf; \
|
||||
mkdir -p \
|
||||
/var/tmp \
|
||||
/conf \
|
||||
|
||||
@@ -5,3 +5,6 @@ nc -z 127.0.0.1 8188 || exit 1
|
||||
nc -z 127.0.0.1 4222 || exit 1
|
||||
nc -z 127.0.0.1 "$TALK_PORT" || exit 1
|
||||
eturnalctl status || exit 1
|
||||
# Verify that the signaling server is actually serving requests, not just
|
||||
# listening on the TCP port (which nc -z above only tests for open port).
|
||||
wget -q -O /dev/null http://127.0.0.1:8081/api/v1/stats || exit 1
|
||||
|
||||
@@ -91,10 +91,12 @@ if [ -z "$TALK_MAX_SCREEN_BITRATE" ]; then
|
||||
TALK_MAX_SCREEN_BITRATE=2097152
|
||||
fi
|
||||
|
||||
# Signling
|
||||
# Signaling
|
||||
cat << SIGNALING_CONF > "/conf/signaling.conf"
|
||||
[http]
|
||||
listen = 0.0.0.0:8081
|
||||
readtimeout = 15
|
||||
writetimeout = 30
|
||||
|
||||
[app]
|
||||
debug = false
|
||||
@@ -110,7 +112,9 @@ internalsecret = ${INTERNAL_SECRET}
|
||||
backends = backend-1
|
||||
allowall = false
|
||||
timeout = 10
|
||||
connectionsperhost = 8
|
||||
# connectionsperhost: This is the HTTP keep-alive connection pool size from the signaling server to the Nextcloud backend.
|
||||
# Under load (many concurrent calls joining/leaving simultaneously) a pool of 8 creates a queue bottleneck for backend authentication and session lookups, thus increasing to 32.
|
||||
connectionsperhost = 32
|
||||
skipverify = ${SKIP_CERT_VERIFY}
|
||||
|
||||
[backend-1]
|
||||
|
||||
@@ -7,19 +7,23 @@ logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=error
|
||||
|
||||
[program:eturnal]
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=eturnalctl foreground
|
||||
|
||||
[program:nats-server]
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=nats-server -c /etc/nats.conf
|
||||
# Start first: signaling depends on NATS being available
|
||||
priority=10
|
||||
|
||||
[program:eturnal]
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=eturnalctl foreground
|
||||
# Start alongside Janus; independent of signaling
|
||||
priority=20
|
||||
|
||||
[program:janus]
|
||||
stdout_logfile=/dev/stdout
|
||||
@@ -28,6 +32,8 @@ stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
# 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
|
||||
|
||||
[program:signaling]
|
||||
stdout_logfile=/dev/stdout
|
||||
@@ -35,3 +41,5 @@ stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=nextcloud-spreed-signaling -config /conf/signaling.conf
|
||||
# Start last: depends on NATS (priority=10) and Janus (priority=20) being up
|
||||
priority=30
|
||||
|
||||
@@ -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.
|
||||
@@ -34,6 +34,9 @@
|
||||
"enable_nvidia_gpu": true,
|
||||
"backup_volumes": [
|
||||
"nextcloud_aio_jellyfin"
|
||||
],
|
||||
"depends_on": [
|
||||
"nextcloud-aio-lldap"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -5,7 +5,6 @@ This container bundles Local AI and auto-configures it for you. It support hardw
|
||||
Documentation is available on the container repository. This documentation is regularly updated and is intended to be as simple and detailed as possible. Thanks for all your feedback!
|
||||
|
||||
- See https://github.com/docjyJ/aio-local-ai-vulkan#getting-started for getting start with this container.
|
||||
- See [this guide](https://github.com/nextcloud/all-in-one/discussions/5430) for how to improve AI task pickup speed
|
||||
- Note that Nextcloud supports only one server for AI queries, so this container cannot be used at the same time as other AI containers.
|
||||
- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack
|
||||
|
||||
|
||||
@@ -4,6 +4,61 @@ This directory features containers that are built for AIO which allows to add ad
|
||||
## Disclaimers
|
||||
All containers that are in this directory are community maintained so the responsibility is on the community to keep them updated and secure. There is no guarantee that this will be the case in the future.
|
||||
|
||||
## Overview
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
%% ── Styles ───────────────────────────────────────────────────────────────────
|
||||
classDef community fill:#FDEBD0,stroke:#E67E22,color:#222
|
||||
classDef group fill:#FEF9E7,stroke:#F39C12,color:#333
|
||||
|
||||
subgraph COMM_AI["🤖 AI & Language"]
|
||||
LAI(["🧠 Local AI\nPrivate AI assistant"]):::community
|
||||
LT(["✏️ LanguageTool\nSpell & grammar check"]):::community
|
||||
LTRANS(["🌐 LibreTranslate\nTranslation engine"]):::community
|
||||
FACE(["🙂 FaceRecognition\nPhoto AI processor"]):::community
|
||||
end
|
||||
|
||||
subgraph COMM_BACKUP["💾 Backup & Storage"]
|
||||
BV(["📦 Borgbackup Viewer\nBrowse backups"]):::community
|
||||
CALB(["📅 CalCardBackup\nCalendar/Contacts backup"]):::community
|
||||
MINIO(["🗃️ MinIO\nS3-compatible storage"]):::community
|
||||
SMB(["📂 SMB Server\nWindows file sharing"]):::community
|
||||
end
|
||||
|
||||
subgraph COMM_EXTRA["🌟 Extra Services"]
|
||||
HA(["🏠 Home Assistant\nHome automation"]):::community
|
||||
STLW(["📧 Stalwart\nMail server"]):::community
|
||||
NOCO(["🗂️ NocoDB\nNo-code database"]):::community
|
||||
JSER(["🎯 Jellyseerr\nMedia request manager"]):::community
|
||||
NOTIF(["📣 Notifications\nExternal push notify"]):::community
|
||||
end
|
||||
|
||||
subgraph COMM_MEDIA["🎬 Media"]
|
||||
PLEX(["🎞️ Plex\nMedia Server"]):::community
|
||||
JELLY(["🎬 Jellyfin\nMedia Server"]):::community
|
||||
DLNA(["📡 DLNA\nMedia Streaming"]):::community
|
||||
MEMTR(["📸 Memories\nVideo Transcoder"]):::community
|
||||
MKV(["💿 MakeMKV\nBlu-ray / DVD rip"]):::community
|
||||
end
|
||||
|
||||
subgraph COMM_MONITOR["📊 Monitoring & Infra"]
|
||||
GLAN(["📈 Glances\nSystem monitoring"]):::community
|
||||
EXP(["📊 Nextcloud Exporter\nPrometheus metrics"]):::community
|
||||
SCRU(["💽 Scrutiny\nDisk health (S.M.A.R.T.)"]):::community
|
||||
CMGMT(["🐳 Container Mgmt\nDocker web console"]):::community
|
||||
end
|
||||
|
||||
subgraph COMM_SEC["🔒 Security & Network"]
|
||||
F2B(["🚫 Fail2ban\nBrute-force protection"]):::community
|
||||
PIH(["🕳️ Pi-hole\nAd & DNS blocker"]):::community
|
||||
VW(["🔐 Vaultwarden\nPassword Manager"]):::community
|
||||
LDAP(["👥 LLDAP\nLight LDAP / Users"]):::community
|
||||
CADDY(["🌐 Caddy\nReverse Proxy + Geoblocking"]):::community
|
||||
NPMPLUS(["🌐 NPMplus\nNginx Proxy Manager"]):::community
|
||||
end
|
||||
```
|
||||
|
||||
## 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 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.
|
||||
|
||||
@@ -186,6 +186,7 @@ services:
|
||||
- WHITEBOARD_ENABLED
|
||||
stop_grace_period: 600s
|
||||
restart: unless-stopped
|
||||
shm_size: 134217728
|
||||
cap_drop:
|
||||
- NET_RAW
|
||||
|
||||
@@ -444,6 +445,9 @@ services:
|
||||
- http.port=9200
|
||||
- xpack.license.self_generated.type=basic
|
||||
- xpack.security.enabled=false
|
||||
- indices.fielddata.cache.size=20%
|
||||
- indices.memory.index_buffer_size=20%
|
||||
- thread_pool.write.queue_size=1000
|
||||
- FULLTEXTSEARCH_PASSWORD
|
||||
volumes:
|
||||
- nextcloud_aio_elasticsearch:/usr/share/elasticsearch/data:rw
|
||||
|
||||
@@ -34,7 +34,7 @@ NEXTCLOUD_DATADIR=nextcloud_aio_nextcloud_data # You can change this to
|
||||
NEXTCLOUD_MAX_TIME=3600 # This allows to change the upload time limit of the Nextcloud container
|
||||
NEXTCLOUD_MEMORY_LIMIT=512M # This allows to change the PHP memory limit of the Nextcloud container
|
||||
NEXTCLOUD_MOUNT=/mnt/ # This allows the Nextcloud container to access directories on the host. It must never be equal to the value of NEXTCLOUD_DATADIR!
|
||||
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
|
||||
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"
|
||||
NEXTCLOUD_TRUSTED_CACERTS_DIR=/usr/local/share/ca-certificates/my-custom-ca # Nextcloud container will trust all the Certification Authorities, whose certificates are included in the given directory.
|
||||
NEXTCLOUD_UPLOAD_LIMIT=16G # This allows to change the upload limit of the Nextcloud container
|
||||
REMOVE_DISABLED_APPS=yes # Setting this to no keep Nextcloud apps that are disabled via their switch and not uninstall them if they should be installed in Nextcloud.
|
||||
|
||||
@@ -101,7 +101,7 @@ sed -i 's|NEXTCLOUD_PASSWORD=|NEXTCLOUD_PASSWORD= # TODO! This is the p
|
||||
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|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|' 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
|
||||
sed -i 's|NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS=|NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS=imagick # This allows to add additional php extensions to the Nextcloud container permanently. Default is imagick but can be overwritten by modifying this value.|' sample.conf
|
||||
sed -i 's|INSTALL_LATEST_MAJOR=|INSTALL_LATEST_MAJOR=no # Setting this to yes will install the latest Major Nextcloud version upon the first installation|' sample.conf
|
||||
|
||||
20
php/composer.lock
generated
20
php/composer.lock
generated
@@ -2520,16 +2520,16 @@
|
||||
},
|
||||
{
|
||||
"name": "amphp/socket",
|
||||
"version": "v2.3.1",
|
||||
"version": "v2.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/socket.git",
|
||||
"reference": "58e0422221825b79681b72c50c47a930be7bf1e1"
|
||||
"reference": "dadb63c5d3179fd83803e29dfeac27350e619314"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/socket/zipball/58e0422221825b79681b72c50c47a930be7bf1e1",
|
||||
"reference": "58e0422221825b79681b72c50c47a930be7bf1e1",
|
||||
"url": "https://api.github.com/repos/amphp/socket/zipball/dadb63c5d3179fd83803e29dfeac27350e619314",
|
||||
"reference": "dadb63c5d3179fd83803e29dfeac27350e619314",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2538,17 +2538,17 @@
|
||||
"amphp/dns": "^2",
|
||||
"ext-openssl": "*",
|
||||
"kelunik/certificate": "^1.1",
|
||||
"league/uri": "^6.5 | ^7",
|
||||
"league/uri-interfaces": "^2.3 | ^7",
|
||||
"league/uri": "^7",
|
||||
"league/uri-interfaces": "^7",
|
||||
"php": ">=8.1",
|
||||
"revolt/event-loop": "^1 || ^0.2"
|
||||
"revolt/event-loop": "^1"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "^2",
|
||||
"amphp/phpunit-util": "^3",
|
||||
"amphp/process": "^2",
|
||||
"phpunit/phpunit": "^9",
|
||||
"psalm/phar": "5.20"
|
||||
"psalm/phar": "6.16.1"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -2592,7 +2592,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/socket/issues",
|
||||
"source": "https://github.com/amphp/socket/tree/v2.3.1"
|
||||
"source": "https://github.com/amphp/socket/tree/v2.4.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2600,7 +2600,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2024-04-21T14:33:03+00:00"
|
||||
"time": "2026-04-19T15:09:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/sync",
|
||||
|
||||
@@ -267,6 +267,7 @@
|
||||
],
|
||||
"stop_grace_period": 600,
|
||||
"restart": "unless-stopped",
|
||||
"shm_size": 134217728,
|
||||
"devices": [
|
||||
"/dev/dri"
|
||||
],
|
||||
@@ -813,6 +814,9 @@
|
||||
"http.port=9200",
|
||||
"xpack.license.self_generated.type=basic",
|
||||
"xpack.security.enabled=false",
|
||||
"indices.fielddata.cache.size=20%",
|
||||
"indices.memory.index_buffer_size=20%",
|
||||
"thread_pool.write.queue_size=1000",
|
||||
"FULLTEXTSEARCH_PASSWORD=%FULLTEXTSEARCH_PASSWORD%"
|
||||
],
|
||||
"volumes": [
|
||||
|
||||
@@ -9,8 +9,8 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
|
||||
document.querySelectorAll('input[data-input-show-password]').forEach((element) => {
|
||||
element.addEventListener('input', (element) => {
|
||||
let passwordField = element
|
||||
element.addEventListener('input', (event) => {
|
||||
let passwordField = event.target;
|
||||
if (passwordField.type === "password" && passwordField.value !== "") {
|
||||
passwordField.type = "text";
|
||||
} else if (passwordField.type === "text" && passwordField.value === "") {
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
// Clamav
|
||||
let clamav = document.getElementById("clamav");
|
||||
clamav.disabled = true;
|
||||
});
|
||||
@@ -1,5 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
// Collabora
|
||||
const collabora = document.getElementById("office-collabora");
|
||||
collabora.disabled = true;
|
||||
});
|
||||
44
php/public/disable-containers.js
Normal file
44
php/public/disable-containers.js
Normal file
@@ -0,0 +1,44 @@
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
// Clamav
|
||||
let clamav = document.getElementById("clamav");
|
||||
clamav.disabled = true;
|
||||
|
||||
// Docker socket proxy
|
||||
let dockerSocketProxy = document.getElementById("docker-socket-proxy");
|
||||
if (dockerSocketProxy) {
|
||||
dockerSocketProxy.disabled = true;
|
||||
}
|
||||
|
||||
// HaRP
|
||||
let harp = document.getElementById("harp");
|
||||
if (harp) {
|
||||
harp.disabled = true;
|
||||
}
|
||||
|
||||
// Talk
|
||||
let talk = document.getElementById("talk");
|
||||
talk.disabled = true;
|
||||
|
||||
// Collabora
|
||||
const collabora = document.getElementById("office-collabora");
|
||||
collabora.disabled = true;
|
||||
|
||||
// OnlyOffice
|
||||
const onlyoffice = document.getElementById("office-onlyoffice");
|
||||
onlyoffice.disabled = true;
|
||||
|
||||
// Imaginary
|
||||
let imaginary = document.getElementById("imaginary");
|
||||
imaginary.disabled = true;
|
||||
|
||||
// Fulltextsearch
|
||||
let fulltextsearch = document.getElementById("fulltextsearch");
|
||||
fulltextsearch.disabled = true;
|
||||
|
||||
// Talk-recording
|
||||
document.getElementById("talk-recording").disabled = true;
|
||||
|
||||
// Whiteboard
|
||||
let whiteboard = document.getElementById("whiteboard");
|
||||
whiteboard.disabled = true;
|
||||
});
|
||||
@@ -1,7 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
// Docker socket proxy
|
||||
let dockerSocketProxy = document.getElementById("docker-socket-proxy");
|
||||
if (dockerSocketProxy) {
|
||||
dockerSocketProxy.disabled = true;
|
||||
}
|
||||
});
|
||||
@@ -1,5 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
// Fulltextsearch
|
||||
let fulltextsearch = document.getElementById("fulltextsearch");
|
||||
fulltextsearch.disabled = true;
|
||||
});
|
||||
@@ -1,7 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
// HaRP
|
||||
let harp = document.getElementById("harp");
|
||||
if (harp) {
|
||||
harp.disabled = true;
|
||||
}
|
||||
});
|
||||
@@ -1,5 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
// Imaginary
|
||||
let imaginary = document.getElementById("imaginary");
|
||||
imaginary.disabled = true;
|
||||
});
|
||||
@@ -1,5 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
// OnlyOffice
|
||||
const onlyoffice = document.getElementById("office-onlyoffice");
|
||||
onlyoffice.disabled = true;
|
||||
});
|
||||
@@ -1,4 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
// Talk-recording
|
||||
document.getElementById("talk-recording").disabled = true;
|
||||
});
|
||||
@@ -1,5 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
// Talk
|
||||
let talk = document.getElementById("talk");
|
||||
talk.disabled = true;
|
||||
});
|
||||
@@ -1,5 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
// Whiteboard
|
||||
let whiteboard = document.getElementById("whiteboard");
|
||||
whiteboard.disabled = true;
|
||||
});
|
||||
@@ -10,6 +10,9 @@ ini_set('max_execution_time', '7200');
|
||||
// Log whole log messages
|
||||
ini_set('log_errors_max_len', '0');
|
||||
|
||||
// Path for the Twig compiled-template cache (created at container startup by start.sh)
|
||||
const TWIG_CACHE_PATH = '/tmp/twig-cache';
|
||||
|
||||
use DI\Container;
|
||||
use DI\NotFoundException;
|
||||
use Slim\Csrf\Guard;
|
||||
@@ -37,22 +40,52 @@ $container->set(Guard::class, function () use ($responseFactory) {
|
||||
});
|
||||
|
||||
// Register Middleware To Be Executed On All Routes
|
||||
|
||||
// Migrate from the old PHPSESSID cookie to the new __Host-Http-PHPSESSID cookie.
|
||||
// This is needed because the session cookie was renamed in a previous release. Without this,
|
||||
// users that were logged in before the update would be logged out after the container restarts.
|
||||
$wasAuthenticated = false;
|
||||
$oldSessionTimestamp = null;
|
||||
if (!isset($_COOKIE['__Host-Http-PHPSESSID']) && isset($_COOKIE['PHPSESSID'])) {
|
||||
session_name('PHPSESSID');
|
||||
if (session_start(['save_path' => $dataConst->GetSessionDirectory(), 'use_strict_mode' => true])) {
|
||||
$wasAuthenticated = isset($_SESSION[\AIO\Auth\AuthManager::SESSION_KEY]) && $_SESSION[\AIO\Auth\AuthManager::SESSION_KEY] === true;
|
||||
$oldSessionTimestamp = isset($_SESSION['date_time']) ? (int)$_SESSION['date_time'] : null;
|
||||
// Do not destroy the old session: if the response carrying the new __Host-Http-PHPSESSID
|
||||
// cookie is lost (e.g., due to a 502 during a mastercontainer update), the client can
|
||||
// retry with the old PHPSESSID cookie and still be authenticated.
|
||||
session_write_close();
|
||||
}
|
||||
}
|
||||
|
||||
session_start([
|
||||
"name" => "__Host-Http-PHPSESSID", // Set cookie prefix to prevent other pages from overwriting this cookie. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie#cookie_prefixes
|
||||
"save_path" => $dataConst->GetSessionDirectory(), // Where to save the session files
|
||||
"cookie_lifetime" => 0, // Delete the session cookie whenever the browser is closed. See https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime
|
||||
"gc_maxlifetime" => 86400, // Delete sessions after 24 hours. See https://www.php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime
|
||||
"gc_probability" => 1, // Probability that the session cleanup starts. See https://www.php.net/manual/en/session.configuration.php#ini.session.gc-probability
|
||||
"gc_divisor" => 1, // gc_probability/gc_divisor = 1/1 = 100%, meaning that *all* outdated sessions get deleted when the cleanup job runs. See https://www.php.net/manual/en/session.configuration.php#ini.session.gc-divisor
|
||||
"gc_probability" => 0, // Probability that the session cleanup starts. The sessions are cleaned up by a cron job instead, see /cron.sh. See https://www.php.net/manual/en/session.configuration.php#ini.session.gc-probability
|
||||
"gc_divisor" => 100, // gc_probability/gc_divisor = 0/100 = 0%, meaning that PHP will never run session GC itself (cron.sh handles cleanup instead). See https://www.php.net/manual/en/session.configuration.php#ini.session.gc-divisor
|
||||
"use_strict_mode" => true, // Only allow initialized session IDs. See https://www.php.net/manual/en/session.configuration.php#ini.session.use-strict-mode
|
||||
"cookie_secure" => true, // Only send cookies over https (not http). See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie#secure
|
||||
"cookie_httponly" => true, // Block the cookie from being read with js in the browser, will still be send for fetch request triggered by js. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie#httponly
|
||||
"cookie_samesite" => "Strict", // Only send the cookie with requests triggered by AIO itself. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie#samesitesamesite-value
|
||||
]);
|
||||
|
||||
if ($wasAuthenticated) {
|
||||
if ($oldSessionTimestamp !== null) {
|
||||
// Use MigrateAuthState to preserve the original login timestamp. This prevents the
|
||||
// session deduplicator from running and keeps the old PHPSESSID session file alive,
|
||||
// so the client can retry with the old cookie if the 502 response causes the new
|
||||
// __Host-Http-PHPSESSID cookie to not be received.
|
||||
$container->get(\AIO\Auth\AuthManager::class)->MigrateAuthState($oldSessionTimestamp);
|
||||
} else {
|
||||
$container->get(\AIO\Auth\AuthManager::class)->SetAuthState(true);
|
||||
}
|
||||
}
|
||||
$app->add(Guard::class);
|
||||
|
||||
// Create Twig
|
||||
$twig = Twig::create(__DIR__ . '/../templates/', ['cache' => false]);
|
||||
$twig = Twig::create(__DIR__ . '/../templates/', ['cache' => TWIG_CACHE_PATH]);
|
||||
$app->add(TwigMiddleware::create($app, $twig));
|
||||
$twig->addExtension(new \AIO\Twig\CsrfExtension($container->get(Guard::class)));
|
||||
|
||||
@@ -76,6 +109,7 @@ $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) {
|
||||
@@ -147,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->getDesecPassword(),
|
||||
'is_desec_domain' => $configurationManager->isDesecDomain(),
|
||||
'desec_account_registered' => $configurationManager->isDesecAccountRegistered(),
|
||||
]);
|
||||
})->setName('profile');
|
||||
$app->get('/login', function (Request $request, Response $response, array $args) use ($container) {
|
||||
|
||||
@@ -8,7 +8,7 @@ use AIO\Data\DataConst;
|
||||
use \DateTime;
|
||||
|
||||
readonly class AuthManager {
|
||||
private const string SESSION_KEY = 'aio_authenticated';
|
||||
public const string SESSION_KEY = 'aio_authenticated';
|
||||
|
||||
public function __construct(
|
||||
private ConfigurationManager $configurationManager
|
||||
@@ -42,6 +42,18 @@ readonly class AuthManager {
|
||||
$_SESSION[self::SESSION_KEY] = $isLoggedIn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrates the authenticated state from an old session (different cookie name) to the new session.
|
||||
* Unlike SetAuthState, this method preserves the original login timestamp and does not update
|
||||
* the session_date_file, so the session deduplicator is not triggered. This keeps the old session
|
||||
* file alive in case the response carrying the new cookie is lost (e.g., due to a 502 error during
|
||||
* a mastercontainer update), allowing the client to retry with the old cookie.
|
||||
*/
|
||||
public function MigrateAuthState(int $oldTimestamp) : void {
|
||||
$_SESSION[self::SESSION_KEY] = true;
|
||||
$_SESSION['date_time'] = $oldTimestamp;
|
||||
}
|
||||
|
||||
public function IsAuthenticated() : bool {
|
||||
return isset($_SESSION[self::SESSION_KEY]) && $_SESSION[self::SESSION_KEY] === true;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,17 @@ readonly class ContainerDefinitionFetcher {
|
||||
*/
|
||||
private function GetDefinition(): array
|
||||
{
|
||||
$data = json_decode((string)file_get_contents(DataConst::GetContainersDefinitionPath()), true, 512, JSON_THROW_ON_ERROR);
|
||||
$containersDefinitionPath = DataConst::GetContainersDefinitionPath();
|
||||
$cacheKey = 'containers-json-' . $containersDefinitionPath;
|
||||
$cachedJson = apcu_fetch($cacheKey);
|
||||
if (!is_string($cachedJson)) {
|
||||
$cachedJson = (string)file_get_contents($containersDefinitionPath);
|
||||
apcu_add($cacheKey, $cachedJson);
|
||||
}
|
||||
$data = json_decode($cachedJson, true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
// We store this information for later because we need to use it to distinct between community containers and default containers.
|
||||
$standardContainerNames = array_column($data['aio_services_v1'], 'container_name');
|
||||
|
||||
$additionalContainerNames = [];
|
||||
foreach ($this->configurationManager->aioCommunityContainers as $communityContainer) {
|
||||
@@ -212,6 +222,15 @@ readonly class ContainerDefinitionFetcher {
|
||||
if (!$this->configurationManager->isWhiteboardEnabled) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// Skip dependencies on community containers that are not currently enabled.
|
||||
// Only apply this when the current entry is itself a community container,
|
||||
// and the dependency is not an enabled community container or a standard built-in container.
|
||||
if (in_array($entry['container_name'], $additionalContainerNames, true)
|
||||
&& !in_array($value, $additionalContainerNames, true)
|
||||
&& !in_array($value, $standardContainerNames, true)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$dependsOn[] = $value;
|
||||
}
|
||||
|
||||
273
php/src/Controller/DesecController.php
Normal file
273
php/src/Controller/DesecController.php
Normal file
@@ -0,0 +1,273 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace AIO\Controller;
|
||||
|
||||
use AIO\Data\ConfigurationManager;
|
||||
use AIO\Data\InvalidSettingConfigurationException;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\TransferException;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
readonly class DesecController {
|
||||
private const string DESEC_API_BASE = 'https://desec.io/api/v1';
|
||||
private const string DEDYN_SUFFIX = '.dedyn.io';
|
||||
private const int MAX_SLUG_ATTEMPTS = 5;
|
||||
private const int SLUG_BYTES = 5; // 10-char hex slug
|
||||
private const string SLUG_PATTERN = '/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/';
|
||||
|
||||
private Client $guzzleClient;
|
||||
|
||||
public function __construct(
|
||||
private ConfigurationManager $configurationManager,
|
||||
) {
|
||||
$this->guzzleClient = new Client([
|
||||
'timeout' => 15,
|
||||
'connect_timeout' => 10,
|
||||
'http_errors' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
public function Register(Request $request, Response $response, array $args): Response {
|
||||
// Only allow registration when no domain is configured yet
|
||||
if ($this->configurationManager->domain !== '') {
|
||||
$response->getBody()->write('A domain is already configured. Reset the AIO instance first to register a new domain.');
|
||||
return $response->withStatus(422);
|
||||
}
|
||||
|
||||
// When a deSEC account was already registered (token exists) but domain creation previously
|
||||
// failed, we skip account registration and re-use the stored token and email.
|
||||
$accountAlreadyRegistered = $this->configurationManager->isDesecAccountRegistered();
|
||||
|
||||
if ($accountAlreadyRegistered) {
|
||||
$token = $this->configurationManager->getDesecToken();
|
||||
// email is already stored; no need to validate or update it
|
||||
} else {
|
||||
$email = trim((string)($request->getParsedBody()['desec_email'] ?? ''));
|
||||
if ($email === '' || filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
|
||||
$response->getBody()->write('Please provide a valid email address.');
|
||||
return $response->withStatus(422);
|
||||
}
|
||||
}
|
||||
|
||||
$slug = trim((string)($request->getParsedBody()['desec_slug'] ?? ''));
|
||||
if ($slug !== '' && !preg_match(self::SLUG_PATTERN, $slug)) {
|
||||
$response->getBody()->write(
|
||||
'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 $response->withStatus(422);
|
||||
}
|
||||
|
||||
try {
|
||||
if (!$accountAlreadyRegistered) {
|
||||
// Register an account at deSEC and obtain an API token.
|
||||
// The password is stored so the user can log in to desec.io directly if needed.
|
||||
// 24 random bytes encoded as hex produce a 48-character password.
|
||||
$password = bin2hex(random_bytes(24));
|
||||
$token = $this->registerDesecAccount($email, $password);
|
||||
|
||||
// Persist the token, password and email immediately so that a subsequent
|
||||
// domain-registration failure leaves the account credentials stored and allows
|
||||
// the user to retry.
|
||||
$this->configurationManager->startTransaction();
|
||||
$this->configurationManager->setDesecToken($token);
|
||||
$this->configurationManager->setDesecPassword($password);
|
||||
$this->configurationManager->desecEmail = $email;
|
||||
$this->configurationManager->commitTransaction();
|
||||
}
|
||||
|
||||
// Register a free dedyn.io subdomain
|
||||
$domain = $this->registerDesecDomain($token, $slug);
|
||||
|
||||
// Auto-enable caddy and dnsmasq (idempotent — safe to call even on retry)
|
||||
$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();
|
||||
|
||||
// Set the domain; skip the reachability validation because the domain was just
|
||||
// created and DNS propagation may not have completed yet.
|
||||
$this->configurationManager->setDomain($domain, true);
|
||||
|
||||
// Perform the first DNS IP update so the record is populated immediately
|
||||
$this->updateIpIfDesecDomain();
|
||||
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
} catch (InvalidSettingConfigurationException $ex) {
|
||||
$response->getBody()->write($ex->getMessage());
|
||||
return $response->withStatus(422);
|
||||
} catch (\Exception $ex) {
|
||||
$response->getBody()->write($ex->getMessage());
|
||||
return $response->withStatus(422);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the deSEC DNS A/AAAA record with the current public IP of this host.
|
||||
* Uses deSEC's DynDNS2-compatible update endpoint, which auto-detects the requester's IP.
|
||||
* Safe to call frequently; the endpoint returns "nochg" when the IP has not changed.
|
||||
* Errors are logged but never thrown, so callers are not interrupted.
|
||||
*/
|
||||
public function updateIpIfDesecDomain(): void {
|
||||
if (!$this->configurationManager->isDesecDomain()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$domain = $this->configurationManager->domain;
|
||||
$token = $this->configurationManager->getDesecToken();
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new deSEC account and returns the API token from the response.
|
||||
*
|
||||
* @throws \Exception on network failure or an unexpected API response
|
||||
*/
|
||||
private function registerDesecAccount(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());
|
||||
}
|
||||
|
||||
$httpCode = $res->getStatusCode();
|
||||
$body = $res->getBody()->getContents();
|
||||
|
||||
if ($httpCode === 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. '
|
||||
. 'Please log in at https://desec.io to retrieve your token and set up your domain manually.',
|
||||
);
|
||||
}
|
||||
throw new \Exception('Registration at deSEC failed (HTTP 400): ' . $body);
|
||||
}
|
||||
|
||||
if ($httpCode !== 201) {
|
||||
throw new \Exception(
|
||||
'Unexpected response from deSEC during account registration '
|
||||
. '(HTTP ' . $httpCode . '): ' . $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'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a new dedyn.io subdomain and returns its full name.
|
||||
*
|
||||
* When $requestedSlug is non-empty the caller's preferred slug is tried once; a 409
|
||||
* conflict returns an actionable error immediately (no silent retry).
|
||||
* When $requestedSlug is empty a random 10-char hex slug is generated and retried up
|
||||
* to MAX_SLUG_ATTEMPTS times on 409 conflicts.
|
||||
*
|
||||
* @throws \Exception when all attempts fail or a network/API error occurs
|
||||
*/
|
||||
private function registerDesecDomain(string $token, string $requestedSlug = ''): string {
|
||||
if ($requestedSlug !== '') {
|
||||
// User chose a specific slug — try it exactly once.
|
||||
$domain = $requestedSlug . self::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());
|
||||
}
|
||||
|
||||
$httpCode = $res->getStatusCode();
|
||||
|
||||
if ($httpCode === 201) {
|
||||
return $domain;
|
||||
}
|
||||
|
||||
if ($httpCode === 409) {
|
||||
throw new \Exception(
|
||||
'"' . $domain . '" is already taken. Please choose a different subdomain and try again.',
|
||||
);
|
||||
}
|
||||
|
||||
$body = $res->getBody()->getContents();
|
||||
throw new \Exception(
|
||||
'Unexpected response from deSEC during domain registration '
|
||||
. '(HTTP ' . $httpCode . '): ' . $body,
|
||||
);
|
||||
}
|
||||
|
||||
// No slug provided — generate random slugs and retry on conflicts.
|
||||
$lastError = '';
|
||||
|
||||
for ($attempt = 0; $attempt < self::MAX_SLUG_ATTEMPTS; $attempt++) {
|
||||
$slug = bin2hex(random_bytes(self::SLUG_BYTES));
|
||||
$domain = $slug . self::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());
|
||||
}
|
||||
|
||||
$httpCode = $res->getStatusCode();
|
||||
|
||||
if ($httpCode === 201) {
|
||||
return $domain;
|
||||
}
|
||||
|
||||
if ($httpCode === 409) {
|
||||
// Slug already taken — try another one
|
||||
$lastError = '"' . $domain . '" is already taken';
|
||||
continue;
|
||||
}
|
||||
|
||||
$body = $res->getBody()->getContents();
|
||||
throw new \Exception(
|
||||
'Unexpected response from deSEC during domain registration '
|
||||
. '(HTTP ' . $httpCode . '): ' . $body,
|
||||
);
|
||||
}
|
||||
|
||||
throw new \Exception(
|
||||
'Could not register a free dedyn.io domain after ' . self::MAX_SLUG_ATTEMPTS . ' attempts'
|
||||
. ($lastError !== '' ? ' (' . $lastError . ')' : '') . '. Please try again.',
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,8 @@ readonly class DockerController {
|
||||
public function __construct(
|
||||
private DockerActionManager $dockerActionManager,
|
||||
private ContainerDefinitionFetcher $containerDefinitionFetcher,
|
||||
private ConfigurationManager $configurationManager
|
||||
private ConfigurationManager $configurationManager,
|
||||
private DesecController $desecController,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -263,6 +264,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->desecController->updateIpIfDesecDomain();
|
||||
|
||||
$id = self::TOP_CONTAINER;
|
||||
|
||||
$this->PerformRecursiveContainerStart($id, $pullImage, $addToStreamingResponseBody);
|
||||
|
||||
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\Controller\DesecController $desecController */
|
||||
$desecController = $container->get(\AIO\Controller\DesecController::class);
|
||||
|
||||
$desecController->updateIpIfDesecDomain();
|
||||
@@ -14,6 +14,10 @@ class ConfigurationManager
|
||||
|
||||
private bool $noWrite = false;
|
||||
|
||||
private string $dailyBackupFileCache = '';
|
||||
|
||||
private int $dailyBackupFileMtime = 0;
|
||||
|
||||
public string $aioToken {
|
||||
get => $this->get('AIO_TOKEN', '');
|
||||
set { $this->set('AIO_TOKEN', $value); }
|
||||
@@ -194,6 +198,61 @@ class ConfigurationManager
|
||||
set { $this->set('turn_domain', $value); }
|
||||
}
|
||||
|
||||
public string $desecEmail {
|
||||
get => $this->get('desec_email', '');
|
||||
set { $this->set('desec_email', $value); }
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores a deSEC API token in the secrets store.
|
||||
* Unlike randomly-generated secrets, this token is obtained from the deSEC REST API and
|
||||
* must be set explicitly; it is never auto-generated.
|
||||
*/
|
||||
public function setDesecToken(string $token): void {
|
||||
$secrets = $this->get('secrets', []);
|
||||
$secrets['DESEC_TOKEN'] = $token;
|
||||
$this->set('secrets', $secrets);
|
||||
}
|
||||
|
||||
public function getDesecToken(): string {
|
||||
$secrets = $this->get('secrets', []);
|
||||
return isset($secrets['DESEC_TOKEN']) && is_string($secrets['DESEC_TOKEN'])
|
||||
? $secrets['DESEC_TOKEN']
|
||||
: '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores the deSEC account password in the secrets store so the user can log in at desec.io.
|
||||
*/
|
||||
public function setDesecPassword(string $password): void {
|
||||
$secrets = $this->get('secrets', []);
|
||||
$secrets['DESEC_PASSWORD'] = $password;
|
||||
$this->set('secrets', $secrets);
|
||||
}
|
||||
|
||||
public function getDesecPassword(): string {
|
||||
$secrets = $this->get('secrets', []);
|
||||
return isset($secrets['DESEC_PASSWORD']) && is_string($secrets['DESEC_PASSWORD'])
|
||||
? $secrets['DESEC_PASSWORD']
|
||||
: '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when the configured domain is a deSEC dedyn.io subdomain and a token is stored.
|
||||
*/
|
||||
public function isDesecDomain(): bool {
|
||||
return str_ends_with($this->domain, '.dedyn.io') && $this->getDesecToken() !== '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when a deSEC account token is stored but no domain has been configured yet.
|
||||
* This happens when account registration succeeded but domain registration subsequently failed.
|
||||
* In this state the user can retry domain registration with a different slug.
|
||||
*/
|
||||
public function isDesecAccountRegistered(): bool {
|
||||
return $this->getDesecToken() !== '' && $this->desecEmail !== '' && $this->domain === '';
|
||||
}
|
||||
|
||||
public string $apachePort {
|
||||
get => $this->getEnvironmentalVariableOrConfig('APACHE_PORT', 'apache_port', '443');
|
||||
set { $this->set('apache_port', $value); }
|
||||
@@ -298,6 +357,9 @@ class ConfigurationManager
|
||||
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
|
||||
{
|
||||
$configContent = (string)file_get_contents(DataConst::GetConfigFile());
|
||||
if ($configContent === '') {
|
||||
throw new \RuntimeException("The config file " . DataConst::GetConfigFile() . " is empty. It may have been truncated due to low disk space. Please restore it from a backup.");
|
||||
}
|
||||
$this->config = json_decode($configContent, true, 512, JSON_THROW_ON_ERROR);
|
||||
}
|
||||
|
||||
@@ -356,7 +418,7 @@ class ConfigurationManager
|
||||
}
|
||||
|
||||
public function getRegisteredSecret(string $secretId) : string {
|
||||
if ($this->secrets[$secretId]) {
|
||||
if (isset($this->secrets[$secretId])) {
|
||||
return $this->getAndGenerateSecret($secretId);
|
||||
}
|
||||
throw new \Exception("The secret " . $secretId . " was not registered. Please check if it is defined in secrets of containers.json.");
|
||||
@@ -556,7 +618,6 @@ class ConfigurationManager
|
||||
$this->set('domain', $domain);
|
||||
// Reset the borg restore password when setting the domain
|
||||
$this->borgRestorePassword = '';
|
||||
$this->startTransaction();
|
||||
$this->commitTransaction();
|
||||
}
|
||||
|
||||
@@ -698,7 +759,21 @@ class ConfigurationManager
|
||||
if ($df !== false && (int)$df < $size) {
|
||||
throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not have enough space for writing the config file! Not writing it back!");
|
||||
}
|
||||
file_put_contents(DataConst::GetConfigFile(), $content);
|
||||
// Write to a temp file first to avoid truncating the config file if the
|
||||
// disk fills up mid-write. rename() is atomic on POSIX filesystems, so the
|
||||
// original config is never touched until the new content is fully on disk.
|
||||
$tempFile = DataConst::GetConfigFile() . '.tmp';
|
||||
if (file_put_contents($tempFile, $content) === false) {
|
||||
// The file probably wasn't created, but better check nonetheless.
|
||||
if (file_exists($tempFile)) {
|
||||
unlink($tempFile);
|
||||
}
|
||||
throw new InvalidSettingConfigurationException("Failed to write temporary config file: " . $tempFile);
|
||||
}
|
||||
if (!rename($tempFile, DataConst::GetConfigFile())) {
|
||||
unlink($tempFile);
|
||||
throw new InvalidSettingConfigurationException("Failed to rename " . $tempFile . " to " . DataConst::GetConfigFile());
|
||||
}
|
||||
$this->config = [];
|
||||
}
|
||||
|
||||
@@ -760,23 +835,47 @@ class ConfigurationManager
|
||||
$time .= PHP_EOL;
|
||||
}
|
||||
file_put_contents(DataConst::GetDailyBackupTimeFile(), $time);
|
||||
$this->dailyBackupFileCache = '';
|
||||
$this->dailyBackupFileMtime = 0;
|
||||
}
|
||||
|
||||
private function getDailyBackupFileContent() : string {
|
||||
$file = DataConst::GetDailyBackupTimeFile();
|
||||
if (!file_exists($file)) {
|
||||
$this->dailyBackupFileCache = '';
|
||||
$this->dailyBackupFileMtime = 0;
|
||||
return '';
|
||||
}
|
||||
$mtime = filemtime($file);
|
||||
if ($mtime !== false && $this->dailyBackupFileMtime === $mtime && $this->dailyBackupFileCache !== '') {
|
||||
return $this->dailyBackupFileCache;
|
||||
}
|
||||
$content = file_get_contents($file);
|
||||
if ($content === false || $content === '') {
|
||||
return '';
|
||||
}
|
||||
if ($mtime !== false) {
|
||||
$this->dailyBackupFileCache = $content;
|
||||
$this->dailyBackupFileMtime = $mtime;
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function getDailyBackupTime() : string {
|
||||
if (!file_exists(DataConst::GetDailyBackupTimeFile())) {
|
||||
$content = $this->getDailyBackupFileContent();
|
||||
if ($content === '') {
|
||||
return '';
|
||||
}
|
||||
$dailyBackupFile = (string)file_get_contents(DataConst::GetDailyBackupTimeFile());
|
||||
$dailyBackupFileArray = explode("\n", $dailyBackupFile);
|
||||
$dailyBackupFileArray = explode("\n", $content);
|
||||
return $dailyBackupFileArray[0];
|
||||
}
|
||||
|
||||
public function areAutomaticUpdatesEnabled() : bool {
|
||||
if (!file_exists(DataConst::GetDailyBackupTimeFile())) {
|
||||
$content = $this->getDailyBackupFileContent();
|
||||
if ($content === '') {
|
||||
return false;
|
||||
}
|
||||
$dailyBackupFile = (string)file_get_contents(DataConst::GetDailyBackupTimeFile());
|
||||
$dailyBackupFileArray = explode("\n", $dailyBackupFile);
|
||||
$dailyBackupFileArray = explode("\n", $content);
|
||||
if (isset($dailyBackupFileArray[1]) && $dailyBackupFileArray[1] === 'automaticUpdatesAreNotEnabled') {
|
||||
return false;
|
||||
} else {
|
||||
@@ -788,11 +887,10 @@ class ConfigurationManager
|
||||
if (file_exists(DataConst::GetDailyBackupTimeFile())) {
|
||||
unlink(DataConst::GetDailyBackupTimeFile());
|
||||
}
|
||||
$this->dailyBackupFileCache = '';
|
||||
$this->dailyBackupFileMtime = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidSettingConfigurationException
|
||||
*/
|
||||
public function setAdditionalBackupDirectories(string $additionalBackupDirectories) : void {
|
||||
$additionalBackupDirectoriesArray = explode("\n", $additionalBackupDirectories);
|
||||
$validDirectories = '';
|
||||
@@ -1066,6 +1164,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->getDesecToken(),
|
||||
default => $this->getRegisteredSecret($placeholder),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -157,11 +157,12 @@ readonly class DockerActionManager {
|
||||
$response = "";
|
||||
$separator = "\r\n";
|
||||
$line = strtok($responseBody, $separator);
|
||||
$response = substr((string)$line, 8) . $separator;
|
||||
if ($line !== false) {
|
||||
$response = substr($line, 8) . $separator;
|
||||
}
|
||||
|
||||
while ($line !== false) {
|
||||
$line = strtok($separator);
|
||||
$response .= substr((string)$line, 8) . $separator;
|
||||
while (($line = strtok($separator)) !== false) {
|
||||
$response .= substr($line, 8) . $separator;
|
||||
}
|
||||
|
||||
return $response;
|
||||
@@ -187,7 +188,7 @@ readonly class DockerActionManager {
|
||||
];
|
||||
|
||||
if ($volume->name === 'nextcloud_aio_nextcloud_datadir' || $volume->name === 'nextcloud_aio_backupdir') {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
$firstChar = substr($volume->name, 0, 1);
|
||||
@@ -425,6 +426,13 @@ readonly class DockerActionManager {
|
||||
// $mounts[] = ["Type" => "bind", "Source" => $volume->name, "Target" => $volume->mountPoint, "ReadOnly" => !$volume->isWritable, "BindOptions" => [ "Propagation" => "rshared"]];
|
||||
// }
|
||||
|
||||
// Special things for the jellyfin community container
|
||||
} elseif ($container->identifier === 'nextcloud-aio-jellyfin') {
|
||||
$lldapIp = gethostbyname('nextcloud-aio-lldap');
|
||||
if ($lldapIp !== 'nextcloud-aio-lldap') {
|
||||
$requestBody['HostConfig']['ExtraHosts'] = ['nextcloud-aio-lldap:' . $lldapIp];
|
||||
}
|
||||
|
||||
// Special things for the caddy community container
|
||||
} elseif ($container->identifier === 'nextcloud-aio-caddy') {
|
||||
$requestBody['HostConfig']['ExtraHosts'] = ['host.docker.internal:host-gateway'];
|
||||
@@ -859,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);
|
||||
|
||||
|
||||
@@ -132,6 +132,30 @@
|
||||
{% 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>
|
||||
<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>
|
||||
<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="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>
|
||||
{% endif %}
|
||||
|
||||
<h2>Restore former AIO instance from backup</h2>
|
||||
@@ -375,6 +399,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>
|
||||
@@ -599,8 +631,8 @@
|
||||
<summary>Click here to change your AIO passphrase</summary>
|
||||
<p>You can change your AIO passphrase below:</p>
|
||||
<form method="POST" action="api/configuration" class="xhr">
|
||||
<input type="password" autocomplete="current-password" name="current-master-password" placeholder="Your current AIO passphrase" id="current-master-password" data-input-show-password="showPassword('current-master-password')">
|
||||
<input type="password" autocomplete="new-password" name="new-master-password" placeholder="Your new AIO passphrase" id="new-master-password" data-input-show-password="showPassword('new-master-password')">
|
||||
<input type="password" autocomplete="current-password" name="current-master-password" placeholder="Your current AIO passphrase" id="current-master-password" data-input-show-password>
|
||||
<input type="password" autocomplete="new-password" name="new-master-password" placeholder="Your new AIO passphrase" id="new-master-password" data-input-show-password>
|
||||
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
|
||||
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
|
||||
<input type="submit" value="Submit passphrase change" />
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
@@ -224,16 +224,7 @@
|
||||
</form>
|
||||
<p><strong>Minimal system requirements:</strong> When any optional container is enabled, at least 2GB RAM, a dual-core CPU and 40GB system storage are required. When enabling ClamAV, Nextcloud Talk Recording-server or Fulltextsearch, at least 3GB RAM are required. For Talk Recording-server additional 2 vCPUs are required. When enabling everything, at least 5GB RAM and a quad-core CPU are required. Recommended are at least 1GB more RAM than the minimal requirement. For further advice and recommendations see <strong><a target="_blank" href="https://github.com/nextcloud/all-in-one/discussions/1335">this documentation</a></strong></p>
|
||||
{% if isAnyRunning == true %}
|
||||
<script type="text/javascript" src="disable-clamav.js"></script>
|
||||
<script type="text/javascript" src="disable-docker-socket-proxy.js"></script>
|
||||
<script type="text/javascript" src="disable-harp.js"></script>
|
||||
<script type="text/javascript" src="disable-talk.js"></script>
|
||||
<script type="text/javascript" src="disable-collabora.js?v2"></script>
|
||||
<script type="text/javascript" src="disable-onlyoffice.js?v2"></script>
|
||||
<script type="text/javascript" src="disable-imaginary.js"></script>
|
||||
<script type="text/javascript" src="disable-fulltextsearch.js"></script>
|
||||
<script type="text/javascript" src="disable-talk-recording.js"></script>
|
||||
<script type="text/javascript" src="disable-whiteboard.js"></script>
|
||||
<script type="text/javascript" src="disable-containers.js"></script>
|
||||
{% endif %}
|
||||
|
||||
{% if is_collabora_enabled == true and isAnyRunning == false and was_start_button_clicked == true %}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<link rel="icon" href="img/favicon.png">
|
||||
<script type="text/javascript" src="forms.js?v2"></script>
|
||||
<script type="text/javascript" src="toggle-dark-mode.js?v1"></script>
|
||||
<script type="text/javascript" src="click-handlers.js?v1"></script>
|
||||
<script type="text/javascript" src="click-handlers.js?v2"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{% if is_login_allowed == true %}
|
||||
<p>Log in using your Nextcloud AIO passphrase:</p>
|
||||
<form method="POST" action="api/auth/login" class="xhr">
|
||||
<input type="password" autocomplete="current-password" name="password" placeholder="Password" id="master-password" data-input-show-password="showPassword('master-password')">
|
||||
<input type="password" autocomplete="current-password" name="password" placeholder="Password" id="master-password" data-input-show-password>
|
||||
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
|
||||
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
|
||||
<input type="submit" class="button" value="Log in" />
|
||||
|
||||
64
readme.md
64
readme.md
@@ -87,6 +87,70 @@ Included are:
|
||||
|---|---|
|
||||
|  |  |
|
||||
|
||||
## Architecture overview
|
||||
|
||||
```mermaid
|
||||
flowchart TB
|
||||
%% ── Styles ───────────────────────────────────────────────────────────────────
|
||||
classDef user fill:#FFF3CD,stroke:#F0AD4E,color:#333
|
||||
classDef master fill:#E8D5F5,stroke:#9B59B6,color:#222
|
||||
classDef core fill:#D6EAF8,stroke:#2E86C1,color:#222
|
||||
classDef opt fill:#D5F5E3,stroke:#27AE60,color:#222
|
||||
classDef community fill:#FDEBD0,stroke:#E67E22,color:#222
|
||||
classDef access fill:#EAFAF1,stroke:#1E8449,color:#222
|
||||
|
||||
%% ── Top row: people ─────────────────────────────────────────────────────────
|
||||
YOU(["🧑💻 Admin\n(You)"]):::user
|
||||
ENDUSER(["🧑🤝🧑 Users\n(family / team)"]):::user
|
||||
|
||||
%% ── Everything that runs inside AIO ─────────────────────────────────────────
|
||||
subgraph AIO[" 🐳 Nextcloud AIO "]
|
||||
MC(["🧠 Mastercontainer\n─────────────────────────\n▸ AIO interface :8080 / :8443\n▸ Manages & updates containers\n▸ Handles backups"]):::master
|
||||
|
||||
subgraph CORE[" 📦 Core Stack (auto-started) "]
|
||||
PROXY(["🔀 Apache\nProxy & HTTPS"]):::core
|
||||
NC(["☁️ Nextcloud\nApp Server"]):::core
|
||||
DB(["🗄️ PostgreSQL\nDatabase"]):::core
|
||||
CACHE(["⚡ Redis\nCache"]):::core
|
||||
PUSH(["🔔 Notify Push\nReal-time sync"]):::core
|
||||
end
|
||||
|
||||
subgraph OPT[" 🧩 Optional Built-in Containers (enable in AIO interface) "]
|
||||
COLLA(["📄 Nextcloud Office"]):::opt
|
||||
OO(["📄 OnlyOffice\nDocument Server"]):::opt
|
||||
TALK(["🎙️ Talk\nVideo & Voice calls"]):::opt
|
||||
TALKREC(["🎬 Talk Recording"]):::opt
|
||||
FTS(["🔎 Full-text Search\n(Elasticsearch)"]):::opt
|
||||
IMAG(["🖼️ Imaginary\nImage previews"]):::opt
|
||||
CLAM(["🦠 ClamAV\nAntivirus"]):::opt
|
||||
WB(["🖊️ Whiteboard"]):::opt
|
||||
end
|
||||
|
||||
COMM(["🌍 Community Containers\n──────────────────────\n30+ optional add-ons\nSee community-containers/"]):::community
|
||||
click COMM "https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers" "Browse community containers"
|
||||
end
|
||||
|
||||
%% ── Result node (outside AIO) ────────────────────────────────────────────────
|
||||
NC_URL(["🌐 https://your-domain.com\n✅ Nextcloud — ready to use!"]):::access
|
||||
|
||||
%% ── Flows ────────────────────────────────────────────────────────────────────
|
||||
YOU -->|"① open :8080 or :8443 in browser"| MC
|
||||
MC -->|"② auto-starts & wires up"| CORE
|
||||
MC -. "③ enable in AIO interface" .-> OPT
|
||||
MC -. "④ add via AIO interface" .-> COMM
|
||||
|
||||
PROXY --> NC
|
||||
NC --- DB
|
||||
NC --- CACHE
|
||||
NC --- PUSH
|
||||
OPT -->|"integrate with"| NC
|
||||
COMM -.->|"integrate with"| NC
|
||||
|
||||
CORE -->|"⑤ stack is ready!"| NC_URL
|
||||
ENDUSER -->|"⑥ browser / app"| NC_URL
|
||||
YOU -->|"⑥ use normally"| NC_URL
|
||||
```
|
||||
|
||||
## How to use this?
|
||||
|
||||
The steps below are written for Linux. For platform-specific guidance see:
|
||||
|
||||
Reference in New Issue
Block a user