Moved to Angular v20 and Tailwind v4 plus all related dependencies

Renamed Docker directory.

Also serving static files from FastAPI.
This commit is contained in:
2025-06-25 08:19:37 +00:00
parent 05b395af00
commit cb2b650375
253 changed files with 8626 additions and 1995 deletions

15
ansible/files/.env Normal file
View File

@ -0,0 +1,15 @@
TITLE={{ title }}
HOST=0.0.0.0
PORT=80
LOG_LEVEL=WARN
DEBUG=false
SQLALCHEMY_DATABASE_URI=postgresql+psycopg://postgres:123456@{{ db }}:5432/brewman_{{ name }}
MODULE_NAME=brewman.main
PROJECT_NAME=brewman
PUBLIC_KEY={{ public_key }}
PRIVATE_KEY={{ private_key }}
MIDDLEWARE_SECRET_KEY={{ middleware_key }}
ALGORITHM=EdDSA
JWT_TOKEN_EXPIRE_MINUTES=30
ALEMBIC_LOG_LEVEL=INFO
ALEMBIC_SQLALCHEMY_LOG_LEVEL=WARN

24
ansible/files/Caddyfile Normal file
View File

@ -0,0 +1,24 @@
{{ host }} {
# Match and proxy API routes
@apiRoutes {
path_regexp ^/(api|token|refresh|attendance-report|fingerprint-report|db-image)
}
handle @apiRoutes {
reverse_proxy @apiRoutes {{ host_directory }}:80
}
# Match requests that end with .js, .css, .ico, or .html
@staticFiles {
path_regexp \.(js|css|ico|html)$
}
handle @staticFiles {
rewrite * /static{uri}
reverse_proxy {{ host_directory }}:80
}
# All other frontend routes → /static/index.html
handle {
rewrite * /static/index.html
reverse_proxy {{ host_directory }}:80
}
}

37
ansible/files/keygen.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
# File names
PRIVATE_KEY_FILE="ed25519-private.pem"
PUBLIC_KEY_FILE="ed25519-public.pem"
# Generate private key
openssl genpkey -algorithm Ed25519 -out "$PRIVATE_KEY_FILE"
if [ $? -ne 0 ]; then
echo "❌ Failed to generate private key"
exit 1
fi
# Extract public key
openssl pkey -in "$PRIVATE_KEY_FILE" -pubout -out "$PUBLIC_KEY_FILE"
if [ $? -ne 0 ]; then
echo "❌ Failed to extract public key"
exit 1
fi
# Function to convert PEM to one-liner with \n
format_pem_for_env() {
awk '{printf "%s\\n", $0}' "$1"
}
# Output .env formatted variables
echo "✅ Keys generated. Add the following to your .env file:"
echo ""
echo "PRIVATE_KEY=\"$(format_pem_for_env $PRIVATE_KEY_FILE)\""
echo ""
echo "PUBLIC_KEY=\"$(format_pem_for_env $PUBLIC_KEY_FILE)\""
echo ""
echo "ALGORITHM=EdDSA"
rm -f "$PRIVATE_KEY_FILE" "$PUBLIC_KEY_FILE"
echo "Temporary key files removed."
echo "Done."