From 1ac2fd4f8e83fb38e343c6f8f4a3c760a5d0a0d2 Mon Sep 17 00:00:00 2001 From: Jarno Rankinen Date: Mon, 1 Aug 2022 00:36:29 +0300 Subject: [PATCH] Make a backup copy of config.php before modifying, updated readme --- README.md | 36 +++++++++++++++++++++++++++++++++++- enable-previews | 1 + 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b06c6f2..6607f49 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,36 @@ # nextcloud-previews -Nextcloud container with preinstalled video preview generation +## Nextcloud container with preinstalled video preview generation + +These are container images built using the official Nextcloud Apache images as +source, adding the required packages to generate video previews and `supervisord` +to use `cron` inside the container. + +I'll try to keep up with Nextcloud's upstream releases. +The build itself is automated, but requires a tag to be pushed before triggering, +so there may be a slight delay before a new image version is built. The plan is to +automate the whole process to automatically build images after upstream release. + +## Usage +For instructions on using these images, go to https://github.com/nextcloud/docker +and https://docs.nextcloud.com/. + +Simply use `ghcr.io/0ranki/nextcloud-previews/nextcloud:` +instead of `docker.io/library/nextcloud`. At the moment the images don't use the `latest` +tag, so you'll need to use a specific version. + +To pull e.g. version 24.0.3: +``` +podman pull ghcr.io/0ranki/nextcloud-previews/nextcloud:24.0.3 +``` + +The images have a convenience script installed that modifies `config.php` to actually +enable the video preview generation. To use it, run +``` +podman run enable-previews +``` +if using podman. If using docker substitute `podman` with `docker`. The script makes +a backup copy of `config.php` starting from versions 23.0.7 and 24.0.3 (noticed that +feature missing a bit late) +## Disclaimer +Nextcloud is a registered trademark of Nextcloud GmbH, and I am in no way affiliated +with them. These images are built for personal use and for learning GitHub actions. \ No newline at end of file diff --git a/enable-previews b/enable-previews index 6bcf435..8f123f6 100755 --- a/enable-previews +++ b/enable-previews @@ -2,6 +2,7 @@ if curl -sL localhost/status.php | grep -qF '"installed":true,'; then NEXTCLOUD_DATA_DIR="/var/www/html" + cp "$NEXTCLOUD_DATA_DIR"/config/config.php "$NEXTCLOUD_DATA_DIR"/config/config.php.bak sed -i '/^);$/d' "$NEXTCLOUD_DATA_DIR"/config/config.php cat /previews.conf >> "$NEXTCLOUD_DATA_DIR"/config/config.php echo "Enabled video previews in $NEXTCLOUD_DATA_DIR/config/config.php"