# Purpose of this instance
# Use "production", "devel", "local" or "test"
ENV="devel"

# Directory and files where is stored Copr database files
#DATA_DIR = '/var/lib/copr/data'
#DATABASE = '/var/lib/copr/data/copr.db'
#OPENID_STORE = '/var/lib/copr/data/openid_store'
#WHOOSHEE_DIR = '/var/lib/copr/data/whooshee'

# salt for CSRF codes
#SECRET_KEY = 'put_some_secret_here'

#BACKEND_PASSWORD = 'password_here'

# restrict access to a set of users
#USE_ALLOWED_USERS = False
#ALLOWED_USERS = ['bonnie', 'clyde']

SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://copr-fe:coprpass@/coprdb'

# Token length, defaults to 30 (max 255)
#API_TOKEN_LENGTH = 30

# Expiration of API token in days
#API_TOKEN_EXPIRATION = 180

# logging options
#SEND_LOGS_TO = ['root@localhost']
#LOGGING_LEVEL = 'info'

# where to send notice about raised legal flag
#SEND_LEGAL_TO = ['root@localhost', 'somebody@somewhere.com']

SQLALCHEMY_ECHO = False

#CSRF_ENABLED = True
# as of Flask-WTF 0.9+
#WTF_CSRF_ENABLED = True

# send emails when user's perms change in project?
SEND_EMAILS = True

## post-process url leading to backend
## possible options: None, "http", "https"
# ENFORCE_PROTOCOL_FOR_BACKEND_URL = "https"
## post-process url leading to frontend
# ENFORCE_PROTOCOL_FOR_FRONTEND_URL = "https"

# URLs for fedmenu resources
#FEDMENU_URL = "http://threebean.org/fedmenu/"
#FEDMENU_DATA_URL = "http://threebean.org/fedmenu/dev-data.js"
#or
#FEDMENU_URL = "https://apps.fedoraproject.org/fedmenu/"
#FEDMENU_DATA_URL = "https://apps.fedoraproject.org/js/data.js"

# Kerberos authentication configuration.  This requires mod_auth_gssapi package
# (Fedora/RHEL) installed on your frontend machine, and properly configured
# HTTP server there with a Kerberos auth accepted (keytab required) on the
# /api_v3/gssapi_login/ route.
# When KRB5_LOGIN is enabled together with FAS_LOGIN, users are forced to first
# log-in into Copr build system via OpenID -- so we get their info about FAS
# groups and the real e-mail (nb the fedoraproject.org alias is only created for
# the users who have at least one group in FAS).
#
# log_text        - What text will be shown in top-menu link pointing to URI
#                   with particular Kerberos/GSSAPI login
# email_domain    - For now and for simplicity, we expect that all users coming
#                   from the realm have the same email domain.  E.g. users we
#                   configure that all users in Fedora FAS have the
#                   @fedoraproject.org alias working.

#KRB5_LOGIN = {
#    'log_text':     "GSSAPI login",
#    'email_domain': "fedoraproject.org",
#}
#
# List of KRB5 user patterns (fnmatch format) where we want to refuse
# logging in with error 403
#KRB5_USER_DENYLIST_PATTERNS = [
#    'spammer',
#    '*-team',
#]

PUBLIC_COPR_HOSTNAME = "copr.fedoraproject.org"

BACKEND_BASE_URL = "http://copr-be-dev.cloud.fedoraproject.org"
DIST_GIT_CLONE_URL = "http://copr-dist-git-dev.fedorainfracloud.org/git"
DIST_GIT_URL = "http://copr-dist-git-dev.fedorainfracloud.org/cgit"
COPR_DIST_GIT_LOGS_URL = "http://copr-dist-git-dev.fedorainfracloud.org/per-task-logs"

# The web-UI page layout shows a "storage statistics" link in footer when
# this is configured (!= None).
BACKEND_STATS_URI = "/stats/index.html"

# primary
LOG_FILENAME = "/var/log/copr-frontend/frontend.log"
LOG_DIR = "/var/log/copr-frontend/"

# Internal network, used to accept statistics without auth
# list of IP or subnet
INTRANET_IPS = ["127.0.0.1", "192.168.1.0/24"]

# Builder VMs network, used to avoid requests from builders in popularity statistics
# list of IP or subnet, optional
BUILDER_IPS = ["127.0.0.1"]

# a place for storing srpms until they get uploaded
STORAGE_DIR = "/var/lib/copr/data/srpm_storage"

# no need to filter cla_* groups, they are already filtered by fedora openid
GROUP_DENYLIST = ['fedorabugs', 'packager', 'provenpackager']

REDIS_HOST = "127.0.0.1"
REDIS_PORT = 6379

# Hide page parts not relevant to this Copr instance:
# LAYOUT_OVERVIEW_HIDE_QUICK_ENABLE = False

# Allow logging into the Copr Web-UI using the Fedora Accounts System OpenID.
#OPENID_PROVIDER_URL = "https://id.stg.fedoraproject.org"

# The OPENID_* configuration is a Fedora Accounts OpenID.  This will show the
# "FAS login" link at the top of the front page, user e-mails are downloaded
# from OpenID, and also @groups are downloaded from OpenID.
# OPENID_PROVIDER_URL.
#FAS_LOGIN = True

