# Copy to .env (or run `python scripts/init_env.py`). Never commit .env. # --- Port --------------------------------------------------------------------- # The one place the web port is set; compose publishes it and the app listens on it. WEB_PORT=6080 # --- Persistent data ---------------------------------------------------------- # All data lives in this one folder on the host: DATA_PATH/db (the database, one SQLite file) and DATA_PATH/uploads (uploaded STL/3MF # files). They are plain folders, never Docker volumes, so a rebuild, an update or `docker compose down -v` cannot lose them. # It MUST be an ABSOLUTE folder of the machine Docker runs on, never ./data: a relative path is resolved by whatever tool starts the # stack (Dockhand on Unraid put it in the RAM disk, gone at the next reboot; a fresh checkout starts with an empty database). # Unraid: /mnt/cache/appdata/printpricing (a disk or the pool itself, /mnt//..., not /mnt/user/...: SQLite does not belong on that FUSE share, # unless appdata is an exclusive share; and never /appdata or /data). Other servers: /srv/printpricing, on a local disk (not NFS or SMB). # Data created in another folder by an earlier .env: run `sh scripts/migrate_data.sh` on the host. Back up the whole folder (see README). DATA_PATH=/srv/printpricing # --- Database ----------------------------------------------------------------- # The database is a SQLite file in DATA_PATH/db and needs no settings. The three values below belong to the PostgreSQL of the releases # before it: this release reads that database once, when it starts without a SQLite file, and moves the data over. Leave them as they are # (the next release drops them). For a new installation, letters and digits only in the password (it is embedded in a URL): # openssl rand -hex 16 POSTGRES_USER=printpricing POSTGRES_PASSWORD=change-me POSTGRES_DB=printpricing # --- Passkeys (relying party) ------------------------------------------------- # Optional. Leave RP_ID and RP_ORIGINS empty and the app uses the address it is opened on: that also works on an IP address # on your own network, where you sign in with a password (a passkey needs a domain name and https). # Set them once you have a domain, to pin the app to it: # RP_ID is the domain the app is served on, without scheme or port, for example print.example.com. Passkeys are bound to it: # changing it later makes existing passkeys unusable (recovery codes still work). # RP_ORIGINS is the full origin(s) browsers use, comma separated, for example https://print.example.com. Passkeys need https, # except on http://localhost. Writes from any other origin are refused. RP_ID= RP_ORIGINS= RP_NAME=3D Print Pricing # --- Onboarding & sessions ---------------------------------------------------- # Typed into the "Setup code" field of the onboarding screen (the first screen the app shows) when you # create the first passkey or password, so that nobody who reaches the URL first can claim the app. Only needed once. # After changing it, run `docker compose up -d` so the app reads the new value. Generate: openssl rand -hex 8 SETUP_CODE=change-me # Signs session cookies, minimum 32 characters. Generate: openssl rand -hex 32 SESSION_SECRET=change-me-to-at-least-32-characters-long SESSION_HOURS=24 # --- Notifications (web push) ------------------------------------------------- # Leave empty to switch notifications off. Generate a pair with: python scripts/generate_vapid.py # (init_env.py does it for a new .env). Changing the pair later makes devices turn notifications on again. VAPID_PUBLIC_KEY= VAPID_PRIVATE_KEY= # Contact the push services can reach if your server misbehaves: mailto:you@example.com or an https URL. # Empty = mailto:admin@, or mailto:admin@localhost when RP_ID is empty too: set it when you use notifications. VAPID_SUBJECT= # --- Optional ----------------------------------------------------------------- # Number of reverse proxies in front of the app (trusts X-Forwarded-* from them). PROXY_HOPS=0 # Gunicorn worker processes, and the threads each has: workers x threads requests are handled at once. WEB_CONCURRENCY=2 WEB_THREADS=4 # Largest STL/3MF upload in MB. A proxy or CDN in front must allow at least this much # (Cloudflare's free plan stops at 100 MB). MAX_UPLOAD_MB=50 # Optional feature: AI product images (GPT Image) made from a photo of a print. Off unless this is TRUE; the OpenAI API key # is then entered under Settings -> AI images, not here. AI_IMAGES_ENABLED=FALSE # Where Settings -> Filaments -> Sync reads the shared filament library from: a JSON file in the format of that screen's export, on # raw.githubusercontent.com. Empty switches the Sync button off. FILAMENT_LIBRARY_URL=https://raw.githubusercontent.com/Flux76HQ/3dprint_pricing/main/library/filaments.json # Spoolman (https://github.com/Donkie/Spoolman) as the source of the rolls and what is left on them: Settings -> Integrations -> Spoolman -> Sync reads the # spools from it, and what is used is kept there (the app then books nothing from a 3D Model). Its address as the app's container reaches it, for # example http://spoolman:8000 (no login; a path is fine when Spoolman sits behind one). Empty (the default) means that an administrator # types the address in the app (Settings -> Integrations), or that there is no Spoolman. When it is set here it wins, and the app shows it read-only. SPOOLMAN_URL= # HaspelSync (https://github.com/Rdiger-36/HaspelSync) shows what a Bambu Lab printer is printing now and which filament is in it: the Printers page then has a # live card for every printer that names a printer of HaspelSync. The app only reads from it. Its address as the app's container reaches it, for example # http://haspelsync:4000 (no login). A name that does not end in .local has to be listed under "Allowed host names" in HaspelSync; an IP address does not. And an # API key made in HaspelSync under "Network access" (it starts with ams_). A HaspelSync key can do everything there, so make one for this app only. A key set here # needs its address set here too, and is only ever sent to that address. Empty (the default) means that an administrator types them in the app # (Settings -> Integrations), or that there is no HaspelSync. What is set here wins, and the app shows it read-only. HASPELSYNC_URL= HASPELSYNC_API_KEY= # The update check: the app asks GitHub whether a release newer than the one it runs exists, and tells the owner (a banner and # Settings -> General -> Updates). It only announces: it never updates, restarts or downloads anything, and sends nothing about your # installation. On by default; false (also 0, no, off) switches it off, for an installation that must not call out. A beta build # only ever sees stable releases. PRINTPRICING_UPDATE_CHECK=true # Which build to install: latest (stable, the default) or beta (the development version, with a "beta" label in # the app). A version number such as 0.26.15 pins that release. Use a separate data folder for beta. # Pull with `docker compose pull`. PRINTPRICING_TAG=latest