mirror of
https://github.com/CoolnsX/selfhost_podman.git
synced 2025-12-20 03:45:16 +05:30
Pro Tip: Read Copilot output before pushing it
This commit is contained in:
@@ -4,3 +4,5 @@ MARIADB_DATABASE=nextcloud
|
||||
MARIADB_USER=nextcloud
|
||||
TZ=Asia/Kolkata
|
||||
EXTERNAL_DIR=/media/vault/nextcloud
|
||||
SOCKET_PATH=/tmp/docker/notify_push.sock
|
||||
NEXTCLOUD_URL=https://cloud.example.com
|
||||
|
||||
40
nextcloud/nextcloud-notify-push-entrypoint.sh
Executable file
40
nextcloud/nextcloud-notify-push-entrypoint.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
NC_PATH="/var/www/html"
|
||||
CONFIG="$NC_PATH/config/config.php"
|
||||
NOTIFY_BIN="$NC_PATH/apps/notify_push/bin/x86_64/notify_push"
|
||||
SOCKET_PATH="${SOCKET_PATH:-/tmp/docker/notify_push.sock}"
|
||||
|
||||
# Clean shutdown handler
|
||||
cleanup() {
|
||||
echo "[*] Stopping notify_push..."
|
||||
kill -TERM "$NOTIFY_PID" 2>/dev/null || true
|
||||
wait "$NOTIFY_PID" 2>/dev/null || true
|
||||
}
|
||||
trap 'cleanup' TERM INT
|
||||
|
||||
echo "[*] Ensuring notify_push app is installed/updated..."
|
||||
php occ app:install notify_push 2>/dev/null || true
|
||||
php occ app:update notify_push 2>/dev/null || true
|
||||
|
||||
echo "[*] Starting notify_push binary..."
|
||||
"$NOTIFY_BIN" "$CONFIG" &
|
||||
NOTIFY_PID=$!
|
||||
|
||||
# Wait for the socket to appear, max 30 seconds
|
||||
echo "[*] Waiting for notify_push to be ready..."
|
||||
i=0
|
||||
while [ $i -lt 30 ]; do
|
||||
if [ -S "$SOCKET_PATH" ]; then
|
||||
echo "[*] Socket found, running occ notify_push:setup"
|
||||
php occ notify_push:setup "${NEXTCLOUD_URL}/push" || true
|
||||
break
|
||||
fi
|
||||
i=$((i+1))
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# Keep container alive while notify_push runs
|
||||
wait "$NOTIFY_PID"
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
[Unit]
|
||||
Description=Push daemon for Nextcloud clients
|
||||
Documentation=https://github.com/nextcloud/notify_push
|
||||
Requires=nextcloud.service
|
||||
After=nextcloud.service
|
||||
PartOf=nextcloud.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/podman exec -u 1000 nextcloud \
|
||||
/var/www/html/apps/notify_push/bin/x86_64/notify_push \
|
||||
/var/www/html/config/config.php
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -28,13 +28,9 @@ Environment=PHP_MEMORY_LIMIT=2G
|
||||
Environment=PHP_UPLOAD_LIMIT=100G
|
||||
Environment=PHP_OPCACHE_MEMORY_CONSUMPTION=256
|
||||
|
||||
# Nextcloud Notify Push socket
|
||||
Environment=SOCKET_PATH=/tmp/docker/notify_push.sock
|
||||
|
||||
|
||||
Volume=%h/podman/nextcloud/html:/var/www/html
|
||||
Volume=%h/nextcloud:/var/www/html/data
|
||||
Volume=%h/.config/containers/systemd/nextcloud/zz-docker.conf:/usr/local/etc/php-fpm.d/zz-docker.conf
|
||||
Volume=./zz-docker.conf:/usr/local/etc/php-fpm.d/zz-docker.conf
|
||||
Volume=${EXTERNAL_DIR}:${EXTERNAL_DIR}
|
||||
|
||||
[Service]
|
||||
|
||||
33
nextcloud/nextcloud_push.container
Normal file
33
nextcloud/nextcloud_push.container
Normal file
@@ -0,0 +1,33 @@
|
||||
[Unit]
|
||||
Description=Nextcloud Notify Push Container
|
||||
Requires=nextcloud_db.service nextcloud_valkey.service nextcloud.service
|
||||
After=nextcloud_db.service nextcloud_valkey.service nextcloud.service
|
||||
|
||||
[Container]
|
||||
Pod=nextcloud.pod
|
||||
ContainerName=nextcloud_push
|
||||
Image=docker.io/library/nextcloud:fpm-alpine
|
||||
Exec=/nextcloud-notify-push-entrypoint.sh
|
||||
User=1000
|
||||
|
||||
# Enable auto-update container
|
||||
AutoUpdate=registry
|
||||
|
||||
Environment=TZ=${TZ}
|
||||
|
||||
# Nextcloud Notify Push socket
|
||||
Environment=SOCKET_PATH=${SOCKET_PATH}
|
||||
Environment=NEXTCLOUD_URL=${NEXTCLOUD_URL}
|
||||
|
||||
Volume=%h/podman/nextcloud/html:/var/www/html
|
||||
Volume=./nextcloud-notify-push-entrypoint.sh:/nextcloud-notify-push-entrypoint.sh
|
||||
Volume=%h/nextcloud:/var/www/html/data
|
||||
|
||||
[Service]
|
||||
# pass this to autofill above variables
|
||||
EnvironmentFile=%h/.config/containers/systemd/nextcloud/.env
|
||||
Restart=always
|
||||
TimeoutStartSec=300
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
Reference in New Issue
Block a user