Skip to content

Commit

Permalink
Repo-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Workflow committed Nov 2, 2023
1 parent c413fc4 commit afc443b
Show file tree
Hide file tree
Showing 36 changed files with 145 additions and 58 deletions.
8 changes: 4 additions & 4 deletions Containers/borgbackup/backupscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ if [ "$BORG_MODE" = backup ]; then
exit 1
fi

# Test that nothing is empty
for directory in "${VOLUME_DIRS[@]}"; do
if [ -z "$(ls -A "$directory")" ] && [ "$directory" != "/nextcloud_aio_volumes/nextcloud_aio_elasticsearch" ]; then
echo "$directory is empty which is not allowed."
# Test that default volumes are not empty
for volume in "${DEFAULT_VOLUMES[@]}"; do
if [ -z "$(ls -A "/nextcloud_aio_volumes/$volume")" ] && [ "$volume" != "nextcloud_aio_elasticsearch" ]; then
echo "/nextcloud_aio_volumes/$volume is empty which should not happen!"
exit 1
fi
done
Expand Down
2 changes: 1 addition & 1 deletion Containers/clamav/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Probably from this file: https://github.com/Cisco-Talos/clamav-docker/blob/main/clamav/1.1/alpine/Dockerfile
FROM clamav/clamav:1.2.0-9
FROM clamav/clamav:1.2.1-12

COPY clamav.conf /tmp/clamav.conf

Expand Down
2 changes: 1 addition & 1 deletion Containers/collabora/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# From a file located probably somewhere here: https://github.com/CollaboraOnline/online/tree/master/docker
FROM collabora/code:23.05.5.1.1
FROM collabora/code:23.05.5.3.1

USER root

Expand Down
2 changes: 1 addition & 1 deletion Containers/imaginary/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM golang:1.21.3-alpine3.18 as go

ENV IMAGINARY_HASH b632dae8cc321452c3f85bcae79c580b1ae1ed84
ENV IMAGINARY_HASH 7efb66c243056e5b3b65215e101be7915983e364

RUN set -ex; \
apk add --no-cache \
Expand Down
4 changes: 2 additions & 2 deletions Containers/mastercontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Docker CLI is a requirement
FROM docker:24.0.6-cli as docker
FROM docker:24.0.7-cli as docker

# Caddy is a requirement
FROM caddy:2.7.5-alpine as caddy

# From https://github.com/docker-library/php/blob/master/8.2/alpine3.18/fpm/Dockerfile
FROM php:8.2.11-fpm-alpine3.18
FROM php:8.2.12-fpm-alpine3.18

EXPOSE 80
EXPOSE 8080
Expand Down
4 changes: 2 additions & 2 deletions Containers/nextcloud/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1.24-fpm-alpine3.18
FROM php:8.1.25-fpm-alpine3.18

ENV PHP_MEMORY_LIMIT 512M
ENV PHP_UPLOAD_LIMIT 10G
Expand Down Expand Up @@ -70,7 +70,7 @@ RUN set -ex; \
# pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.22; \
pecl install memcached-3.2.0; \
pecl install redis-6.0.1; \
pecl install redis-6.0.2; \
pecl install imagick-3.7.0; \
\
docker-php-ext-enable \
Expand Down
5 changes: 5 additions & 0 deletions Containers/nextcloud/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ REDIS_CONF
echo "Setting php max children..."
MEMORY=$(awk '/MemTotal/ {printf "%d", $2/1024}' /proc/meminfo)
PHP_MAX_CHILDREN=$((MEMORY/50))
# 100 is the default, we do not want to go lower than this
if [ "$PHP_MAX_CHILDREN" -lt 100 ]; then
PHP_MAX_CHILDREN=100
fi
if [ -n "$PHP_MAX_CHILDREN" ]; then
sed -i "s/^pm.max_children =.*/pm.max_children = $PHP_MAX_CHILDREN/" /usr/local/etc/php-fpm.d/www.conf
sed -i "s/^;pm.process_idle_timeout =.*/pm.process_idle_timeout = 3s/" /usr/local/etc/php-fpm.d/www.conf
fi

