# //////////////////////////////////////////////////////////////////////////////////////
# //                                                                                  //
# //                                                                                  //
# //  ███████╗████████╗██████╗ ███████╗███╗   ███╗████████╗██╗  ██╗██████╗ ██╗   ██╗  //
# //  ██╔════╝╚══██╔══╝██╔══██╗██╔════╝████╗ ████║╚══██╔══╝██║  ██║██╔══██╗██║   ██║  //
# //  ███████╗   ██║   ██████╔╝█████╗  ██╔████╔██║   ██║   ███████║██████╔╝██║   ██║  //
# //  ╚════██║   ██║   ██╔══██╗██╔══╝  ██║╚██╔╝██║   ██║   ██╔══██║██╔══██╗██║   ██║  //
# //  ███████║   ██║   ██║  ██║███████╗██║ ╚═╝ ██║   ██║   ██║  ██║██║  ██║╚██████╔╝  //
# //  ╚══════╝   ╚═╝   ╚═╝  ╚═╝╚══════╝╚═╝     ╚═╝   ╚═╝   ╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝   //
# //                                                                                  //
# //                                                                                  //
# //////////////////////////////////////////////////////////////////////////////////////
# This is the configuration file for StremThru
# Review the official documentation at https://github.com/MunifTanjim/stremthru#configuration 
# for a full list of available environment variables.

# The base URL of the StremThru instance.
# Required for the StremThru Lists addon to work correctly with Trakt OAuth.
STREMTHRU_BASE_URL=https://${STREMTHRU_HOSTNAME}


# =============================
#     LOGGING CONFIGURATION
# ================================

# The level of information to log. The options are: DEBUG, INFO, WARN, ERROR
STREMTHRU_LOG_LEVEL=INFO
# The format of the log output. The options are: json, text
STREMTHRU_LOG_FORMAT=json

# ============================
#       PROXY CONFIGURATION
# ================================

# A list of user credentials for the proxy. In a comma separated list of username:password pairs. 
STREMTHRU_PROXY_AUTH=user1:pass1,user2:pass2
# A list of admin users. Should be a comma separated list of usernames that must be defined above in the STREMTHRU_PROXY_AUTH variable.
# If you do not set this, all users will be admins.
# STREMTHRU_AUTH_ADMIN=

# A list of store credentials per user. In a comma separated list of username:store_name:store_token. 
# You can also use * as the username to apply to all users.
# This lets you use different API keys for different users. 
# e.g. something like *:realdebrid:abc...xyz would mean for all users, this API key would be used for Real Debrid.
# (Not needed if using StremThru as a external proxy within other apps/addons like AIOStreams)
STREMTHRU_STORE_AUTH=*:realdebrid:abc...xyz             

# A list of proxy configurations per store. This lets you control what is proxied based on what store its from. 
# The format is a comma separated list of <store>:<true/false>
# You can use * to apply to all stores. 
# e.g. *:true,premiumize:false would mean all stores are proxied, except for premiumize.
# (Does not affect proxying of stream links generated by other apps/addons like AIOStreams)
STREMTHRU_STORE_CONTENT_PROXY=*:true,easydebrid:false,premiumize:false

# This is the maximum number of connections to the proxy per user.
# In the format of a comma separated list of <username>:<number of connections> pairs.
# e.g. user1:10,user2:5 would mean user1 can have 10 connections, and user2 can have 5 connections.
# If you want to set a limit for all users, use * as the username.
# A connection limit of 0 means no limit.
# (This DOES affect the proxying of stream links generated by other apps/addons like AIOStreams)
STREMTHRU_CONTENT_PROXY_CONNECTION_LIMIT=*:0


# ============================
#       TUNNEL CONFIGURATION
# ================================
# This is the configuration for the tunnel.
# The tunnel is separate to the actual proxying of your addons. It lets you configure a
# HTTP proxy to use for requests. Configuring a hostname to not be tunneled doesn't affect the proxying of the addon itself, 
# only that it won't also be tunneled through the HTTP proxy.
# 
# If you do not need a tunnel, you can comment out the STREMTHRU_HTTP_PROXY variable.
# 
# This is the URL of the tunnel.
# warp: http://warp:1080 or gluetun: http://gluetun:8080
# (Must have the warp or gluetun profile running to use it as a tunnel)
STREMTHRU_HTTP_PROXY=http://warp:1080

# This allows you to configure what to use the tunnel for. 
# The format is <domain>:<true/false>,<domain>:<true/false>,<domain>:<true/false>. 
# * represents all domains.
# The following configuration only routes requests to torrentio.strem.fun through the tunnel.
# This is necessary when Torrentio blocks your VPS and we want to access the original RD link. 
# It wouldn't use the tunnel for the actual playback link, only to get access to the streaming link through Torrentio.
STREMTHRU_TUNNEL=*:false,torrentio.strem.fun:true       
# This setting is the same as above, but has a higher priority, and used specifically to configure specific stores. 
# The format is <store>:<true/api>. 
# Using api as the value means only the api access will be routed through the tunnel, not the playback links. 
# Using true would route everything for that store through the tunnel.
STREMTHRU_STORE_TUNNEL=realdebrid:api                   

# In most cases, the defaults above are fine. If you want to route everything through the tunnel (e.g. route everything through a VPN), 
# then make sure to set the STREMTHRU_TUNNEL variable to *:true.


# ============================================================
#                   INTEGRATION CONFIGURATION
# ============================================================

