# 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

# 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 also logs successful health, status and artwork requests,
# playback progress reports and search terms.
MEMBY_LOG_LEVEL=INFO
MEMBY_LOG_BUFFER_CAPACITY=5000
# 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=

# 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 and a dedicated token used only by the Gitea release workflow.
# Generate the token with: openssl rand -hex 32
MEMBY_PUBLIC_URL=https://mserver.sublogue.com
MEMBY_RELEASE_PUBLISH_TOKEN=4b0a891382f056d6ab2ddb43ad08fbbadda0a5a7db9371c7d90fd57b38d083d2

# Library import. Hourly incremental keeps up with episodes added through the day.
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 after an episode airs the "aired, coming soon" banner keeps being offered.
# 0 turns the banners off and leaves the airing-today row alone.
MEMBY_SONARR_ALERT_WINDOW=3h

# Optional Radarr calendar integration. Upcoming movies are selected strictly from
# Radarr's digital release date; theatrical and 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 "On Import" webhook, which announces a newly added film on
# every TV that is awake. In Radarr: Settings > Connect > + > Webhook, On Import only,
# URL https://<public gateway>/hooks/radarr?token=<this value>. Empty makes the hook 404.
MEMBY_RADARR_WEBHOOK_TOKEN=bfa059594adeadf9105c27481a5fd758
# How long an imported 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

# 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
MEMBY_FOR_YOU_MIN_REBUILD_AGE=24h
MEMBY_FOR_YOU_REFRESH_INTERVAL=24h
MEMBY_FOR_YOU_REBUILD_HOUR=4
