Skip to content

Commit

Permalink
Repo-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Workflow committed Mar 1, 2024
1 parent aacd537 commit 4038c60
Show file tree
Hide file tree
Showing 52 changed files with 221 additions and 118 deletions.
2 changes: 1 addition & 1 deletion Containers/clamav/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:latest
# Probably from this file: https://github.com/Cisco-Talos/clamav-docker/blob/main/clamav/1.1/alpine/Dockerfile
FROM clamav/clamav:1.3.0-39
FROM clamav/clamav:1.3.0-40

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,6 +1,6 @@
# syntax=docker/dockerfile:latest
# From a file located probably somewhere here: https://github.com/CollaboraOnline/online/tree/master/docker
FROM collabora/code:23.05.9.1.1
FROM collabora/code:23.05.9.2.1

USER root

Expand Down
2 changes: 1 addition & 1 deletion Containers/docker-socket-proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:latest
FROM haproxy:2.9.5-alpine3.19
FROM haproxy:2.9.6-alpine3.19

# hadolint ignore=DL3002
USER root
Expand Down
2 changes: 1 addition & 1 deletion Containers/fulltextsearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:latest
# Probably from here https://github.com/elastic/elasticsearch/blob/main/distribution/docker/src/docker/Dockerfile
FROM elasticsearch:8.12.1
FROM elasticsearch:8.12.2

USER root

Expand Down
2 changes: 1 addition & 1 deletion Containers/imaginary/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:latest
FROM golang:1.22.0-alpine3.18 as go

ENV IMAGINARY_HASH 6cd9edd1d3fb151eb773c14552886e4fc8e50138
ENV IMAGINARY_HASH 6cd9edd1d3fb151eb773c14552886e4fc8e50138

RUN set -ex; \
apk add --no-cache \
Expand Down
16 changes: 12 additions & 4 deletions Containers/nextcloud/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ FROM php:8.1.27-fpm-alpine3.19
ENV PHP_MEMORY_LIMIT 512M
ENV PHP_UPLOAD_LIMIT 10G
ENV PHP_MAX_TIME 3600
ENV NEXTCLOUD_VERSION 27.1.5
ENV SOURCE_LOCATION /usr/src/nextcloud

# AIO settings start # Do not remove or change this line!
ENV NEXTCLOUD_VERSION 27.1.7
ENV AIO_TOKEN 123456
ENV AIO_URL localhost
COPY supervisord.conf /supervisord.conf
# AIO settings end # Do not remove or change this line!

