mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-21 10:50:10 +00:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90c2328400 | ||
|
|
f5ee38247c | ||
|
|
f51029270b | ||
|
|
d27aa357db | ||
|
|
4b3e192ee6 | ||
|
|
d974023c8d | ||
|
|
204aa5649c | ||
|
|
8cd5f604c4 | ||
|
|
fdb0330959 | ||
|
|
4f5062080b | ||
|
|
39b669ae83 | ||
|
|
671a73a6c4 | ||
|
|
a4f0852bdf | ||
|
|
46ae99e36b | ||
|
|
07054d869b | ||
|
|
ebbcb998ce | ||
|
|
9f8d17d888 | ||
|
|
56a95182c7 | ||
|
|
e218c1d041 | ||
|
|
356792ec68 | ||
|
|
30ae4eeecd | ||
|
|
8685107e2e | ||
|
|
f01a5841b9 | ||
|
|
2a01e9683b | ||
|
|
0873e526b4 | ||
|
|
2306587a7d | ||
|
|
69b0911db1 | ||
|
|
6587530242 | ||
|
|
cf3f1f04cd | ||
|
|
ba6efd2a9c | ||
|
|
1e96eed341 | ||
|
|
c54395aa4c | ||
|
|
4590b28b50 | ||
|
|
a77ae20e5d | ||
|
|
c5e481b767 |
@@ -1,7 +1,7 @@
|
||||
# Caddy is a requirement
|
||||
FROM caddy:2.6.4-alpine as caddy
|
||||
|
||||
FROM httpd:2.4.55-alpine3.17
|
||||
FROM httpd:2.4.56-alpine3.17
|
||||
|
||||
RUN set -ex; \
|
||||
apk add --no-cache shadow; \
|
||||
|
||||
@@ -129,10 +129,13 @@ if [ "$BORG_MODE" = backup ]; then
|
||||
# https://forum.level1techs.com/t/optimal-compression-for-borg-backups/145870/6
|
||||
BORG_OPTS=(-v --stats --compression "auto,zstd" --exclude-caches --checkpoint-interval 86400)
|
||||
|
||||
# Exclude the nextcloud log and audit log for GDPR reasons
|
||||
BORG_EXCLUDE=(--exclude "/nextcloud_aio_volumes/nextcloud_aio_nextcloud/data/nextcloud.log*" --exclude "/nextcloud_aio_volumes/nextcloud_aio_nextcloud/data/audit.log")
|
||||
|
||||
# Create the backup
|
||||
echo "Starting the backup..."
|
||||
get_start_time
|
||||
if ! borg create "${BORG_OPTS[@]}" "$BORG_BACKUP_DIRECTORY::$CURRENT_DATE-nextcloud-aio" "/nextcloud_aio_volumes/"; then
|
||||
if ! borg create "${BORG_OPTS[@]}" "${BORG_EXCLUDE[@]}" "$BORG_BACKUP_DIRECTORY::$CURRENT_DATE-nextcloud-aio" "/nextcloud_aio_volumes/"; then
|
||||
echo "Deleting the failed backup archive..."
|
||||
borg delete --stats "$BORG_BACKUP_DIRECTORY::$CURRENT_DATE-nextcloud-aio"
|
||||
echo "Backup failed!"
|
||||
@@ -264,13 +267,15 @@ if [ "$BORG_MODE" = restore ]; then
|
||||
|
||||
# Restore everything except the configuration file
|
||||
if ! rsync --stats --archive --human-readable -vv --delete \
|
||||
--exclude "nextcloud_aio_apache/caddy/"** \
|
||||
--exclude "nextcloud_aio_mastercontainer/caddy/"** \
|
||||
--exclude "nextcloud_aio_mastercontainer/certs/"** \
|
||||
--exclude "nextcloud_aio_apache/caddy/**" \
|
||||
--exclude "nextcloud_aio_mastercontainer/caddy/**" \
|
||||
--exclude "nextcloud_aio_nextcloud/data/nextcloud.log*" \
|
||||
--exclude "nextcloud_aio_nextcloud/data/audit.log" \
|
||||
--exclude "nextcloud_aio_mastercontainer/certs/**" \
|
||||
--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/"** \
|
||||
--exclude "nextcloud_aio_mastercontainer/session/**" \
|
||||
/tmp/borg/nextcloud_aio_volumes/ /nextcloud_aio_volumes; then
|
||||
RESTORE_FAILED=1
|
||||
echo "Something failed while restoring from backup."
|
||||
|
||||
@@ -8,6 +8,15 @@ RUN set -ex; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
netcat \
|
||||
; \
|
||||
echo "deb http://deb.debian.org/debian bookworm main" > /etc/apt/sources.list.d/bookworm.list; \
|
||||
apt-get update; \
|
||||
apt-get install -t bookworm -y --no-install-recommends \
|
||||
libheif1 \
|
||||
libde265-0 \
|
||||
libx265-199 \
|
||||
libvips \
|
||||
; \
|
||||
rm /etc/apt/sources.list.d/bookworm.list; \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
USER nobody
|
||||
|
||||
@@ -15,3 +24,6 @@ ENTRYPOINT ["/usr/local/bin/imaginary", "-return-size", "-max-allowed-resolution
|
||||
|
||||
HEALTHCHECK CMD nc -z localhost 9000 || exit 1
|
||||
LABEL com.centurylinklabs.watchtower.monitor-only="true"
|
||||
|
||||
# https://github.com/h2non/imaginary#memory-issues
|
||||
ENV MALLOC_ARENA_MAX=2
|
||||
|
||||
@@ -27,7 +27,6 @@ RUN set -ex; \
|
||||
util-linux-misc \
|
||||
ca-certificates \
|
||||
wget \
|
||||
tzdata \
|
||||
bash \
|
||||
apache2 \
|
||||
apache2-proxy \
|
||||
|
||||
@@ -38,8 +38,10 @@ while true; do
|
||||
# Make sure to delete the lock file always
|
||||
rm -f "/mnt/docker-aio-config/data/daily_backup_running"
|
||||
|
||||
# Check for updates and send notification if yes
|
||||
sudo -u www-data php /var/www/docker-aio/php/src/Cron/UpdateNotification.php
|
||||
# Check for updates and send notification if yes on saturdays
|
||||
if [ "$(date +%u)" = 6 ]; then
|
||||
sudo -u www-data php /var/www/docker-aio/php/src/Cron/UpdateNotification.php
|
||||
fi
|
||||
|
||||
# Check if AIO is outdated
|
||||
sudo -u www-data php /var/www/docker-aio/php/src/Cron/OutdatedNotification.php
|
||||
|
||||
@@ -85,6 +85,10 @@ elif ! sudo -u www-data docker volume ls --format "{{.Name}}" | grep -q "^nextcl
|
||||
echo "It seems like you did not give the mastercontainer volume the correct name?
|
||||
Using a different name is not supported!"
|
||||
exit 1
|
||||
elif ! sudo -u www-data docker inspect nextcloud-aio-mastercontainer | grep -q "nextcloud_aio_mastercontainer"; then
|
||||
echo "It seems like you did not attach the nextcloud_aio_mastercontainer volume to the mastercontainer?
|
||||
This is not supported!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for other options
|
||||
|
||||
@@ -212,9 +212,8 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$SKIP_DATA_DIRECTORY_PERMISSION_CHECK" = yes ]; then
|
||||
php /var/www/html/occ config:system:set check_data_directory_permissions --value=false --type=bool
|
||||
fi
|
||||
# We do our own permission check so the permission check is not needed
|
||||
php /var/www/html/occ config:system:set check_data_directory_permissions --value=false --type=bool
|
||||
|
||||
# Try to force generation of appdata dir:
|
||||
php /var/www/html/occ maintenance:repair
|
||||
@@ -297,6 +296,11 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
|
||||
done
|
||||
fi
|
||||
|
||||
# Set the permission check to its default value again if not set
|
||||
if [ "$SKIP_DATA_DIRECTORY_PERMISSION_CHECK" != yes ]; then
|
||||
php /var/www/html/occ config:system:set check_data_directory_permissions --value=true --type=bool
|
||||
fi
|
||||
|
||||
#upgrade
|
||||
else
|
||||
touch "$NEXTCLOUD_DATA_DIR/update.failed"
|
||||
|
||||
@@ -15,12 +15,12 @@ The procedure for migrating only the files works like this:
|
||||
1. Recreate all users that were present on your former installation
|
||||
1. Take a backup using Nextcloud AIO's built-in backup solution (so that you can easily restore to this state again) (Note: this will stop all containers and is expected: don't start the container again at this point!)
|
||||
1. Restore the datadirectory of your former instance: for `/path/to/nextcloud/data/` run `sudo docker cp --follow-link /path/to/nextcloud/data/ nextcloud-aio-nextcloud:/mnt/ncdata/` Note: the `/` at the end are necessary.
|
||||
1. Next, run `sudo docker run --rm --volume nextcloud_aio_nextcloud_data:/mnt/ncdata:rw alpine chown -R 33:0 /mnt/ncdata/"` and `sudo docker run --rm --volume nextcloud_aio_nextcloud_data:/mnt/ncdata:rw alpine chmod -R 750 /mnt/ncdata/` to apply the correct permissions. (Or if `NEXTCLOUD_DATADIR` was provided, apply `chown -R 33:0` and `chmod -R 750` to the chosen path.)
|
||||
1. Next, run `sudo docker run --rm --volume nextcloud_aio_nextcloud_data:/mnt/ncdata:rw alpine chown -R 33:0 /mnt/ncdata/` and `sudo docker run --rm --volume nextcloud_aio_nextcloud_data:/mnt/ncdata:rw alpine chmod -R 750 /mnt/ncdata/` to apply the correct permissions. (Or if `NEXTCLOUD_DATADIR` was provided, apply `chown -R 33:0` and `chmod -R 750` to the chosen path.)
|
||||
1. Start the containers again and wait until all containers are running
|
||||
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! 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.
|
||||
**Please note**: this is much more complicated than migrating only the files and also not as failproof so be warned! Also, this will not work on former snap installations as the snap is read-only and thus you cannot install the necessary `pdo_pgsql` PHP extension. So if migrating from snap, you will need to use one of the other methods. However you could try to ask if the snaps maintainer could add this one small PHP extension to the snap here: https://github.com/nextcloud-snap/nextcloud-snap/issues which would allow for an easy migration.
|
||||
|
||||
The procedure for migrating the files and the database works like this:
|
||||
1. Make sure that your old instance is on exactly the same version like the version used in Nextcloud AIO. (e.g. 23.0.0) You can find the used version here: [click here](https://github.com/nextcloud/all-in-one/search?l=Dockerfile&q=NEXTCLOUD_VERSION&type=). If not, simply upgrade your former installation to that version or wait until the version used in Nextcloud AIO got updated to the same version of your former installation or the other way around.
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"cap_add": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"depends_on": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
||||
@@ -318,6 +318,9 @@
|
||||
],
|
||||
"devices": [
|
||||
"/dev/fuse"
|
||||
],
|
||||
"cap_add": [
|
||||
"SYS_ADMIN"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -411,7 +414,10 @@
|
||||
"environment": [
|
||||
"TZ=%TIMEZONE%"
|
||||
],
|
||||
"restart": "unless-stopped"
|
||||
"restart": "unless-stopped",
|
||||
"cap_add": [
|
||||
"SYS_NICE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-fulltextsearch",
|
||||
|
||||
@@ -23,6 +23,8 @@ class Container {
|
||||
private array $secrets;
|
||||
/** @var string[] */
|
||||
private array $devices;
|
||||
/** @var string[] */
|
||||
private array $capAdd;
|
||||
private DockerActionManager $dockerActionManager;
|
||||
|
||||
public function __construct(
|
||||
@@ -38,6 +40,7 @@ class Container {
|
||||
array $dependsOn,
|
||||
array $secrets,
|
||||
array $devices,
|
||||
array $capAdd,
|
||||
DockerActionManager $dockerActionManager
|
||||
) {
|
||||
$this->identifier = $identifier;
|
||||
@@ -52,6 +55,7 @@ class Container {
|
||||
$this->dependsOn = $dependsOn;
|
||||
$this->secrets = $secrets;
|
||||
$this->devices = $devices;
|
||||
$this->capAdd = $capAdd;
|
||||
$this->dockerActionManager = $dockerActionManager;
|
||||
}
|
||||
|
||||
@@ -83,6 +87,10 @@ class Container {
|
||||
return $this->devices;
|
||||
}
|
||||
|
||||
public function GetCapAdds() : array {
|
||||
return $this->capAdd;
|
||||
}
|
||||
|
||||
public function GetPorts() : ContainerPorts {
|
||||
return $this->ports;
|
||||
}
|
||||
|
||||
@@ -213,6 +213,11 @@ class ContainerDefinitionFetcher
|
||||
$devices = $entry['devices'];
|
||||
}
|
||||
|
||||
$capAdd = [];
|
||||
if (isset($entry['cap_add'])) {
|
||||
$capAdd = $entry['cap_add'];
|
||||
}
|
||||
|
||||
$containers[] = new Container(
|
||||
$entry['container_name'],
|
||||
$displayName,
|
||||
@@ -226,6 +231,7 @@ class ContainerDefinitionFetcher
|
||||
$dependsOn,
|
||||
$secrets,
|
||||
$devices,
|
||||
$capAdd,
|
||||
$this->container->get(DockerActionManager::class)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -411,9 +411,13 @@ class DockerActionManager
|
||||
$requestBody['HostConfig']['Devices'] = $devices;
|
||||
}
|
||||
|
||||
$capAdds = $container->GetCapAdds();
|
||||
if (count($capAdds) > 0) {
|
||||
$requestBody['HostConfig']['CapAdd'] = $capAdds;
|
||||
}
|
||||
|
||||
// Special things for the backup container which should not be exposed in the containers.json
|
||||
if ($container->GetIdentifier() === 'nextcloud-aio-borgbackup') {
|
||||
$requestBody['HostConfig']['CapAdd'] = ["SYS_ADMIN"];
|
||||
$requestBody['HostConfig']['SecurityOpt'] = ["apparmor:unconfined"];
|
||||
|
||||
// Additional backup directories
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</header>
|
||||
|
||||
<div class="content">
|
||||
<h1>Nextcloud AIO v4.5.1</h1>
|
||||
<h1>Nextcloud AIO v4.6.1</h1>
|
||||
|
||||
{# Add 2nd tab warning #}
|
||||
<script type="text/javascript" src="second-tab-warning.js"></script>
|
||||
|
||||
@@ -445,7 +445,7 @@ You can configure the Nextcloud container to use a specific directory on your ho
|
||||
- An example for Linux is `-e NEXTCLOUD_DATADIR="/mnt/ncdata"`.
|
||||
- On macOS it might be `-e NEXTCLOUD_DATADIR="/var/nextcloud-data"`
|
||||
- For Synology it may be `-e NEXTCLOUD_DATADIR="/volume1/docker/nextcloud/data"`.
|
||||
- On Windows it might be `-e NEXTCLOUD_DATADIR="/run/desktop/mnt/host/c/ncdata"`. (This path is equivalent to `C:\backup` on your Windows host so you need to translate the path accordingly. Hint: the path that you enter needs to start with `/run/desktop/mnt/host/`. Append to that the exact location on your windows host, e.g. `c/ncdata` which is equivalent to `C:\ncdata`.)
|
||||
- On Windows it might be `-e NEXTCLOUD_DATADIR="/run/desktop/mnt/host/c/ncdata"`. (This path is equivalent to `C:\ncdata` on your Windows host so you need to translate the path accordingly. Hint: the path that you enter needs to start with `/run/desktop/mnt/host/`. Append to that the exact location on your windows host, e.g. `c/ncdata` which is equivalent to `C:\ncdata`.)
|
||||
- Another option is to provide a specific volume name here with: `-e NEXTCLOUD_DATADIR="nextcloud_aio_nextcloud_datadir"`. This volume needs to be created beforehand manually by you in order to be able to use it. e.g. with:
|
||||
```
|
||||
docker volume create ^
|
||||
@@ -459,7 +459,7 @@ You can configure the Nextcloud container to use a specific directory on your ho
|
||||
### Can I use a CIFS/SMB share as Nextcloud's datadir?
|
||||
|
||||
Sure. Add this to the `/etc/fstab` file: <br>
|
||||
`<your-storage-host-and-subpath> <your-mount-dir> cifs rw,credentials=<your-credentials-file>,uid=33,gid=0,file_mode=0770,dir_mode=0770 0 0`<br>
|
||||
`<your-storage-host-and-subpath> <your-mount-dir> cifs rw,mfsymlinks,seal,credentials=<your-credentials-file>,uid=33,gid=0,file_mode=0770,dir_mode=0770 0 0`<br>
|
||||
(Of course you need to modify `<your-storage-host-and-subpath>`, `<your-mount-dir>` and `<your-credentials-file>` for your specific case.)
|
||||
|
||||
One example could look like this:<br>
|
||||
@@ -477,10 +477,11 @@ Now you can use `/mnt/storagebox` as Nextcloud's datadir like described in the s
|
||||
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 `/`.
|
||||
|
||||
- Two examples for Linux are `-e NEXTCLOUD_MOUNT="/mnt/"` and `-e NEXTCLOUD_MOUNT="/media/"`.
|
||||
- On macOS it might be `-e NEXTCLOUD_MOUNT="/Volumes/your_drive/"`
|
||||
- For Synology it may be `-e NEXTCLOUD_MOUNT="/volume1/"`.
|
||||
- On Windows is this option not supported.
|
||||
- On Windows it might be `-e NEXTCLOUD_MOUNT="/run/desktop/mnt/host/d/your-folder/"`. (This path is equivalent to `D:\your-folder` on your Windows host so you need to translate the path accordingly. Hint: the path that you enter needs to start with `/run/desktop/mnt/host/`. Append to that the exact location on your windows host, e.g. `d/your-folder/` which is equivalent to `D:\your-folder`.)
|
||||
|
||||
After using this option, please make sure to apply the correct permissions to the directories that you want to use in Nextcloud. E.g. `sudo chown -R 33:0 /mnt/your-drive-mountpoint` and `sudo chmod -R 750 /mnt/your-drive-mountpoint` should make it work on Linux when you have used `-e NEXTCLOUD_MOUNT="/mnt/"`.
|
||||
After using this option, please make sure to apply the correct permissions to the directories that you want to use in Nextcloud. E.g. `sudo chown -R 33:0 /mnt/your-drive-mountpoint` and `sudo chmod -R 750 /mnt/your-drive-mountpoint` should make it work on Linux when you have used `-e NEXTCLOUD_MOUNT="/mnt/"`. On Windows you could do this e.g. with `docker exec -it nextcloud-aio-nextcloud chown -R 33:0 /run/desktop/mnt/host/d/your-folder/` and `docker exec -it nextcloud-aio-nextcloud chmod -R 750 /run/desktop/mnt/host/d/your-folder/`.
|
||||
|
||||
You can then navigate to the apps management page, activate the external storage app, navigate to `https://your-nc-domain.com/settings/admin/externalstorages` and add a local external storage directory that will be accessible inside the container at the same place that you've entered. E.g. `/mnt/your-drive-mountpoint` will be mounted to `/mnt/your-drive-mountpoint` inside the container, etc.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user