Chore: moved the nextcloud setup to control via environment variables

This commit is contained in:
coolnsx
2025-09-28 17:24:20 +05:30
parent 5eb90153ed
commit 19fae3f6d3
6 changed files with 70 additions and 27 deletions

View File

@@ -1,9 +1,10 @@
#!/bin/sh
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}"
# env exports
export NEXTCLOUD_URL="${NEXTCLOUD_URL:-$OVERWRITECLIURL}"
export REDIS_URL="redis+unix://${REDIS_HOST}"
export DATABASE_URL="mysql://${MARIADB_USER}:${MARIADB_PASSWORD}@localhost/${MARIADB_DATABASE}?socket=${MARIADB_HOST}"
export DATABASE_PREFIX="oc_"
# Clean shutdown handler
cleanup() {
@@ -18,12 +19,12 @@ php occ app:install notify_push || true
php occ app:enable notify_push || true
echo "[*] Starting notify_push binary..."
"$NOTIFY_BIN" "$CONFIG" &
/var/www/html/apps/notify_push/bin/x86_64/notify_push &
NOTIFY_PID=$!
# Wait for the socket to appear, max 30 seconds
i=0
while [ $i -lt 6 ]; do
i=1
while [ $i -le 6 ]; do
echo "[*] Waiting 5 seconds for notify_push to be ready... (try $i/6)"
sleep 5
if [ -S "$SOCKET_PATH" ]; then