COPY --chmod=775 *.sh /
COPY --chmod=774 upgrade.exclude /upgrade.exclude
COPY config/*.php /
COPY supervisord.conf /supervisord.conf

VOLUME /mnt/ncdata
VOLUME /var/www/html
Expand Down Expand Up @@ -116,6 +120,7 @@ RUN set -ex; \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www; \
\
# Download Nextcloud archive start # Do not remove or change this line!
apk add --no-cache --virtual .fetch-deps \
bzip2 \
gnupg \
Expand All @@ -136,8 +141,9 @@ RUN set -ex; \
mkdir -p /usr/src/nextcloud/custom_apps; \
chmod +x /usr/src/nextcloud/occ; \
mkdir -p /usr/src/nextcloud/config; \
mv /*.php /usr/src/nextcloud/config/; \
apk del .fetch-deps; \
# Download Nextcloud archive end # Do not remove or change this line!
mv /*.php /usr/src/nextcloud/config/; \
\
# Template from https://github.com/nextcloud/docker/blob/master/.examples/dockerfiles/full/fpm-alpine/Dockerfile
apk add --no-cache \
Expand Down Expand Up @@ -205,18 +211,20 @@ RUN set -ex; \
sed -i 's/^pm.max_children =.*/pm.max_children = 5000/' /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; \
\
# AIO cloning start # Do not remove or change this line!
rm -rf /tmp/nextcloud-aio && \
mkdir -p /tmp/nextcloud-aio && \
cd /tmp/nextcloud-aio && \
git clone https://github.com/nextcloud-releases/all-in-one.git --depth 1 .; \
mkdir -p /usr/src/nextcloud/apps/nextcloud-aio; \
cp -r ./app/* /usr/src/nextcloud/apps/nextcloud-aio/; \
# AIO cloning end # Do not remove or change this line!
\
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 && \
chmod -R 777 /tmp; \
rm -r /usr/src/nextcloud/apps/updatenotification; \
rm -rf /usr/src/nextcloud/apps/updatenotification; \
\
mkdir -p /nc-updater; \
chown -R www-data:www-data /nc-updater; \
Expand Down
31 changes: 20 additions & 11 deletions Containers/nextcloud/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ if [ -f /var/www/html/version.php ]; then
else
installed_version="0.0.0.0"
fi
if [ -f "/usr/src/nextcloud/version.php" ]; then
if [ -f "$SOURCE_LOCATION/version.php" ]; then
# shellcheck disable=SC2016
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
image_version="$(php -r "require '$SOURCE_LOCATION/version.php'; echo implode('.', \$OC_Version);")"
else
image_version="$installed_version"
fi
Expand Down Expand Up @@ -106,6 +106,8 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
fi

if [ "$installed_version" != "0.0.0.0" ] && [ "$((IMAGE_MAJOR - INSTALLED_MAJOR))" -gt 1 ]; then
# Do not skip major versions placeholder # Do not remove or change this line!
# Do not skip major versions start # Do not remove or change this line!
set -ex
NEXT_MAJOR="$((INSTALLED_MAJOR + 1))"
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/latest-${NEXT_MAJOR}.tar.bz2"
Expand All @@ -122,17 +124,18 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
mkdir -p /usr/src/tmp/nextcloud/data
mkdir -p /usr/src/tmp/nextcloud/custom_apps
chmod +x /usr/src/tmp/nextcloud/occ
cp -r /usr/src/nextcloud/config/* /usr/src/tmp/nextcloud/config/
cp -r "$SOURCE_LOCATION"/config/* /usr/src/tmp/nextcloud/config/
mkdir -p /usr/src/tmp/nextcloud/apps/nextcloud-aio
cp -r /usr/src/nextcloud/apps/nextcloud-aio/* /usr/src/tmp/nextcloud/apps/nextcloud-aio/
mv /usr/src/nextcloud /usr/src/temp-nextcloud
mv /usr/src/tmp/nextcloud /usr/src/nextcloud
cp -r "$SOURCE_LOCATION"/apps/nextcloud-aio/* /usr/src/tmp/nextcloud/apps/nextcloud-aio/
mv "$SOURCE_LOCATION" /usr/src/temp-nextcloud
mv /usr/src/tmp/nextcloud "$SOURCE_LOCATION"
rm -r /usr/src/tmp
rm -r /usr/src/temp-nextcloud
# shellcheck disable=SC2016
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
image_version="$(php -r "require $SOURCE_LOCATION/version.php; echo implode('.', \$OC_Version);")"
IMAGE_MAJOR="${image_version%%.*}"
set +ex
# Do not skip major versions end # Do not remove or change this line!
fi

if [ "$installed_version" != "0.0.0.0" ]; then
Expand Down Expand Up @@ -186,15 +189,15 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
fi

echo "Initializing nextcloud $image_version ..."
rsync -rlD --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
rsync -rlD --delete --exclude-from=/upgrade.exclude "$SOURCE_LOCATION/" /var/www/html/

for dir in config data custom_apps themes; do
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
rsync -rlD --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
rsync -rlD --include "/$dir/" --exclude '/*' "$SOURCE_LOCATION/" /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/
rsync -rlD --delete --include '/config/' --exclude '/*' --exclude '/config/CAN_INSTALL' --exclude '/config/config.sample.php' --exclude '/config/config.php' "$SOURCE_LOCATION/" /var/www/html/
rsync -rlD --include '/version.php' --exclude '/*' "$SOURCE_LOCATION/" /var/www/html/
echo "Initializing finished"

#install
Expand Down Expand Up @@ -255,6 +258,7 @@ DATADIR_PERMISSION_CONF
# unset admin password
unset ADMIN_PASSWORD

# AIO update to latest start # Do not remove or change this line!
if [ "$INSTALL_LATEST_MAJOR" = yes ]; then
php /var/www/html/occ config:system:set updatedirectory --value="/nc-updater"
INSTALLED_AT="$(php /var/www/html/occ config:app:get core installedat)"
Expand Down Expand Up @@ -292,6 +296,7 @@ DATADIR_PERMISSION_CONF
php /var/www/html/occ db:add-missing-primary-keys
yes | php /var/www/html/occ db:convert-filecache-bigint
fi
# AIO update to latest end # Do not remove or change this line!

# Apply log settings
echo "Applying default settings..."
Expand Down Expand Up @@ -463,11 +468,13 @@ if [ -f "$NEXTCLOUD_DATA_DIR/fingerprint.update" ]; then
rm "$NEXTCLOUD_DATA_DIR/fingerprint.update"
fi

# AIO one-click settings start # Do not remove or change this line!
# Apply one-click-instance settings
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/"
# AIO one-click settings end # Do not remove or change this line!
php /var/www/html/occ app:enable support
if [ -n "$SUBSCRIPTION_KEY" ] && [ -z "$(php /var/www/html/occ config:app:get support potential_subscription_key)" ]; then
php /var/www/html/occ config:app:set support potential_subscription_key --value="$SUBSCRIPTION_KEY"
Expand Down Expand Up @@ -503,6 +510,7 @@ else
php /var/www/html/occ config:system:set files_external_allow_create_new_local --type=bool --value=true
fi

# AIO app start # Do not remove or change this line!
# AIO app
if [ "$THIS_IS_AIO" = "true" ]; then
if [ "$(php /var/www/html/occ config:app:get nextcloud-aio enabled)" != "yes" ]; then
Expand All @@ -513,6 +521,7 @@ else
php /var/www/html/occ app:disable nextcloud-aio
fi
fi
# AIO app end # Do not remove or change this line!

# Notify push
if ! [ -d "/var/www/html/custom_apps/notify_push" ]; then
Expand Down
2 changes: 1 addition & 1 deletion Containers/onlyoffice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:latest
# From https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/Dockerfile
FROM onlyoffice/documentserver:7.5.1.1
FROM onlyoffice/documentserver:8.0.1.1

# USER root is probably used

Expand Down
24 changes: 24 additions & 0 deletions manual-install/latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ services:
- /usr/local/apache2/logs
- /tmp
- /home/www-data
cap_drop:
- NET_RAW

nextcloud-aio-database:
image: nextcloud/aio-postgresql:latest
Expand All @@ -68,6 +70,8 @@ services:
read_only: true
tmpfs:
- /var/run/postgresql
cap_drop:
- NET_RAW

nextcloud-aio-nextcloud:
depends_on:
Expand Down Expand Up @@ -149,6 +153,8 @@ services:
restart: unless-stopped
networks:
- nextcloud-aio
cap_drop:
- NET_RAW

nextcloud-aio-notify-push:
image: nextcloud/aio-notify-push:latest
Expand All @@ -170,6 +176,8 @@ services:
networks:
- nextcloud-aio
read_only: true
cap_drop:
- NET_RAW

nextcloud-aio-redis:
image: nextcloud/aio-redis:latest
Expand All @@ -185,6 +193,8 @@ services:
networks:
- nextcloud-aio
read_only: true
cap_drop:
- NET_RAW

nextcloud-aio-collabora:
image: nextcloud/aio-collabora:latest
Expand All @@ -205,6 +215,8 @@ services:
- nextcloud-aio
cap_add:
- MKNOD
cap_drop:
- NET_RAW

nextcloud-aio-talk:
image: nextcloud/aio-talk:latest
Expand Down Expand Up @@ -234,6 +246,8 @@ services:
- /opt/eturnal/run
- /conf
- /tmp
cap_drop:
- NET_RAW

nextcloud-aio-talk-recording:
image: nextcloud/aio-talk-recording:latest
Expand All @@ -255,6 +269,8 @@ services:
tmpfs:
- /tmp
- /conf
cap_drop:
- NET_RAW

nextcloud-aio-clamav:
image: nextcloud/aio-clamav:latest
Expand All @@ -276,6 +292,8 @@ services:
- /var/lock
- /var/log/clamav
- /tmp
cap_drop:
- NET_RAW

nextcloud-aio-onlyoffice:
image: nextcloud/aio-onlyoffice:latest
Expand All @@ -294,6 +312,8 @@ services:
- onlyoffice
networks:
- nextcloud-aio
cap_drop:
- NET_RAW

nextcloud-aio-imaginary:
image: nextcloud/aio-imaginary:latest
Expand All @@ -305,6 +325,8 @@ services:
restart: unless-stopped
cap_add:
- SYS_NICE
cap_drop:
- NET_RAW
profiles:
- imaginary
networks:
Expand Down Expand Up @@ -336,6 +358,8 @@ services:
- fulltextsearch
networks:
- nextcloud-aio
cap_drop:
- NET_RAW

volumes:
nextcloud_aio_apache:
Expand Down
3 changes: 2 additions & 1 deletion migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ The procedure for migrating the files and the database works like this:
1. Change it to look like this: `local::/mnt/ncdata/`.
1. Now save the file by pressing `[CTRL] + [o]` then `[ENTER]` and close nano by pressing `[CTRL] + [x]`
1. In order to make sure that everything is good, you can now run `grep "/your/old/datadir" database-dump.sql` which should not bring up further results.<br>
1. **Please note:** Unfortunately it is not possible to import a database dump from a former database owner with the name `nextcloud`. You can check if that is the case with this command: `grep "Name: oc_appconfig; Type: TABLE; Schema: public; Owner:" database-dump.sql | grep -oP 'Owner:.*$' | sed 's|Owner:||;s| ||g'`. If it returns `nextcloud`, you need to rename the owner in the dump file manually. A command like the following should work, however please note that it is possible that it will overwrite wrong lines. You can thus first check which lines it will change with `grep "Owner: nextcloud$" database-dump.sql`. If only correct looking lines get returned, feel free to change them with `sed -i 's|Owner: nextcloud$|Owner: ncadmin|' database-dump.sql`.
1. **Please note:** Unfortunately it is not possible to import a database dump from a former database owner with the name `nextcloud`. You can check if that is the case with this command: `grep "Name: oc_appconfig; Type: TABLE; Schema: public; Owner:" database-dump.sql | grep -oP 'Owner:.*$' | sed 's|Owner:||;s| ||g'`. If it returns `nextcloud`, you need to rename the owner in the dump file manually. A command like the following should work, however please note that it is possible that it will overwrite wrong lines. You can thus first check which lines it will change with `grep "Owner: nextcloud$" database-dump.sql`. If only correct looking lines get returned, feel free to change them with `sed -i 's|Owner: nextcloud$|Owner: ncadmin|' database-dump.sql`.
The same applies for the second statement, check with `grep " OWNER TO nextcloud;$" database-dump.sql` and replace with `sed -i 's| OWNER TO nextcloud;$| OWNER TO ncadmin;$|' database-dump.sql`.
1. Next, copy the database dump into the correct place and prepare the database container which will import from the database dump automatically the next container start:
```
sudo docker run --rm --volume nextcloud_aio_database_dump:/mnt/data:rw alpine rm /mnt/data/database-dump.sql
Expand Down
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.12.0-beta
version: 7.13.0
apiVersion: v2
keywords:
- latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml --namespace {{ .Values.NAMESPACE }}
kompose.cmd: kompose convert -c -f latest.yml --namespace "{{ .Values.NAMESPACE }}"
kompose.version: 1.32.0 (765fde254)
labels:
io.kompose.service: nextcloud-aio-apache
name: nextcloud-aio-apache
namespace: {{ .Values.NAMESPACE }}
namespace: "{{ .Values.NAMESPACE }}"
spec:
replicas: 1
selector:
Expand All @@ -16,7 +16,7 @@ spec:
template:
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml --namespace {{ .Values.NAMESPACE }}
kompose.cmd: kompose convert -c -f latest.yml --namespace "{{ .Values.NAMESPACE }}"
kompose.version: 1.32.0 (765fde254)
labels:
io.kompose.network/nextcloud-aio: "true"
Expand Down Expand Up @@ -59,8 +59,7 @@ spec:
value: nextcloud-aio-talk
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-apache:beta
imagePullPolicy: Always
image: nextcloud/aio-apache:20240228_172209-latest
name: nextcloud-aio-apache
ports:
- containerPort: {{ .Values.APACHE_PORT }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
io.kompose.service: nextcloud-aio-apache
name: nextcloud-aio-apache
namespace: {{ .Values.NAMESPACE }}
namespace: "{{ .Values.NAMESPACE }}"
spec:
{{- if .Values.STORAGE_CLASS }}
storageClassName: {{ .Values.STORAGE_CLASS }}
Expand Down
Loading

0 comments on commit 4038c60

Please sign in to comment.