# Check permissions in ncdata
Expand Down
12 changes: 10 additions & 2 deletions Containers/postgresql/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi
if [ -f "$DUMP_DIR/initialization.failed" ]; then
echo "The database initialization failed. Most likely was a wrong timezone selected."
echo "The selected timezone is '$TZ'."
echo "Please check if it is in 'TZ database name' column of the timezone list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List"
echo "Please check if it is in the 'TZ identifier' column of the timezone list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List"
echo "For further clues on what went wrong, look at the logs above."
echo "You might start again from scratch by following https://github.com/nextcloud/all-in-one#how-to-properly-reset-the-instance and selecting a proper timezone."
exit 1
Expand Down Expand Up @@ -152,13 +152,21 @@ if [ -f "/var/lib/postgresql/data/postgresql.conf" ]; then
MEMORY=$(awk '/MemTotal/ {printf "%d", $2/1024}' /proc/meminfo)
MAX_CONNECTIONS=$((MEMORY/50+3))
if [ -n "$MAX_CONNECTIONS" ]; then
# 100 is the default, we do not want to go lower than this
if [ "$MAX_CONNECTIONS" -lt 100 ]; then
MAX_CONNECTIONS=100
fi
sed -i "s|^max_connections =.*|max_connections = $MAX_CONNECTIONS|" "/var/lib/postgresql/data/postgresql.conf"
fi

# Modify conf
# Do not log checkpoints
if grep -q "#log_checkpoints" /var/lib/postgresql/data/postgresql.conf; then
sed -i 's|#log_checkpoints.*|log_checkpoints = off|' /var/lib/postgresql/data/postgresql.conf
fi
# Close idling connections automatically after 3s which does not seem to happen automatically so that we run into max_connections limits
if grep -q "#idle_session_timeout" /var/lib/postgresql/data/postgresql.conf; then
sed -i 's|#idle_session_timeout.*|idle_session_timeout = 3000|' /var/lib/postgresql/data/postgresql.conf
fi
fi

# Catch docker stop attempts
Expand Down
2 changes: 1 addition & 1 deletion Containers/talk-recording/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python:3.12.0-alpine3.18

COPY --chmod=775 start.sh /start.sh

ENV RECORDING_VERSION v17.1.1
ENV RECORDING_VERSION v17.1.2
ENV ALLOW_ALL false
ENV HPB_PROTOCOL https
ENV SKIP_VERIFY false
Expand Down
4 changes: 2 additions & 2 deletions Containers/talk/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM nats:2.10.3-scratch as nats
FROM nats:2.10.4-scratch as nats
FROM eturnal/eturnal:1.12.0 AS eturnal
FROM strukturag/nextcloud-spreed-signaling:1.1.3 as signaling
FROM strukturag/nextcloud-spreed-signaling:1.2.0 as signaling
FROM alpine:3.18.4 as janus

ARG JANUS_VERSION=v0.14.0
Expand Down
17 changes: 10 additions & 7 deletions Containers/talk/server.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ internalsecret = the-shared-secret-for-internal-clients
# only be used while running the benchmark client against the server.
allowall = false

# Common shared secret for requests from and to the backend servers if
# "allowall" is enabled. This must be the same value as configured in the
# Nextcloud admin ui.
# Common shared secret for requests from and to the backend servers. Used if
# "allowall" is enabled or as fallback for individual backends that don't have
# their own secret set.
# This must be the same value as configured in the Nextcloud admin ui.
#secret = the-shared-secret-for-allowall

# Timeout in seconds for requests to the backend.
Expand All @@ -109,8 +110,9 @@ connectionsperhost = 8
# URL of the Nextcloud instance
#url = https://cloud.domain.invalid

# Shared secret for requests from and to the backend servers. This must be the
# same value as configured in the Nextcloud admin ui.
# Shared secret for requests from and to the backend servers. Leave empty to use
# the common shared secret from above.
# This must be the same value as configured in the Nextcloud admin ui.
#secret = the-shared-secret

# Limit the number of sessions that are allowed to connect to this backend.
Expand All @@ -129,8 +131,9 @@ connectionsperhost = 8
# URL of the Nextcloud instance
#url = https://cloud.otherdomain.invalid

# Shared secret for requests from and to the backend servers. This must be the
# same value as configured in the Nextcloud admin ui.
# Shared secret for requests from and to the backend servers. Leave empty to use
# the common shared secret from above.
# This must be the same value as configured in the Nextcloud admin ui.
#secret = the-shared-secret

