Add encryption for user PII fields (phone number, name, attributes) and address fields to enhance data security. Introduced timestamped activation tokens for improved validation. Included migrations to encrypt existing plaintext data. Refactored GraphQL settings to limit query depth and optionally disable introspection for enhanced API defense. Implemented throttling to safeguard API rates. Improved Dockerfiles for better user management and restored media migration tools for smooth instance upgrades.
48 lines
1.4 KiB
Bash
48 lines
1.4 KiB
Bash
#!/usr/bin/env bash
|
|
# =============================================================================
|
|
# migrate-media.sh
|
|
# Migrates user-uploaded media files from host bind-mount (eVibes / early Schon)
|
|
# into the new Docker-managed named volume (media-data).
|
|
#
|
|
# Run this ONCE after upgrading from an eVibes or pre-volume Schon instance.
|
|
# =============================================================================
|
|
set -euo pipefail
|
|
|
|
HOST_MEDIA="$(pwd)/media"
|
|
|
|
echo "Schon — media migration from host bind-mount → named volume"
|
|
echo ""
|
|
|
|
if [ ! -d "$HOST_MEDIA" ]; then
|
|
echo "No ./media directory found on host. Nothing to migrate."
|
|
exit 0
|
|
fi
|
|
|
|
FILE_COUNT=$(find "$HOST_MEDIA" -type f | wc -l | tr -d ' ')
|
|
if [ "$FILE_COUNT" -eq 0 ]; then
|
|
echo "Host ./media directory is empty. Nothing to migrate."
|
|
exit 0
|
|
fi
|
|
|
|
echo "Found $FILE_COUNT file(s) in $HOST_MEDIA"
|
|
echo ""
|
|
echo "This will copy them into the Docker named volume 'media-data'."
|
|
read -rp "Continue? [y/N] " confirm
|
|
if [ "$confirm" != "y" ] && [ "$confirm" != "Y" ]; then
|
|
echo "Migration cancelled."
|
|
exit 0
|
|
fi
|
|
|
|
echo ""
|
|
echo "Copying files..."
|
|
docker compose run --rm \
|
|
-v "$HOST_MEDIA":/old_media:ro \
|
|
app bash -c "
|
|
cp -a /old_media/. /app/media/
|
|
COUNT=\$(find /app/media -type f | wc -l)
|
|
echo \"Migration complete: \$COUNT file(s) now in media volume.\"
|
|
"
|
|
|
|
echo ""
|
|
echo "Done. You can safely ignore the host ./media directory — it is no longer used."
|
|
echo "To remove it: rm -rf ./media"
|