Phase 1 done

This commit is contained in:
Joey Yakimowich-Payne 2026-01-13 14:14:30 -07:00
commit 9a3fc97a34
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
14 changed files with 496 additions and 33 deletions

48
scripts/setup.sh Executable file
View file

@ -0,0 +1,48 @@
#!/bin/bash
set -e
ENV_FILE=".env"
ENV_EXAMPLE=".env.example"
echo "Kaboot Setup Script"
echo "==================="
echo ""
if [ -f "$ENV_FILE" ]; then
read -p ".env file already exists. Overwrite? (y/N): " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Aborting. Existing .env file preserved."
exit 0
fi
fi
if [ ! -f "$ENV_EXAMPLE" ]; then
echo "Error: .env.example not found. Run this script from the project root."
exit 1
fi
echo "Generating secrets..."
PG_PASS=$(openssl rand -base64 36 | tr -d '\n')
AUTHENTIK_SECRET_KEY=$(openssl rand -base64 60 | tr -d '\n')
cp "$ENV_EXAMPLE" "$ENV_FILE"
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s|^PG_PASS=.*|PG_PASS=${PG_PASS}|" "$ENV_FILE"
sed -i '' "s|^AUTHENTIK_SECRET_KEY=.*|AUTHENTIK_SECRET_KEY=${AUTHENTIK_SECRET_KEY}|" "$ENV_FILE"
else
sed -i "s|^PG_PASS=.*|PG_PASS=${PG_PASS}|" "$ENV_FILE"
sed -i "s|^AUTHENTIK_SECRET_KEY=.*|AUTHENTIK_SECRET_KEY=${AUTHENTIK_SECRET_KEY}|" "$ENV_FILE"
fi
echo ""
echo "Created .env file with generated secrets."
echo ""
echo "Next steps:"
echo " 1. Review .env and adjust settings if needed"
echo " 2. Run: docker compose up -d"
echo " 3. Open: http://localhost:9000/if/flow/initial-setup/"
echo " 4. Follow docs/AUTHENTIK_SETUP.md to configure the OAuth2 provider"
echo ""