mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-21 10:50:10 +00:00
Compare commits
331 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
756511f16a | ||
|
|
4ab3520d10 | ||
|
|
de01850279 | ||
|
|
70b87ed9f8 | ||
|
|
e389a17a74 | ||
|
|
331442fe38 | ||
|
|
1208000234 | ||
|
|
083150bfb3 | ||
|
|
f4944fbf92 | ||
|
|
3f775653a0 | ||
|
|
c16d59f9e4 | ||
|
|
605f8c87fb | ||
|
|
1dee9c465c | ||
|
|
ec1f5aa129 | ||
|
|
17fe0db050 | ||
|
|
3c40abbb60 | ||
|
|
163f6ea10a | ||
|
|
1bd3c2cb4c | ||
|
|
b90226282a | ||
|
|
08aa2eece3 | ||
|
|
e18f8308ed | ||
|
|
0b961c9dfc | ||
|
|
9b3ad32764 | ||
|
|
fb6668755c | ||
|
|
71231b9b8b | ||
|
|
e53281610d | ||
|
|
3568adf8c6 | ||
|
|
b1d5204078 | ||
|
|
79946a876c | ||
|
|
882fd3be26 | ||
|
|
7eb59374a2 | ||
|
|
28919e27f3 | ||
|
|
098a6c4b29 | ||
|
|
d20cf5777f | ||
|
|
6b3be9d6e8 | ||
|
|
03e2ffb3c9 | ||
|
|
1e3dccf976 | ||
|
|
84a5e28784 | ||
|
|
4de666eba4 | ||
|
|
e061a16cb7 | ||
|
|
f5e36c854e | ||
|
|
ab384f6e29 | ||
|
|
e5ca49356c | ||
|
|
bd81c3133f | ||
|
|
c6e45ef378 | ||
|
|
bea8ca86dd | ||
|
|
ab5369023b | ||
|
|
f9290e49c8 | ||
|
|
becfb3cc16 | ||
|
|
7cf9fe8dec | ||
|
|
aa32d496e6 | ||
|
|
d9f994fc5d | ||
|
|
df9457bd91 | ||
|
|
85999c297c | ||
|
|
af1612cda1 | ||
|
|
211ce3c69b | ||
|
|
7b4d0baa6c | ||
|
|
bce08a1564 | ||
|
|
ba6a0f4652 | ||
|
|
02ed48f0d5 | ||
|
|
979f2e45fe | ||
|
|
710b0d15f8 | ||
|
|
9b622f3c37 | ||
|
|
914bc68eea | ||
|
|
16dadb8f4e | ||
|
|
3d94ae56c4 | ||
|
|
7833057c6d | ||
|
|
56c400bd83 | ||
|
|
df9882a944 | ||
|
|
dffba06345 | ||
|
|
a05a3c02a2 | ||
|
|
a0cbcc7f52 | ||
|
|
94a508d8aa | ||
|
|
38f9cb2046 | ||
|
|
bc77beced4 | ||
|
|
b86c1f490a | ||
|
|
d33f3f3b26 | ||
|
|
ae6b328de4 | ||
|
|
7f0f84ecfb | ||
|
|
f3c20d8b76 | ||
|
|
638675906c | ||
|
|
9cffa4db38 | ||
|
|
906926382f | ||
|
|
8a213fa29a | ||
|
|
c31990e41d | ||
|
|
700ddf25bf | ||
|
|
5c966bc1f8 | ||
|
|
d093b524ed | ||
|
|
87ac260764 | ||
|
|
a3ed26063c | ||
|
|
bd8546f30d | ||
|
|
fe251a9996 | ||
|
|
1ef7945c31 | ||
|
|
9d305844bf | ||
|
|
413633cfea | ||
|
|
f8820cb7c9 | ||
|
|
d632df56bd | ||
|
|
d34e18ee91 | ||
|
|
170e512690 | ||
|
|
3b97270862 | ||
|
|
d5db7568fe | ||
|
|
0969d0582a | ||
|
|
459fe462ab | ||
|
|
efbc247cb6 | ||
|
|
9019fda7e4 | ||
|
|
b13e8afe18 | ||
|
|
3fa584442b | ||
|
|
6b6500c29d | ||
|
|
b02d5cde1a | ||
|
|
4a1539b473 | ||
|
|
9e0079effc | ||
|
|
b8d5903c3b | ||
|
|
ebe30e69f9 | ||
|
|
e323f9770b | ||
|
|
d5272c0ea7 | ||
|
|
daa9a94ebd | ||
|
|
ccd4c9046a | ||
|
|
ed7b1e3cba | ||
|
|
d45c42f8ed | ||
|
|
bec7ee9a76 | ||
|
|
dea53d9dad | ||
|
|
374b7bf7a6 | ||
|
|
e56a388cc5 | ||
|
|
df8b340b18 | ||
|
|
febe766eac | ||
|
|
c3aa304e08 | ||
|
|
64f37b959e | ||
|
|
9ff31d48cc | ||
|
|
92f00b2068 | ||
|
|
7e5c56c066 | ||
|
|
bd0bb708b8 | ||
|
|
4f93ffc870 | ||
|
|
77a0717417 | ||
|
|
de137f70ae | ||
|
|
16b0f77895 | ||
|
|
bdcd4fc240 | ||
|
|
2ad2d7c9eb | ||
|
|
72248fc4bd | ||
|
|
15526b6fed | ||
|
|
cccf21805e | ||
|
|
b6f8d3e8e9 | ||
|
|
c5201731c3 | ||
|
|
30911356c1 | ||
|
|
bf4ef11474 | ||
|
|
cbf579df18 | ||
|
|
8c1e1a268e | ||
|
|
7a93ad0e4e | ||
|
|
84f54b58aa | ||
|
|
ed8979ab2d | ||
|
|
7bca6b3d2e | ||
|
|
a04947034e | ||
|
|
fb7d5e531f | ||
|
|
bc9abd39a9 | ||
|
|
bb09e4ac0a | ||
|
|
d06c4419cc | ||
|
|
38dd034fae | ||
|
|
0bab4eaa6d | ||
|
|
50e3a5f5de | ||
|
|
6f4b918677 | ||
|
|
da2b967a33 | ||
|
|
63f568ef36 | ||
|
|
588f9a36e7 | ||
|
|
a1eac7dbbc | ||
|
|
e4becc7249 | ||
|
|
dd6925d004 | ||
|
|
e9d1afe4fd | ||
|
|
89b0c1f73d | ||
|
|
6a51a6a251 | ||
|
|
d424776a43 | ||
|
|
9b8937884e | ||
|
|
dd7dac314f | ||
|
|
bdb159b2fe | ||
|
|
bd80fd1915 | ||
|
|
54687a2375 | ||
|
|
f9f29ae42a | ||
|
|
78959b26cb | ||
|
|
b027cdd293 | ||
|
|
36f38e549e | ||
|
|
029b6ea797 | ||
|
|
f42fa09202 | ||
|
|
4e7fa6b4b9 | ||
|
|
43eddabeaf | ||
|
|
b47e674aa7 | ||
|
|
54f39b5334 | ||
|
|
19369c7ce2 | ||
|
|
cd8ba20716 | ||
|
|
0e36ae0ba9 | ||
|
|
fd88b61882 | ||
|
|
90991c6c24 | ||
|
|
99b45997a6 | ||
|
|
8cf7d47f26 | ||
|
|
4e67b82d46 | ||
|
|
820ac1d918 | ||
|
|
e63d59ff1e | ||
|
|
df8791b7f8 | ||
|
|
df808c10bb | ||
|
|
3bba9da0d5 | ||
|
|
968103ee45 | ||
|
|
982f7644f5 | ||
|
|
bdfb238683 | ||
|
|
b02a874497 | ||
|
|
0b540ef4fc | ||
|
|
bd8a1c024d | ||
|
|
48e692a09f | ||
|
|
d767ec65d9 | ||
|
|
0e60c52b91 | ||
|
|
77613f456c | ||
|
|
adb4279de1 | ||
|
|
3616ce48a9 | ||
|
|
0397f30bb5 | ||
|
|
b7708b66df | ||
|
|
6b0b65e425 | ||
|
|
896b44a172 | ||
|
|
39f7874ea7 | ||
|
|
a0dc8781a7 | ||
|
|
db5cab9e34 | ||
|
|
a547f1d892 | ||
|
|
a03fad2c33 | ||
|
|
6458bf6613 | ||
|
|
24eefc7009 | ||
|
|
e358e40c15 | ||
|
|
a639a9f103 | ||
|
|
1c987b180c | ||
|
|
c8ffe9ef4a | ||
|
|
12f6220591 | ||
|
|
31a16535fe | ||
|
|
e81c4e3041 | ||
|
|
87192838e8 | ||
|
|
9f2c74b030 | ||
|
|
201dbc15ae | ||
|
|
f8a1c1862a | ||
|
|
4b10fcada2 | ||
|
|
d6f0023a42 | ||
|
|
b9ada72be3 | ||
|
|
41507c05fa | ||
|
|
53044c8354 | ||
|
|
d01a1087fa | ||
|
|
2771f5124d | ||
|
|
d9e8c98724 | ||
|
|
f282d1439c | ||
|
|
e92daa62bf | ||
|
|
2faa1357d3 | ||
|
|
fa6a238d16 | ||
|
|
ab7c2fccad | ||
|
|
7606cadf40 | ||
|
|
6f87a30595 | ||
|
|
e1ec9c738d | ||
|
|
9daecad5b3 | ||
|
|
d41ae98de7 | ||
|
|
8a71b4e9dc | ||
|
|
aae58915d7 | ||
|
|
0f728d2660 | ||
|
|
ec7f379779 | ||
|
|
e7d1d19936 | ||
|
|
62f129bdd2 | ||
|
|
e5fce3eb89 | ||
|
|
69122c55bf | ||
|
|
f5102f8562 | ||
|
|
3a29a55dc0 | ||
|
|
5c25656460 | ||
|
|
d4645d50ab | ||
|
|
4cbc8c7e53 | ||
|
|
4cffe12e16 | ||
|
|
be243fdba9 | ||
|
|
8397ff50b4 | ||
|
|
132b97ba20 | ||
|
|
228d113bb0 | ||
|
|
203b17d316 | ||
|
|
d3d8b11e28 | ||
|
|
c789b7e5db | ||
|
|
3ac260837f | ||
|
|
3118ecf385 | ||
|
|
8450d7d9a5 | ||
|
|
9d4c591f1a | ||
|
|
4e598b9de3 | ||
|
|
b6470db144 | ||
|
|
6210657558 | ||
|
|
5641f62561 | ||
|
|
6c81f2b244 | ||
|
|
82adedf26a | ||
|
|
c4e5e0e8d4 | ||
|
|
ce47fab555 | ||
|
|
0bbae775c6 | ||
|
|
c283c71362 | ||
|
|
ca5e97ef5b | ||
|
|
19e1e067bc | ||
|
|
d5a1fa32c4 | ||
|
|
be299dfe8c | ||
|
|
56af317778 | ||
|
|
1cf6f995d4 | ||
|
|
dc97ef872e | ||
|
|
99cf7f385a | ||
|
|
a721e250bd | ||
|
|
95311fd7c3 | ||
|
|
abbeaa31d7 | ||
|
|
ac06db59c7 | ||
|
|
3904e24ee0 | ||
|
|
e80fd26fdb | ||
|
|
0f8561a920 | ||
|
|
677123e57b | ||
|
|
e60cffc4cc | ||
|
|
dced664925 | ||
|
|
ab0856842b | ||
|
|
2bd8894454 | ||
|
|
1b7c7a3d66 | ||
|
|
b88b55feb4 | ||
|
|
1a2b4217ec | ||
|
|
dd607243d7 | ||
|
|
fcabd7cf50 | ||
|
|
b63f50e00b | ||
|
|
7e235b088f | ||
|
|
7239360a70 | ||
|
|
ece09c2f41 | ||
|
|
6e34656540 | ||
|
|
1e8d9809c9 | ||
|
|
27d70b7739 | ||
|
|
77e6f59610 | ||
|
|
bce24687cc | ||
|
|
7716548c75 | ||
|
|
dafa03698b | ||
|
|
fd3c30bdb7 | ||
|
|
730128b1ab | ||
|
|
3645033663 | ||
|
|
99838dea4f | ||
|
|
8889e92a64 | ||
|
|
2af13efe63 | ||
|
|
1f58094ddd | ||
|
|
0523af0f8a | ||
|
|
fb8fcae3d6 | ||
|
|
240a29cb2b | ||
|
|
073f5e18e3 |
2
.github/workflows/command-rebase.yml
vendored
2
.github/workflows/command-rebase.yml
vendored
@@ -37,7 +37,7 @@ jobs:
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
|
||||
- name: Automatic Rebase
|
||||
uses: cirrus-actions/rebase@1.7
|
||||
uses: cirrus-actions/rebase@1.8
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
|
||||
|
||||
6
.github/workflows/dependency-updates.yml
vendored
6
.github/workflows/dependency-updates.yml
vendored
@@ -1,18 +1,20 @@
|
||||
name: dependency-updates
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '00 12 * * *'
|
||||
|
||||
jobs:
|
||||
dependency_updates:
|
||||
name: Run dependency update script
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: nanasess/setup-php@master
|
||||
with:
|
||||
php-version: '8.0'
|
||||
php-version: 8.0
|
||||
extensions: apcu
|
||||
- name: Run dependency update script
|
||||
run: |
|
||||
set -x
|
||||
|
||||
103
.github/workflows/lint-php.yml
vendored
103
.github/workflows/lint-php.yml
vendored
@@ -1,48 +1,55 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- stable*
|
||||
|
||||
jobs:
|
||||
php-lint:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ["8.0"]
|
||||
|
||||
name: php-lint
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
coverage: none
|
||||
|
||||
- name: Lint
|
||||
run: cd php && composer run lint
|
||||
|
||||
summary:
|
||||
runs-on: ubuntu-latest
|
||||
needs: php-lint
|
||||
|
||||
if: always()
|
||||
|
||||
name: php-lint-summary
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: lint-php-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
php-lint:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ["8.0"]
|
||||
|
||||
name: php-lint
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
coverage: none
|
||||
|
||||
- name: Lint
|
||||
run: cd php && composer run lint
|
||||
|
||||
summary:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest
|
||||
needs: php-lint
|
||||
|
||||
if: always()
|
||||
|
||||
name: php-lint-summary
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi
|
||||
|
||||
2
.github/workflows/lock-threads.yml
vendored
2
.github/workflows/lock-threads.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
action:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v3
|
||||
- uses: dessant/lock-threads@v4
|
||||
with:
|
||||
issue-inactive-days: '14'
|
||||
process-only: 'issues'
|
||||
|
||||
5
.github/workflows/nextcloud-update.yml
vendored
5
.github/workflows/nextcloud-update.yml
vendored
@@ -2,6 +2,7 @@
|
||||
name: nextcloud-update
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '00 12 * * *'
|
||||
|
||||
@@ -57,8 +58,8 @@ jobs:
|
||||
| sort -V \
|
||||
| tail -1
|
||||
)"
|
||||
sed -i "s|pecl install imagick.*\;|pecl install imagick-$imagick_version\;|" ./Containers/nextcloud/Dockerfile
|
||||
|
||||
sed -i "s|pecl install imagick.*|pecl install imagick-$imagick_version >/dev/null|" ./Containers/nextcloud/start.sh
|
||||
|
||||
# Nextcloud
|
||||
NC_MAJOR="$(grep "ENV NEXTCLOUD_VERSION" ./Containers/nextcloud/Dockerfile | grep -oP '[23][0-9]')"
|
||||
NCVERSION=$(curl -s -m 900 https://download.nextcloud.com/server/releases/ | sed --silent 's/.*href="nextcloud-\([^"]\+\).zip.asc".*/\1/p' | grep "$NC_MAJOR" | sort --version-sort | tail -1)
|
||||
|
||||
29
.github/workflows/php-deprecation-detector.yml
vendored
Normal file
29
.github/workflows/php-deprecation-detector.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: PHP Deprecation Detector
|
||||
# See https://github.com/wapmorgan/PhpDeprecationDetector
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
psalm:
|
||||
name: PHP Deprecation Detector
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up php8.0
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.0
|
||||
extensions: apcu
|
||||
coverage: none
|
||||
|
||||
- name: Run script
|
||||
run: |
|
||||
set -x
|
||||
cd php
|
||||
composer global require wapmorgan/php-deprecation-detector dev-master
|
||||
composer install
|
||||
composer run php-deprecation-detector
|
||||
2
.github/workflows/shellcheck.yml
vendored
2
.github/workflows/shellcheck.yml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
|
||||
jobs:
|
||||
shellcheck:
|
||||
name: Github Actions
|
||||
name: Check Shell
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
* @szaimen @juliushaertl
|
||||
@@ -1,7 +1,7 @@
|
||||
# Caddy is a requirement
|
||||
FROM caddy:2.5.2-alpine as caddy
|
||||
FROM caddy:2.6.2-alpine as caddy
|
||||
|
||||
FROM debian:bullseye-20220912-slim
|
||||
FROM debian:bullseye-20221205-slim
|
||||
|
||||
RUN mkdir -p /mnt/data; \
|
||||
chown www-data:www-data /mnt/data;
|
||||
@@ -46,6 +46,10 @@ RUN rm /etc/apache2/ports.conf; \
|
||||
RUN set -ex; \
|
||||
a2dissite 000-default && \
|
||||
a2dissite default-ssl && \
|
||||
rm -f /etc/apache2/sites-enabled/000-default.conf && \
|
||||
rm -f /etc/apache2/sites-enabled/default-ssl.conf && \
|
||||
rm /etc/apache2/sites-available/000-default.conf && \
|
||||
rm /etc/apache2/sites-available/default-ssl.conf && \
|
||||
a2ensite nextcloud.conf && \
|
||||
rm -rf /var/www/html/* && \
|
||||
chown www-data:www-data -R /var/log/apache2; \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
curl -skfI localhost:8000 || exit 1
|
||||
if [ "$APACHE_PORT" != '443' ]; then
|
||||
curl -skfI localhost:"$APACHE_PORT" || exit 1
|
||||
nc -z localhost "$APACHE_PORT" || exit 1
|
||||
else
|
||||
curl -skfI https://"$NC_DOMAIN":"$APACHE_PORT" || exit 1
|
||||
nc -z "$NC_DOMAIN" "$APACHE_PORT" || exit 1
|
||||
fi
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
Listen 8000
|
||||
<VirtualHost *:8000>
|
||||
ServerName localhost
|
||||
|
||||
# Add error log
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
CustomLog /proc/self/fd/1 combined
|
||||
ErrorLog /proc/self/fd/2
|
||||
|
||||
# PHP match
|
||||
<FilesMatch "\.php$">
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
nodaemon=true
|
||||
logfile=/var/log/supervisord/supervisord.log
|
||||
pidfile=/var/run/supervisord/supervisord.pid
|
||||
childlogdir=/var/log/supervisord/
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=error
|
||||
|
||||
[program:apache]
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=apachectl -DFOREGROUND
|
||||
|
||||
[program:caddy]
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=/usr/bin/caddy run -config /Caddyfile
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
nodaemon=true
|
||||
logfile=/var/log/supervisord/supervisord.log
|
||||
pidfile=/var/run/supervisord/supervisord.pid
|
||||
childlogdir=/var/log/supervisord/
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=error
|
||||
|
||||
[program:apache]
|
||||
# stdout_logfile=/dev/stdout
|
||||
# stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=apachectl -DFOREGROUND
|
||||
|
||||
[program:caddy]
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=/usr/bin/caddy run --config /Caddyfile
|
||||
@@ -1,10 +1,11 @@
|
||||
FROM debian:bullseye-20220912-slim
|
||||
FROM debian:bullseye-20221205-slim
|
||||
|
||||
RUN set -ex; \
|
||||
\
|
||||
echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list; \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends borgbackup -t bullseye-backports; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
borgbackup \
|
||||
rsync \
|
||||
fuse \
|
||||
python3-llfuse \
|
||||
|
||||
@@ -66,7 +66,7 @@ if [ "$BORG_MODE" = backup ]; then
|
||||
|
||||
# Test that nothing is empty
|
||||
for directory in "${VOLUME_DIRS[@]}"; do
|
||||
if [ -z "$(ls -A "$directory")" ]; then
|
||||
if [ -z "$(ls -A "$directory")" ] && [ "$directory" != "/nextcloud_aio_volumes/nextcloud_aio_elasticsearch" ]; then
|
||||
echo "$directory is empty which is not allowed."
|
||||
exit 1
|
||||
fi
|
||||
@@ -88,6 +88,7 @@ if [ "$BORG_MODE" = backup ]; then
|
||||
if [ -f "/nextcloud_aio_volumes/nextcloud_aio_mastercontainer/data/borg.config" ]; then
|
||||
echo "Cannot initialize a new repository as that was already done at least one time."
|
||||
echo "If you still want to do so, you may delete the 'borg.config' file that is stored in the mastercontainer volume manually, which will allow you to initialize a new borg repository in the chosen directory."
|
||||
echo "By default it is stored here: /var/lib/docker/volumes/nextcloud_aio_mastercontainer/_data/data/borg.config"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -155,6 +156,13 @@ if [ "$BORG_MODE" = backup ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Compact archives
|
||||
echo "Compacting the archives..."
|
||||
if ! borg compact "$BORG_BACKUP_DIRECTORY"; then
|
||||
echo "Failed to compact archives!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Back up additional directories of the host
|
||||
if [ "$ADDITIONAL_DIRECTORIES_BACKUP" = 'yes' ]; then
|
||||
if [ -d "/docker_volumes/" ]; then
|
||||
@@ -172,11 +180,14 @@ if [ "$BORG_MODE" = backup ]; then
|
||||
echo "Backup of additional docker-volumes failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! borg prune --prefix '*_*-additional-docker-volumes' "${BORG_PRUNE_OPTS[@]}"; then
|
||||
echo "Failed to prune additional docker-volumes archives!"
|
||||
exit 1
|
||||
fi
|
||||
if ! borg compact "$BORG_BACKUP_DIRECTORY"; then
|
||||
echo "Failed to compact archives!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ -d "/host_mounts/" ]; then
|
||||
EXCLUDED_DIRECTORIES=(home/*/.cache root/.cache var/cache lost+found run var/run dev tmp sys proc)
|
||||
@@ -200,6 +211,10 @@ if [ "$BORG_MODE" = backup ]; then
|
||||
echo "Failed to prune additional host-mount archives!"
|
||||
exit 1
|
||||
fi
|
||||
if ! borg compact "$BORG_BACKUP_DIRECTORY"; then
|
||||
echo "Failed to compact archives!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -243,10 +258,13 @@ if [ "$BORG_MODE" = restore ]; then
|
||||
|
||||
# Restore everything except the configuration file
|
||||
if ! rsync --stats --archive --human-readable -vv --delete \
|
||||
--exclude "nextcloud_aio_mastercontainer/session/"** \
|
||||
--exclude "nextcloud_aio_apache/caddy/"** \
|
||||
--exclude "nextcloud_aio_mastercontainer/caddy/"** \
|
||||
--exclude "nextcloud_aio_mastercontainer/certs/"** \
|
||||
--exclude "nextcloud_aio_mastercontainer/data/daily_backup_running" \
|
||||
--exclude "nextcloud_aio_mastercontainer/data/configuration.json" \
|
||||
--exclude "nextcloud_aio_mastercontainer/data/daily_backup_running" \
|
||||
--exclude "nextcloud_aio_mastercontainer/data/session_date_file" \
|
||||
--exclude "nextcloud_aio_mastercontainer/session/"** \
|
||||
/tmp/borg/nextcloud_aio_volumes/ /nextcloud_aio_volumes; then
|
||||
echo "Something failed while restoring from backup."
|
||||
umount /tmp/borg
|
||||
@@ -318,6 +336,9 @@ if [ "$BORG_MODE" = restore ]; then
|
||||
# Add file to Nextcloud container so that it performs a fingerprint update the next time
|
||||
touch "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/fingerprint.update"
|
||||
chmod 777 "/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/fingerprint.update"
|
||||
|
||||
# Delete redis cache
|
||||
rm -f "/mnt/redis/dump.rdb"
|
||||
fi
|
||||
|
||||
# Do the Backup check
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Probably from this file: https://github.com/Cisco-Talos/clamav/blob/main/Dockerfile
|
||||
FROM clamav/clamav:0.105.1
|
||||
FROM clamav/clamav:0.105.1-7
|
||||
|
||||
RUN apk add --update --no-cache tzdata
|
||||
COPY clamav.conf /tmp/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# From a file located probably somewhere here: https://github.com/CollaboraOnline/online/tree/master/docker
|
||||
FROM collabora/code:22.05.6.1.1
|
||||
FROM collabora/code:22.05.8.4.1
|
||||
|
||||
USER root
|
||||
|
||||
@@ -9,9 +9,10 @@ RUN set -ex; \
|
||||
export DEBIAN_FRONTEND=noninteractive; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
tzdata \
|
||||
netcat \
|
||||
; \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
USER 104
|
||||
|
||||
HEALTHCHECK CMD curl -skfI localhost:9980 || exit 1
|
||||
HEALTHCHECK CMD nc -z localhost 9980 || exit 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
FROM alpine:3.16.2
|
||||
RUN apk add --update --no-cache lighttpd bash curl
|
||||
FROM alpine:3.16.3
|
||||
RUN apk add --update --no-cache lighttpd bash curl netcat-openbsd
|
||||
|
||||
RUN adduser -S www-data -G www-data
|
||||
RUN rm -rf /etc/lighttpd/lighttpd.conf
|
||||
@@ -15,4 +15,4 @@ USER www-data
|
||||
RUN mkdir -p /var/www/domaincheck/
|
||||
ENTRYPOINT ["/start.sh"]
|
||||
|
||||
HEALTHCHECK CMD curl -skfI localhost:$APACHE_PORT || exit 1
|
||||
HEALTHCHECK CMD nc -z localhost $APACHE_PORT || exit 1
|
||||
@@ -1,5 +1,5 @@
|
||||
# Probably from here https://github.com/elastic/elasticsearch/blob/main/distribution/docker/src/docker/Dockerfile
|
||||
FROM elasticsearch:7.17.6
|
||||
FROM elasticsearch:7.17.8
|
||||
|
||||
RUN elasticsearch-plugin install --batch ingest-attachment
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# From https://github.com/h2non/imaginary/blob/master/Dockerfile
|
||||
FROM nextcloud/imaginary:20220919
|
||||
FROM nextcloud/imaginary:20221201
|
||||
|
||||
USER root
|
||||
RUN set -ex; \
|
||||
@@ -8,8 +8,11 @@ RUN set -ex; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
curl \
|
||||
netcat \
|
||||
; \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
USER nobody
|
||||
|
||||
HEALTHCHECK CMD curl -skI 127.0.0.1:9000 || exit 1
|
||||
ENTRYPOINT ["/usr/local/bin/imaginary", "-return-size"]
|
||||
|
||||
HEALTHCHECK CMD nc -z localhost 9000 || exit 1
|
||||
@@ -1,11 +1,11 @@
|
||||
# Docker CLI is a requirement
|
||||
FROM docker:20.10.18-dind-alpine3.16 as dind
|
||||
FROM docker:20.10.21-dind-alpine3.16 as dind
|
||||
|
||||
# Caddy is a requirement
|
||||
FROM caddy:2.5.2-alpine as caddy
|
||||
FROM caddy:2.6.2-alpine as caddy
|
||||
|
||||
# From https://github.com/docker-library/php/blob/master/8.0/bullseye/apache/Dockerfile
|
||||
FROM php:8.0.23-apache-bullseye
|
||||
FROM php:8.0.26-apache-bullseye
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 8080
|
||||
@@ -52,7 +52,7 @@ RUN set -e && \
|
||||
cd ..; \
|
||||
rm -f /usr/local/bin/composer; \
|
||||
chmod 770 -R ./; \
|
||||
chown www-data:www-data -R ./; \
|
||||
chown www-data:www-data -R /var/www; \
|
||||
rm -r ./php/data; \
|
||||
rm -r ./php/session
|
||||
|
||||
@@ -76,8 +76,13 @@ RUN rm /etc/apache2/ports.conf; \
|
||||
sed -s -i -e "s/Include ports.conf//" /etc/apache2/apache2.conf; \
|
||||
sed -i "/^Listen /d" /etc/apache2/apache2.conf
|
||||
|
||||
RUN a2dissite 000-default && \
|
||||
RUN set -ex; \
|
||||
a2dissite 000-default && \
|
||||
a2dissite default-ssl && \
|
||||
rm -f /etc/apache2/sites-enabled/000-default.conf && \
|
||||
rm -f /etc/apache2/sites-enabled/default-ssl.conf && \
|
||||
rm /etc/apache2/sites-available/000-default.conf && \
|
||||
rm /etc/apache2/sites-available/default-ssl.conf && \
|
||||
a2ensite mastercontainer.conf
|
||||
|
||||
RUN mkdir /var/log/supervisord; \
|
||||
|
||||
@@ -13,14 +13,14 @@ while true; do
|
||||
export START_CONTAINERS=1
|
||||
fi
|
||||
set +x
|
||||
if [ -f "/mnt/docker-aio-config/data/daily_backup_running" ]; then
|
||||
export LOCK_FILE_PRESENT=1
|
||||
else
|
||||
export LOCK_FILE_PRESENT=0
|
||||
fi
|
||||
else
|
||||
export BACKUP_TIME="04:00"
|
||||
export DAILY_BACKUP=0
|
||||
fi
|
||||
|
||||
if [ -f "/mnt/docker-aio-config/data/daily_backup_running" ]; then
|
||||
export LOCK_FILE_PRESENT=1
|
||||
else
|
||||
export LOCK_FILE_PRESENT=0
|
||||
fi
|
||||
|
||||
@@ -41,6 +41,9 @@ while true; do
|
||||
# Check for updates and send notification if yes
|
||||
sudo -u www-data php /var/www/docker-aio/php/src/Cron/UpdateNotification.php
|
||||
|
||||
# Check if AIO is outdated
|
||||
sudo -u www-data php /var/www/docker-aio/php/src/Cron/OutdatedNotification.php
|
||||
|
||||
# Remove sessions older than 24h
|
||||
find "/mnt/docker-aio-config/session/" -mindepth 1 -mmin +1440 -delete
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f "/mnt/docker-aio-config/data/configuration.json" ]; then
|
||||
curl -skfI https://localhost:8080 || exit 1
|
||||
nc -z localhost 8080 || exit 1
|
||||
fi
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
Listen 8000
|
||||
Listen 8080
|
||||
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
|
||||
# Deny access to .ht files
|
||||
<Files ".ht*">
|
||||
Require all denied
|
||||
@@ -11,6 +8,8 @@ ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
|
||||
# Http host
|
||||
<VirtualHost *:8000>
|
||||
ServerName localhost
|
||||
|
||||
# PHP match
|
||||
<FilesMatch "\.php$">
|
||||
SetHandler application/x-httpd-php
|
||||
|
||||
@@ -1,26 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
while true; do
|
||||
while [ "$(find "/mnt/docker-aio-config/session/" -mindepth 1 -exec grep "aio_authenticated|[a-z]:1" {} \; | wc -l)" -gt 1 ]; do
|
||||
# First delete all session files that are not authenticated
|
||||
unset SESSION_FILES
|
||||
SESSION_FILES="$(find "/mnt/docker-aio-config/session/" -mindepth 1)"
|
||||
unset SESSION_FILES_ARRAY
|
||||
mapfile -t SESSION_FILES_ARRAY <<< "$SESSION_FILES"
|
||||
for SESSION_FILE in "${SESSION_FILES_ARRAY[@]}"; do
|
||||
if [ -f "$SESSION_FILE" ] && ! grep -q "aio_authenticated|[a-z]:1" "$SESSION_FILE"; then
|
||||
rm "$SESSION_FILE"
|
||||
fi
|
||||
done
|
||||
deduplicate_sessions() {
|
||||
echo "Deleting duplicate sessions"
|
||||
find "/mnt/docker-aio-config/session/" -mindepth 1 -exec grep -qv "$NEW_SESSION_TIME" {} \; -delete
|
||||
}
|
||||
|
||||
# Second clean up all sessions that are authenticated
|
||||
echo "Deleting duplicate sessions"
|
||||
unset OLDEST_FILE
|
||||
set -x
|
||||
# shellcheck disable=SC2012
|
||||
OLDEST_FILE="$(ls -t "/mnt/docker-aio-config/session/" | tail -1)"
|
||||
rm "/mnt/docker-aio-config/session/$OLDEST_FILE"
|
||||
set +x
|
||||
done
|
||||
sleep 5
|
||||
compare_times() {
|
||||
if [ -f "/mnt/docker-aio-config/data/session_date_file" ]; then
|
||||
unset NEW_SESSION_TIME
|
||||
NEW_SESSION_TIME="$(cat "/mnt/docker-aio-config/data/session_date_file")"
|
||||
if [ -n "$NEW_SESSION_TIME" ] && [ -n "$OLD_SESSION_TIME" ] && [ "$NEW_SESSION_TIME" != "$OLD_SESSION_TIME" ]; then
|
||||
deduplicate_sessions
|
||||
fi
|
||||
OLD_SESSION_TIME="$NEW_SESSION_TIME"
|
||||
fi
|
||||
}
|
||||
|
||||
while true; do
|
||||
compare_times
|
||||
sleep 2
|
||||
done
|
||||
|
||||
51
Containers/mastercontainer/start.sh
Executable file → Normal file
51
Containers/mastercontainer/start.sh
Executable file → Normal file
@@ -65,6 +65,17 @@ else
|
||||
sleep 10
|
||||
fi
|
||||
|
||||
# Check Storage drivers
|
||||
STORAGE_DRIVER="$(docker info | grep "Storage Driver")"
|
||||
# Check if vfs is used: https://github.com/nextcloud/all-in-one/discussions/1467
|
||||
if echo "$STORAGE_DRIVER" | grep -q vfs; then
|
||||
echo "$STORAGE_DRIVER"
|
||||
echo "Warning: It seems like the storage driver vfs is used. This will lead to problems with disk space and performance and is disrecommended!"
|
||||
elif echo "$STORAGE_DRIVER" | grep -q fuse-overlayfs; then
|
||||
echo "$STORAGE_DRIVER"
|
||||
echo "Warning: It seems like the storage driver fuse-overlayfs is used. Please check if you can switch to overlay2 instead."
|
||||
fi
|
||||
|
||||
# Check if startup command was executed correctly
|
||||
if ! sudo -u www-data docker ps | grep -q "nextcloud-aio-mastercontainer"; then
|
||||
echo "It seems like you did not give the mastercontainer the correct name?
|
||||
@@ -120,6 +131,14 @@ It is set to '$NEXTCLOUD_MAX_TIME'."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ -n "$NEXTCLOUD_MEMORY_LIMIT" ]; then
|
||||
if ! echo "$NEXTCLOUD_MEMORY_LIMIT" | grep -q '^[0-9]\+M$'; then
|
||||
echo "You've set NEXTCLOUD_MEMORY_LIMIT but not to an allowed value.
|
||||
The string must start with a number and end with 'M'.
|
||||
It is set to '$NEXTCLOUD_MEMORY_LIMIT'."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ -n "$APACHE_PORT" ]; then
|
||||
if ! check_if_number "$APACHE_PORT"; then
|
||||
echo "You provided an Apache port but did not only use numbers.
|
||||
@@ -161,11 +180,35 @@ It is set to '$DOCKER_SOCKET_PATH'."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ -n "$TRUSTED_CACERTS_DIR" ]; then
|
||||
if ! echo "$TRUSTED_CACERTS_DIR" | grep -q "^/" || echo "$TRUSTED_CACERTS_DIR" | grep -q "/$"; then
|
||||
echo "You've set TRUSTED_CACERTS_DIR but not to an allowed value.
|
||||
if [ -n "$NEXTCLOUD_TRUSTED_CACERTS_DIR" ]; then
|
||||
if ! echo "$NEXTCLOUD_TRUSTED_CACERTS_DIR" | grep -q "^/" || echo "$NEXTCLOUD_TRUSTED_CACERTS_DIR" | grep -q "/$"; then
|
||||
echo "You've set NEXTCLOUD_TRUSTED_CACERTS_DIR but not to an allowed value.
|
||||
It should be an absolute path to a directory that starts with '/' but not end with '/'.
|
||||
It is set to '$TRUSTED_CACERTS_DIR '."
|
||||
It is set to '$NEXTCLOUD_TRUSTED_CACERTS_DIR '."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ -n "$NEXTCLOUD_STARTUP_APPS" ]; then
|
||||
if ! echo "$NEXTCLOUD_STARTUP_APPS" | grep -q "^[a-z _-]\+$"; then
|
||||
echo "You've set NEXTCLOUD_STARTUP_APPS but not to an allowed value.
|
||||
It needs to be a string. Allowed are small letters a-z, spaces, hyphens and '_'.
|
||||
It is set to '$NEXTCLOUD_STARTUP_APPS'."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ -n "$NEXTCLOUD_ADDITIONAL_APKS" ]; then
|
||||
if ! echo "$NEXTCLOUD_ADDITIONAL_APKS" | grep -q "^[a-z0-9 ._-]\+$"; then
|
||||
echo "You've set NEXTCLOUD_ADDITIONAL_APKS but not to an allowed value.
|
||||
It needs to be a string. Allowed are small letters a-z, digits 0-9, spaces, hyphens, dots and '_'.
|
||||
It is set to '$NEXTCLOUD_ADDITIONAL_APKS'."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ -n "$NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS" ]; then
|
||||
if ! echo "$NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS" | grep -q "^[a-z0-9 ._-]\+$"; then
|
||||
echo "You've set NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS but not to an allowed value.
|
||||
It needs to be a string. Allowed are small letters a-z, digits 0-9, spaces, hyphens, dots and '_'.
|
||||
It is set to '$NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS'."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,26 +1,28 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
nodaemon=true
|
||||
logfile=/var/log/supervisord/supervisord.log
|
||||
pidfile=/var/run/supervisord/supervisord.pid
|
||||
childlogdir=/var/log/supervisord/
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=error
|
||||
user=root
|
||||
|
||||
[program:apache]
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
# stdout_logfile=/dev/stdout
|
||||
# stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=apache2-foreground
|
||||
user=root
|
||||
|
||||
[program:caddy]
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=sudo -u www-data /usr/bin/caddy run -config /Caddyfile
|
||||
command=/usr/bin/caddy run --config /Caddyfile
|
||||
user=www-data
|
||||
|
||||
[program:cron]
|
||||
stdout_logfile=/dev/stdout
|
||||
@@ -35,6 +37,7 @@ stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=/backup-time-file-watcher.sh
|
||||
user=root
|
||||
|
||||
[program:session-deduplicator]
|
||||
stdout_logfile=/dev/stdout
|
||||
@@ -42,3 +45,4 @@ stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=/session-deduplicator.sh
|
||||
user=root
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# From https://github.com/nextcloud/docker/blob/master/23/fpm-alpine/Dockerfile
|
||||
FROM php:8.0.23-fpm-alpine3.16
|
||||
FROM php:8.0.26-fpm-alpine3.16
|
||||
|
||||
# Custom: change id of www-data user as it needs to be the same like on old installations
|
||||
RUN set -ex; \
|
||||
@@ -39,7 +39,6 @@ RUN set -ex; \
|
||||
openldap-dev \
|
||||
pcre-dev \
|
||||
postgresql-dev \
|
||||
imagemagick-dev \
|
||||
libwebp-dev \
|
||||
gmp-dev \
|
||||
; \
|
||||
@@ -54,7 +53,6 @@ RUN set -ex; \
|
||||
ldap \
|
||||
opcache \
|
||||
pcntl \
|
||||
pdo_mysql \
|
||||
pdo_pgsql \
|
||||
zip \
|
||||
gmp \
|
||||
@@ -64,13 +62,11 @@ RUN set -ex; \
|
||||
pecl install APCu-5.1.22; \
|
||||
pecl install memcached-3.2.0; \
|
||||
pecl install redis-5.3.7; \
|
||||
pecl install imagick-3.7.0; \
|
||||
\
|
||||
docker-php-ext-enable \
|
||||
apcu \
|
||||
memcached \
|
||||
redis \
|
||||
imagick \
|
||||
; \
|
||||
rm -r /tmp/pear; \
|
||||
\
|
||||
@@ -107,7 +103,7 @@ RUN { \
|
||||
|
||||
VOLUME /var/www/html
|
||||
|
||||
ENV NEXTCLOUD_VERSION 24.0.5
|
||||
ENV NEXTCLOUD_VERSION 25.0.2
|
||||
|
||||
RUN set -ex; \
|
||||
apk add --no-cache --virtual .fetch-deps \
|
||||
@@ -126,7 +122,6 @@ RUN set -ex; \
|
||||
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
|
||||
gpgconf --kill all; \
|
||||
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
|
||||
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
|
||||
mkdir -p /usr/src/nextcloud/data; \
|
||||
mkdir -p /usr/src/nextcloud/custom_apps; \
|
||||
chmod +x /usr/src/nextcloud/occ; \
|
||||
@@ -144,7 +139,6 @@ RUN set -ex; \
|
||||
\
|
||||
apk add --no-cache \
|
||||
ffmpeg \
|
||||
imagemagick \
|
||||
procps \
|
||||
samba-client \
|
||||
supervisor \
|
||||
@@ -202,6 +196,9 @@ RUN set -ex; \
|
||||
postgresql-client \
|
||||
tzdata \
|
||||
mawk \
|
||||
sudo \
|
||||
grep \
|
||||
coreutils \
|
||||
; \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -211,7 +208,8 @@ RUN set -ex; \
|
||||
sed -i 's/^pm.max_children =.*/pm.max_children = 80/' /usr/local/etc/php-fpm.d/www.conf; \
|
||||
sed -i 's/^pm.start_servers =.*/pm.start_servers = 2/' /usr/local/etc/php-fpm.d/www.conf; \
|
||||
sed -i 's/^pm.min_spare_servers =.*/pm.min_spare_servers = 1/' /usr/local/etc/php-fpm.d/www.conf; \
|
||||
sed -i 's/^pm.max_spare_servers =.*/pm.max_spare_servers = 3/' /usr/local/etc/php-fpm.d/www.conf
|
||||
sed -i 's/^pm.max_spare_servers =.*/pm.max_spare_servers = 3/' /usr/local/etc/php-fpm.d/www.conf; \
|
||||
sed -i 's|access.log = /proc/self/fd/2|access.log = /proc/self/fd/1|' /usr/local/etc/php-fpm.d/docker.conf
|
||||
|
||||
RUN set -ex; \
|
||||
rm -rf /tmp/nextcloud-aio && \
|
||||
@@ -225,19 +223,18 @@ RUN set -ex; \
|
||||
chown www-data:root -R /usr/src && \
|
||||
chown www-data:root -R /usr/local/etc/php/conf.d && \
|
||||
chown www-data:root -R /usr/local/etc/php-fpm.d && \
|
||||
chown www-data:root -R /var/log/supervisord/ && \
|
||||
chown www-data:root -R /var/run/supervisord/ && \
|
||||
rm -r /usr/src/nextcloud/apps/updatenotification
|
||||
|
||||
COPY start.sh /
|
||||
COPY notify.sh /
|
||||
COPY notify-all.sh /
|
||||
RUN set -ex; \
|
||||
chmod +x /start.sh && \
|
||||
chmod +r /supervisord.conf && \
|
||||
chmod +x /entrypoint.sh && \
|
||||
chmod +r /upgrade.exclude && \
|
||||
chmod +x /cron.sh && \
|
||||
chmod +x /notify.sh && \
|
||||
chmod +x /notify-all.sh && \
|
||||
chmod +x /activate-collabora.sh
|
||||
|
||||
RUN set -ex; \
|
||||
@@ -249,7 +246,7 @@ VOLUME /mnt/ncdata
|
||||
# Give root a random password
|
||||
RUN echo "root:$(openssl rand -base64 12)" | chpasswd
|
||||
|
||||
USER www-data
|
||||
USER root
|
||||
ENTRYPOINT ["/start.sh"]
|
||||
|
||||
HEALTHCHECK CMD (nc -z localhost 9000 && curl -skI localhost:7867) || exit 1
|
||||
HEALTHCHECK CMD (sudo -u www-data nc -z localhost 9000 && sudo -u www-data nc -z localhost 7867) || exit 1
|
||||
@@ -32,8 +32,8 @@ fi
|
||||
touch "$NEXTCLOUD_DATA_DIR/this-is-a-test-file" &>/dev/null
|
||||
if ! [ -f "$NEXTCLOUD_DATA_DIR/this-is-a-test-file" ]; then
|
||||
echo "The www-data user doesn't seem to have access rights in the datadir.
|
||||
Did you maybe change the datadir and did forget to apply the correct permissions?
|
||||
See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir
|
||||
Most likely are the files located on a drive that does not follow linux permissions.
|
||||
Please adjust the permissions like mentioned below.
|
||||
The found permissions are:
|
||||
$(stat -c "%u:%g %a" "$NEXTCLOUD_DATA_DIR")
|
||||
(userID:groupID permissions)
|
||||
@@ -79,12 +79,27 @@ if [ -f "$NEXTCLOUD_DATA_DIR/update.failed" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Do not start the container if the install failed
|
||||
if [ -f "$NEXTCLOUD_DATA_DIR/install.failed" ]; then
|
||||
echo "The initial Nextcloud installation failed."
|
||||
echo "Please reset AIO properly and try again. For further clues what went wrong, check the logs above."
|
||||
echo "See https://github.com/nextcloud/all-in-one#how-to-properly-reset-the-instance"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Skip any update if Nextcloud was just restored
|
||||
if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||
if version_greater "$image_version" "$installed_version"; then
|
||||
# Check if it skips a major version
|
||||
INSTALLED_MAJOR="${installed_version%%.*}"
|
||||
IMAGE_MAJOR="${image_version%%.*}"
|
||||
|
||||
if [ "$installed_version" != "0.0.0.0" ]; then
|
||||
# Write output to logfile.
|
||||
exec > >(tee -i "/var/www/html/data/update.log")
|
||||
exec 2>&1
|
||||
fi
|
||||
|
||||
if [ "$installed_version" != "0.0.0.0" ] && [ "$((IMAGE_MAJOR - INSTALLED_MAJOR))" -gt 1 ]; then
|
||||
set -ex
|
||||
NEXT_MAJOR="$((INSTALLED_MAJOR + 1))"
|
||||
@@ -99,7 +114,6 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||
tar -xjf nextcloud.tar.bz2 -C /usr/src/tmp/
|
||||
gpgconf --kill all
|
||||
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2
|
||||
rm -rf "$GNUPGHOME" /usr/src/tmp/nextcloud/updater
|
||||
mkdir -p /usr/src/tmp/nextcloud/data
|
||||
mkdir -p /usr/src/tmp/nextcloud/custom_apps
|
||||
chmod +x /usr/src/tmp/nextcloud/occ
|
||||
@@ -133,7 +147,19 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||
php /var/www/html/occ maintenance:mode --off
|
||||
|
||||
echo "Getting and backing up the status of apps for later, this might take a while..."
|
||||
php /var/www/html/occ app:list | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
|
||||
NC_APPS="$(find /var/www/html/custom_apps/ -type d -maxdepth 1 -mindepth 1 | sed 's|/var/www/html/custom_apps/||g')"
|
||||
if [ -z "$NC_APPS" ]; then
|
||||
echo "No apps detected, aborting export of app status..."
|
||||
APPSTORAGE="no-export-done"
|
||||
else
|
||||
mapfile -t NC_APPS_ARRAY <<< "$NC_APPS"
|
||||
declare -Ag APPSTORAGE
|
||||
echo "Disabling apps before the update in order to make the update procedure more safe. This can take a while..."
|
||||
for app in "${NC_APPS_ARRAY[@]}"; do
|
||||
APPSTORAGE[$app]=$(php /var/www/html/occ config:app:get "$app" enabled)
|
||||
php /var/www/html/occ app:disable "$app"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$((IMAGE_MAJOR - INSTALLED_MAJOR))" -eq 1 ]; then
|
||||
php /var/www/html/occ config:system:delete app_install_overwrite
|
||||
@@ -158,6 +184,7 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||
rsync -rlD --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
|
||||
fi
|
||||
done
|
||||
rsync -rlD --delete --include '/config/' --exclude '/*' --exclude '/config/CAN_INSTALL' --exclude '/config/config.sample.php' --exclude '/config/config.php' /usr/src/nextcloud/ /var/www/html/
|
||||
rsync -rlD --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
|
||||
echo "Initializing finished"
|
||||
|
||||
@@ -184,12 +211,16 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||
done
|
||||
if [ "$try" -gt "$max_retries" ]; then
|
||||
echo "installing of nextcloud failed!"
|
||||
touch "$NEXTCLOUD_DATA_DIR/install.failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# unset admin password
|
||||
unset ADMIN_PASSWORD
|
||||
|
||||
# Post Install logs: For questions like https://help.nextcloud.com/t/nextcloud-aio-error-could-not-get-appdata-folder-after-container-has-already-written-data-in-it/151122/5
|
||||
echo "Install errors: $(cat /var/www/html/data/nextcloud.log)"
|
||||
|
||||
# Apply log settings
|
||||
echo "Applying default settings..."
|
||||
mkdir -p /var/www/html/data
|
||||
@@ -229,22 +260,16 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||
# php /var/www/html/occ config:app:set updatenotification notify_groups --value="[]"
|
||||
|
||||
# Install some apps by default
|
||||
php /var/www/html/occ app:install twofactor_totp
|
||||
php /var/www/html/occ app:install deck
|
||||
php /var/www/html/occ app:install tasks
|
||||
php /var/www/html/occ app:install calendar
|
||||
php /var/www/html/occ app:install contacts
|
||||
php /var/www/html/occ app:install apporder
|
||||
if [ -n "$STARTUP_APPS" ]; then
|
||||
read -ra STARTUP_APPS_ARRAY <<< "$STARTUP_APPS"
|
||||
for app in "${STARTUP_APPS_ARRAY[@]}"; do
|
||||
php /var/www/html/occ app:install "$app"
|
||||
done
|
||||
fi
|
||||
|
||||
#upgrade
|
||||
else
|
||||
touch "$NEXTCLOUD_DATA_DIR/update.failed"
|
||||
while [ -n "$(pgrep -f cron.php)" ]
|
||||
do
|
||||
echo "Waiting for Nextclouds cronjob to finish..."
|
||||
sleep 5
|
||||
done
|
||||
|
||||
echo "Upgrading nextcloud from $installed_version to $image_version..."
|
||||
if ! php /var/www/html/occ upgrade || ! php /var/www/html/occ -V; then
|
||||
echo "Upgrade failed. Please restore from backup."
|
||||
@@ -255,10 +280,35 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||
rm "$NEXTCLOUD_DATA_DIR/update.failed"
|
||||
bash /notify.sh "Nextcloud update to $image_version successful!" "Feel free to inspect the Nextcloud container logs for more info."
|
||||
|
||||
php /var/www/html/occ app:list | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
||||
echo "The following apps have been disabled:"
|
||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
||||
rm -f /tmp/list_before /tmp/list_after
|
||||
php /var/www/html/occ app:update --all
|
||||
|
||||
# Restore app status
|
||||
if [ "${APPSTORAGE[0]}" != "no-export-done" ]; then
|
||||
echo "Restoring the status of apps. This can take a while..."
|
||||
for app in "${!APPSTORAGE[@]}"; do
|
||||
if [ -n "${APPSTORAGE[$app]}" ]; then
|
||||
if [ "${APPSTORAGE[$app]}" != "no" ]; then
|
||||
echo "Enabling $app..."
|
||||
if ! php /var/www/html/occ app:enable "$app" >/dev/null; then
|
||||
echo "The $app app could not get enabled. Probably because it is not compatible with the new Nextcloud version."
|
||||
if [ "$app" = apporder ]; then
|
||||
CUSTOM_HINT="The apporder app was deprecated. A possible replacement is the side_menu app, aka 'Custom menu'."
|
||||
else
|
||||
CUSTOM_HINT="Most likely because it is not compatible with the new Nextcloud version."
|
||||
fi
|
||||
bash /notify.sh "Could not enable the $app app after the Nextcloud update!" "$CUSTOM_HINT Feel free to look at the Nextcloud update logs and force-enable the app again from the app-store UI."
|
||||
continue
|
||||
fi
|
||||
# Only restore the group settings, if the app was enabled (and is thus compatible with the new NC version)
|
||||
if [ "${APPSTORAGE[$app]}" != "yes" ]; then
|
||||
php /var/www/html/occ config:app:set "$app" enabled --value="${APPSTORAGE[$app]}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
php /var/www/html/occ app:update --all
|
||||
|
||||
# Apply optimization
|
||||
echo "Doing some optimizations..."
|
||||
@@ -279,12 +329,17 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||
bash /notify.sh "Your apps just got updated!" "$UPDATED_APPS"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
SKIP_UPDATE=1
|
||||
fi
|
||||
|
||||
# Check if appdata is present
|
||||
# If not, something broke (e.g. changing ncdatadir after aio was first started)
|
||||
if [ -z "$(find "$NEXTCLOUD_DATA_DIR/" -maxdepth 1 -mindepth 1 -type d -name "appdata_*")" ]; then
|
||||
echo "Appdata is not present. Did you maybe change the datadir after aio was first started?"
|
||||
echo "See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir"
|
||||
echo "In the datadir was found:"
|
||||
ls -la "$NEXTCLOUD_DATA_DIR/"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -307,6 +362,8 @@ fi
|
||||
echo "Applying one-click-instance settings..."
|
||||
php /var/www/html/occ config:system:set one-click-instance --value=true --type=bool
|
||||
php /var/www/html/occ config:system:set one-click-instance.user-limit --value=100 --type=int
|
||||
php /var/www/html/occ config:system:set one-click-instance.link --value="https://nextcloud.com/all-in-one/"
|
||||
php /var/www/html/occ app:enable support
|
||||
|
||||
# Adjusting log files to be stored on a volume
|
||||
echo "Adjusting log files..."
|
||||
@@ -339,7 +396,7 @@ if ! [ -d "/var/www/html/custom_apps/notify_push" ]; then
|
||||
php /var/www/html/occ app:install notify_push
|
||||
elif [ "$(php /var/www/html/occ config:app:get notify_push enabled)" = "no" ]; then
|
||||
php /var/www/html/occ app:enable notify_push
|
||||
else
|
||||
elif [ "$SKIP_UPDATE" != 1 ]; then
|
||||
php /var/www/html/occ app:update notify_push
|
||||
fi
|
||||
php /var/www/html/occ config:system:set trusted_proxies 0 --value="127.0.0.1"
|
||||
@@ -352,7 +409,7 @@ if [ "$COLLABORA_ENABLED" = 'yes' ]; then
|
||||
php /var/www/html/occ app:install richdocuments
|
||||
elif [ "$(php /var/www/html/occ config:app:get richdocuments enabled)" = "no" ]; then
|
||||
php /var/www/html/occ app:enable richdocuments
|
||||
else
|
||||
elif [ "$SKIP_UPDATE" != 1 ]; then
|
||||
php /var/www/html/occ app:update richdocuments
|
||||
fi
|
||||
php /var/www/html/occ config:app:set richdocuments wopi_url --value="https://$NC_DOMAIN/"
|
||||
@@ -374,7 +431,7 @@ if [ "$ONLYOFFICE_ENABLED" = 'yes' ]; then
|
||||
php /var/www/html/occ app:install onlyoffice
|
||||
elif [ "$(php /var/www/html/occ config:app:get onlyoffice enabled)" = "no" ]; then
|
||||
php /var/www/html/occ app:enable onlyoffice
|
||||
else
|
||||
elif [ "$SKIP_UPDATE" != 1 ]; then
|
||||
php /var/www/html/occ app:update onlyoffice
|
||||
fi
|
||||
php /var/www/html/occ config:system:set onlyoffice jwt_secret --value="$ONLYOFFICE_SECRET"
|
||||
@@ -382,7 +439,7 @@ if [ "$ONLYOFFICE_ENABLED" = 'yes' ]; then
|
||||
php /var/www/html/occ config:app:set onlyoffice DocumentServerUrl --value="https://$NC_DOMAIN/onlyoffice"
|
||||
php /var/www/html/occ config:system:set allow_local_remote_servers --type=bool --value=true
|
||||
else
|
||||
if [ -d "/var/www/html/custom_apps/onlyoffice" ]; then
|
||||
if [ -d "/var/www/html/custom_apps/onlyoffice" ] && [ -n "$ONLYOFFICE_SECRET" ] && [ "$(php /var/www/html/occ config:system:get onlyoffice jwt_secret)" = "$ONLYOFFICE_SECRET" ]; then
|
||||
php /var/www/html/occ app:remove onlyoffice
|
||||
fi
|
||||
fi
|
||||
@@ -393,15 +450,20 @@ if [ "$TALK_ENABLED" = 'yes' ]; then
|
||||
php /var/www/html/occ app:install spreed
|
||||
elif [ "$(php /var/www/html/occ config:app:get spreed enabled)" = "no" ]; then
|
||||
php /var/www/html/occ app:enable spreed
|
||||
else
|
||||
elif [ "$SKIP_UPDATE" != 1 ]; then
|
||||
php /var/www/html/occ app:update spreed
|
||||
fi
|
||||
STUN_SERVERS="[\"$NC_DOMAIN:$TALK_PORT\"]"
|
||||
TURN_SERVERS="[{\"server\":\"$NC_DOMAIN:$TALK_PORT\",\"secret\":\"$TURN_SECRET\",\"protocols\":\"udp,tcp\"}]"
|
||||
SIGNALING_SERVERS="{\"servers\":[{\"server\":\"https://$NC_DOMAIN/standalone-signaling/\",\"verify\":true}],\"secret\":\"$SIGNALING_SECRET\"}"
|
||||
php /var/www/html/occ config:app:set spreed stun_servers --value="$STUN_SERVERS" --output json
|
||||
php /var/www/html/occ config:app:set spreed turn_servers --value="$TURN_SERVERS" --output json
|
||||
php /var/www/html/occ config:app:set spreed signaling_servers --value="$SIGNALING_SERVERS" --output json
|
||||
# Based on https://github.com/nextcloud/spreed/issues/960#issuecomment-416993435
|
||||
if [ -z "$(php /var/www/html/occ talk:turn:list --output="plain")" ]; then
|
||||
php /var/www/html/occ talk:turn:add "$NC_DOMAIN:$TALK_PORT" "udp,tcp" --secret="$TURN_SECRET"
|
||||
fi
|
||||
if php /var/www/html/occ talk:stun:list --output="plain" | grep -oP '[a-zA-Z.:0-9]+' | grep -q "^stun.nextcloud.com:443$"; then
|
||||
php /var/www/html/occ talk:stun:add "$NC_DOMAIN:$TALK_PORT"
|
||||
php /var/www/html/occ talk:stun:delete "stun.nextcloud.com:443"
|
||||
fi
|
||||
if ! php /var/www/html/occ talk:signaling:list --output="plain" | grep -q "https://$NC_DOMAIN/standalone-signaling/"; then
|
||||
php /var/www/html/occ talk:signaling:add "https://$NC_DOMAIN/standalone-signaling/" "$SIGNALING_SECRET" --verify
|
||||
fi
|
||||
else
|
||||
if [ -d "/var/www/html/custom_apps/spreed" ]; then
|
||||
php /var/www/html/occ app:remove spreed
|
||||
@@ -418,7 +480,7 @@ if [ "$CLAMAV_ENABLED" = 'yes' ]; then
|
||||
php /var/www/html/occ app:install files_antivirus
|
||||
elif [ "$(php /var/www/html/occ config:app:get files_antivirus enabled)" = "no" ]; then
|
||||
php /var/www/html/occ app:enable files_antivirus
|
||||
else
|
||||
elif [ "$SKIP_UPDATE" != 1 ]; then
|
||||
php /var/www/html/occ app:update files_antivirus
|
||||
fi
|
||||
php /var/www/html/occ config:app:set files_antivirus av_mode --value="daemon"
|
||||
@@ -454,21 +516,21 @@ if [ "$FULLTEXTSEARCH_ENABLED" = 'yes' ]; then
|
||||
php /var/www/html/occ app:install fulltextsearch
|
||||
elif [ "$(php /var/www/html/occ config:app:get fulltextsearch enabled)" = "no" ]; then
|
||||
php /var/www/html/occ app:enable fulltextsearch
|
||||
else
|
||||
elif [ "$SKIP_UPDATE" != 1 ]; then
|
||||
php /var/www/html/occ app:update fulltextsearch
|
||||
fi
|
||||
if ! [ -d "/var/www/html/custom_apps/fulltextsearch_elasticsearch" ]; then
|
||||
php /var/www/html/occ app:install fulltextsearch_elasticsearch
|
||||
elif [ "$(php /var/www/html/occ config:app:get fulltextsearch_elasticsearch enabled)" = "no" ]; then
|
||||
php /var/www/html/occ app:enable fulltextsearch_elasticsearch
|
||||
else
|
||||
elif [ "$SKIP_UPDATE" != 1 ]; then
|
||||
php /var/www/html/occ app:update fulltextsearch_elasticsearch
|
||||
fi
|
||||
if ! [ -d "/var/www/html/custom_apps/files_fulltextsearch" ]; then
|
||||
php /var/www/html/occ app:install files_fulltextsearch
|
||||
elif [ "$(php /var/www/html/occ config:app:get files_fulltextsearch enabled)" = "no" ]; then
|
||||
php /var/www/html/occ app:enable files_fulltextsearch
|
||||
else
|
||||
elif [ "$SKIP_UPDATE" != 1 ]; then
|
||||
php /var/www/html/occ app:update files_fulltextsearch
|
||||
fi
|
||||
php /var/www/html/occ fulltextsearch:configure '{"search_platform":"OCA\\FullTextSearch_Elasticsearch\\Platform\\ElasticSearchPlatform"}'
|
||||
|
||||
27
Containers/nextcloud/notify-all.sh
Normal file
27
Containers/nextcloud/notify-all.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$EUID" = 0 ]]; then
|
||||
COMMAND=(sudo -E -u www-data php /var/www/html/occ)
|
||||
else
|
||||
COMMAND=(php /var/www/html/occ)
|
||||
fi
|
||||
|
||||
SUBJECT="$1"
|
||||
MESSAGE="$2"
|
||||
|
||||
if [ "$("${COMMAND[@]}" config:app:get notifications enabled)" = "no" ]; then
|
||||
echo "Cannot send notification as notification app is not enabled."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Posting notifications to all users..."
|
||||
NC_USERS=$("${COMMAND[@]}" user:list | sed 's|^ - ||g' | sed 's|:.*||')
|
||||
mapfile -t NC_USERS <<< "$NC_USERS"
|
||||
for user in "${NC_USERS[@]}"
|
||||
do
|
||||
echo "Posting '$SUBJECT' to: $user"
|
||||
"${COMMAND[@]}" notification:generate "$user" "$NC_DOMAIN: $SUBJECT" -l "$MESSAGE"
|
||||
done
|
||||
|
||||
echo "Done!"
|
||||
exit 0
|
||||
@@ -1,19 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$EUID" = 0 ]]; then
|
||||
COMMAND=(sudo -E -u www-data php /var/www/html/occ)
|
||||
else
|
||||
COMMAND=(php /var/www/html/occ)
|
||||
fi
|
||||
|
||||
SUBJECT="$1"
|
||||
MESSAGE="$2"
|
||||
|
||||
if [ "$(php /var/www/html/occ config:app:get notifications enabled)" = "no" ]; then
|
||||
if [ "$("${COMMAND[@]}" config:app:get notifications enabled)" = "no" ]; then
|
||||
echo "Cannot send notification as notification app is not enabled."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Posting notifications to users that are admins..."
|
||||
NC_USERS=$(php /var/www/html/occ user:list | sed 's|^ - ||g' | sed 's|:.*||')
|
||||
NC_USERS=$("${COMMAND[@]}" user:list | sed 's|^ - ||g' | sed 's|:.*||')
|
||||
mapfile -t NC_USERS <<< "$NC_USERS"
|
||||
for user in "${NC_USERS[@]}"
|
||||
do
|
||||
if php /var/www/html/occ user:info "$user" | cut -d "-" -f2 | grep -x -q " admin"
|
||||
if "${COMMAND[@]}" user:info "$user" | cut -d "-" -f2 | grep -x -q " admin"
|
||||
then
|
||||
NC_ADMIN_USER+=("$user")
|
||||
fi
|
||||
@@ -22,7 +28,7 @@ done
|
||||
for admin in "${NC_ADMIN_USER[@]}"
|
||||
do
|
||||
echo "Posting '$SUBJECT' to: $admin"
|
||||
php /var/www/html/occ notification:generate "$admin" "$NC_DOMAIN: $SUBJECT" -l "$MESSAGE"
|
||||
"${COMMAND[@]}" notification:generate "$admin" "$NC_DOMAIN: $SUBJECT" -l "$MESSAGE"
|
||||
done
|
||||
|
||||
echo "Done!"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Only start container if database is accessible
|
||||
while ! nc -z "$POSTGRES_HOST" 5432; do
|
||||
while ! sudo -u www-data nc -z "$POSTGRES_HOST" 5432; do
|
||||
echo "Waiting for database to start..."
|
||||
sleep 5
|
||||
done
|
||||
@@ -13,23 +13,104 @@ export POSTGRES_USER
|
||||
# Fix false database connection on old instances
|
||||
if [ -f "/var/www/html/config/config.php" ]; then
|
||||
sleep 2
|
||||
while ! psql -d "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:5432/$POSTGRES_DB" -c "select now()"; do
|
||||
while ! sudo -u www-data psql -d "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:5432/$POSTGRES_DB" -c "select now()"; do
|
||||
echo "Waiting for the database to start..."
|
||||
sleep 5
|
||||
done
|
||||
# The code below is hopefully not needed anymore. Was introduced with https://github.com/nextcloud/all-in-one/pull/218
|
||||
# sed -i "s|'dbuser'.*=>.*$|'dbuser' => '$POSTGRES_USER',|" /var/www/html/config/config.php
|
||||
# sed -i "s|'dbpassword'.*=>.*$|'dbpassword' => '$POSTGRES_PASSWORD',|" /var/www/html/config/config.php
|
||||
if [ "$POSTGRES_USER" = "oc_nextcloud" ] && echo "$POSTGRES_PASSWORD" | grep -q '^[a-z0-9]\+$'; then
|
||||
# this was introduced with https://github.com/nextcloud/all-in-one/pull/218
|
||||
sed -i "s|'dbuser'.*=>.*$|'dbuser' => '$POSTGRES_USER',|" /var/www/html/config/config.php
|
||||
sed -i "s|'dbpassword'.*=>.*$|'dbpassword' => '$POSTGRES_PASSWORD',|" /var/www/html/config/config.php
|
||||
fi
|
||||
fi
|
||||
|
||||
# Trust additional Cacerts, if the user provided $TRUSTED_CACERTS_DIR
|
||||
if [ -n "$TRUSTED_CACERTS_DIR" ]; then
|
||||
echo "User required to trust additional CA certificates, running 'update-ca-certificates."
|
||||
echo "User required to trust additional CA certificates, running 'update-ca-certificates.'"
|
||||
update-ca-certificates
|
||||
fi
|
||||
|
||||
# Check datadir permissions
|
||||
sudo -u www-data touch "$NEXTCLOUD_DATA_DIR/this-is-a-test-file" &>/dev/null
|
||||
if ! [ -f "$NEXTCLOUD_DATA_DIR/this-is-a-test-file" ]; then
|
||||
chown -R www-data:root "$NEXTCLOUD_DATA_DIR"
|
||||
chmod 750 -R "$NEXTCLOUD_DATA_DIR"
|
||||
fi
|
||||
sudo -u www-data rm -f "$NEXTCLOUD_DATA_DIR/this-is-a-test-file"
|
||||
|
||||
# Install additional dependencies
|
||||
if [ -n "$ADDITIONAL_APKS" ]; then
|
||||
if ! [ -f "/additional-apks-are-installed" ]; then
|
||||
read -ra ADDITIONAL_APKS_ARRAY <<< "$ADDITIONAL_APKS"
|
||||
for app in "${ADDITIONAL_APKS_ARRAY[@]}"; do
|
||||
echo "Installing $app via apk..."
|
||||
if ! apk add --no-cache "$app" >/dev/null; then
|
||||
echo "The packet $app was not installed!"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
touch /additional-apks-are-installed
|
||||
fi
|
||||
|
||||
# Install additional php extensions
|
||||
if [ -n "$ADDITIONAL_PHP_EXTENSIONS" ]; then
|
||||
if ! [ -f "/additional-php-extensions-are-installed" ]; then
|
||||
read -ra ADDITIONAL_PHP_EXTENSIONS_ARRAY <<< "$ADDITIONAL_PHP_EXTENSIONS"
|
||||
for app in "${ADDITIONAL_PHP_EXTENSIONS_ARRAY[@]}"; do
|
||||
# shellcheck disable=SC2086
|
||||
if [ "$PHP_DEPS_ARE_INSTALLED" != 1 ]; then
|
||||
echo "Installing PHP build dependencies..."
|
||||
if ! apk add --no-cache --virtual .build-deps libxml2-dev imagemagick-dev autoconf $PHPIZE_DEPS >/dev/null; then
|
||||
echo "Could not install build-deps!"
|
||||
fi
|
||||
PHP_DEPS_ARE_INSTALLED=1
|
||||
fi
|
||||
if [ "$app" = imagick ]; then
|
||||
echo "Installing Imagick via PECL..."
|
||||
pecl install imagick-3.7.0 >/dev/null
|
||||
if ! docker-php-ext-enable imagick >/dev/null; then
|
||||
echo "Could not install PHP extension imagick!"
|
||||
fi
|
||||
elif [ "$app" = inotify ]; then
|
||||
echo "Installing $app via PECL..."
|
||||
pecl install "$app" >/dev/null
|
||||
if ! docker-php-ext-enable "$app" >/dev/null; then
|
||||
echo "Could not install PHP extension $app!"
|
||||
fi
|
||||
elif [ "$app" = soap ]; then
|
||||
echo "Installing $app from core..."
|
||||
if ! docker-php-ext-install -j "$(nproc)" "$app" >/dev/null; then
|
||||
echo "Could not install PHP extension $app!"
|
||||
fi
|
||||
else
|
||||
echo "Installing PHP extension $app ..."
|
||||
if ! docker-php-ext-install -j "$(nproc)" "$app" >/dev/null; then
|
||||
echo "Could not install $app from core. Trying to install from PECL..."
|
||||
pecl install "$app" >/dev/null
|
||||
if ! docker-php-ext-enable "$app" >/dev/null; then
|
||||
echo "Could also not install $app from PECL. The PHP extensions was not installed!"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [ "$PHP_DEPS_ARE_INSTALLED" = 1 ]; then
|
||||
rm -rf /tmp/pear
|
||||
runDeps="$( \
|
||||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
|
||||
| tr ',' '\n' \
|
||||
| sort -u \
|
||||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||
)";
|
||||
# shellcheck disable=SC2086
|
||||
apk add --virtual .nextcloud-phpext-rundeps $runDeps >/dev/null
|
||||
apk del .build-deps >/dev/null
|
||||
fi
|
||||
fi
|
||||
touch /additional-php-extensions-are-installed
|
||||
fi
|
||||
|
||||
# Run original entrypoint
|
||||
if ! bash /entrypoint.sh; then
|
||||
if ! sudo -E -u www-data bash /entrypoint.sh; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ childlogdir=/var/log/supervisord/
|
||||
logfile_maxbytes=50MB ; maximum size of logfile before rotation
|
||||
logfile_backups=10 ; number of backed up logfiles
|
||||
loglevel=error
|
||||
user=root
|
||||
|
||||
[program:php-fpm]
|
||||
stdout_logfile=/dev/stdout
|
||||
@@ -14,6 +15,7 @@ stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=php-fpm
|
||||
user=root
|
||||
|
||||
[program:cron]
|
||||
stdout_logfile=/dev/stdout
|
||||
@@ -21,6 +23,7 @@ stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=/cron.sh
|
||||
user=www-data
|
||||
|
||||
[program:notify-push]
|
||||
stdout_logfile=/dev/stdout
|
||||
@@ -28,6 +31,7 @@ stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=/var/www/html/custom_apps/notify_push/bin/%(ENV_CPU_ARCH)s/notify_push /var/www/html/config/config.php --port 7867 --redis-url redis://:%(ENV_REDIS_HOST_PASSWORD)s@%(ENV_REDIS_HOST)s
|
||||
user=www-data
|
||||
|
||||
[program:activate-collabora]
|
||||
stdout_logfile=/dev/stdout
|
||||
@@ -35,3 +39,4 @@ stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=/activate-collabora.sh
|
||||
user=www-data
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# From https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/Dockerfile
|
||||
FROM onlyoffice/documentserver:7.1.1.23
|
||||
FROM onlyoffice/documentserver:7.2.1.34
|
||||
|
||||
HEALTHCHECK CMD curl -skfI localhost || exit 1
|
||||
@@ -1,5 +1,5 @@
|
||||
# From https://github.com/docker-library/postgres/blob/master/13/alpine/Dockerfile
|
||||
FROM postgres:14.5-alpine
|
||||
FROM postgres:14.6-alpine
|
||||
|
||||
RUN apk add --update --no-cache bash openssl shadow netcat-openbsd grep mawk
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ export PGPASSWORD="$POSTGRES_PASSWORD"
|
||||
# Don't start database as long as backup is running
|
||||
while [ -f "$DUMP_DIR/backup-is-running" ]; do
|
||||
echo "Waiting for backup container to finish..."
|
||||
echo "If this is incorrect because the backup container is not running anymore (because it was forcefully killed), you might delete the lock file which is by default stored here:"
|
||||
echo "/var/lib/docker/volumes/nextcloud_aio_database_dump/_data/backup-is-running"
|
||||
sleep 10
|
||||
done
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# From https://github.com/docker-library/redis/blob/master/6.2/alpine/Dockerfile
|
||||
FROM redis:6.2.7-alpine
|
||||
FROM redis:6.2.8-alpine
|
||||
|
||||
RUN apk add --update --no-cache openssl bash
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM ubuntu:focal-20220826
|
||||
FROM ubuntu:focal-20221130
|
||||
|
||||
RUN set -ex; \
|
||||
\
|
||||
@@ -69,4 +69,4 @@ USER talk
|
||||
ENTRYPOINT ["start.sh"]
|
||||
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
|
||||
|
||||
HEALTHCHECK CMD (curl -skI localhost:8081 && curl -skI localhost:8188 && curl -skf --http0.9 localhost:4222 && nc -z localhost $TALK_PORT) || exit 1
|
||||
HEALTHCHECK CMD (nc -z localhost 8081 && nc -z localhost 8188 && nc -z localhost 4222 && nc -z localhost $TALK_PORT) || exit 1
|
||||
@@ -43,6 +43,8 @@ sed -i 's|#turn_type .*|turn_type = "udp"|g' /etc/janus/janus.jcfg
|
||||
sed -i 's|#ice_ignore_list .*|ice_ignore_list = "udp"|g' /etc/janus/janus.jcfg
|
||||
sed -i 's|#interface.*|interface = "lo"|g' /etc/janus/janus.transport.websockets.jcfg
|
||||
sed -i 's|#ws_interface.*|ws_interface = "lo"|g' /etc/janus/janus.transport.websockets.jcfg
|
||||
sed -i 's|certfile =|#certfile =|g' /etc/janus/janus.transport.mqtt.jcfg
|
||||
sed -i 's|keyfile =|#keyfile =|g' /etc/janus/janus.transport.mqtt.jcfg
|
||||
set +x
|
||||
|
||||
# Signling
|
||||
|
||||
@@ -27,11 +27,11 @@ stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=/usr/bin/janus --config=/etc/janus/janus.jcfg --disable-colors --daemon --log-stdout
|
||||
command=/usr/bin/janus --config=/etc/janus/janus.jcfg --disable-colors --log-stdout
|
||||
|
||||
[program:signaling]
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
command=signaling -config /etc/signaling/server.conf
|
||||
command=signaling --config /etc/signaling/server.conf
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# From https://github.com/containrrr/watchtower/blob/main/dockerfiles/Dockerfile.self-contained
|
||||
FROM containrrr/watchtower:1.4.0 as watchtower
|
||||
FROM containrrr/watchtower:1.5.1 as watchtower
|
||||
|
||||
FROM alpine:3.16.2
|
||||
FROM alpine:3.16.3
|
||||
|
||||
RUN apk add --update --no-cache bash
|
||||
COPY --from=watchtower /watchtower /
|
||||
|
||||
@@ -10,7 +10,7 @@ elif ! test -r /var/run/docker.sock; then
|
||||
fi
|
||||
|
||||
if [ -n "$CONTAINER_TO_UPDATE" ]; then
|
||||
exec /watchtower --cleanup --run-once "$CONTAINER_TO_UPDATE"
|
||||
exec /watchtower --cleanup --debug --run-once "$CONTAINER_TO_UPDATE"
|
||||
else
|
||||
echo "'CONTAINER_TO_UPDATE' is not set. Cannot update anything."
|
||||
exit 1
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<name>Nextcloud All In One</name>
|
||||
<summary>Provides a login link for admins.</summary>
|
||||
<description>Add a link to the admin settings that gives access to the Nextcloud All In One admin interface</description>
|
||||
<version>0.2.0</version>
|
||||
<version>0.3.0</version>
|
||||
<licence>agpl</licence>
|
||||
<author>Azul</author>
|
||||
<namespace>AllInOne</namespace>
|
||||
@@ -13,7 +13,7 @@
|
||||
<category>monitoring</category>
|
||||
<bugs>https://github.com/nextcloud/all-in-one/issues</bugs>
|
||||
<dependencies>
|
||||
<nextcloud min-version="23" max-version="24"/>
|
||||
<nextcloud min-version="24" max-version="25"/>
|
||||
</dependencies>
|
||||
|
||||
<settings>
|
||||
|
||||
@@ -11,7 +11,7 @@ services:
|
||||
container_name: nextcloud-aio-mastercontainer # This line is not allowed to be changed
|
||||
volumes:
|
||||
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config # This line is not allowed to be changed
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro # May be changed on macOS, Windows or docker rootless. See the applicable documentation
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro # May be changed on macOS, Windows or docker rootless. See the applicable documentation. If adjusting, don't forget to also set 'DOCKER_SOCKET_PATH'!
|
||||
ports:
|
||||
- 80:80 # Can be removed when running behind a reverse proxy. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
|
||||
- 8080:8080
|
||||
@@ -19,15 +19,19 @@ services:
|
||||
# environment: # Is needed when using any of the options below
|
||||
# - APACHE_PORT=11000 # Is needed when running behind a reverse proxy. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
|
||||
# - APACHE_IP_BINDING=127.0.0.1 # Should be set when running behind a reverse proxy that is running on the same host. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
|
||||
# - TALK_PORT=3478 # This allows to adjust the port that the talk container is using.
|
||||
# - COLLABORA_SECCOMP_DISABLED=false # Setting this to true allows to disable Collabora's Seccomp feature. See https://github.com/nextcloud/all-in-one#how-to-disable-collaboras-seccomp-feature
|
||||
# - DOCKER_SOCKET_PATH=/var/run/docker.sock # Needs to be specified if the docker socket on the host is not located in the default '/var/run/docker.sock'. Otherwise mastercontainer updates will fail.
|
||||
# - DISABLE_BACKUP_SECTION=false # Setting this to true allows to hide the backup section in the AIO interface.
|
||||
# - NEXTCLOUD_DATADIR=/mnt/ncdata # Allows to set the host directory for Nextcloud's datadir. See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir
|
||||
# - NEXTCLOUD_MOUNT=/mnt/ # Allows the Nextcloud container to access the chosen directory on the host. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host
|
||||
# - DOCKER_SOCKET_PATH=/var/run/docker.sock # Needs to be specified if the docker socket on the host is not located in the default '/var/run/docker.sock'. Otherwise mastercontainer updates will fail.
|
||||
# - DISABLE_BACKUP_SECTION=true # Setting this to true allows to hide the backup section in the AIO interface.
|
||||
# - NEXTCLOUD_UPLOAD_LIMIT=10G # Can be adjusted if you need more. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-upload-limit-for-nextcloud
|
||||
# - NEXTCLOUD_MAX_TIME=3600 # Can be adjusted if you need more. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-max-execution-time-for-nextcloud
|
||||
# - TRUSTED_CACERTS_DIR=/path/to/my/cacerts # CA certificates in this directory will be trusted by the OS of the nexcloud container (Useful e.g. for LDAPS) See See https://github.com/nextcloud/all-in-one#how-to-trust-user-defiend-certification-authorities-ca
|
||||
# - COLLABORA_SECCOMP_DISABLED=false # Setting this to true allows to disable Collabora's Seccomp feature. See https://github.com/nextcloud/all-in-one#how-to-disable-collaboras-seccomp-feature
|
||||
# - NEXTCLOUD_MEMORY_LIMIT=512M # Can be adjusted if you need more. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-php-memory-limit-for-nextcloud
|
||||
# - NEXTCLOUD_TRUSTED_CACERTS_DIR=/path/to/my/cacerts # CA certificates in this directory will be trusted by the OS of the nexcloud container (Useful e.g. for LDAPS) See See https://github.com/nextcloud/all-in-one#how-to-trust-user-defiend-certification-authorities-ca
|
||||
# - NEXTCLOUD_STARTUP_APPS=deck tasks calendar contacts # Allows to modify the Nextcloud apps that are installed on starting AIO the first time. See https://github.com/nextcloud/all-in-one#how-to-change-the-nextcloud-apps-that-are-installed-on-the-first-startup
|
||||
# - 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. See https://github.com/nextcloud/all-in-one#how-to-add-packets-permanently-to-the-nextcloud-container
|
||||
# - 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. See https://github.com/nextcloud/all-in-one#how-to-add-php-extensions-permanently-to-the-nextcloud-container
|
||||
# - TALK_PORT=3478 # This allows to adjust the port that the talk container is using.
|
||||
|
||||
# # Optional: Caddy reverse proxy. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
|
||||
# # You can find further examples here: https://github.com/nextcloud/all-in-one/discussions/588
|
||||
|
||||
@@ -11,4 +11,4 @@ You can run AIO with docker rootless by following the steps below.
|
||||
1. Use the official AIO startup command but use `--volume $XDG_RUNTIME_DIR/docker.sock:/var/run/docker.sock:ro` instead of `--volume /var/run/docker.sock:/var/run/docker.sock:ro` and also add `-e DOCKER_SOCKET_PATH=$XDG_RUNTIME_DIR/docker.sock` to the initial container startup (which is needed for mastercontainer updates to work correctly).
|
||||
1. Now everything should work like without docker rootless. You can consider using docker-compose for this or running it behind a reverse proxy. Basically the only thing that needs to be adjusted always in the startup command or docker-compose file (after installing docker rootles) are things that are mentioned in point 3.
|
||||
|
||||
**Please note:** All files outside the containers get created, written to and accessed as the user that is running the docker daemon or a subuid of it. So for the built-in backup to work you need to allow this user to write to the target directory. For changing Nextcloud's datadir, you need to adjust the permissions of the chosen folders to be accessible/writeable by the userid `100032:100032` (if running `grep ^$(whoami): /etc/subuid` as the user that is running the docker daemon returns 100000 as first value). This logically also applies to the NEXTCLOUD_MOUNT option.
|
||||
**Please note:** All files outside the containers get created, written to and accessed as the user that is running the docker daemon or a subuid of it. So for the built-in backup to work you need to allow this user to write to the target directory. E.g. with `sudo chown -R USERNAME:GROUPNAME /mnt/backup`. The same applies when changing Nextcloud's datadir. E.g. `sudo chown -R USERNAME:GROUPNAME /mnt/ncdata`. When you want to use the NEXTCLOUD_MOUNT option for local external storage, you need to adjust the permissions of the chosen folders to be accessible/writeable by the userid `100032:100032` (if running `grep ^$(whoami): /etc/subuid` as the user that is running the docker daemon returns 100000 as first value).
|
||||
|
||||
@@ -5,7 +5,7 @@ It is possible due to several reasons that you do not want or cannot open Nextcl
|
||||
The recommended way is the following:
|
||||
1. Set up your domain correctly to point to your home network
|
||||
1. Set up a reverse proxy by following the [reverse proxy documentation](./reverse-proxy.md) but only open port 80 (which is needed for the ACME challenge to work - however no real traffic will use this port).
|
||||
1. Set up a local DNS-server like a pi-hole and configure it to be your local DNS-server for the whole network. Then in the Pi-hole interface, add a custom DNS-record for your domain and overwrite the A-record (and possibly the AAAA-record, too) to point to the local ip-address of your reverse proxy
|
||||
1. Set up a local DNS-server like a pi-hole and configure it to be your local DNS-server for the whole network. Then in the Pi-hole interface, add a custom DNS-record for your domain and overwrite the A-record (and possibly the AAAA-record, too) to point to the local ip-address of your reverse proxy (see https://github.com/nextcloud/all-in-one#how-can-i-access-nextcloud-locally)
|
||||
1. Enter the the ip-address of your local dns-server in the deamon.json file for docker so that you are sure that all docker containers use the correct local dns-server.
|
||||
1. Now, entering the domain in the AIO-interface should work as expected and should allow you to continue with the setup
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ services:
|
||||
nextcloud-aio-apache:
|
||||
container_name: nextcloud-aio-apache
|
||||
depends_on:
|
||||
- nextcloud-aio-onlyoffice
|
||||
- nextcloud-aio-collabora
|
||||
- nextcloud-aio-talk
|
||||
- nextcloud-aio-nextcloud
|
||||
@@ -16,7 +17,10 @@ services:
|
||||
- COLLABORA_HOST=nextcloud-aio-collabora
|
||||
- TALK_HOST=nextcloud-aio-talk
|
||||
- APACHE_PORT=${APACHE_PORT}
|
||||
- ONLYOFFICE_HOST=nextcloud-aio-onlyoffice
|
||||
- TZ=${TIMEZONE}
|
||||
- APACHE_MAX_SIZE=${APACHE_MAX_SIZE}
|
||||
- APACHE_MAX_TIME=${NEXTCLOUD_MAX_TIME}
|
||||
volumes:
|
||||
- nextcloud_aio_nextcloud:/var/www/html:ro
|
||||
- nextcloud_aio_apache:/mnt/data:rw
|
||||
@@ -54,6 +58,7 @@ services:
|
||||
- nextcloud_aio_nextcloud:/var/www/html:rw
|
||||
- ${NEXTCLOUD_DATADIR}:/mnt/ncdata:rw
|
||||
- ${NEXTCLOUD_MOUNT}:${NEXTCLOUD_MOUNT}:rw
|
||||
- ${NEXTCLOUD_TRUSTED_CACERTS_DIR}:/usr/local/share/ca-certificates:ro
|
||||
environment:
|
||||
- POSTGRES_HOST=nextcloud-aio-database
|
||||
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
|
||||
@@ -70,20 +75,28 @@ services:
|
||||
- OVERWRITEPROTOCOL=https
|
||||
- TURN_SECRET=${TURN_SECRET}
|
||||
- SIGNALING_SECRET=${SIGNALING_SECRET}
|
||||
- ONLYOFFICE_SECRET=${ONLYOFFICE_SECRET}
|
||||
- AIO_URL=${AIO_URL}
|
||||
- NEXTCLOUD_MOUNT=${NEXTCLOUD_MOUNT}
|
||||
- ONLYOFFICE_ENABLED=${ONLYOFFICE_ENABLED}
|
||||
- COLLABORA_ENABLED=${COLLABORA_ENABLED}
|
||||
- COLLABORA_HOST=nextcloud-aio-collabora
|
||||
- TALK_ENABLED=${TALK_ENABLED}
|
||||
- ONLYOFFICE_HOST=nextcloud-aio-onlyoffice
|
||||
- UPDATE_NEXTCLOUD_APPS=${UPDATE_NEXTCLOUD_APPS}
|
||||
- TZ=${TIMEZONE}
|
||||
- TALK_PORT=${TALK_PORT}
|
||||
- IMAGINARY_ENABLED=${IMAGINARY_ENABLED}
|
||||
- IMAGINARY_HOST=nextcloud-aio-imaginary
|
||||
- PHP_UPLOAD_LIMIT=${NEXTCLOUD_UPLOAD_LIMIT}
|
||||
- PHP_MEMORY_LIMIT=${NEXTCLOUD_MEMORY_LIMIT}
|
||||
- FULLTEXTSEARCH_ENABLED=${FULLTEXTSEARCH_ENABLED}
|
||||
- FULLTEXTSEARCH_HOST=nextcloud-aio-fulltextsearch
|
||||
- PHP_MAX_TIME=${NEXTCLOUD_MAX_TIME}
|
||||
- TRUSTED_CACERTS_DIR=${NEXTCLOUD_TRUSTED_CACERTS_DIR}
|
||||
- STARTUP_APPS=${NEXTCLOUD_STARTUP_APPS}
|
||||
- ADDITIONAL_APKS=${NEXTCLOUD_ADDITIONAL_APKS}
|
||||
- ADDITIONAL_PHP_EXTENSIONS=${NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS}
|
||||
stop_grace_period: 10s
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
@@ -105,7 +118,7 @@ services:
|
||||
image: nextcloud/aio-collabora:latest-arm64
|
||||
environment:
|
||||
- aliasgroup1=https://${NC_DOMAIN}:443
|
||||
- extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.level=warning --o:home_mode.enable=true
|
||||
- extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.level=warning --o:home_mode.enable=true ${COLLABORA_SECCOMP_POLICY}
|
||||
- dictionaries=${COLLABORA_DICTIONARIES}
|
||||
- TZ=${TIMEZONE}
|
||||
stop_grace_period: 10s
|
||||
@@ -131,6 +144,21 @@ services:
|
||||
networks:
|
||||
- nextcloud-aio
|
||||
|
||||
nextcloud-aio-onlyoffice:
|
||||
container_name: nextcloud-aio-onlyoffice
|
||||
image: nextcloud/aio-onlyoffice:latest-arm64
|
||||
environment:
|
||||
- TZ=${TIMEZONE}
|
||||
- JWT_ENABLED=true
|
||||
- JWT_HEADER=AuthorizationJwt
|
||||
- JWT_SECRET=${ONLYOFFICE_SECRET}
|
||||
volumes:
|
||||
- nextcloud_aio_onlyoffice:/var/lib/onlyoffice:rw
|
||||
stop_grace_period: 10s
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- nextcloud-aio
|
||||
|
||||
nextcloud-aio-imaginary:
|
||||
container_name: nextcloud-aio-imaginary
|
||||
image: nextcloud/aio-imaginary:latest-arm64
|
||||
@@ -166,6 +194,8 @@ volumes:
|
||||
name: nextcloud_aio_elasticsearch
|
||||
nextcloud_aio_nextcloud:
|
||||
name: nextcloud_aio_nextcloud
|
||||
nextcloud_aio_onlyoffice:
|
||||
name: nextcloud_aio_onlyoffice
|
||||
nextcloud_aio_nextcloud_data:
|
||||
name: nextcloud_aio_nextcloud_data
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ services:
|
||||
- APACHE_PORT=${APACHE_PORT}
|
||||
- ONLYOFFICE_HOST=nextcloud-aio-onlyoffice
|
||||
- TZ=${TIMEZONE}
|
||||
- APACHE_MAX_SIZE=${APACHE_MAX_SIZE}
|
||||
- APACHE_MAX_TIME=${NEXTCLOUD_MAX_TIME}
|
||||
volumes:
|
||||
- nextcloud_aio_nextcloud:/var/www/html:ro
|
||||
- nextcloud_aio_apache:/mnt/data:rw
|
||||
@@ -57,6 +59,7 @@ services:
|
||||
- nextcloud_aio_nextcloud:/var/www/html:rw
|
||||
- ${NEXTCLOUD_DATADIR}:/mnt/ncdata:rw
|
||||
- ${NEXTCLOUD_MOUNT}:${NEXTCLOUD_MOUNT}:rw
|
||||
- ${NEXTCLOUD_TRUSTED_CACERTS_DIR}:/usr/local/share/ca-certificates:ro
|
||||
environment:
|
||||
- POSTGRES_HOST=nextcloud-aio-database
|
||||
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
|
||||
@@ -89,9 +92,14 @@ services:
|
||||
- IMAGINARY_ENABLED=${IMAGINARY_ENABLED}
|
||||
- IMAGINARY_HOST=nextcloud-aio-imaginary
|
||||
- PHP_UPLOAD_LIMIT=${NEXTCLOUD_UPLOAD_LIMIT}
|
||||
- PHP_MEMORY_LIMIT=${NEXTCLOUD_MEMORY_LIMIT}
|
||||
- FULLTEXTSEARCH_ENABLED=${FULLTEXTSEARCH_ENABLED}
|
||||
- FULLTEXTSEARCH_HOST=nextcloud-aio-fulltextsearch
|
||||
- PHP_MAX_TIME=${NEXTCLOUD_MAX_TIME}
|
||||
- TRUSTED_CACERTS_DIR=${NEXTCLOUD_TRUSTED_CACERTS_DIR}
|
||||
- STARTUP_APPS=${NEXTCLOUD_STARTUP_APPS}
|
||||
- ADDITIONAL_APKS=${NEXTCLOUD_ADDITIONAL_APKS}
|
||||
- ADDITIONAL_PHP_EXTENSIONS=${NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS}
|
||||
stop_grace_period: 10s
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
@@ -113,7 +121,7 @@ services:
|
||||
image: nextcloud/aio-collabora:latest
|
||||
environment:
|
||||
- aliasgroup1=https://${NC_DOMAIN}:443
|
||||
- extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.level=warning --o:home_mode.enable=true
|
||||
- extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.level=warning --o:home_mode.enable=true ${COLLABORA_SECCOMP_POLICY}
|
||||
- dictionaries=${COLLABORA_DICTIONARIES}
|
||||
- TZ=${TIMEZONE}
|
||||
stop_grace_period: 10s
|
||||
|
||||
@@ -5,12 +5,14 @@ You can run the containers that are build for AIO with docker-compose. This come
|
||||
### Advantages
|
||||
- You can run it without a container having access to the docker socket
|
||||
- You can modify all values on your own
|
||||
- You can run the containers with docker swarm
|
||||
|
||||
### Disadvantages
|
||||
- You lose the AIO interface
|
||||
- You lose update notifications and automatic updates
|
||||
- You lose all AIO backup and restore features
|
||||
- You need to know what you are doing, especially when modifying the docker-compose file
|
||||
- For updating, you need to strictly follow the at the bottom described update routine
|
||||
- Probably more
|
||||
|
||||
## How to use this?
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
AIO_TOKEN=123456 # Has no function but needs to be set!
|
||||
AIO_URL=localhost # Has no function but needs to be set!
|
||||
APACHE_MAX_SIZE=10737418240 # This needs to be an integer and in sync with NEXTCLOUD_UPLOAD_LIMIT
|
||||
APACHE_PORT=443 # Changing this to a different value than 443 will allow you to run it behind a reverse proxy.
|
||||
CLAMAV_ENABLED=no # Setting this to "yes" enables the option in Nextcloud automatically.
|
||||
COLLABORA_DICTIONARIES=de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru # You can change this in order to enable other dictionaries for collabora
|
||||
COLLABORA_DICTIONARIES="de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru" # You can change this in order to enable other dictionaries for collabora
|
||||
COLLABORA_ENABLED=yes # Setting this to "yes" enables the option in Nextcloud automatically.
|
||||
COLLABORA_SECCOMP_POLICY=--o:security.seccomp=true # Changing the value to false allows to disable the seccomp feature of the Collabora container.
|
||||
DATABASE_PASSWORD= # TODO! This needs to be a unique and good password!
|
||||
FULLTEXTSEARCH_ENABLED=no # Setting this to "yes" enables the option in Nextcloud automatically.
|
||||
IMAGINARY_ENABLED=no # Setting this to "yes" enables the option in Nextcloud automatically.
|
||||
JANUS_API_KEY= # TODO! This needs to be a unique and good password!
|
||||
NC_DOMAIN=yourdomain.com # TODO! Needs to be changed to the domain that you want to use for Nextcloud.
|
||||
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.
|
||||
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.
|
||||
NEXTCLOUD_DATADIR=nextcloud_aio_nextcloud_data # You can change this to e.g. "/mnt/ncdata" to map it to a location on your host. It needs to be adjusted before the first startup and never afterwards!
|
||||
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_PASSWORD= # TODO! This is the password of the initially created Nextcloud admin with username "admin".
|
||||
NEXTCLOUD_STARTUP_APPS="deck tasks calendar contacts" # Allows to modify the Nextcloud apps that are installed on starting AIO the first time
|
||||
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=10G # This allows to change the upload limit of the Nextcloud container
|
||||
ONLYOFFICE_ENABLED=no # Setting this to "yes" enables the option in Nextcloud automatically.
|
||||
ONLYOFFICE_SECRET= # TODO! This needs to be a unique and good password!
|
||||
|
||||
@@ -59,13 +59,14 @@ done
|
||||
sed -i 's|_ENABLED=|_ENABLED=no # Setting this to "yes" enables the option in Nextcloud automatically.|' sample.conf
|
||||
sed -i 's|TALK_ENABLED=no|TALK_ENABLED=yes|' sample.conf
|
||||
sed -i 's|COLLABORA_ENABLED=no|COLLABORA_ENABLED=yes|' sample.conf
|
||||
sed -i 's|COLLABORA_DICTIONARIES=|COLLABORA_DICTIONARIES=de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru # You can change this in order to enable other dictionaries for collabora|' sample.conf
|
||||
sed -i 's|COLLABORA_DICTIONARIES=|COLLABORA_DICTIONARIES="de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru" # You can change this in order to enable other dictionaries for collabora|' sample.conf
|
||||
sed -i 's|NEXTCLOUD_DATADIR=|NEXTCLOUD_DATADIR=nextcloud_aio_nextcloud_data # You can change this to e.g. "/mnt/ncdata" to map it to a location on your host. It needs to be adjusted before the first startup and never afterwards!|' sample.conf
|
||||
sed -i 's|NEXTCLOUD_MOUNT=|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!|' sample.conf
|
||||
sed -i 's|NEXTCLOUD_UPLOAD_LIMIT=|NEXTCLOUD_UPLOAD_LIMIT=10G # This allows to change the upload limit of the Nextcloud container|' sample.conf
|
||||
sed -i 's|NEXTCLOUD_MEMORY_LIMIT=|NEXTCLOUD_MEMORY_LIMIT=512M # This allows to change the PHP memory limit of the Nextcloud container|' sample.conf
|
||||
sed -i 's|APACHE_MAX_SIZE=|APACHE_MAX_SIZE=10737418240 # This needs to be an integer and in sync with NEXTCLOUD_UPLOAD_LIMIT|' sample.conf
|
||||
sed -i 's|NEXTCLOUD_MAX_TIME=|NEXTCLOUD_MAX_TIME=3600 # This allows to change the upload time limit of the Nextcloud container|' sample.conf
|
||||
sed -i 's|TRUSTED_CACERTS_DIR=|TRUSTED_CACERTS_DIR=/path/to/my/cacerts # Nextcloud container will trust all the Certification Authorities, whose certificates are included in the given directory.|' sample.conf
|
||||
sed -i 's|NEXTCLOUD_TRUSTED_CACERTS_DIR=|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.|' sample.conf
|
||||
sed -i 's|UPDATE_NEXTCLOUD_APPS=|UPDATE_NEXTCLOUD_APPS=no # When setting to yes, it will automatically update all installed Nextcloud apps upon container startup on saturdays.|' sample.conf
|
||||
sed -i 's|APACHE_PORT=|APACHE_PORT=443 # Changing this to a different value than 443 will allow you to run it behind a reverse proxy.|' sample.conf
|
||||
sed -i 's|TALK_PORT=|TALK_PORT=3478 # This allows to adjust the port that the talk container is using.|' sample.conf
|
||||
@@ -75,6 +76,9 @@ sed -i 's|NC_DOMAIN=|NC_DOMAIN=yourdomain.com # TODO! Needs to be chang
|
||||
sed -i 's|NEXTCLOUD_PASSWORD=|NEXTCLOUD_PASSWORD= # TODO! This is the password of the initially created Nextcloud admin with username "admin".|' sample.conf
|
||||
sed -i 's|TIMEZONE=|TIMEZONE=Europe/Berlin # TODO! This is the timezone that your containers will use.|' sample.conf
|
||||
sed -i 's|COLLABORA_SECCOMP_POLICY=|COLLABORA_SECCOMP_POLICY=--o:security.seccomp=true # Changing the value to false allows to disable the seccomp feature of the Collabora container.|' sample.conf
|
||||
sed -i 's|NEXTCLOUD_STARTUP_APPS=|NEXTCLOUD_STARTUP_APPS="deck tasks calendar contacts" # Allows to modify the Nextcloud apps that are installed on starting AIO the first time|' 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|=$|= # TODO! This needs to be a unique and good password!|' sample.conf
|
||||
|
||||
cat sample.conf
|
||||
@@ -97,6 +101,8 @@ echo "" >> containers.yml
|
||||
|
||||
echo "$OUTPUT" >> containers.yml
|
||||
|
||||
sed -i '/container_name/d' containers.yml
|
||||
|
||||
VOLUMES="$(grep -oP 'nextcloud_aio_[a-z_]+' containers.yml | sort -u)"
|
||||
mapfile -t VOLUMES <<< "$VOLUMES"
|
||||
echo "" >> containers.yml
|
||||
@@ -123,9 +129,5 @@ sed -i '/image:/s/$/:latest-arm64/' latest-arm64.yml
|
||||
sed -i '/ nextcloud-aio-clamav:/,/^ $/d' latest-arm64.yml
|
||||
sed -i '/nextcloud[-_]aio[-_]clamav/d' latest-arm64.yml
|
||||
sed -i '/CLAMAV_ENABLED/d' latest-arm64.yml
|
||||
sed -i '/ nextcloud-aio-onlyoffice:/,/^ $/d' latest-arm64.yml
|
||||
sed -i '/nextcloud[-_]aio[-_]onlyoffice/d' latest-arm64.yml
|
||||
sed -i '/ONLYOFFICE_ENABLED/d' latest-arm64.yml
|
||||
sed -i '/ONLYOFFICE_SECRET/d' latest-arm64.yml
|
||||
|
||||
rm containers.yml
|
||||
|
||||
14
migration.md
14
migration.md
@@ -3,7 +3,7 @@
|
||||
There are basically three ways how to migrate from an already existing Nextcloud installation to Nextcloud AIO:
|
||||
|
||||
1. Migrate only the files which is the easiest way
|
||||
1. Migrate the files and the database which is much more complicated
|
||||
1. Migrate the files and the database which is much more complicated (and doesn't work on former snap installations)
|
||||
1. Use the user_migration app that allows to migrate some of the user's data from a former instance to a new instance but needs to be done manually for each user
|
||||
|
||||
## Migrate only the files
|
||||
@@ -17,10 +17,10 @@ The procedure for migrating only the files works like this:
|
||||
1. Restore the datadirectory of your former instance into the following directory: `/var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/`
|
||||
1. Next, run `sudo chown -R 33:0 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/*` and `sudo chmod -R 750 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/*` to apply the correct permissions
|
||||
1. Start the containers again and wait until all containers are running
|
||||
1. Run `sudo docker exec -it nextcloud-aio-nextcloud php occ files:scan-app-data && sudo docker exec -it nextcloud-aio-nextcloud php occ files:scan --all` in order to scan all files in the datadirectory.
|
||||
1. Run `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan-app-data && sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan --all` in order to scan all files in the datadirectory.
|
||||
|
||||
## Migrate the files and the database
|
||||
**Please note**: this is much more complicated than migrating only the files and also not as failproof so be warned!
|
||||
**Please note**: this is much more complicated than migrating only the files and also not as failproof so be warned! Also, this will not work on former snap installations as the snap is read-only and thus you cannot install the necessary `pdo_pgsql` PHP extension.
|
||||
|
||||
The procedure for migrating the files and the database works like this:
|
||||
1. Make sure that your old instance is on exactly the same version like the version used in Nextcloud AIO. (e.g. 23.0.0) You can find the used version here: [click here](https://github.com/nextcloud/all-in-one/search?l=Dockerfile&q=NEXTCLOUD_VERSION&type=). If not, simply upgrade your former installation to that version or wait until the version used in Nextcloud AIO got updated to the same version of your former installation or the other way around.
|
||||
@@ -44,8 +44,8 @@ The procedure for migrating the files and the database works like this:
|
||||
```
|
||||
occ db:convert-type --all-apps --password "$PG_PASSWORD" pgsql "$PG_USER" 127.0.0.1 "$PG_DATABASE"
|
||||
```
|
||||
**Please note:** You might need to change the ip-address `127.0.0.1` based on your exact installation.<br>
|
||||
Further information on the conversion is additionally available here: https://docs.nextcloud.com/server/stable/admin_manual/configuration_database/db_conversion.html#converting-database-type
|
||||
**Please note:** You might need to change the ip-address `127.0.0.1` and adjust the occ command (`occ`) based on your exact installation. Further information on the conversion is additionally available here: https://docs.nextcloud.com/server/stable/admin_manual/configuration_database/db_conversion.html#converting-database-type<br>
|
||||
**Troubleshooting:** If you get an error that it could not find a driver for the conversion, you most likely need to install the PHP extension `pdo_pgsql`.
|
||||
1. Hopefully does the conversion finish successfully. If not, simply restore your old Nextcloud installation from backup. If yes, you should now log in to your Nextcloud and test if everything works and if all data has been converted successfully.
|
||||
1. If everything works as expected, feel free to continue with the steps below.
|
||||
1. Now, run a pg_dump to get an export of your current database. Something like the following command should work:
|
||||
@@ -72,8 +72,8 @@ The procedure for migrating the files and the database works like this:
|
||||
sudo chmod 777 /var/lib/docker/volumes/nextcloud_aio_database_dump/_data/database-dump.sql
|
||||
sudo rm /var/lib/docker/volumes/nextcloud_aio_database_dump/_data/initial-cleanup-done
|
||||
```
|
||||
1. If the commands above were executed successfully, restore the datadirectory of your former instance into the following directory: `/var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/`
|
||||
1. Next, run `sudo chown -R 33:0 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/*` and `sudo chmod -R 750 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/*`to apply the correct permissions
|
||||
1. If the commands above were executed successfully, restore the datadirectory of your former instance into your datadirectory: `/var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/`. Be aware if you have changed the standard path of your datadirectory like described [here](https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir).
|
||||
1. Next, run `sudo chown -R 33:0 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/*` and `sudo chmod -R 750 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/*`to apply the correct permissions on the datadirectory.
|
||||
1. Edit the Nextcloud AIO config.php file that is stored in `/var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/config/config.php` and modify only `passwordsalt`, `secret`, `instanceid` and set it to the old values that you used on your old installation. If you are brave, feel free to modify further values e.g. add your old LDAP config or S3 storage config. (Some things like Mail server config can be added back using Nextcloud's webinterface later on).
|
||||
1. When you are done and saved your changes to the file, finally start the containers again and wait until all containers are running.
|
||||
1. As last step, install all apps again that were installed before on your old instance by using the webinterface.
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"scripts": {
|
||||
"psalm": "psalm --threads=1",
|
||||
"psalm:update-baseline": "psalm --threads=1 --update-baseline",
|
||||
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l"
|
||||
"lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l {} \\;",
|
||||
"php-deprecation-detector": "find . -name \\*.php -not -path './vendor/*' -exec phpdd scan {} -n -t 8.0 \\;"
|
||||
}
|
||||
}
|
||||
|
||||
106
php/composer.lock
generated
106
php/composer.lock
generated
@@ -220,16 +220,16 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/psr7",
|
||||
"version": "2.4.1",
|
||||
"version": "2.4.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/psr7.git",
|
||||
"reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379"
|
||||
"reference": "67c26b443f348a51926030c83481b85718457d3d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/69568e4293f4fa993f3b0e51c9723e1e17c41379",
|
||||
"reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d",
|
||||
"reference": "67c26b443f348a51926030c83481b85718457d3d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -319,7 +319,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/psr7/issues",
|
||||
"source": "https://github.com/guzzle/psr7/tree/2.4.1"
|
||||
"source": "https://github.com/guzzle/psr7/tree/2.4.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -335,7 +335,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-08-28T14:45:39+00:00"
|
||||
"time": "2022-10-26T14:07:24+00:00"
|
||||
},
|
||||
{
|
||||
"name": "http-interop/http-factory-guzzle",
|
||||
@@ -1137,30 +1137,30 @@
|
||||
},
|
||||
{
|
||||
"name": "slim/csrf",
|
||||
"version": "1.2.1",
|
||||
"version": "1.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/slimphp/Slim-Csrf.git",
|
||||
"reference": "ee811a258ecee807846aefc51aabc1963ae0a400"
|
||||
"reference": "ebaaf295fd6d7224078d8ae3bba45329b31798c7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/slimphp/Slim-Csrf/zipball/ee811a258ecee807846aefc51aabc1963ae0a400",
|
||||
"reference": "ee811a258ecee807846aefc51aabc1963ae0a400",
|
||||
"url": "https://api.github.com/repos/slimphp/Slim-Csrf/zipball/ebaaf295fd6d7224078d8ae3bba45329b31798c7",
|
||||
"reference": "ebaaf295fd6d7224078d8ae3bba45329b31798c7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.3|^8.0",
|
||||
"php": "^7.4 || ^8.0",
|
||||
"psr/http-factory": "^1.0",
|
||||
"psr/http-message": "^1.0",
|
||||
"psr/http-server-handler": "^1.0",
|
||||
"psr/http-server-middleware": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpspec/prophecy": "^1.12",
|
||||
"phpspec/prophecy": "^1.15",
|
||||
"phpspec/prophecy-phpunit": "^2.0",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"squizlabs/php_codesniffer": "^3.5.8"
|
||||
"squizlabs/php_codesniffer": "^3.7"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -1180,7 +1180,7 @@
|
||||
}
|
||||
],
|
||||
"description": "Slim Framework 4 CSRF protection PSR-15 middleware",
|
||||
"homepage": "http://slimframework.com",
|
||||
"homepage": "https://www.slimframework.com",
|
||||
"keywords": [
|
||||
"csrf",
|
||||
"framework",
|
||||
@@ -1189,22 +1189,22 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/slimphp/Slim-Csrf/issues",
|
||||
"source": "https://github.com/slimphp/Slim-Csrf/tree/1.2.1"
|
||||
"source": "https://github.com/slimphp/Slim-Csrf/tree/1.3.0"
|
||||
},
|
||||
"time": "2021-02-04T15:37:21+00:00"
|
||||
"time": "2022-11-05T19:27:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "slim/slim",
|
||||
"version": "4.10.0",
|
||||
"version": "4.11.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/slimphp/Slim.git",
|
||||
"reference": "0dfc7d2fdf2553b361d864d51af3fe8a6ad168b0"
|
||||
"reference": "b0f4ca393ea037be9ac7292ba7d0a34d18bac0c7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/slimphp/Slim/zipball/0dfc7d2fdf2553b361d864d51af3fe8a6ad168b0",
|
||||
"reference": "0dfc7d2fdf2553b361d864d51af3fe8a6ad168b0",
|
||||
"url": "https://api.github.com/repos/slimphp/Slim/zipball/b0f4ca393ea037be9ac7292ba7d0a34d18bac0c7",
|
||||
"reference": "b0f4ca393ea037be9ac7292ba7d0a34d18bac0c7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1219,21 +1219,21 @@
|
||||
"psr/log": "^1.1 || ^2.0 || ^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"adriansuter/php-autoload-override": "^1.2",
|
||||
"adriansuter/php-autoload-override": "^1.3",
|
||||
"ext-simplexml": "*",
|
||||
"guzzlehttp/psr7": "^2.1",
|
||||
"guzzlehttp/psr7": "^2.4",
|
||||
"httpsoft/http-message": "^1.0",
|
||||
"httpsoft/http-server-request": "^1.0",
|
||||
"laminas/laminas-diactoros": "^2.8",
|
||||
"laminas/laminas-diactoros": "^2.17",
|
||||
"nyholm/psr7": "^1.5",
|
||||
"nyholm/psr7-server": "^1.0",
|
||||
"phpspec/prophecy": "^1.15",
|
||||
"phpspec/prophecy-phpunit": "^2.0",
|
||||
"phpstan/phpstan": "^1.4",
|
||||
"phpstan/phpstan": "^1.8",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"slim/http": "^1.2",
|
||||
"slim/psr7": "^1.5",
|
||||
"squizlabs/php_codesniffer": "^3.6"
|
||||
"squizlabs/php_codesniffer": "^3.7"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-simplexml": "Needed to support XML format in BodyParsingMiddleware",
|
||||
@@ -1306,7 +1306,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-03-14T14:18:23+00:00"
|
||||
"time": "2022-11-06T16:33:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "slim/twig-view",
|
||||
@@ -1442,16 +1442,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.26.0",
|
||||
"version": "v1.27.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||
"reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4"
|
||||
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
|
||||
"reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1466,7 +1466,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.26-dev"
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@@ -1504,7 +1504,7 @@
|
||||
"portable"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0"
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1520,20 +1520,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-24T11:49:31+00:00"
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.26.0",
|
||||
"version": "v1.27.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1548,7 +1548,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.26-dev"
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@@ -1587,7 +1587,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1603,20 +1603,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-24T11:49:31+00:00"
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php81",
|
||||
"version": "v1.26.0",
|
||||
"version": "v1.27.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php81.git",
|
||||
"reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1"
|
||||
"reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1",
|
||||
"reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a",
|
||||
"reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1625,7 +1625,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.26-dev"
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@@ -1666,7 +1666,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0"
|
||||
"source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1682,20 +1682,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-24T11:49:31+00:00"
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "v3.4.2",
|
||||
"version": "v3.4.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "e07cdd3d430cd7e453c31b36eb5ad6c0c5e43077"
|
||||
"reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/e07cdd3d430cd7e453c31b36eb5ad6c0c5e43077",
|
||||
"reference": "e07cdd3d430cd7e453c31b36eb5ad6c0c5e43077",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/c38fd6b0b7f370c198db91ffd02e23b517426b58",
|
||||
"reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1746,7 +1746,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/twigphp/Twig/issues",
|
||||
"source": "https://github.com/twigphp/Twig/tree/v3.4.2"
|
||||
"source": "https://github.com/twigphp/Twig/tree/v3.4.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1758,7 +1758,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-08-12T06:47:24+00:00"
|
||||
"time": "2022-09-28T08:42:51+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
"writeable": true
|
||||
},
|
||||
{
|
||||
"name": "%TRUSTED_CACERTS_DIR%",
|
||||
"name": "%NEXTCLOUD_TRUSTED_CACERTS_DIR%",
|
||||
"location": "/usr/local/share/ca-certificates",
|
||||
"writeable": false
|
||||
}
|
||||
@@ -153,10 +153,14 @@
|
||||
"IMAGINARY_ENABLED=%IMAGINARY_ENABLED%",
|
||||
"IMAGINARY_HOST=nextcloud-aio-imaginary",
|
||||
"PHP_UPLOAD_LIMIT=%NEXTCLOUD_UPLOAD_LIMIT%",
|
||||
"PHP_MEMORY_LIMIT=%NEXTCLOUD_MEMORY_LIMIT%",
|
||||
"FULLTEXTSEARCH_ENABLED=%FULLTEXTSEARCH_ENABLED%",
|
||||
"FULLTEXTSEARCH_HOST=nextcloud-aio-fulltextsearch",
|
||||
"PHP_MAX_TIME=%NEXTCLOUD_MAX_TIME%",
|
||||
"TRUSTED_CACERTS_DIR=%TRUSTED_CACERTS_DIR%"
|
||||
"TRUSTED_CACERTS_DIR=%NEXTCLOUD_TRUSTED_CACERTS_DIR%",
|
||||
"STARTUP_APPS=%NEXTCLOUD_STARTUP_APPS%",
|
||||
"ADDITIONAL_APKS=%NEXTCLOUD_ADDITIONAL_APKS%",
|
||||
"ADDITIONAL_PHP_EXTENSIONS=%NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS%"
|
||||
],
|
||||
"maxShutdownTime": 10,
|
||||
"restartPolicy": "unless-stopped"
|
||||
@@ -174,7 +178,13 @@
|
||||
"REDIS_HOST_PASSWORD=%REDIS_PASSWORD%",
|
||||
"TZ=%TIMEZONE%"
|
||||
],
|
||||
"volumes": [],
|
||||
"volumes": [
|
||||
{
|
||||
"name": "nextcloud_aio_redis",
|
||||
"location": "/data",
|
||||
"writeable": true
|
||||
}
|
||||
],
|
||||
"secrets": [
|
||||
"REDIS_PASSWORD",
|
||||
"ONLYOFFICE_SECRET"
|
||||
@@ -197,7 +207,13 @@
|
||||
"dictionaries=%COLLABORA_DICTIONARIES%",
|
||||
"TZ=%TIMEZONE%"
|
||||
],
|
||||
"volumes": [],
|
||||
"volumes": [
|
||||
{
|
||||
"name": "nextcloud_aio_collabora_fonts",
|
||||
"location": "/opt/cool/systemplate/tmpfonts",
|
||||
"writeable": true
|
||||
}
|
||||
],
|
||||
"secrets": [],
|
||||
"maxShutdownTime": 10,
|
||||
"restartPolicy": "unless-stopped"
|
||||
@@ -286,6 +302,16 @@
|
||||
"name": "%BORGBACKUP_HOST_LOCATION%",
|
||||
"location": "/mnt/borgbackup",
|
||||
"writeable": true
|
||||
},
|
||||
{
|
||||
"name": "nextcloud_aio_elasticsearch",
|
||||
"location": "/nextcloud_aio_volumes/nextcloud_aio_elasticsearch",
|
||||
"writeable": true
|
||||
},
|
||||
{
|
||||
"name": "nextcloud_aio_redis",
|
||||
"location": "/mnt/redis",
|
||||
"writeable": true
|
||||
}
|
||||
],
|
||||
"secrets": [
|
||||
@@ -345,7 +371,8 @@
|
||||
"3310"
|
||||
],
|
||||
"environmentVariables": [
|
||||
"TZ=%TIMEZONE%"
|
||||
"TZ=%TIMEZONE%",
|
||||
"CLAMD_STARTUP_TIMEOUT=90"
|
||||
],
|
||||
"volumes": [
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<files psalm-version="4.27.0@faf106e717c37b8c81721845dba9de3d8deed8ff">
|
||||
<files psalm-version="5.2.0@fb685a16df3050d4c18d8a4100fe83abe6458cba">
|
||||
<file src="public/index.php">
|
||||
<MissingClosureParamType occurrences="10">
|
||||
<code>$args</code>
|
||||
@@ -30,12 +30,6 @@
|
||||
<code>$args</code>
|
||||
<code>$args</code>
|
||||
</MissingParamType>
|
||||
<PossiblyInvalidArrayAccess occurrences="1">
|
||||
<code>$request->getParsedBody()['selected_restore_time']</code>
|
||||
</PossiblyInvalidArrayAccess>
|
||||
<PossiblyNullArrayAccess occurrences="1">
|
||||
<code>$request->getParsedBody()['selected_restore_time']</code>
|
||||
</PossiblyNullArrayAccess>
|
||||
</file>
|
||||
<file src="src/Controller/LoginController.php">
|
||||
<MissingParamType occurrences="3">
|
||||
@@ -43,15 +37,6 @@
|
||||
<code>$args</code>
|
||||
<code>$args</code>
|
||||
</MissingParamType>
|
||||
<PossiblyInvalidArrayAccess occurrences="1">
|
||||
<code>$request->getParsedBody()['password']</code>
|
||||
</PossiblyInvalidArrayAccess>
|
||||
<PossiblyNullArgument occurrences="1">
|
||||
<code>$password</code>
|
||||
</PossiblyNullArgument>
|
||||
<PossiblyNullArrayAccess occurrences="1">
|
||||
<code>$request->getParsedBody()['password']</code>
|
||||
</PossiblyNullArrayAccess>
|
||||
</file>
|
||||
<file src="src/Docker/DockerActionManager.php">
|
||||
<InvalidReturnType occurrences="1">
|
||||
@@ -64,11 +49,6 @@
|
||||
<code>$container->GetInternalPorts() !== null</code>
|
||||
</RedundantCondition>
|
||||
</file>
|
||||
<file src="src/Middleware/AuthMiddleware.php">
|
||||
<UndefinedInterfaceMethod occurrences="1">
|
||||
<code>withStatus</code>
|
||||
</UndefinedInterfaceMethod>
|
||||
</file>
|
||||
<file src="src/Twig/ClassExtension.php">
|
||||
<MissingParamType occurrences="1">
|
||||
<code>$object</code>
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
// OnlyOffice
|
||||
try {
|
||||
var onlyoffice = document.getElementById("onlyoffice");
|
||||
var onlyoffice = document.getElementById("onlyoffice");
|
||||
if (onlyoffice) {
|
||||
onlyoffice.disabled = true;
|
||||
} catch (error) {
|
||||
// console.error(error);
|
||||
}
|
||||
});
|
||||
@@ -19,12 +19,13 @@
|
||||
const xhr = e.target;
|
||||
if (xhr.status === 201) {
|
||||
window.location.replace(xhr.getResponseHeader('Location'));
|
||||
}
|
||||
if (xhr.status === 422) {
|
||||
} else if (xhr.status === 422) {
|
||||
showError(xhr.response);
|
||||
}
|
||||
if (xhr.status === 500) {
|
||||
showError("Server error. Please see the logs for details.");
|
||||
} else if (xhr.status === 500) {
|
||||
showError("Server error. Please check the mastercontainer logs for details.");
|
||||
} else {
|
||||
// If the responose is not one of the above, we should reload to show the latest content
|
||||
window.location.reload(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,9 @@ ini_set('session.save_path', $dataConst->GetSessionDirectory());
|
||||
// Auto logout on browser close
|
||||
ini_set('session.cookie_lifetime', '0');
|
||||
|
||||
# Keep session for 24h max
|
||||
ini_set('session.gc_maxlifetime', '86400');
|
||||
|
||||
// Create app
|
||||
AppFactory::setContainer($container);
|
||||
$app = AppFactory::create();
|
||||
|
||||
@@ -13,11 +13,9 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
||||
clamav.addEventListener('change', makeOptionsFormSubmitVisible);
|
||||
|
||||
// OnlyOffice
|
||||
try {
|
||||
var onlyoffice = document.getElementById("onlyoffice");
|
||||
var onlyoffice = document.getElementById("onlyoffice");
|
||||
if (onlyoffice) {
|
||||
onlyoffice.addEventListener('change', makeOptionsFormSubmitVisible);
|
||||
} catch (error) {
|
||||
// console.error(error);
|
||||
}
|
||||
|
||||
// Collabora
|
||||
|
||||
12
php/public/second-tab-warning.js
Normal file
12
php/public/second-tab-warning.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const channel = new BroadcastChannel('tab')
|
||||
|
||||
channel.postMessage('second-tab')
|
||||
// note that listener is added after posting the message
|
||||
|
||||
channel.addEventListener('message', (msg) => {
|
||||
if (msg.data === 'second-tab') {
|
||||
// message received from 2nd tab
|
||||
document.getElementById('overlay').classList.add('loading')
|
||||
alert('Cannot open multiple instances. You can use AIO here by reloading the page.')
|
||||
}
|
||||
});
|
||||
@@ -3,6 +3,8 @@
|
||||
namespace AIO\Auth;
|
||||
|
||||
use AIO\Data\ConfigurationManager;
|
||||
use AIO\Data\DataConst;
|
||||
use \DateTime;
|
||||
|
||||
class AuthManager {
|
||||
private const SESSION_KEY = 'aio_authenticated';
|
||||
@@ -21,6 +23,14 @@ class AuthManager {
|
||||
}
|
||||
|
||||
public function SetAuthState(bool $isLoggedIn) : void {
|
||||
|
||||
if (!$this->IsAuthenticated() && $isLoggedIn === true) {
|
||||
$date = new DateTime();
|
||||
$dateTime = $date->getTimestamp();
|
||||
$_SESSION['date_time'] = $dateTime;
|
||||
file_put_contents(DataConst::GetSessionDateFile(), (string)$dateTime);
|
||||
}
|
||||
|
||||
$_SESSION[self::SESSION_KEY] = $isLoggedIn;
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ class ContainerDefinitionFetcher
|
||||
if($value['name'] === '') {
|
||||
continue;
|
||||
}
|
||||
} elseif ($value['name'] === '%TRUSTED_CACERTS_DIR%') {
|
||||
} elseif ($value['name'] === '%NEXTCLOUD_TRUSTED_CACERTS_DIR%') {
|
||||
$value['name'] = $this->configurationManager->GetTrustedCacertsDir();
|
||||
if($value['name'] === '') {
|
||||
continue;
|
||||
|
||||
@@ -101,7 +101,7 @@ class DockerController
|
||||
public function StartBackupContainerRestore(Request $request, Response $response, $args) : Response {
|
||||
$config = $this->configurationManager->GetConfig();
|
||||
$config['backup-mode'] = 'restore';
|
||||
$config['selected-restore-time'] = $request->getParsedBody()['selected_restore_time'];
|
||||
$config['selected-restore-time'] = $request->getParsedBody()['selected_restore_time'] ?? '';
|
||||
$this->configurationManager->WriteConfig($config);
|
||||
|
||||
$id = self::TOP_CONTAINER;
|
||||
|
||||
@@ -23,7 +23,7 @@ class LoginController
|
||||
if (!$this->dockerActionManager->isLoginAllowed()) {
|
||||
return $response->withHeader('Location', '/')->withStatus(302);
|
||||
}
|
||||
$password = $request->getParsedBody()['password'];
|
||||
$password = $request->getParsedBody()['password'] ?? '';
|
||||
if($this->authManager->CheckCredentials($password)) {
|
||||
$this->authManager->SetAuthState(true);
|
||||
return $response->withHeader('Location', '/')->withStatus(302);
|
||||
@@ -33,7 +33,7 @@ class LoginController
|
||||
}
|
||||
|
||||
public function GetTryLogin(Request $request, Response $response, $args) : Response {
|
||||
$token = $request->getQueryParams()['token'];
|
||||
$token = $request->getQueryParams()['token'] ?? '';
|
||||
if($this->authManager->CheckToken($token)) {
|
||||
$this->authManager->SetAuthState(true);
|
||||
return $response->withHeader('Location', '/')->withStatus(302);
|
||||
|
||||
26
php/src/Cron/OutdatedNotification.php
Normal file
26
php/src/Cron/OutdatedNotification.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
// increase memory limit to 2GB
|
||||
ini_set('memory_limit', '2048M');
|
||||
|
||||
use DI\Container;
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$container = \AIO\DependencyInjection::GetContainer();
|
||||
|
||||
/** @var \AIO\Docker\DockerActionManager $dockerActionManger */
|
||||
$dockerActionManger = $container->get(\AIO\Docker\DockerActionManager::class);
|
||||
/** @var \AIO\ContainerDefinitionFetcher $containerDefinitionFetcher */
|
||||
$containerDefinitionFetcher = $container->get(\AIO\ContainerDefinitionFetcher::class);
|
||||
|
||||
$id = 'nextcloud-aio-nextcloud';
|
||||
$nextcloudContainer = $containerDefinitionFetcher->GetContainerById($id);
|
||||
|
||||
$isNextcloudImageOutdated = $dockerActionManger->isNextcloudImageOutdated();
|
||||
|
||||
if ($isNextcloudImageOutdated === true) {
|
||||
$dockerActionManger->sendNotification($nextcloudContainer, 'AIO is outdated!', 'Please open the AIO interface or ask an administrator to update it. If you do not want to do it manually each time, you can enable the daily backup feature from the AIO interface which automatically updates all containers.', '/notify-all.sh');
|
||||
}
|
||||
|
||||
@@ -439,7 +439,11 @@ class ConfigurationManager
|
||||
if(!is_dir(DataConst::GetDataDirectory())) {
|
||||
throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not exist! Something was set up falsely!");
|
||||
}
|
||||
file_put_contents(DataConst::GetConfigFile(), json_encode($config));
|
||||
$df = disk_free_space(DataConst::GetDataDirectory());
|
||||
if ($df !== false && (int)$df < 10240) {
|
||||
throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not have enough space for writing the config file! Not writing it back!");
|
||||
}
|
||||
file_put_contents(DataConst::GetConfigFile(), json_encode($config, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT));
|
||||
}
|
||||
|
||||
private function GetEnvironmentalVariableOrConfig(string $envVariableName, string $configName, string $defaultValue) : string {
|
||||
@@ -524,6 +528,13 @@ class ConfigurationManager
|
||||
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||
}
|
||||
|
||||
public function GetNextcloudMemoryLimit() : string {
|
||||
$envVariableName = 'NEXTCLOUD_MEMORY_LIMIT';
|
||||
$configName = 'nextcloud_memory_limit';
|
||||
$defaultValue = '512M';
|
||||
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||
}
|
||||
|
||||
public function GetApacheMaxSize() : int {
|
||||
$uploadLimit = (int)rtrim($this->GetNextcloudUploadLimit(), 'G');
|
||||
return $uploadLimit * 1024 * 1024 * 1024;
|
||||
@@ -544,12 +555,26 @@ class ConfigurationManager
|
||||
}
|
||||
|
||||
public function GetTrustedCacertsDir() : string {
|
||||
$envVariableName = 'TRUSTED_CACERTS_DIR';
|
||||
$envVariableName = 'NEXTCLOUD_TRUSTED_CACERTS_DIR';
|
||||
$configName = 'trusted_cacerts_dir';
|
||||
$defaultValue = '';
|
||||
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||
}
|
||||
|
||||
public function GetNextcloudAdditionalApks() : string {
|
||||
$envVariableName = 'NEXTCLOUD_ADDITIONAL_APKS';
|
||||
$configName = 'nextcloud_additional_apks';
|
||||
$defaultValue = 'imagemagick';
|
||||
return trim($this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue));
|
||||
}
|
||||
|
||||
public function GetNextcloudAdditionalPhpExtensions() : string {
|
||||
$envVariableName = 'NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS';
|
||||
$configName = 'nextcloud_additional_php_extensions';
|
||||
$defaultValue = 'imagick';
|
||||
return trim($this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue));
|
||||
}
|
||||
|
||||
public function GetCollaboraSeccompPolicy() : string {
|
||||
$defaultString = '--o:security.seccomp=';
|
||||
if ($this->GetCollaboraSeccompDisabledState() !== 'true') {
|
||||
@@ -696,6 +721,14 @@ class ConfigurationManager
|
||||
return false;
|
||||
}
|
||||
|
||||
public function GetNextcloudStartupApps() : string {
|
||||
$apps = getenv('NEXTCLOUD_STARTUP_APPS');
|
||||
if (is_string($apps)) {
|
||||
return trim($apps);
|
||||
}
|
||||
return 'deck tasks calendar contacts';
|
||||
}
|
||||
|
||||
public function GetCollaboraDictionaries() : string {
|
||||
$config = $this->GetConfig();
|
||||
if(!isset($config['collabora_dictionaries'])) {
|
||||
|
||||
@@ -46,4 +46,8 @@ class DataConst {
|
||||
public static function GetBackupArchivesList() : string {
|
||||
return self::GetDataDirectory() . '/backup_archives.list';
|
||||
}
|
||||
|
||||
public static function GetSessionDateFile() : string {
|
||||
return self::GetDataDirectory() . '/session_date_file';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,9 +312,11 @@ class DockerActionManager
|
||||
}
|
||||
} elseif ($out[1] === 'NEXTCLOUD_UPLOAD_LIMIT') {
|
||||
$replacements[1] = $this->configurationManager->GetNextcloudUploadLimit();
|
||||
} elseif ($out[1] === 'NEXTCLOUD_MEMORY_LIMIT') {
|
||||
$replacements[1] = $this->configurationManager->GetNextcloudMemoryLimit();
|
||||
} elseif ($out[1] === 'NEXTCLOUD_MAX_TIME') {
|
||||
$replacements[1] = $this->configurationManager->GetNextcloudMaxTime();
|
||||
} elseif ($out[1] === 'TRUSTED_CACERTS_DIR') {
|
||||
} elseif ($out[1] === 'NEXTCLOUD_TRUSTED_CACERTS_DIR') {
|
||||
$replacements[1] = $this->configurationManager->GetTrustedCacertsDir();
|
||||
} elseif ($out[1] === 'ADDITIONAL_DIRECTORIES_BACKUP') {
|
||||
if ($this->configurationManager->GetAdditionalBackupDirectoriesString() !== '') {
|
||||
@@ -328,6 +330,12 @@ class DockerActionManager
|
||||
$replacements[1] = $this->configurationManager->GetApacheMaxSize();
|
||||
} elseif ($out[1] === 'COLLABORA_SECCOMP_POLICY') {
|
||||
$replacements[1] = $this->configurationManager->GetCollaboraSeccompPolicy();
|
||||
} elseif ($out[1] === 'NEXTCLOUD_STARTUP_APPS') {
|
||||
$replacements[1] = $this->configurationManager->GetNextcloudStartupApps();
|
||||
} elseif ($out[1] === 'NEXTCLOUD_ADDITIONAL_APKS') {
|
||||
$replacements[1] = $this->configurationManager->GetNextcloudAdditionalApks();
|
||||
} elseif ($out[1] === 'NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS') {
|
||||
$replacements[1] = $this->configurationManager->GetNextcloudAdditionalPhpExtensions();
|
||||
} else {
|
||||
$replacements[1] = $this->configurationManager->GetSecret($out[1]);
|
||||
}
|
||||
@@ -532,7 +540,7 @@ class DockerActionManager
|
||||
return true;
|
||||
}
|
||||
|
||||
public function sendNotification(Container $container, string $subject, string $message) : void
|
||||
public function sendNotification(Container $container, string $subject, string $message, string $file = '/notify.sh') : void
|
||||
{
|
||||
if ($this->GetContainerStartingState($container) instanceof RunningState) {
|
||||
|
||||
@@ -550,7 +558,7 @@ class DockerActionManager
|
||||
'Tty' => true,
|
||||
'Cmd' => [
|
||||
'bash',
|
||||
'/notify.sh',
|
||||
$file,
|
||||
$subject,
|
||||
$message
|
||||
],
|
||||
@@ -731,4 +739,36 @@ class DockerActionManager
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function GetCreatedTimeOfNextcloudImage() : ?string {
|
||||
$imageName = 'nextcloud/aio-nextcloud' . ':' . $this->GetCurrentChannel();
|
||||
try {
|
||||
$imageUrl = $this->BuildApiUrl(sprintf('images/%s/json', $imageName));
|
||||
$imageOutput = json_decode($this->guzzleClient->get($imageUrl)->getBody()->getContents(), true);
|
||||
|
||||
if (!isset($imageOutput['Created'])) {
|
||||
error_log('Created is not set of image ' . $imageName);
|
||||
return null;
|
||||
}
|
||||
|
||||
return str_replace('T', ' ', $imageOutput['Created']);
|
||||
} catch (\Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function isNextcloudImageOutdated() : bool {
|
||||
$createdTime = $this->GetCreatedTimeOfNextcloudImage();
|
||||
|
||||
if ($createdTime === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the image is older than 90 days, it is outdated.
|
||||
if ((time() - (60 * 60 * 24 * 90)) > strtotime($createdTime)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@ class AuthMiddleware
|
||||
|
||||
if(!in_array($request->getUri()->getPath(), $publicRoutes)) {
|
||||
if(!$this->authManager->IsAuthenticated()) {
|
||||
$response = new Response();
|
||||
return $response
|
||||
->withHeader('Location', '/')
|
||||
->withStatus(302);
|
||||
$status = 302;
|
||||
$headers = ['Location' => '/'];
|
||||
$response = new Response($status, $headers);
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,10 @@
|
||||
</header>
|
||||
|
||||
<div class="content">
|
||||
<h1>Nextcloud AIO v2.0.3</h1>
|
||||
<h1>Nextcloud AIO v4.0.0</h1>
|
||||
|
||||
{# Add 2nd tab warning #}
|
||||
<script type="text/javascript" src="second-tab-warning.js"></script>
|
||||
|
||||
{% set isAnyRunning = false %}
|
||||
{% set isAnyRestarting = false %}
|
||||
@@ -108,7 +111,7 @@
|
||||
{% if borg_backup_mode == 'test' %}
|
||||
Please adjust the path and/or the password in order to make it work!<br><br>
|
||||
{% elseif borg_backup_mode == 'check' %}
|
||||
The backup archive seems to be corrupt. Please try to use a different intact backup archive or try to fix it by following <a href="https://borgbackup.readthedocs.io/en/stable/faq.html?highlight=repair#:~:text=repairing%20a%20damaged%20repository"><b>this documentation</b></a>
|
||||
The backup archive seems to be corrupt. Please try to use a different intact backup archive or try to fix it by following <a href="https://borgbackup.readthedocs.io/en/stable/faq.html#i-get-an-integrityerror-or-similar-what-now"><b>this documentation</b></a>
|
||||
{% endif %}
|
||||
{% elseif backup_exit_code == 0 %}
|
||||
<span class="status success"></span> Last {{ borg_backup_mode }} successful! (<a href="/api/docker/logs?id=nextcloud-aio-borgbackup">Logs</a>)<br /><br />
|
||||
@@ -167,7 +170,11 @@
|
||||
{% endif %}
|
||||
|
||||
{% if domain != "" and was_start_button_clicked == true %}
|
||||
{% if current_channel starts with 'latest' or current_channel starts with 'beta' or current_channel starts with 'develop' %}
|
||||
You are running the <a href="https://github.com/nextcloud/all-in-one#how-to-switch-the-channel"><b>{{ current_channel }}</b></a> channel. (<a href="/api/docker/logs?id=nextcloud-aio-mastercontainer">Logs</a>)<br><br>
|
||||
{% else %}
|
||||
No channel was found. This means that AIO is not able to update itself and its component and will also not be able to report about updates. Updates need to be done externally.
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if is_backup_container_running == true %}
|
||||
@@ -321,6 +328,9 @@
|
||||
<h2>Backup and restore</h2>
|
||||
{% if backup_exit_code > 0 %}
|
||||
<span class="status error"></span> Last {{ borg_backup_mode }} failed! (<a href="/api/docker/logs?id=nextcloud-aio-borgbackup">Logs</a>)<br /><br />
|
||||
{% if borg_backup_mode == "check" %}
|
||||
The backup archive seems to be corrupt. You can try to fix it by following <a href="https://borgbackup.readthedocs.io/en/stable/faq.html#i-get-an-integrityerror-or-similar-what-now"><b>this documentation</b></a><br /><br />
|
||||
{% endif %}
|
||||
{% if has_backup_run_once == false %}
|
||||
You may change the backup path again since the initial backup was not successful. After submitting the new value, you need to click on 'Create Backup' for testing the new value.<br /><br />
|
||||
<form method="POST" action="/api/configuration" class="xhr">
|
||||
@@ -483,20 +493,20 @@
|
||||
<input type="checkbox" id="talk" name="talk"><label for="talk">Nextcloud Talk (needs ports {{ talk_port }}/TCP and {{ talk_port }}/UDP open in your firewall/router)</label><br><br>
|
||||
{% endif %}
|
||||
{% if is_onlyoffice_enabled == true %}
|
||||
<input type="checkbox" id="onlyoffice" name="onlyoffice" checked="checked"><label for="onlyoffice">OnlyOffice (only supported on x64)</label><br>
|
||||
<input type="checkbox" id="onlyoffice" name="onlyoffice" checked="checked"><label for="onlyoffice">OnlyOffice</label><br>
|
||||
{% else %}
|
||||
{#<input type="checkbox" id="onlyoffice" name="onlyoffice"><label for="onlyoffice">OnlyOffice (only supported on x64)</label><br>#}
|
||||
{#<input type="checkbox" id="onlyoffice" name="onlyoffice"><label for="onlyoffice">OnlyOffice</label><br>#}
|
||||
{% endif %}
|
||||
<input id="options-form-submit" class="button" type="submit" value="Save changes" />
|
||||
</form>
|
||||
<b>Minimal system requirements:</b> When any optional addon is enabled, at least 2GB RAM, a dual-core CPU and 40GB system storage are required. When enabling ClamAV or Fulltextsearch, at least 3GB RAM are required. When enabling everything, at least 4GB RAM are required. Recommended are at least 1GB more RAM than the minimal requirement.<br><br>
|
||||
{% if isAnyRunning == true or is_x64_platform == false %}
|
||||
<script type="text/javascript" src="disable-clamav.js"></script>
|
||||
<script type="text/javascript" src="disable-onlyoffice.js"></script>
|
||||
{% endif %}
|
||||
{% if isAnyRunning == true %}
|
||||
<script type="text/javascript" src="disable-talk.js"></script>
|
||||
<script type="text/javascript" src="disable-collabora.js"></script>
|
||||
<script type="text/javascript" src="disable-onlyoffice.js"></script>
|
||||
<script type="text/javascript" src="disable-imaginary.js"></script>
|
||||
<script type="text/javascript" src="disable-fulltextsearch.js"></script>
|
||||
{% endif %}
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
<input type="submit" class="button" value="Log in" />
|
||||
</form>
|
||||
{% else %}
|
||||
<p>The login is blocked since Nextcloud is running. Please use the automatic login from your Nextcloud.<br><br>
|
||||
You can unblock the login by running 'sudo docker stop nextcloud-aio-apache'.</p>
|
||||
<p>The login is blocked since Nextcloud is running.<br>Please use the <a href="https://github.com/nextcloud/all-in-one#how-to-easily-log-in-to-the-aio-interface"><b>automatic login</b></a> from your Nextcloud.<br><br>
|
||||
If that is not possible, you can unblock the login by running<br><b>sudo docker stop nextcloud-aio-apache</b></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
135
readme.md
135
readme.md
@@ -52,6 +52,21 @@ The following instructions are especially meant for Linux. For macOS see [this](
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Explanation of the command</summary>
|
||||
|
||||
- `sudo docker run` This command spins up a new docker container. Docker commands can optionally be used without `sudo` if the user is added to the docker group (this is not the same as docker rootless, see FAQ below).
|
||||
- `--name nextcloud-aio-mastercontainer` This is the name of the container. This line is not allowed to be changed, since mastercontainer updates would fail.
|
||||
- `--restart always` This is the "restart policy". `always` means that the container should always get started with the Docker daemon. See the Docker documentation for further detail about restart policies: https://docs.docker.com/config/containers/start-containers-automatically/
|
||||
- `--publish 80:80` This means that port 80 of the container should get published on the host using port 80. It is used for getting valid certificates for the AIO interface if you want to use port 8443. It is not needed if you run AIO behind a reverse proxy and can get removed in that case as you can simply use port 8080 for the AIO interface then.
|
||||
- `--publish 8080:8080` This means that port 8080 of the container should get published on the host using port 8080. This port is used for the AIO interface and uses a self-signed certificate by default. You can also use a different host port if port 8080 is already used on your host, for example `--publish 8081:8080` (only the first port can be changed for the host, the second port is for the container and must remain at 8080).
|
||||
- `--publish 8443:8443` This means that port 8443 of the container should get published on the host using port 8443. If you publish port 80 and 8443 to the public internet, you can access the AIO interface via this port with a valid certificate. It is not needed if you run AIO behind a reverse proxy and can get removed in that case as you can simply use port 8080 for the AIO interface then.
|
||||
- `--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config` This means that the files that are created by the mastercontainer will be stored in a docker volume that is called `nextcloud_aio_mastercontainer`. This line is not allowed to be changed, since built-in backups would fail later on.
|
||||
- `--volume /var/run/docker.sock:/var/run/docker.sock:ro` The docker socket is mounted into the container which is used for spinning up all the other containers and for further features. It needs to be adjusted on Windows/macOS and on docker rootless. See the applicable documentation on this. If adjusting, don't forget to also set `DOCKER_SOCKET_PATH`! If you dislike this, see https://github.com/nextcloud/all-in-one/discussions/500#discussioncomment-2740767 and the whole thread for options.
|
||||
- `nextcloud/all-in-one:latest` or `nextcloud/all-in-one:latest-arm64` This is the docker container image that is used. See https://github.com/nextcloud/all-in-one/discussions/490 for why there are different images for the different CPU architectures.
|
||||
- Further options can be set using environment variables, for example `--env TALK_PORT=3478`. To see explanations and examples for further variables (like changing the location of Nextcloud's datadir or mounting some locations as external storage into the Nextcloud container), read through this readme and look at the docker-compose file: https://github.com/nextcloud/all-in-one/blob/main/docker-compose.yml
|
||||
</details>
|
||||
|
||||
3. After the initial startup, you should be able to open the Nextcloud AIO Interface now on port 8080 of this server.<br>
|
||||
E.g. `https://ip.address.of.this.server:8080`<br><br>
|
||||
If your firewall/router has port 80 and 8443 open and you point a domain to your server, you can get a valid certificate automatically by opening the Nextcloud AIO Interface via:<br>
|
||||
@@ -134,7 +149,10 @@ No and they will not be. Please use a dedicated domain for Nextcloud and set it
|
||||
No and it will not be added. Please use a dedicated domain for Nextcloud and set it up correctly by following the [reverse proxy documentation](./reverse-proxy.md).
|
||||
|
||||
### How can I access Nextcloud locally?
|
||||
The recommended way is to set up a local dns-server like a pi-hole and set up a custom dns-record for that domain that points to the internal ip-adddress of your server that runs Nextcloud AIO.
|
||||
The recommended way is to set up a local dns-server like a pi-hole and set up a custom dns-record for that domain that points to the internal ip-adddress of your server that runs Nextcloud AIO. Below are some guides:
|
||||
- https://www.howtogeek.com/devops/how-to-run-your-own-dns-server-on-your-local-network/
|
||||
- https://howchoo.com/pi/pi-hole-setup together with https://docs.callitkarma.me/posts/PiHole-Local-DNS/
|
||||
- https://dockerlabs.collabnix.com/intermediate/networking/Configuring_DNS.html
|
||||
|
||||
### How to skip the domain validation?
|
||||
If you are completely sure that you've configured everything correctly and are not able to pass the domain validation, you may skip the domain validation by adding `-e SKIP_DOMAIN_VALIDATION=true` to the docker run command of the mastercontainer.
|
||||
@@ -150,16 +168,16 @@ Afterwards it should work.<br>
|
||||
See https://dev.to/ozorest/fedora-32-how-to-solve-docker-internal-network-issue-22me for more details on this. This limitation is even mentioned on the official firewalld website: https://firewalld.org/#who-is-using-it
|
||||
|
||||
### How to run `occ` commands?
|
||||
Simply run the following: `sudo docker exec -it nextcloud-aio-nextcloud php occ your-command`. Of course `your-command` needs to be exchanged with the command that you want to run.
|
||||
Simply run the following: `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ your-command`. Of course `your-command` needs to be exchanged with the command that you want to run.
|
||||
|
||||
### How to resolve `Security & setup warnings displays the "missing default phone region" after initial install`?
|
||||
Simply run the following command: `sudo docker exec -it nextcloud-aio-nextcloud php occ config:system:set default_phone_region --value="yourvalue"`. Of course you need to modify `yourvalue` based on your location. Examples are `DE`, `EN` and `GB`. See this list for more codes: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
|
||||
Simply run the following command: `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:system:set default_phone_region --value="yourvalue"`. Of course you need to modify `yourvalue` based on your location. Examples are `DE`, `EN` and `GB`. See this list for more codes: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
|
||||
|
||||
### How to run multiple AIO instances on one server?
|
||||
See [multiple-instances.md](./multiple-instances.md) for some documentation on this.
|
||||
|
||||
### Bruteforce protection FAQ
|
||||
Nextcloud features a built-in bruteforce protection which may get triggered and will block an ip-address or disable a user. You can unblock an ip-address by running `sudo docker exec -it nextcloud-aio-nextcloud php occ security:bruteforce:reset <ip-address>` and enable a disabled user by running `sudo docker exec -it nextcloud-aio-nextcloud php occ user:enable <name of user>`. See https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#security for further information.
|
||||
Nextcloud features a built-in bruteforce protection which may get triggered and will block an ip-address or disable a user. You can unblock an ip-address by running `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ security:bruteforce:reset <ip-address>` and enable a disabled user by running `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ user:enable <name of user>`. See https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#security for further information.
|
||||
|
||||
### Update policy
|
||||
This project values stability over new features. That means that when a new major Nextcloud update gets introduced, we will wait at least until the first patch release, e.g. `24.0.1` is out before upgrading to it. Also we will wait with the upgrade until all important apps are compatible with the new major version. Minor or patch releases for Nextcloud and all dependencies as well as all containers will be updated to new versions as soon as possible but we try to give all updates first a good test round before pushing them. That means that it can take around 2 weeks before new updates reach the `latest` channel. If you want to help testing, you can switch to the `beta` channel by following [this documentation](#how-to-switch-the-channel) which will also give you the updates earlier.
|
||||
@@ -196,7 +214,7 @@ Here is how to reset the AIO instance properly:
|
||||
1. Now remove all these stopped containers with `sudo docker container prune`
|
||||
1. Delete the docker network with `sudo docker network rm nextcloud-aio`
|
||||
1. Check which volumes are dangling with `sudo docker volume ls --filter "dangling=true"`
|
||||
1. Now remove all these dangling volumes: `sudo docker volume prune` (on Windows you might need to remove some volumes afterwards manually with `docker volume rm nextcloud_aio_backupdir`, `docker volume rm nextcloud_aio_nextcloud_datadir`)
|
||||
1. Now remove all these dangling volumes: `sudo docker volume prune` (on Windows you might need to remove some volumes afterwards manually with `docker volume rm nextcloud_aio_backupdir`, `docker volume rm nextcloud_aio_nextcloud_datadir`). Also if you've configured `NEXTCLOUD_DATADIR` to a path on your host instead of the default volume, you need to clean that up as well.
|
||||
1. Optional: You can remove all docker images with `sudo docker image prune -a`.
|
||||
1. And you are done! Now feel free to start over with the recommended docker run command!
|
||||
|
||||
@@ -270,6 +288,12 @@ sudo borg list "/mnt/backup/borg"
|
||||
# An example backup archive might be called 20220223_174237-nextcloud-aio
|
||||
# Then you can simply delete the archive with:
|
||||
sudo borg delete --stats --progress "/mnt/backup/borg::20220223_174237-nextcloud-aio"
|
||||
|
||||
# If borg 1.2.0 or higher is installed, you then need to run borg compact in order to clean up the freed space
|
||||
sudo borg --version
|
||||
# If version number of the command above is higher than 1.2.0 you need to run the command below:
|
||||
sudo borg compact "/mnt/backup/"
|
||||
|
||||
```
|
||||
|
||||
After doing so, make sure to update the backup archives list in the AIO interface!<br>
|
||||
@@ -317,7 +341,7 @@ if ! [ -d "$DRIVE_MOUNTPOINT" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -q " $DRIVE_MOUNTPOINT " /etc/fstab; then
|
||||
if ! grep -q "$DRIVE_MOUNTPOINT" /etc/fstab; then
|
||||
echo "Could not find the drive mountpoint in the fstab file. Did you add it there?"
|
||||
exit 1
|
||||
fi
|
||||
@@ -409,13 +433,6 @@ You can configure the Nextcloud container to use a specific directory on your ho
|
||||
```
|
||||
(The value `/host_mnt/c/your/data/path` in this example would be equivalent to `C:\your\data\path` on the Windows host. So you need to translate the path that you want to use into the correct format.) ⚠️️ **Attention**: Make sure that the path exists on the host before you create the volume! Otherwise everything will bug out!
|
||||
|
||||
⚠️ Please make sure to apply the correct permissions to the chosen directory before starting Nextcloud the first time (not needed on Windows).
|
||||
|
||||
- In this example for Linux, the command for this would be `sudo chown -R 33:0 /mnt/ncdata` and `sudo chmod -R 750 /mnt/ncdata`.
|
||||
- On macOS, the command for this would be `sudo chown -R 33:0 /var/nextcloud-data` and `sudo chmod -R 750 /var/nextcloud-data`.
|
||||
- For Synology, the command for this example would be `sudo chown -R 33:0 /volume1/docker/nextcloud/data` and `sudo chmod -R 750 /volume1/docker/nextcloud/data`
|
||||
- On Windows, this command is not needed.
|
||||
|
||||
### How to allow the Nextcloud container to access directories on the host?
|
||||
By default, the Nextcloud container is confined and cannot access directories on the host OS. You might want to change this when you are planning to use local external storage in Nextcloud to store some files outside the data directory and can do so by adding the environmental variable `NEXTCLOUD_MOUNT` to the initial startup of the mastercontainer. Allowed values for that variable are strings that start with `/` and are not equal to `/`.
|
||||
|
||||
@@ -429,6 +446,8 @@ You can then navigate to the apps management page, activate the external storage
|
||||
|
||||
Be aware though that these locations will not be covered by the built-in backup solution!
|
||||
|
||||
**Please note:** If you can't see the type "local storage" in the external storage admin options, a restart of the containers from the AIO interface may be required.
|
||||
|
||||
### How to adjust the Talk port?
|
||||
By default will the talk container use port `3478/UDP` and `3478/TCP` for connections. You can adjust the port by adding e.g. `-e TALK_PORT=3478` to the initial docker run command and adjusting the port to your desired value.
|
||||
|
||||
@@ -438,19 +457,35 @@ By default are uploads to Nextcloud limited to a max of 10G. You can adjust the
|
||||
### How to adjust the max execution time for Nextcloud?
|
||||
By default are uploads to Nextcloud limited to a max of 3600s. You can adjust the upload time limit by providing `-e NEXTCLOUD_MAX_TIME=3600` to the docker run command of the mastercontainer and customize the value to your fitting. It must be a number e.g. `3600`.
|
||||
|
||||
### How to adjust the PHP memory limit for Nextcloud?
|
||||
By default is each PHP process in the Nextcloud container limited to a max of 512 MB. You can adjust the memory limit by providing `-e NEXTCLOUD_MEMORY_LIMIT=512M` to the docker run command of the mastercontainer and customize the value to your fitting. It must start with a number and end with `M` e.g. `1024M`.
|
||||
|
||||
### What can I do to fix the internal or reserved ip-address error?
|
||||
If you get an error during the domain validation which states that your ip-address is an internal or reserved ip-address, you can fix this by first making sure that your domain indeed has the correct public ip-address that points to the server and then adding `--add-host yourdomain.com:<public-ip-address>` to the initial docker run command which will allow the domain validation to work correctly. And so that you know: even if the `A` record of your domain should change over time, this is no problem since the mastercontainer will not make any attempt to access the chosen domain after the initial domain validation.
|
||||
|
||||
### How to run this with docker rootless?
|
||||
You can run AIO also with docker rootless. How to do this is documented here: [docker-rootless.md](https://github.com/nextcloud/all-in-one/blob/main/docker-rootless.md)
|
||||
|
||||
### How to change the Nextcloud apps that are installed on the first startup?
|
||||
You might want to adjust the Nextcloud apps that are installed upon the first startup of the Nextcloud container. You can do so by adding `-e NEXTCLOUD_STARTUP_APPS="deck tasks calendar contacts"` to the docker run command of the mastercontainer and customize the value to your fitting. It must be a string with small letters a-z, spaces and hyphens or '_'.
|
||||
|
||||
### How to add packets permanently to the Nextcloud container?
|
||||
Some Nextcloud apps require additional external dependencies that must be bundled within Nextcloud container in order to work correctly. As we cannot put each and every dependency for all apps into the container - as this would make the project very fast unmaintainable - there is an official way how you can add additional dependencies into the Nextcloud container. However note that doing this is disrecommended since we do not test Nextcloud apps that require external dependencies.
|
||||
|
||||
You can do so by adding `-e NEXTCLOUD_ADDITIONAL_APKS="imagemagick dependency2 dependency3"` to the docker run command of the mastercontainer and customize the value to your fitting. It must be a string with small letters a-z, digits 0-9, spaces, dots and hyphens or '_'. You can find available packages here: https://pkgs.alpinelinux.org/packages?name=&branch=v3.16&repo=&arch=&maintainer=. By default added is `imagemagick`. If you want to keep that, you need to specify it as well.
|
||||
|
||||
### How to add PHP extensions permanently to the Nextcloud container?
|
||||
Some Nextcloud apps require additional php extensions that must be bundled within Nextcloud container in order to work correctly. As we cannot put each and every dependency for all apps into the container - as this would make the project very fast unmaintainable - there is an official way how you can add additional php extensions into the Nextcloud container. However note that doing this is disrecommended since we do not test Nextcloud apps that require additional php extensions.
|
||||
|
||||
You can do so by adding `-e NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS="imagick extension1 extension2"` to the docker run command of the mastercontainer and customize the value to your fitting. It must be a string with small letters a-z, digits 0-9, spaces, dots and hyphens or '_'. You can find available extensions here: https://pecl.php.net/packages.php. By default added is `imagick`. If you want to keep that, you need to specify it as well.
|
||||
|
||||
### Huge docker logs
|
||||
When your containers run for a few days without a restart, the container logs that you can view from the AIO interface can get really huge. You can limit the loge sizes by enabling logrotate for docker container logs. Feel free to enable this by following those instructions: https://sandro-keil.de/blog/logrotate-for-docker-container/
|
||||
|
||||
### Access/Edit Nextcloud files/folders manually
|
||||
The files and folders that you add to Nextcloud are by default stored in the following directory: `/var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/` on the host. If needed, you can modify/add/delete files/folders there but **ATTENTION**: be very careful when doing so because you might corrupt your AIO installation! Best is to create a backup using the built-in backup solution before editing/changing files/folders in there because you will then be able to restore your instance to the backed up state.
|
||||
|
||||
After you are done modifying/adding/deleting files/folders, don't forget to apply the correct permissions by running: `sudo chown -R 33:0 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/*` and `sudo chmod -R 750 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/*` and rescan the files with `sudo docker exec -it nextcloud-aio-nextcloud php occ files:scan --all`.
|
||||
After you are done modifying/adding/deleting files/folders, don't forget to apply the correct permissions by running: `sudo chown -R 33:0 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/*` and `sudo chmod -R 750 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/*` and rescan the files with `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan --all`.
|
||||
|
||||
### How to store the files/installation on a separate drive?
|
||||
You can move the whole docker library and all its files including all Nextcloud AIO files and folders to a separate drive by first mounting the drive in the host OS (NTFS is not supported) and then following this tutorial: https://www.guguweb.com/2019/02/07/how-to-move-docker-data-directory-to-another-location-on-ubuntu/<br>
|
||||
@@ -460,7 +495,7 @@ You can move the whole docker library and all its files including all Nextcloud
|
||||
You can edit Nextclouds config.php file directly from the host with your favorite text editor. E.g. like this: `sudo nano /var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/config/config.php`. Make sure to not break the file though which might corrupt your Nextcloud instance otherwise. In best case, create a backup using the built-in backup solution before editing the file.
|
||||
|
||||
### Custom skeleton directory
|
||||
If you want to define a custom skeleton directory, you can do so by putting your skeleton files into `/var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/skeleton/`, applying the correct permissions with `sudo chown -R 33:0 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/skeleton` and and `sudo chmod -R 750 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/*` and setting the skeleton directory option with `sudo docker exec -it nextcloud-aio-nextcloud php occ config:system:set skeletondirectory --value="/mnt/ncdata/skeleton"`. You can read further on this option here: [click here](https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=skeletondir#:~:text=adding%20%3Fdirect%3D1-,'skeletondirectory',-%3D%3E%20'%2Fpath%2Fto%2Fnextcloud)
|
||||
If you want to define a custom skeleton directory, you can do so by putting your skeleton files into `/var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/skeleton/`, applying the correct permissions with `sudo chown -R 33:0 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/skeleton` and and `sudo chmod -R 750 /var/lib/docker/volumes/nextcloud_aio_nextcloud_data/_data/*` and setting the skeleton directory option with `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:system:set skeletondirectory --value="/mnt/ncdata/skeleton"`. You can read further on this option here: [click here](https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=skeletondir#:~:text=adding%20%3Fdirect%3D1-,'skeletondirectory',-%3D%3E%20'%2Fpath%2Fto%2Fnextcloud)
|
||||
|
||||
### Fail2ban
|
||||
You can configure your server to block certain ip-addresses using fail2ban as bruteforce protection. Here is how to set it up: https://docs.nextcloud.com/server/stable/admin_manual/installation/harden_server.html#setup-fail2ban. The logpath of AIO is by default `/var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/data/nextcloud.log`. Do not forget to add `chain=DOCKER-USER` to your nextcloud jail config (`nextcloud.local`) otherwise the nextcloud service running on docker will still be accessible even if the IP is banned. Also, you may change the blocked ports to cover all AIO ports: by default `80,443,8080,8443,3478` (see [this](https://github.com/nextcloud/all-in-one#explanation-of-used-ports))
|
||||
@@ -496,11 +531,77 @@ What are the requirements?
|
||||
### How to trust user-defiend Certification Authorities (CA)?
|
||||
For some applications it might be necessary to enstablish a secured connection to a host / server which is using a certificated issued by a Certification Authority that is not trusted out of the box. An example could be configuring LDAPS against the Domain Controller (ActiveDirectory) of an organization
|
||||
|
||||
You can make the Nextcloud container trust any Certification Authority by providing the environmental variable `TRUSTED_CACERTS_DIR` when starting the AIO-mastercontainer. The value of the variables should be set to the absolute path to a directory on the host, which contains one or more Certification Authority's certificate. You should use X.509 certificates, Base64 encoded. (Other formats may work but have not been tested!) All the certificates in the directory will be trusted.
|
||||
You can make the Nextcloud container trust any Certification Authority by providing the environmental variable `NEXTCLOUD_TRUSTED_CACERTS_DIR` when starting the AIO-mastercontainer. The value of the variables should be set to the absolute path to a directory on the host, which contains one or more Certification Authority's certificate. You should use X.509 certificates, Base64 encoded. (Other formats may work but have not been tested!) All the certificates in the directory will be trusted.
|
||||
|
||||
When using `docker run`, the environmental variable can be set with `-e TRUSTED_CACERTS_DIR=/path/to/my/cacerts`.
|
||||
When using `docker run`, the environmental variable can be set with `-e NEXTCLOUD_TRUSTED_CACERTS_DIR=/path/to/my/cacerts`.
|
||||
|
||||
In order for the value to be valid, the path should start with `/` and not end with '/' and point to an existing **directory**. Pointing the variable directly to a certificate **file** will not work and may also break things.
|
||||
|
||||
### How to disable Collabora's Seccomp feature?
|
||||
The Collabora container enables Seccomp by default, which is a security feature of the Linux kernel. On systems without this kernel feature enabled, you need to provide `-e COLLABORA_SECCOMP_DISABLED=true` to the initial docker run command in order to make it work.
|
||||
|
||||
### How to enable automatic updates without creating a backup beforehand?
|
||||
If you have an external backup solution, you might want to enable automatic updates without creating a backup first. However note that doing this is disrecommended since you will not be able to easily create and restore a backup from the AIO interface anymore and you need to make sure to shut down all the containers properly before creating the backup, e.g. by stopping them from the AIO interface first.
|
||||
|
||||
But anyhow, is here a guide that helps you automate the whole procedure:
|
||||
|
||||
<details>
|
||||
<summary>Click here to expand</summary>
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
# Stop the containers
|
||||
docker exec -e STOP_CONTAINERS=1 nextcloud-aio-mastercontainer /daily-backup.sh
|
||||
|
||||
# Below is optional if you run AIO in a VM which will shut down the VM afterwards
|
||||
# poweroff
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
You can simply copy and past the script into a file e.g. named `shutdown-script.sh` e.g. here: `/root/shutdown-script.sh`.
|
||||
|
||||
Afterwards apply the correct permissions with `sudo chown root:root /root/shutdown-script.sh` and `sudo chmod 700 /root/shutdown-script.sh`. Then you can create a cronjob that runs e.g. runs the script at `04:00` each day like this:
|
||||
1. Open the cronjob with `sudo crontab -u root -e` (and choose your editor of choice if not already done. I'd recommend nano).
|
||||
1. Add the following new line to the crontab if not already present: `0 4 * * * /root/shutdown-script.sh` which will run the script at 04:00 each day.
|
||||
1. save and close the crontab (when using nano are the shortcuts for this `Ctrl + o` -> `Enter` and close the editor with `Ctrl + x`).
|
||||
|
||||
|
||||
**After that is in place, you should schedule a backup from your backup solution that creates a backup after AIO is shut down properly. Hint: If your backup runs on the same host, make sure to at least back up all docker volumes and additionally Nextclouds datadir, if it is not stored in a docker volume.**
|
||||
|
||||
**Afterwards, you can create a second script that automatically updates the containers:**
|
||||
|
||||
<details>
|
||||
<summary>Click here to expand</summary>
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
# Run container update once
|
||||
if ! docker exec -e AUTOMATIC_UPDATES=1 nextcloud-aio-mastercontainer /daily-backup.sh; then
|
||||
while docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-watchtower$"; do
|
||||
echo "Waiting for watchtower to stop"
|
||||
sleep 30
|
||||
done
|
||||
|
||||
while ! docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-mastercontainer$"; do
|
||||
echo "Waiting for Mastercontainer to start"
|
||||
sleep 30
|
||||
done
|
||||
|
||||
# Run container update another time to make sure that all containers are updated correctly.
|
||||
docker exec -e AUTOMATIC_UPDATES=1 nextcloud-aio-mastercontainer /daily-backup.sh
|
||||
fi
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
You can simply copy and past the script into a file e.g. named `automatic-updates.sh` e.g. here: `/root/automatic-updates.sh`.
|
||||
|
||||
Afterwards apply the correct permissions with `sudo chown root:root /root/automatic-updates.sh` and `sudo chmod 700 /root/automatic-updates.sh`. Then you can create a cronjob that runs e.g. at `05:00` each day like this:
|
||||
1. Open the cronjob with `sudo crontab -u root -e` (and choose your editor of choice if not already done. I'd recommend nano).
|
||||
1. Add the following new line to the crontab if not already present: `0 5 * * * /root/automatic-updates.sh` which will run the script at 05:00 each day.
|
||||
1. save and close the crontab (when using nano are the shortcuts for this `Ctrl + o` -> `Enter` and close the editor with `Ctrl + x`).
|
||||
|
||||
161
reverse-proxy.md
161
reverse-proxy.md
@@ -21,7 +21,7 @@ In order to run Nextcloud behind a reverse proxy, you need to specify the port t
|
||||
|
||||
<summary>click here to expand</summary>
|
||||
|
||||
**Disclaimer:** It might be possible that the config below is not working 100% correctly, yet. See e.g. https://github.com/nextcloud/all-in-one/issues/834. Improvements to it are very welcome!
|
||||
**Disclaimer:** It might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome!
|
||||
|
||||
Add this as a new Apache site config:
|
||||
|
||||
@@ -41,14 +41,14 @@ Add this as a new Apache site config:
|
||||
<VirtualHost *:443>
|
||||
ServerName <your-nc-domain>
|
||||
|
||||
# Reverse proxy
|
||||
# Reverse proxy based on https://httpd.apache.org/docs/current/mod/mod_proxy_wstunnel.html
|
||||
RewriteEngine On
|
||||
ProxyPreserveHost On
|
||||
AllowEncodedSlashes NoDecode
|
||||
ProxyPass / http://localhost:11000/
|
||||
RewriteCond %{HTTP:Upgrade} websocket [NC]
|
||||
RewriteCond %{HTTP:Connection} upgrade [NC]
|
||||
RewriteRule ^/(.*) "ws://localhost:11000/$1" [P,L]
|
||||
ProxyPass / http://localhost:11000/
|
||||
ProxyPassReverse / http://localhost:11000/
|
||||
RewriteRule ^/?(.*) "ws://localhost:11000/$1" [P,QSA,B=?:;]
|
||||
|
||||
# Enable h2, h2c and http1.1
|
||||
Protocols h2 h2c http/1.1
|
||||
@@ -118,7 +118,7 @@ You can get AIO running using the ACME DNS-challenge. Here is how to do it.
|
||||
Of course you need to modify `<your-nc-domain>` to the domain on which you want to run Nextcloud. You also need to adjust `<provider>` and `<key>` to match your case. Also make sure to adjust the port 11000 to match the chosen APACHE_PORT. **Please note:** The above configuration will only work if your reverse proxy is running directly on the host that is running the docker daemon. If the reverse proxy is running in a docker container, you can use the `--network host` option (or `network_mode: host` for docker-compose) when starting the reverse proxy container in order to connect the reverse proxy container to the host network. If that is not an option for you, you can alternatively instead of `localhost` use the ip-address that is displayed after running the following command on the host OS: `ip a | grep "scope global" | head -1 | awk '{print $2}' | sed 's|/.*||'` (the command only works on Linux)
|
||||
1. Now continue with [point 2](#2-use-this-startup-command) but additionally, add `-e SKIP_DOMAIN_VALIDATION=true` to the docker run command which will disable the dommain validation (because it is known that the domain validation will not when using the DNS-challenge since no port is publicly opened.
|
||||
|
||||
**Advice:** In order to make it work in your home network, you may add the internal ipv4-address of your reverse proxy as A DNS-record to your domain and disable the dns-rebind-protection in your router. Another way it to set up a local dns-server like a pi-hole and set up a custom dns-record for that domain that points to the internal ip-adddress of your reverse proxy. If both is not possible, you may add the domain to the hosts file which is needed then for any devices that shall use the server.
|
||||
**Advice:** In order to make it work in your home network, you may add the internal ipv4-address of your reverse proxy as A DNS-record to your domain and disable the dns-rebind-protection in your router. Another way it to set up a local dns-server like a pi-hole and set up a custom dns-record for that domain that points to the internal ip-adddress of your reverse proxy (see https://github.com/nextcloud/all-in-one#how-can-i-access-nextcloud-locally). If both is not possible, you may add the domain to the hosts file which is needed then for any devices that shall use the server.
|
||||
|
||||
</details>
|
||||
|
||||
@@ -135,6 +135,96 @@ Although it does not seems like it is the case but from AIO perspective a Cloudf
|
||||
|
||||
</details>
|
||||
|
||||
### HaProxy
|
||||
|
||||
<details>
|
||||
|
||||
<summary>click here to expand</summary>
|
||||
|
||||
**Disclaimer:** It might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome!
|
||||
|
||||
Here is an example HaProxy config:
|
||||
|
||||
```
|
||||
global
|
||||
chroot /var/haproxy
|
||||
log /var/run/log audit debug
|
||||
lua-prepend-path /tmp/haproxy/lua/?.lua
|
||||
|
||||
defaults
|
||||
log global
|
||||
option redispatch -1
|
||||
retries 3
|
||||
default-server init-addr last,libc
|
||||
|
||||
# Frontend: LetsEncrypt_443 ()
|
||||
frontend LetsEncrypt_443
|
||||
bind 0.0.0.0:443 name 0.0.0.0:443 ssl prefer-client-ciphers ssl-min-ver TLSv1.2 ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256 ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 crt-list /tmp/haproxy/ssl/605f6609f106d1.17683543.certlist
|
||||
mode http
|
||||
option http-keep-alive
|
||||
default_backend acme_challenge_backend
|
||||
option forwardfor
|
||||
# tuning options
|
||||
timeout client 30s
|
||||
|
||||
# logging options
|
||||
# ACL: find_acme_challenge
|
||||
acl acl_605f6d4b6453d2.03059920 path_beg -i /.well-known/acme-challenge/
|
||||
# ACL: Nextcloud
|
||||
acl acl_60604e669c3ca4.13013327 hdr(host) -i <your-nc-domain>
|
||||
|
||||
# ACTION: redirect_acme_challenges
|
||||
use_backend acme_challenge_backend if acl_605f6d4b6453d2.03059920
|
||||
# ACTION: Nextcloud
|
||||
use_backend Nextcloud if acl_60604e669c3ca4.13013327
|
||||
|
||||
|
||||
# Frontend: LetsEncrypt_80 ()
|
||||
frontend LetsEncrypt_80
|
||||
bind 0.0.0.0:80 name 0.0.0.0:80
|
||||
mode tcp
|
||||
default_backend acme_challenge_backend
|
||||
# tuning options
|
||||
timeout client 30s
|
||||
|
||||
# logging options
|
||||
# ACL: find_acme_challenge
|
||||
acl acl_605f6d4b6453d2.03059920 path_beg -i /.well-known/acme-challenge/
|
||||
|
||||
# ACTION: redirect_acme_challenges
|
||||
use_backend acme_challenge_backend if acl_605f6d4b6453d2.03059920
|
||||
|
||||
# Frontend (DISABLED): 1_HTTP_frontend ()
|
||||
|
||||
# Frontend (DISABLED): 1_HTTPS_frontend ()
|
||||
|
||||
# Frontend (DISABLED): 0_SNI_frontend ()
|
||||
|
||||
# Backend: acme_challenge_backend (Added by Let's Encrypt plugin)
|
||||
backend acme_challenge_backend
|
||||
# health checking is DISABLED
|
||||
mode http
|
||||
balance source
|
||||
# stickiness
|
||||
stick-table type ip size 50k expire 30m
|
||||
stick on src
|
||||
# tuning options
|
||||
timeout connect 30s
|
||||
timeout server 30s
|
||||
http-reuse safe
|
||||
server acme_challenge_host 127.0.0.1:43580
|
||||
|
||||
# Backend: Nextcloud ()
|
||||
backend Nextcloud
|
||||
mode http
|
||||
balance source
|
||||
server Nextcloud localhost:11000
|
||||
```
|
||||
|
||||
Of course you need to modify `<your-nc-domain>` to the domain on which you want to run Nextcloud. Also make sure to adjust the port 11000 to match the chosen APACHE_PORT. **Please note:** The above configuration will only work if your reverse proxy is running directly on the host that is running the docker daemon. If the reverse proxy is running in a docker container, you can use the `--network host` option (or `network_mode: host` for docker-compose) when starting the reverse proxy container in order to connect the reverse proxy container to the host network. If that is not an option for you, you can alternatively instead of `localhost` use the ip-address that is displayed after running the following command on the host OS: `ip a | grep "scope global" | head -1 | awk '{print $2}' | sed 's|/.*||'` (the command only works on Linux)
|
||||
|
||||
</details>
|
||||
|
||||
### Nginx
|
||||
|
||||
<details>
|
||||
@@ -146,10 +236,30 @@ Although it does not seems like it is the case but from AIO perspective a Cloudf
|
||||
Add this to you nginx config:
|
||||
|
||||
```
|
||||
location / {
|
||||
proxy_pass http://localhost:11000;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80; # comment to disable IPv6
|
||||
|
||||
if ($scheme = "http") {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2; # comment to disable IPv6
|
||||
|
||||
server_name <your-nc-domain>;
|
||||
|
||||
location / {
|
||||
resolver localhost;
|
||||
proxy_pass http://localhost:11000$request_uri;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
client_max_body_size 0;
|
||||
|
||||
@@ -158,8 +268,21 @@ location / {
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
}
|
||||
```
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/<your-nc-domain>/fullchain.pem; # managed by certbot on host machine
|
||||
ssl_certificate_key /etc/letsencrypt/live/<your-nc-domain>/privkey.pem; # managed by certbot on host machine
|
||||
|
||||
ssl_session_timeout 1d;
|
||||
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
|
||||
ssl_session_tickets off;
|
||||
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
|
||||
ssl_prefer_server_ciphers off;
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Of course you need to modify `<your-nc-domain>` to the domain on which you want to run Nextcloud. Also make sure to adjust the port 11000 to match the chosen APACHE_PORT. **Please note:** The above configuration will only work if your reverse proxy is running directly on the host that is running the docker daemon. If the reverse proxy is running in a docker container, you can use the `--network host` option (or `network_mode: host` for docker-compose) when starting the reverse proxy container in order to connect the reverse proxy container to the host network. If that is not an option for you, you can alternatively instead of `localhost` use the ip-address that is displayed after running the following command on the host OS: `ip a | grep "scope global" | head -1 | awk '{print $2}' | sed 's|/.*||'` (the command only works on Linux)
|
||||
|
||||
**Advice:** You may have a look at [this](https://github.com/nextcloud/all-in-one/discussions/588#discussioncomment-2811152) for a more complete example.
|
||||
@@ -203,6 +326,24 @@ Of course you need to modify `<your-nc-domain>` to the domain on which you want
|
||||
|
||||
</details>
|
||||
|
||||
### Synology Reverse Proxy
|
||||
|
||||
<details>
|
||||
|
||||
<summary>click here to expand</summary>
|
||||
|
||||
**Disclaimer:** It might be possible that the config below is not working 100% correctly, yet. Improvements to it are very welcome!
|
||||
|
||||
See these screenshots for a working config:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Of course you need to modify `<your-nc-domain>` to the domain on which you want to run Nextcloud. Also make sure to adjust the port 11000 to match the chosen APACHE_PORT. **Please note:** The above configuration will only work if your reverse proxy is running directly on the host that is running the docker daemon. If the reverse proxy is running in a docker container, you can use the `--network host` option (or `network_mode: host` for docker-compose) when starting the reverse proxy container in order to connect the reverse proxy container to the host network. If that is not an option for you, you can alternatively instead of `localhost` use the ip-address that is displayed after running the following command on the host OS: `ip a | grep "scope global" | head -1 | awk '{print $2}' | sed 's|/.*||'` (the command only works on Linux)
|
||||
|
||||
</details>
|
||||
|
||||
### Traefik 2
|
||||
|
||||
<details>
|
||||
|
||||
@@ -8,11 +8,15 @@
|
||||
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_DATADIR="/mnt/testdata"` it should map that location from `/mnt/testdata` to `/mnt/ncdata` inside the Nextcloud container. Not having adjusted the permissions correctly before starting the Nextcloud container the first time will not allow the Nextcloud container to start correctly. See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir for allowed values.
|
||||
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_MOUNT="/mnt/"` it should map `/mnt/` to `/mnt/` inside the Nextcloud container. See https://github.com/nextcloud/all-in-one#how-to-allow-the-nextcloud-container-to-access-directories-on-the-host for allowed values.
|
||||
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_UPLOAD_LIMIT=11G` it should change Nextclouds upload limit to 11G. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-upload-limit-for-nextcloud for allowed values.
|
||||
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_MEMORY_LIMIT=1024M` it should change Nextclouds PHP memory limit to 1024M. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-php-memory-limit-for-nextcloud for allowed values.
|
||||
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_MAX_TIME=4000` it should change Nextclouds upload max time 4000s. See https://github.com/nextcloud/all-in-one#how-to-adjust-the-max-execution-time-for-nextcloud for allowed values.
|
||||
- [ ] When starting the mastercontainer with `-e DOCKER_SOCKET_PATH="/var/run/docker.sock.raw"` it should map `/var/run/docker.sock.raw` to `/var/run/docker.sock` inside the watchtower container which allow to update the mastercontainer on macos and with docker rootless.
|
||||
- [ ] When starting the mastercontainer with `-e DISABLE_BACKUP_SECTION=true` it should hide the backup section that gets shown after AIO is set up (everything of [020-backup-and-restore](./020-backup-and-restore.md)) and simply show that the backup section is disabled.
|
||||
- [ ] When starting the mastercontainer with `-e TRUSTED_CACERTS_DIR=/path/to/my/cacerts`, the resulting nextcloud container should trust all the Certification Authorities, whose certificates are included in the directory `/path/to/my/cacerts` on the host.
|
||||
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_TRUSTED_CACERTS_DIR=/path/to/my/cacerts`, the resulting nextcloud container should trust all the Certification Authorities, whose certificates are included in the directory `/path/to/my/cacerts` on the host.
|
||||
See https://github.com/nextcloud/all-in-one#how-to-trust-user-defiend-certification-authorities-ca
|
||||
- [ ] When starting the mastercontainer with `-e COLLABORA_SECCOMP_DISABLED=true`, the resulting collabora container should have `--o:security.seccomp=false` applied to it.
|
||||
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_STARTUP_APPS=deck`, the resulting Nextcloud should have only installed the deck app and not the other apps that get installed by default. Default are `deck tasks calendar contacts`.
|
||||
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_ADDITIONAL_APKS=zip`, the resulting Nextcloud container should have the zip package installed and not imagemagick.
|
||||
- [ ] When starting the mastercontainer with `-e NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS=inotify`, the resulting Nextcloud container should have the inotify extension installed and not the imagick extension.
|
||||
|
||||
You can now continue with [070-timezone-change.md](./070-timezone-change.md)
|
||||
|
||||
Reference in New Issue
Block a user