.env.example 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. # BambuTrack Environment Configuration
  2. # Copy this file to .env and adjust values as needed
  3. # Debug mode (true = DEBUG logging, false = production with INFO logging)
  4. DEBUG=true
  5. # Log level (only used when DEBUG=false)
  6. # Options: DEBUG, INFO, WARNING, ERROR
  7. LOG_LEVEL=INFO
  8. # Enable file logging (logs written to logs/bambutrack.log)
  9. LOG_TO_FILE=true
  10. # Home Assistant Integration (for HA Add-on deployments)
  11. # When both HA_URL and HA_TOKEN are set, Home Assistant integration is automatically enabled
  12. # and these values override any database settings (read-only in UI)
  13. # HA_URL=http://supervisor/core
  14. # HA_TOKEN=your-long-lived-access-token
  15. # Trusted iframe origins (#1191) — comma-separated list of scheme://host[:port]
  16. # origins permitted to embed Bambuddy via <iframe>. Defaults to empty (strict:
  17. # only same-origin embedding allowed). Set this to your Home Assistant origin
  18. # when using the HA Webpage dashboard panel, since HA on port 8123 and Bambuddy
  19. # on port 8000 are different origins to the browser. Wildcards, paths, and
  20. # non-http(s) schemes are rejected at startup with a warning.
  21. # TRUSTED_FRAME_ORIGINS=http://homeassistant.local:8123
  22. # MFA at-rest encryption key (#1219) — Fernet, base64-encoded 32 bytes.
  23. # Auto-generated and stored in DATA_DIR/.mfa_encryption_key on first startup
  24. # if unset. Set explicitly to manage the key out-of-band (e.g. via a secret
  25. # manager).
  26. # Generate with: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
  27. #
  28. # NOTE: Local backups (.zip) include the auto-generated key file, so a backup
  29. # is self-contained. If you set this variable explicitly, ensure your backups
  30. # also store the value separately (otherwise an encrypted backup cannot be
  31. # restored after key loss).
  32. # MFA_ENCRYPTION_KEY=
  33. # External library folders (GHSA-r2qv follow-up) — colon-separated list of
  34. # host paths that users are permitted to register as external library
  35. # folders via Settings → Library → "Add external folder".
  36. #
  37. # Empty (the default) means the external-folder feature is DISABLED:
  38. # attempts to register one return HTTP 400. Set this to one or more
  39. # absolute paths to opt in. Paths that fall inside Bambuddy's own
  40. # DATA_DIR / LOG_DIR / static dir are always rejected regardless of
  41. # this value.
  42. #
  43. # Example for a single NAS mount:
  44. # BAMBUDDY_EXTERNAL_ROOTS=/mnt/nas/3d-prints
  45. # Example for two roots:
  46. # BAMBUDDY_EXTERNAL_ROOTS=/mnt/nas/3d-prints:/srv/library
  47. #
  48. # In Docker, also bind-mount the host path into the container at the same
  49. # location (see docker-compose.yml for the matching volume snippet).
  50. # BAMBUDDY_EXTERNAL_ROOTS=
  51. # Local-login recovery bypass (#1589) — set to "true" / "1" / "yes" to
  52. # accept username + password credentials on /auth/login (and to allow the
  53. # /auth/forgot-password flow) even when the in-app setting "Disable local
  54. # login" is turned on. This is the documented "SSO is broken, let me back
  55. # in" path for an operator whose only normal sign-in route is via OIDC.
  56. # /auth/advanced-auth/status also reports local_login_enabled=true while
  57. # this is set, so the login page shows the credentials form to match.
  58. # LDAP is governed by its own ldap_enabled toggle and is not affected.
  59. # Leave unset for normal operation.
  60. # BAMBUDDY_LOCAL_LOGIN=true
  61. # --- OIDC provider from the environment (#2593) ------------------------------
  62. # Defines ONE OIDC provider declaratively, for deployments that are managed by
  63. # compose files or GitOps and never touch the settings UI. Providers created in
  64. # the UI are unaffected and keep working alongside this one.
  65. #
  66. # Activates only when all four required vars below are set; an empty value
  67. # counts as unset. The provider is written on startup and re-applied on every
  68. # boot, so the UI shows it as read-only and the API refuses to change it -- an
  69. # edit there would be reverted at the next restart anyway.
  70. #
  71. # Removing the vars DISABLES the provider rather than deleting it: accounts
  72. # linked to it would otherwise lose their link permanently. Re-adding the vars
  73. # enables it again with those links intact.
  74. #
  75. # If you lock yourself out, BAMBUDDY_LOCAL_LOGIN=true above is the way back in.
  76. #
  77. # Required:
  78. # BAMBUDDY_OIDC_NAME=Keycloak
  79. # BAMBUDDY_OIDC_ISSUER_URL=https://sso.example.com/realms/main
  80. # BAMBUDDY_OIDC_CLIENT_ID=bambuddy
  81. # BAMBUDDY_OIDC_CLIENT_SECRET=your-client-secret
  82. #
  83. # Optional, shown with their defaults:
  84. # BAMBUDDY_OIDC_SCOPES=openid email profile
  85. # BAMBUDDY_OIDC_ENABLED=true
  86. # BAMBUDDY_OIDC_AUTO_CREATE_USERS=false
  87. # BAMBUDDY_OIDC_AUTO_LINK_EXISTING=false
  88. # BAMBUDDY_OIDC_EMAIL_CLAIM=email
  89. # BAMBUDDY_OIDC_REQUIRE_EMAIL_VERIFIED=true
  90. # BAMBUDDY_OIDC_ICON_URL=
  91. # BAMBUDDY_OIDC_AUTOLOGIN=false
  92. # BAMBUDDY_OIDC_DEFAULT_GROUP=
  93. #
  94. # Booleans accept true/1/yes or false/0/no (case-insensitive). Blank or unset
  95. # uses the default; any other value is rejected and the provider is skipped.
  96. #
  97. # DEFAULT_GROUP is the group new users land in when AUTO_CREATE_USERS is on;
  98. # without it they get Viewers. It matches a group NAME exactly (case-sensitive)
  99. # -- group ids are assigned per install, so the same compose file would point at
  100. # a different group on every deployment. A name that matches no group is
  101. # refused: the provider is left as it was and the reason is logged, rather than
  102. # quietly creating under-privileged users the locked UI could not correct. On a
  103. # FIRST boot that means no provider is created at all and no SSO button appears
  104. # -- create the group first. Removing the variable clears the group again.
  105. #
  106. # AUTO_LINK_EXISTING binds an OIDC identity to an existing local account with
  107. # the same email address. With EMAIL_CLAIM=email it is refused unless
  108. # REQUIRE_EMAIL_VERIFIED=true, because an identity provider that does not
  109. # verify addresses would let anyone claim someone else's account. The whole
  110. # config is then skipped and logged; the app still starts.
  111. #
  112. # ISSUER_URL must be https:// and publicly reachable -- private, loopback,
  113. # link-local, numeric-encoded and IPv4-mapped hosts are rejected. An in-cluster
  114. # URL like http://keycloak:8080 is refused with a single log line and no SSO
  115. # button; use the externally-reachable HTTPS issuer URL instead.
  116. #
  117. # NAME is matched against the existing providers on every boot: setting it to
  118. # the name of one you already created in the UI ADOPTS and OVERWRITES it (its
  119. # issuer, client id and secret are replaced and it becomes read-only). Pick a
  120. # name that doesn't collide unless that takeover is intended.