ЛР2: PostgreSQL, сессии (Basic + Bearer), Compose, миграции
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
+23
-10
@@ -1,11 +1,24 @@
|
||||
# Copy to .env for your LOCAL synthetic test environment; never commit .env.
|
||||
# These are logical interface suggestions; map actual framework names in REPORT.md.
|
||||
APP_HOST=0.0.0.0
|
||||
APP_PORT=8080
|
||||
APP_ENV=lab
|
||||
SESSION_TTL_SECONDS=3600
|
||||
# Choose credentials locally. File paths contain no secret values.
|
||||
DATABASE_URL_FILE=/run/secrets/database_url
|
||||
# Optional on 3, required use on 4 in lab2; Redis OR Valkey:
|
||||
SESSION_STORE=postgres
|
||||
CACHE_URL_FILE=/run/secrets/cache_url
|
||||
# Names follow pydantic-settings: prefix APP_CONFIG__, nesting via "__" (see app/core/config.py).
|
||||
# Mapping to the skeleton's logical names: APP_HOST -> APP_CONFIG__RUN__HOST, APP_PORT -> APP_CONFIG__RUN__PORT,
|
||||
# DATABASE_URL_FILE -> APP_CONFIG__DB__* (host/port/name/user + password file),
|
||||
# SESSION_TTL_SECONDS -> APP_CONFIG__JWT__SESSION_TTL_SECONDS, SESSION_STORE=postgres (sessions table).
|
||||
APP_CONFIG__RUN__HOST=0.0.0.0
|
||||
APP_CONFIG__RUN__PORT=8080
|
||||
APP_CONFIG__LOGGING__LEVEL=INFO
|
||||
|
||||
# PostgreSQL. Values below are for running the API from the venv on the host;
|
||||
# inside Compose the defaults (host=postgres, /run/secrets/postgres_password) are used.
|
||||
APP_CONFIG__DB__HOST=127.0.0.1
|
||||
APP_CONFIG__DB__PORT=5432
|
||||
APP_CONFIG__DB__NAME=messenger
|
||||
APP_CONFIG__DB__USER=messenger
|
||||
# Path only, never the password itself. Relative paths are resolved from the project root.
|
||||
APP_CONFIG__DB__PASSWORD_FILE=secrets/postgres_password
|
||||
|
||||
# Sessions: JWT signed with a key from a secret file + server-side session row in PostgreSQL.
|
||||
APP_CONFIG__JWT__SECRET_FILE=secrets/jwt_secret
|
||||
APP_CONFIG__JWT__SESSION_TTL_SECONDS=3600
|
||||
|
||||
# Used by compose.yaml: host port for PostgreSQL (bound to 127.0.0.1 only).
|
||||
POSTGRES_HOST_PORT=5432
|
||||
|
||||
Reference in New Issue
Block a user