chore: upgrade app 3.5.3 -> 2026.1.5, redis 7.4-alpine -> 8.8-alpine
Some checks failed
cc-ci/testme cc-ci: failure
Some checks failed
cc-ci/testme cc-ci: failure
This commit is contained in:
24
migrate-uploads.sh
Executable file
24
migrate-uploads.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# One-time, idempotent, NON-destructive migration of uploads + backups from a
|
||||
# legacy bitnami discourse volume into the official image's /shared.
|
||||
#
|
||||
# Runs on every boot as a runit 1.d hook but no-ops after the first success
|
||||
# (sentinel) and when there is no legacy volume mounted (fresh installs). It only
|
||||
# ever COPIES from the read-only /legacy mount, so an interruption just re-copies
|
||||
# on the next boot — there is no move/delete to leave the data half-migrated.
|
||||
set -e
|
||||
|
||||
SENTINEL=/shared/.bitnami-uploads-migrated
|
||||
[ -e "$SENTINEL" ] && exit 0
|
||||
|
||||
if [ -d /legacy/public/uploads ]; then
|
||||
echo "[migrate-uploads] copying bitnami uploads/backups -> /shared"
|
||||
mkdir -p /shared/uploads /shared/backups
|
||||
cp -a /legacy/public/uploads/. /shared/uploads/ 2>/dev/null || true
|
||||
cp -a /legacy/public/backups/. /shared/backups/ 2>/dev/null || true
|
||||
# discourse runs as uid 1000; the official boot also chowns /shared, but be explicit
|
||||
chown -R discourse:discourse /shared/uploads /shared/backups 2>/dev/null || true
|
||||
echo "[migrate-uploads] done"
|
||||
fi
|
||||
|
||||
touch "$SENTINEL"
|
||||
Reference in New Issue
Block a user