# LOGIN_INFO = {
#   # Link to user's profile, {username} expaneded.
#   'user_link': 'https://accounts.fedoraproject.org/user/{username}/',
#   # Description sometimes put into template to make clear what we point to
#   'user_desc': 'FAS account'
# }

# enable Discourse integration
ENABLE_DISCUSSION = False
# DISCOURSE_URL = "https://discussion.fedoraproject.org/"

# PAGINATION
ITEMS_PER_PAGE = 10
PAGES_URLS_COUNT = 5

# in seconds. After this time, copr-rpmbuild stops the build
DEFAULT_BUILD_TIMEOUT = 3600 * 5
MIN_BUILD_TIMEOUT = 0
MAX_BUILD_TIMEOUT = 108000

# The import log is automatically removed after some time, depending on
# dist-git-configuration.  It doesn't make sense to show it any longer, it would
# only point users to 404 error page.
HIDE_IMPORT_LOG_AFTER_DAYS = 14

# These entries are common OIDC configs
# The OIDC_LOGIN and OIDC_PROVIDER_NAME should be present when OpenID Connect is enabled
# OIDC_LOGIN = False
# OIDC_PROVIDER_NAME = "" # e.g "openEuler ID"
# OIDC_CLIENT = ""
# OIDC_SECRET = ""
# OIDC_SCOPES = "" # e.g. "openid username profile email"
# OIDC_TOKEN_AUTH_METHOD="client_secret_post" # possible: client_secret_post, client_secret_basic, none

# The "claim" (for our purposes: a piece of information in the
# UserInfo returned by an OIDC provider) to use as a unique
# username.  There are two supported values:
#
#  - "username" (the default): a non-standard Ipsilon extension
#    that provides unique user names.
#
#  - "preferred_username": a claim that is specified in the OpenID
#    Connect standard, but one that the standard forbids Relying
#    Parties from using for this purpose since they are not
#    guaranteed to be unique.  This option is offered regardless,
#    since oftentimes this claim is unique to a specific user in
#    practice.
# OIDC_USERNAME_CLAIM = "username"

# We have supported two types of OIDC client register
# 1. dynamic register
# 2. static register
# For dynamic register: the OIDC_METADATA was used and only needed by dynamic provider register
# OIDC_METADATA = "" # such as "https://accounts.google.com/.well-known/openid-configuration"

# For static client register: you should config all items blow:
# OIDC_AUTH_URL=""
# OIDC_TOKEN_URL=""
# OIDC_USERINFO_URL=""

# Whether to show a total packages count at homepage
# PACKAGES_COUNT = False

# Extend the set of "builder tags" (see `man 1 resalloc`).  This needs to be a
# list like [{"pattern": r"regexp", "tags": ["tag1", "tag2", ...]}, ...].  The
# regexp pattern is matched against BuildChroot fully qualified names in the
# format "user/project:dirname/chroot_name/pkgname", so example rule might
# look like
#    "pattern": r"john/projectX.*/fedora-.*-x86_64/chromium",
#    "tags": ["extra_powerful"],
#EXTRA_BUILDCHROOT_TAGS = []

# Set this to True if you want to see the last 4 builds listed on the Copr
# homepage (this is useful for rather smaller Copr instances with not so many
# builds in database, otherwise implying rather expensive SQL queries).
#RECENT_BUILDS_ON_FRONTPAGE = False

# Whether we want to show the green "Feed Log-detective.com" button for
# failed builds.  Currently only integrated with the Fedora Copr instance.
#LOG_DETECTIVE_BUTTON = False

# After a given _INACTIVITY_WARNING period (DAYS), when no new build appeared
# in a rolling chroot, we start the "rolling" EOL policy.  It means that — after
# the next _INACTIVITY_REMOVAL DAYS — the chroot gets disabled, and the
# corresponding builds are removed to save storage.  This is only applicable to
# MockChroots.rolling = True, and the command
# `copr-frontend eol-lifeless-rolling-chroots` must be executed periodically via
# cron or similar.
#ROLLING_CHROOTS_INACTIVITY_WARNING = 180
#ROLLING_CHROOTS_INACTIVITY_REMOVAL = 180

#############################
##### DEBUGGING Section #####

# The following options are not designed (or even safe) to be used in production
# systems!

# Turn on the Flask debugger (and some Copr internal mechanisms):
# https://flask.palletsprojects.com/en/latest/debugging/
DEBUG = False

# Enable flask-profiler:
# https://pypi.org/project/flask_profiler/
# Setting this to True requires the flask_profiler installed
PROFILER = False

# Provide special /ma/diff*.txt routes for memory management analysis.  This
# should never be enabled in production (see the memory_analyzer.py module for
# more info).
MEMORY_ANALYZER = False

# Turn-on the in-code checkpoints (additional logging info output) which measure
# time since the beginning of the request, and between each checkpoints.  See
# the 'measure.py' module for more info.
DEBUG_CHECKPOINTS = False

##### DEBUGGING Section #####
#############################