# -------------- Trakt.tv Integration --------------
# This lets you use Trakt lists in the StremThru Lists addon.
# You need to create a Trakt application at https://trakt.tv/oauth/applications
# and set the client ID and secret here.
# The redirect URI should be set to https://${STREMTHRU_HOSTNAME}/auth/trakt.tv/callback
# replacing ${STREMTHRU_HOSTNAME} with your StremThru hostname e.g. https://stremthru.example.com/auth/trakt.tv/callback
STREMTHRU_INTEGRATION_TRAKT_CLIENT_ID=
STREMTHRU_INTEGRATION_TRAKT_CLIENT_SECRET=
# This allows you to configure the time after which the Trakt lists are considered stale and would be refreshed on the next request.
# Set to a human readable duration like "1h", "30m", "2d" etc.
# The default is 12h
# STREMTHRU_INTEGRATION_TRAKT_LIST_STALE_TIME=12h

# ------------- TMDB Integration --------------
# For StremThru to integrate with TMDB, provide a Read Access Token here from https://www.themoviedb.org/settings/api
# This is used for the StremThru Lists addon to fetch metadata from TMDB.
STREMTHRU_INTEGRATION_TMDB_ACCESS_TOKEN=
# Configure the time after which TMDB Lists are considered stale and would be refreshed on the next request.
# Set to a human readable duration like "1h", "30m", "2d" etc.
# The default is 12h
# STREMTHRU_INTEGRATION_TMDB_LIST_STALE_TIME=

# -------------- TVDB Integration --------------
# TVDB Integration allows you to add TVDB Lists to the StremThru Lists addon.
# Get your API key from https://www.thetvdb.com/dashboard/account/apikey after signing up for one at https://www.thetvdb.com/api-information.
STREMTHRU_INTEGRATION_TVDB_API_KEY=
# Configure the time after which TVDB Lists are considered stale and would be refreshed on the next request.
# Set to a human readable duration like "1h", "30m", "2d" etc.
# STREMTHRU_INTEGRATION_TVDB_LIST_STALE_TIME=

# -------------- AniList Integration --------------
# This allows you to configure the time after which the AniList lists are considered stale and would be refreshed on the next request.
# Set to a human readable duration like "1h", "30m", "2d" etc.
# The default is 12h
# STREMTHRU_INTEGRATION_ANILIST_LIST_STALE_TIME=

# -------------- MDBList Integration --------------
# This allows you to configure the time after which the MDBList lists are considered stale and would be refreshed on the next request.
# Set to a human readable duration like "1h", "30m", "2d" etc.
# The default is 12h
# STREMTHRU_INTEGRATION_MDBLIST_LIST_STALE_TIME=

# -------------- GitHub Integration --------------
# To avoid rate limits when downloading DMM hashlists and other data from GitHub, provide your GitHub token and username here. 
# STREMTHRU_INTEGRATION_GITHUB_USER=
# STREMTHRU_INTEGRATION_GITHUB_TOKEN=

# -------------- Bitmagnet Integration --------------
# StremThru supports scraping Bitmagnet for torrents. You already pull from the root ST instance which has Bitmagnet configured so this is not required.
# Set this to the base URL of your Bitmagnet instance if you have one, e.g. http://bitmagnet:3333
# STREMTHRU_INTEGRATION_BITMAGNET_BASE_URL=
# Set this to a postgres database URI pointing to your bitmagnet database, e.g. postgres://bitmagnet:bitmagnet@bitmagnet_postgres:5432/bitmagnet
# STREMTHRU_INTEGRATION_BITMAGNET_DATABASE_URI=


# ================================
#             OTHER
# ================================
# Enable Lazy Pull for the StremThru Torz addon.
# Allows the torz addon to pull torrents from upstream databases in the background upon initial requests. 
# On the first request, it returns only local torrents, and pulls the rest in the background,  
# so that on the second search it has all the results available. 
# Makes response times faster, but less results on the first request.
STREMTHRU_STREMIO_TORZ_LAZY_PULL=false


# =============================
#      FEATURE CONFIGURATION
# ================================

# Enables or disables features in StremThru.
# The value is a comma-separated list of feature names prefixed with either a plus (+) to enable or a minus (-) to disable.
# To disable a feature, prefix its name with a hyphen (-), and to enable it, prefix with a plus (+).
#
# Example: "+stremio_sidekick,-dmm_hashlist" enables the Sidekick utility but disables DMM hashlist scraping.
#
# Available features:
#   dmm_hashlist      - Scrapes DMM hashlists for torrents.
#   imdb_title        - Maps movie titles to IMDB IDs for better metadata.
#   anime             - Enables AniList support in the StremThru Lists addon.
#   stremio_sidekick  - Toggles the StremThru Sidekick utility.
#   stremio_store     - Toggles the StremThru Store addon.
#   stremio_wrap      - Toggles the StremThru Wrap addon. 
#   stremio_list      - Toggles the StremThru Lists addon.
#   stremio_torz      - Toggles the StremThru Torz addon.
#   stremio_p2p       - Toggles P2P support in the StremThru Torz addon.
#
# Note: all features are enabled by default, except anime and stremio_p2p. So you should only need to make use of dash (-) prefixed features to disable features
# you do not want to use.
# STREMTHRU_FEATURE=

# =============================
#    DATABASE CONFIGURATION
# ================================
STREMTHRU_DATABASE_URI=sqlite://./data/stremthru.db
# STREMTHRU_REDIS_URI=redis://stremthru_redis:6379