[nats]
Expand Down
2 changes: 1 addition & 1 deletion app/lib/Settings/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ public function getSection(): string {
* E.g.: 70
*/
public function getPriority(): int {
return 5;
return 0;
}
}
39 changes: 39 additions & 0 deletions community-containers/dlna/dlna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"aio_services_v1": [
{
"container_name": "nextcloud-aio-dlna",
"display_name": "DLNA",
"documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/dlna",
"image": "thanek/nextcloud-dlna",
"image_tag": "latest",
"internal_port": "host",
"restart": "unless-stopped",
"depends_on": [
"nextcloud-aio-database"
],
"environment": [
"NC_DOMAIN=%NC_DOMAIN%",
"NC_PORT=443",
"NEXTCLOUD_DLNA_SERVER_PORT=9999",
"NEXTCLOUD_DLNA_FRIENDLY_NAME=nextcloud-aio",
"NEXTCLOUD_DATA_DIR=/data",
"NEXTCLOUD_DB_TYPE=postgres",
"NEXTCLOUD_DB_HOST=%AIO_DATABASE_HOST%",
"NEXTCLOUD_DB_PORT=5432",
"NEXTCLOUD_DB_NAME=nextcloud_database",
"NEXTCLOUD_DB_USER=oc_nextcloud",
"NEXTCLOUD_DB_PASS=%DATABASE_PASSWORD%"
],
"secrets": [
"DATABASE_PASSWORD"
],
"volumes": [
{
"source": "%NEXTCLOUD_DATADIR%",
"destination": "/data",
"writeable": false
}
]
}
]
}
15 changes: 15 additions & 0 deletions community-containers/dlna/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## DLNA server
This container bundles DLNA server for your Nextcloud files to be accessible by the clients in your local network. Simply run the container and look for a new media server `nextcloud-aio` in your local network.

### Notes
- This container will work only if the Nextcloud installation is in your home network, it is not suitable for installations on remote servers.
- This is not working with Docker Desktop since it requires the `host` networking mode in docker, and it doesn't really share the host's network interfaces in this system
- If you have a firewall like ufw configured, you might need to open at least port 9999 TCP and 1900 UDP first in order to make it work.
- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack

### Repository
https://github.com/thanek/nextcloud-dlna

### Maintainer
https://github.com/thanek

1 change: 1 addition & 0 deletions community-containers/libretranslate/libretranslate.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
],
"nextcloud_exec_commands": [
"php /var/www/html/occ app:install integration_libretranslate",
"php /var/www/html/occ app:enable integration_libretranslate",
"php /var/www/html/occ config:app:set integration_libretranslate host --value='http://nextcloud-aio-libretranslate'",
"php /var/www/html/occ config:app:set integration_libretranslate port --value='5000'"
]
Expand Down
2 changes: 1 addition & 1 deletion community-containers/libretranslate/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Local AI
## LibreTranslate
This container bundles LibreTranslate and auto-configures it for you.

