Files
memby/.env.example
T
2026-08-28 23:00:02 +12:00

202 lines
11 KiB
Bash

# Copy to .env next to docker-compose.yml and fill in. Never commit the real .env.
# How the gateway container reaches Emby.
MEMBY_EMBY_URL=https://molise.bounceme.net
# What TVs are told to stream from. Only set this when it differs from the address
# above — video goes device -> Emby directly, never through the gateway.
MEMBY_EMBY_PUBLIC_URL=https://molise.bounceme.net
# Where the gateway reads media *bytes* from, which is a different question from the two
# addresses above and matters for exactly one subsystem.
#
# Credits detection is the only server-side thing that opens a media file, and it does so as
# ranged reads over the last few minutes of it. The gateway runs on the NAS (10.0.0.213) and
# the media and Emby live on the HTPC (10.0.0.2), so with this unset every one of those
# ranged reads takes MEMBY_EMBY_URL: out to the DDNS name, through TLS and the reverse proxy,
# and back in — and a proxy that buffers turns the ranged read into a whole-file read, which
# is the one thing the scan design exists to avoid.
#
# Unset, it falls back to MEMBY_EMBY_URL and behaves exactly as before. Confirm the port your
# Emby listens on over plain HTTP on the LAN before uncommenting.
MEMBY_EMBY_MEDIA_URL=http://10.0.0.2:8096
# Postgres password for the memby role. Generate one, e.g.
# openssl rand -base64 24
POSTGRES_PASSWORD=7dfc3eb07108013c7bea9787457397551b5eb9059adac51aea4741f4ec649be2
# Fixed NAS host port used by the mserver.sublogue.com reverse proxy.
MEMBY_PORT=32768
# INFO is recommended. DEBUG adds diagnostic request and playback detail; TRACE adds the
# deepest request and playback-negotiation trace. Sensitive structured values are redacted.
MEMBY_LOG_LEVEL=INFO
MEMBY_LOG_BUFFER_CAPACITY=5000
# The Compose default is a named-volume-backed JSONL archive restored by the admin log.
MEMBY_LOG_HISTORY_PATH=/data/logs/events.jsonl
# console (default) is one aligned line per event, timestamp first and no `time=` key.
# logfmt restores slog's own key=value line; json is for a log collector.
MEMBY_LOG_FORMAT=console
MEMBY_GOMEMLIMIT=384MiB
MEMBY_SERVER_MEMORY_LIMIT=512m
# Used for local Sonarr air times and Radarr digital-release day boundaries.
MEMBY_TIMEZONE=Pacific/Auckland
# How long a cached home payload stays warm.
MEMBY_HOME_TTL=60s
MEMBY_RECOMMEND_TTL=24h
# Optional JSON overlay on the explainable weighted-ranking defaults.
# MEMBY_RECOMMENDATION_WEIGHTS={"ExplorationRate":0.08,"MinimumEvidence":2,"ImpressionPenalty":0.12}
MEMBY_RECOMMENDATION_WEIGHTS=
# Optional complete Remote Config document. Leave blank for bundled-equivalent defaults.
# Every change must increase configVersion; see server/REMOTE_CONFIG.md.
MEMBY_REMOTE_CONFIG_JSON=
# Maximum number of distinct Memby TVs one Emby user may keep signed in.
# Admin interface at https://mserver.sublogue.com/admin/ — library imports, the
# maintenance switch, and row analytics. Leave blank to disable /admin entirely. Generate with
# openssl rand -hex 32
MEMBY_ADMIN_TOKEN=4fad67d508558efee5cc5ae05694105421d4c79d35ee2333a817b3791235cd8c
# Public gateway address. Release publishing uses the file-backed secret in
# MEMBY_SECRETS_DIR, never a value in this environment file.
MEMBY_PUBLIC_URL=https://mserver.sublogue.com
MEMBY_SECRETS_DIR=/share/Docker/Memby-secrets
# Catalogue sweep. With both *arr webhooks below configured this is reconciliation for
# media Sonarr and Radarr do not manage — a file dropped in by hand, a title edited in
# Emby, a notification that never arrived — so it can be lengthened to 6h. Without them
# it is the only way a new title is ever found and must stay frequent. The console can
# override it at Settings > Catalogue sweep without a redeployment.
MEMBY_SYNC_INTERVAL=1h
MEMBY_SYNC_ON_START=false
# Optional Emby service account for imports. Without it the gateway borrows the most
# recently active TV session, which works but stops if that user is removed.
MEMBY_SYNC_USER_ID=23bf90fc1fe049ce898db7adda1ed7bf
MEMBY_SYNC_API_KEY=56775917938841e7ac1b6a233d4d5075
# Optional Sonarr calendar integration. Use the URL reachable from this container,
# not necessarily the address entered in a browser. The API key is in Sonarr under
# Settings > General > Security.
MEMBY_SONARR_URL=http://10.0.0.2:8989
MEMBY_SONARR_API_KEY=6b608b051ee24582925773bd5dfbe37a
MEMBY_SONARR_TTL=5m
# How long an episode banner keeps being offered — both the "aired, coming soon" one and
# the "new episode added" one a finished scan produces. 0 turns both off and leaves the
# airing-today row alone.
MEMBY_SONARR_ALERT_WINDOW=3h
# Shared secret for Sonarr's webhook, which is how the catalogue learns that an episode
# landed rather than waiting for the next sweep. In Sonarr: Settings > Connect > + >
# Webhook, with On Import, On Upgrade, On Rename, On Episode File Delete and On Series
# Delete ticked, URL https://<public gateway>/hooks/sonarr?token=<this value>. Empty
# makes the hook 404.
MEMBY_SONARR_WEBHOOK_TOKEN=09f091f0f2ee8af3cba1aac29557e344
# How long after a webhook the gateway first looks for the file in Emby. Sonarr and
# Radarr fire the moment they have moved the file into place and Emby has not scanned it
# yet, so asking immediately spends a request to learn nothing.
MEMBY_ARR_INGEST_SETTLE=1m
# Optional Radarr calendar integration. Upcoming movies cover the coming month, ordered by
# Radarr's digital release date. A film with no digital date yet is estimated at its cinema
# date plus 30 days and says so on the card; physical dates are ignored.
MEMBY_RADARR_URL=http://10.0.0.2:7878
MEMBY_RADARR_API_KEY=d393acb157a44dc2b0e2aede96278ad5
MEMBY_RADARR_TTL=5m
# Shared secret for Radarr's webhook, which is how the catalogue learns that a film landed
# rather than waiting for the next sweep. In Radarr: Settings > Connect > + > Webhook, with
# On Import, On Upgrade, On Rename, On Movie File Delete and On Movie Delete ticked, URL
# https://<public gateway>/hooks/radarr?token=<this value>. Empty makes the hook 404.
# The catalogue reads all five; the banner is announced once the film has actually scanned
# in, and only for an import — an upgrade replaced a film that was already there.
MEMBY_RADARR_WEBHOOK_TOKEN=bfa059594adeadf9105c27481a5fd758
# How long a newly scanned film keeps being announced, so a TV switched on shortly after
# the import still hears about it. 0 turns the banners off.
MEMBY_RADARR_ALERT_WINDOW=3h
# Optional Bazarr integration, one of the two providers a viewer can fetch a missing
# subtitle from. Bazarr writes the file beside the media file, so Emby serves the result
# and Memby stores nothing — leaving these unset simply means Bazarr is never offered. The
# API key is in Bazarr under Settings > General.
#
# Whether viewers may actually use it is a switch on the admin console's Subtitles page,
# not an environment variable: the address is deployment configuration and belongs here,
# but turning the provider on and off is an operator's decision that should not need a
# redeployment. The second provider, OpenSubtitles, is configured entirely on that page —
# it needs only an API key, and the credentials live in the database rather than in this
# file.
#MEMBY_BAZARR_URL=http://10.0.0.2:6767
#MEMBY_BAZARR_API_KEY=e079ab79c1e32b5cf648d079f4421e11
# How long Bazarr's movie/series/episode listings are cached. They exist only to turn an
# Emby item into the Radarr/Sonarr id Bazarr keys on.
#MEMBY_BAZARR_TTL=5m
# A manual search queries live subtitle providers and is legitimately slow, so it gets a
# longer timeout than the rest of the upstreams. Too short reads to a viewer as "no
# subtitles found" rather than as a timeout.
MEMBY_BAZARR_TIMEOUT=45s
# How often the gateway checks that Emby is answering. A run of failures raises the
# "server not responding" banner on every TV, including mid-playback, and recovery
# raises the matching "back online" one. 0 turns the probe and both banners off.
MEMBY_EMBY_HEALTH_INTERVAL=60s
# How slow a request has to be before its log line carries a breakdown of where the time
# went: Emby, Postgres, Redis, each *arr, and the gateway's own row assembly and encoding.
# Fast requests carry none deliberately — a breakdown on every /v1/status poll would bury
# the one it exists to reveal. Lower it while chasing one slow screen. The gateway's
# settings page overrides it without a redeployment.
MEMBY_SLOW_REQUEST_THRESHOLD=500ms
# Which reverse proxies the gateway believes when working out where a request came from,
# for the admin console's Remote IP column and the login/trailer logs. X-Forwarded-For
# and X-Real-IP are only honoured when the immediate peer is one of these, so a direct
# client cannot spoof its address with a header. Blank trusts loopback and the private
# ranges (10/8, 172.16/12, 192.168/16, fc00::/7, link-local) — every proxy a home
# deployment puts in front of Memby. Set a comma-separated list of addresses or CIDR
# ranges to narrow or widen it (add your CDN's ranges here if TLS terminates off-site),
# or "none" to trust no proxy. The reverse proxy must be configured to send the headers
# — e.g. nginx: proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; and
# proxy_set_header X-Real-IP $remote_addr;
MEMBY_TRUSTED_PROXIES=
# Optional Tracearr-powered For You signals. Create a read-only public API key in
# Tracearr Settings. Server ID is optional unless Tracearr monitors multiple servers.
MEMBY_TRACEARR_URL=https://tracearr.sublogue.com/
MEMBY_TRACEARR_API_KEY=trr_pub_WKSdiZFGZ_10d-zgQ2Wx0H4Ym4NAiIeLBSvf8a6rvZ0
MEMBY_TRACEARR_SERVER_ID=6964b9ed-3a21-4f51-b94b-cd344ec42c1b
MEMBY_TRACEARR_SYNC_INTERVAL=5m
MEMBY_TRACEARR_FULL_INTERVAL=24h
# Credits detection: where an episode's closing credits begin, discovered for the few
# episodes the household is actually about to watch. Tracearr is what says which those are,
# so this never scans the library — it prepares a sliding window a few episodes ahead of
# each viewer and stops. An accepted marker is scanned once per media version; inconclusive
# attempts observe the retry delay configured in the admin console.
#
# It is the only thing in the gateway that reads media bytes, which is why it is off by
# default. With ffmpeg absent it still runs, writing markers from where viewers actually
# stopped — which on a well-watched show is the better signal anyway.
#
# Where those bytes are read FROM is MEMBY_EMBY_MEDIA_URL, near the top of this file beside
# the other Emby addresses. It is the setting that decides whether a scan crosses the LAN to
# the HTPC or goes out to the DDNS name and back through the reverse proxy, so it is worth
# setting before turning this on.
MEMBY_CREDITS_ENABLED=true
# Leave blank to find ffmpeg on the path, which is where the image puts it.
MEMBY_CREDITS_FFMPEG=
# Look-ahead for an ordinary viewer. A binge expands it, a slow viewer contracts it, and
# MAX_PREFETCH is the ceiling nothing exceeds however fast somebody watches.
MEMBY_CREDITS_PREFETCH_EPISODES=3
MEMBY_CREDITS_MAX_PREFETCH=5
# Pending candidates. Past this, low-priority speculation is discarded rather than queued:
# a backlog of episodes nobody reached has stopped describing demand. These three values
# are first-run defaults; Admin Console → Credits detection can override them durably.
MEMBY_CREDITS_QUEUE_LIMIT=20
MEMBY_FOR_YOU_MIN_REBUILD_AGE=24h
MEMBY_FOR_YOU_REFRESH_INTERVAL=24h
MEMBY_FOR_YOU_REBUILD_HOUR=4