Prep the Download Center epic (Phase 1 + editor + share) for prod/self-host:
- Dockerfile: create /downloads owned by appuser so a named-volume mount is writable (prod Linux).
- docker-compose.{home,selfhost,yml}: add the 'worker' (yt-dlp/ffmpeg job loop) + 'bgutil-pot'
(PO-token) services + a downloads mount (DOWNLOAD_ROOT, WORKER_ENABLED). Media defaults to a
named volume; DOWNLOAD_HOST_PATH points it at a host dir (e.g. a Plex-readable folder).
- README / docs/self-hosting.md / .env.example / install.{sh,ps1}: document the Download Center,
the two extra containers, and DOWNLOAD_HOST_PATH.
- VERSION 0.22.0 + releaseNotes entry.
57 lines
2.1 KiB
Bash
Executable file
57 lines
2.1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Siftlode self-host installer (Linux/macOS). Generates secrets into .env, starts the stack from
|
|
# the prebuilt image, and prints the first-run setup-wizard URL. Re-running is safe: an existing
|
|
# .env is left untouched. Requires Docker (with the compose plugin) and openssl.
|
|
set -euo pipefail
|
|
|
|
COMPOSE="docker compose -f docker-compose.selfhost.yml"
|
|
PORT="${HTTP_PORT:-8080}"
|
|
|
|
if [ -f .env ]; then
|
|
echo ".env already exists — leaving it untouched (delete it to re-generate)."
|
|
else
|
|
printf "Public URL where this instance will be reached [http://localhost:%s]: " "$PORT"
|
|
read -r URL
|
|
URL="${URL:-http://localhost:$PORT}"
|
|
URL="${URL%/}"
|
|
|
|
# Secrets — openssl only, no Python needed. The Fernet key is urlsafe base64 of 32 bytes.
|
|
SECRET_KEY="$(openssl rand -hex 32)"
|
|
TOKEN_ENCRYPTION_KEY="$(openssl rand -base64 32 | tr '+/' '-_')"
|
|
POSTGRES_PASSWORD="$(openssl rand -hex 16)"
|
|
|
|
cat > .env <<EOF
|
|
# Generated by install.sh — keep secret (chmod 600), never commit. Re-run after deleting to reset.
|
|
POSTGRES_PASSWORD=$POSTGRES_PASSWORD
|
|
SECRET_KEY=$SECRET_KEY
|
|
TOKEN_ENCRYPTION_KEY=$TOKEN_ENCRYPTION_KEY
|
|
OAUTH_REDIRECT_URL=$URL/auth/callback
|
|
|
|
# Optional: store Download Center media in a host folder (e.g. one your Plex server reads) instead
|
|
# of a Docker volume. Must be writable by uid 1000 (sudo chown -R 1000:1000 <dir>).
|
|
# DOWNLOAD_HOST_PATH=/mnt/media/youtube
|
|
EOF
|
|
chmod 600 .env
|
|
echo "Wrote .env (secrets generated)."
|
|
fi
|
|
|
|
echo "Pulling and starting Siftlode…"
|
|
$COMPOSE pull
|
|
$COMPOSE up -d
|
|
|
|
echo "Waiting for the app to come up…"
|
|
for _ in $(seq 1 30); do
|
|
curl -fsS -o /dev/null "http://localhost:$PORT/healthz" 2>/dev/null && break
|
|
sleep 2
|
|
done
|
|
|
|
echo
|
|
echo "==================================================================="
|
|
echo " Siftlode is up. Open the first-run setup wizard at:"
|
|
URL_LINE="$($COMPOSE logs api 2>/dev/null | grep -o 'http[s]*://[^ ]*setup?token=[A-Za-z0-9_-]*' | tail -1)"
|
|
if [ -n "$URL_LINE" ]; then
|
|
echo " $URL_LINE"
|
|
else
|
|
echo " (not found yet — run: $COMPOSE logs api | grep 'setup?token=')"
|
|
fi
|
|
echo "==================================================================="
|