# PORTAL PARAMETERS

# Initial values are default vaules.
# Changing at least all passwords and secrets is strongly advised.
# Preferably at least 16 chars longs and randomly generated.


# Initial values for the admin user (portal administrator role),
# that will be created on first startup.
PORTAL_ADMIN_INITIAL_EMAIL="admin@email.com"
PORTAL_ADMIN_INITIAL_PASSWORD="admin"


# The endpoint where you've made Term Candidate Extraction API available.
# It is required for the extraction module to work properly.
EXTRACTION_API_ORIGIN="https://rsdo.lhrs.si"


# The main port, which will be exposed on localhost of the of host running the Docker Engine.
# If you need to expose it on all of host's network interfaces,
# modify docker-compose.prod.yml in project's root directory where it is used.
EXPRESS_LISTEN_PORT=3000
# Set it to true for production and properly configure a reverse proxy in front of it.
EXPRESS_IS_BEHIND_PROXY=false
# It is used for cookie signing.
EXPRESS_SECRET="weak_secret"


# Used for administration.
POSTGRES_ADMIN_PASSWORD="weak_admin_password" # user: postgres
# Used by the express webserver service.
POSTGRES_EXPRESS_PASSWORD="weak_express_password" # user: express
# Used by the concordancer service.
POSTGRES_CONCORDANCER_PASSWORD="weak_concordancer_password" # user: concordancer
# Exposed on host's localhost for administration purposes.
POSTGRES_LISTEN_PORT=5432


# Configuration for webserver to communicate with your SMTP provider.
SMTP_HOST="maildev"
SMTP_PORT=1025
SMTP_USER=""
SMTP_PASSWORD=""
SMTP_SECURE=false # Most often only "true" for port 465.
SMTP_REQUIRE_TLS=false # If "true" and SMTP_SECURE is "false", only send messages if server supports STARTTLS.
SMTP_TLS_ALLOW_INVALID_CERTS=false
SMTP_FROM="Sender name <sender@server.com>"


# Exposed on host's localhost for search index administration purposes.
# Used only if docker compose was ran with opensearch-dashboards profile.
OS_DASHBOARDS_LISTEN_PORT=3002


# The second port, which will be exposed on localhost of the of host running the Docker Engine.
# Used by the concordancer client.
CONCORDANCER_LISTEN_PORT=3003


# Production only settings
# The origin, where the portal will be made available.
URL_ORIGIN="https://mywebportal.com"

# OIDC/SSO federation with the University of Ljubljana (backed by Microsoft Entra ID). Register
# the portal as a confidential OIDC client in the target environment's University of
# Ljubljana/Entra app registration, with redirect URI "${URL_ORIGIN}/users/oidc/callback", then
# fill in the real values below. Not used in dev - dev/docker-compose.yml instead derives dev's
# OIDC_UNI_LJ_* values automatically from AUTHENTIK_OIDC_CLIENT_ID/_SECRET further down this file.
OIDC_UNI_LJ_CLIENT_ID="changeme"
OIDC_UNI_LJ_CLIENT_SECRET="changeme"
OIDC_UNI_LJ_DISCOVERY_URL="https://login.microsoftonline.com/<tenant-id>/v2.0/.well-known/openid-configuration"

# Container image registry prefix, read only by docker-compose.prod.yml.
# Leave empty for a local `up --build` (images get a local name); for a registry-based CI/CD
# deploy set it to <gitea-host>/<owner-lowercase>, e.g. gitea.example.tld/myorg. The image tag is
# not set here — the deploy wrapper exports IMAGE_TAG per deploy.
REGISTRY=""


# Development only settings (not used in production)
MAILDEV_WEB_GUI_PORT=3001

# Throwaway Authentik OIDC Identity Provider, used only for local SSO/OIDC login testing.
# Started with `docker compose --profile develop-idp up -d`. See dev/authentik/README.md.
# It stands in for the single real University of Ljubljana OIDC federation ('uni_lj' in the
# auth_provider enum) - it is not a production identity provider and none of its state is meant
# to be kept.

# Exposed on host's localhost to reach the Authentik admin UI and the test IdP's login pages.
AUTHENTIK_LISTEN_PORT=9000
# Used only by Authentik's own internal Postgres database - a separate, throwaway database
# dedicated to this test IdP, not the portal's own database.
AUTHENTIK_POSTGRES_PASSWORD="weak_authentik_postgres_password"
# Used by Authentik for its own cookie signing/encryption and unique user IDs. Generate a real
# random 50+ char value for anything beyond throwaway local testing, e.g.:
#   openssl rand -base64 60 | tr -d '\n'
AUTHENTIK_SECRET_KEY="weak_authentik_secret_key_please_generate_a_real_one"

# Credentials for Authentik's own built-in "akadmin" superuser, created automatically on first
# startup (Authentik's non-interactive/automated-install feature). Used to log into the Authentik
# admin UI at http://localhost:${AUTHENTIK_LISTEN_PORT}/if/admin/ - unrelated to the portal's own
# PORTAL_ADMIN_INITIAL_EMAIL/PASSWORD above, which is a completely separate account/app.
AUTHENTIK_BOOTSTRAP_EMAIL="admin@authentik.test"
AUTHENTIK_BOOTSTRAP_PASSWORD="weak_authentik_admin_password"
# API token for the akadmin user, also created on first startup. Not needed for manual UI use;
# documented here in case future scripted setup/debugging needs direct Authentik API access.
AUTHENTIK_BOOTSTRAP_TOKEN="weak_authentik_bootstrap_api_token"

# Fixed OIDC client credentials for the single University-of-Ljubljana-stand-in test application
# that the blueprint in dev/authentik/blueprints/ registers in Authentik. Being dev-only throwaway
# values for a testing IdP, committing them is fine (same "weak_" pattern as EXPRESS_SECRET
# above). The express-side OIDC client needs these two values (see OIDC_UNI_LJ_* above).
AUTHENTIK_OIDC_CLIENT_ID="weak_uni_lj_test_client_id"
AUTHENTIK_OIDC_CLIENT_SECRET="weak_uni_lj_test_client_secret"