### Notes
Expand Down
6 changes: 4 additions & 2 deletions community-containers/local-ai/local-ai.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
{
"source": "nextcloud_aio_localai_images",
"destination": "/images",
"destination": "/tmp/generated/images/",
"writeable": true
},
{
Expand All @@ -35,8 +35,10 @@
"echo 'Scanning nextcloud-aio-local-ai folder for admin user...'",
"php /var/www/html/occ files:scan --path='/admin/files/nextcloud-aio-local-ai'",
"php /var/www/html/occ app:install integration_openai",
"php /var/www/html/occ app:enable integration_openai",
"php /var/www/html/occ config:app:set integration_openai url --value http://nextcloud-aio-local-ai:8080",
"php /var/www/html/occ app:install assistant"
"php /var/www/html/occ app:install assistant",
"php /var/www/html/occ app:enable assistant"
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion community-containers/plex/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This container bundles Plex and auto-configures it for you.
- This is not working on arm64 since Plex does only provide x64 docker images.
- This is not working on Docker Desktop since it needs `network_mode: host` in order to work correctly.
- If you have a firewall like ufw configured, you might need to open all Plex ports in there first in order to make it work. Especially port 32400 is important!
- After adding and starting the container, you need to visit http://ip.address.of.server:32400 in order to claim your server with a plex account
- After adding and starting the container, you need to visit http://ip.address.of.server:32400/manage in order to claim your server with a plex account
- The data of Plex will be automatically included in AIOs backup solution!
- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack

Expand Down
17 changes: 17 additions & 0 deletions migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The procedure for migrating only the files works like this:
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.
1. If the restored data is older than any clients you want to continue to sync, for example if the server was down for a period of time during migration, you may want to take a look at [Synchronising with clients after migration](/migration.md#synchronising-with-clients-after-migration) below.

## Migrate the files and the database
**Please note**: this is much more complicated than migrating only the files and also not as failproof so be warned! 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.
Expand Down Expand Up @@ -84,5 +85,21 @@ The procedure for migrating the files and the database works like this:
Now the whole Nextcloud instance should work again.<br>
If not, feel free to restore the AIO instance from backup and start at step 8 again.
If the restored data is older than any clients you want to continue to sync, for example if the server was down for a period of time during migration, you may want to take a look at [Synchronising with clients after migration](/migration.md#synchronising-with-clients-after-migration) below.
## Use the user_migration app
A new way since the Nextcloud update to 24 is to use the new [user_migration app](https://apps.nextcloud.com/apps/user_migration#app-gallery). It allows to export the most important data on one instance and import it on a different Nextcloud instance. For that, you need to install and enable the user_migration app on your old instance, trigger the export for the user, create the user on the new instance, log in with that user and import the archive that was created during the export. This then needs to be done for each user that you want to migrate.
If the restored data is older than any clients you want to continue to sync, for example if the server was down for a period of time during migration, you may want to take a look at [Synchronising with clients after migration](/migration.md#synchronising-with-clients-after-migration) below.
# Synchronising with clients after migration
#### From https://docs.nextcloud.com/server/latest/admin_manual/maintenance/restore.html#synchronising-with-clients-after-data-recovery
By default the Nextcloud server is considered the authoritative source for the data. If the data on the server and the client differs clients will default to fetching the data from the server.
If the recovered backup is outdated the state of the clients may be more up to date than the state of the server. In this case also make sure to run `sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ maintenance:data-fingerprint` command afterwards. It changes the logic of the synchronisation algorithm to try an recover as much data as possible. Files missing on the server are therefore recovered from the clients and in case of different content the users will be asked.
>[!Note]
>The usage of maintenance:data-fingerprint can cause conflict dialogues and difficulties deleting files on the client. Therefore it’s only recommended to prevent dataloss if the backup was outdated.
If you are running multiple application servers you will need to make sure the config files are synced between them so that the updated data-fingerprint is applied on all instances.
2 changes: 1 addition & 1 deletion nextcloud-aio-helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: nextcloud-aio-helm-chart
description: A generated Helm Chart for Nextcloud AIO from Skippbox Kompose
version: 7.5.0
version: 7.5.1
apiVersion: v2
keywords:
- latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
value: nextcloud-aio-talk
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-apache:20231027_071516-latest
image: nextcloud/aio-apache:20231030_072910-latest
name: nextcloud-aio-apache
ports:
- containerPort: {{ .Values.APACHE_PORT }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
value: "90"
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-clamav:20231027_071516-latest
image: nextcloud/aio-clamav:20231030_072910-latest
name: nextcloud-aio-clamav
ports:
- containerPort: 3310
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
value: --o:ssl.enable=false --o:ssl.termination=true --o:mount_jail_tree=false --o:logging.level=warning --o:home_mode.enable=true {{ .Values.COLLABORA_SECCOMP_POLICY }} --o:remote_font_config.url=https://{{ .Values.NC_DOMAIN }}/apps/richdocuments/settings/fonts.json
- name: server_name
value: "{{ .Values.NC_DOMAIN }}"
image: nextcloud/aio-collabora:20231027_071516-latest
image: nextcloud/aio-collabora:20231030_072910-latest
name: nextcloud-aio-collabora
ports:
- containerPort: 9980
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
value: nextcloud
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-postgresql:20231027_071516-latest
image: nextcloud/aio-postgresql:20231030_072910-latest
name: nextcloud-aio-database
ports:
- containerPort: 5432
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
value: basic
- name: xpack.security.enabled
value: "false"
image: nextcloud/aio-fulltextsearch:20231027_071516-latest
image: nextcloud/aio-fulltextsearch:20231030_072910-latest
name: nextcloud-aio-fulltextsearch
ports:
- containerPort: 9200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
- env:
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-imaginary:20231027_071516-latest
image: nextcloud/aio-imaginary:20231030_072910-latest
name: nextcloud-aio-imaginary
ports:
- containerPort: 9000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ spec:
value: "{{ .Values.TIMEZONE }}"
- name: UPDATE_NEXTCLOUD_APPS
value: "{{ .Values.UPDATE_NEXTCLOUD_APPS }}"
image: nextcloud/aio-nextcloud:20231027_071516-latest
image: nextcloud/aio-nextcloud:20231030_072910-latest
name: nextcloud-aio-nextcloud
ports:
- containerPort: 9000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
value: nextcloud-aio-redis
- name: REDIS_HOST_PASSWORD
value: "{{ .Values.REDIS_PASSWORD }}"
image: nextcloud/aio-notify-push:20231027_071516-latest
image: nextcloud/aio-notify-push:20231030_072910-latest
name: nextcloud-aio-notify-push
ports:
- containerPort: 7867
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
value: "{{ .Values.ONLYOFFICE_SECRET }}"
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-onlyoffice:20231027_071516-latest
image: nextcloud/aio-onlyoffice:20231030_072910-latest
name: nextcloud-aio-onlyoffice
ports:
- containerPort: 80
Expand Down
Loading

0 comments on commit afc443b

Please sign in to comment.