# This is a TOML-format file. For the spec, see https://github.com/toml-lang/toml#spec

# Secret key used to generate the CSRF token in the forms.
{% if env == 'staging' %}
secret_key = '{{ stg_anitya_secrect_key }}'
{% else %}
secret_key = '{{ anitya_secret_key }}'
{% endif %}

# The lifetime of the session, in seconds.
permanent_session_lifetime = 604800

{% if env == 'staging' %}
db_url = "postgresql://{{ anitya_stg_db_user }}:{{ anitya_stg_db_pass }}@{{ anitya_stg_db_host }}/{{ anitya_stg_db_name }}"
{% else %}
db_url = "postgresql://{{ anitya_db_user }}:{{ anitya_db_pass }}@{{ anitya_db_host }}/{{ anitya_db_name }}"
{% endif %}

# List of admins
anitya_web_admins = [
{% if env == 'staging' %}
  "7d183b09-d0d7-49e6-8ff3-fc2cce312cc0", # zlopez stg
{% else %}
  "5dd1b1f2-fee1-44f0-abeb-29df5bf151c7", # zlopez
  "5a11f015-54ee-4319-9092-39c427873575", # tibbs
  "42abdf74-b50e-49b4-a674-7cf01868d609", # kevin
{% endif %}
]

# The email to use in the 'From' header when sending emails.
admin_email = "admin@fedoraproject.org"

# The SMTP server to send mail through
smtp_server = "smtp.example.com"

# Whether or not to send emails to MAIL_ADMIN via SMTP_SERVER when HTTP 500
# errors occur.
email_errors = false

# List of users that are not allowed to sign in
blacklisted_users = []

librariesio_platform_whitelist = [
  'pypi',
  'rubygems',
]

social_auth_authentication_backends = [
  'social_core.backends.fedora.FedoraOpenId',
  'social_core.backends.open_id.OpenIdAuth',
]

# Default regular expression used for backend
default_regex = """\
              (?i)%(name)s(?:[-_]?(?:minsrc|src|source))?[-_]([^-/_\\s]+?)(?:[-_]\
              (?:minsrc|src|source|asc|release))?\\.(?:tar|t[bglx]z|tbz2|zip)\
              """

# Github access token
{% if env == 'staging' %}
github_access_token = "{{ github_stg_release_monitoring }}"
{% else %}
github_access_token = "{{ github_prod_release_monitoring }}"
{% endif %}

# Error threshold
check_error_threshold = 100

# Configurable links to package repositories for package mappings in distributions
# If you want to add any new distribution just add a new entry to this section
# %s will be filled in HTML template by the name of package mapping
[distro_mapping_links]
AlmaLinux = "https://git.almalinux.org/rpms/%s"
Alpine = "https://pkgs.alpinelinux.org/packages?name=%s"
ALT = "http://www.sisyphus.ru/srpm/Sisyphus/%s"
"AOSC OS" = "https://packages.aosc.io/packages/%s"
"Arch Linux" = "https://archlinux.org/packages/?q=%s"
"Arch Linux AUR" = "https://aur.archlinux.org/packages/%s"
"Buildroot" = "https://git.buildroot.net/buildroot/tree/package/%s"
"Clear Linux" = "https://clearlinux.org/software/bundle/%s"
COPR = "https://copr.fedorainfracloud.org/coprs/%s/"
CRUX = "https://crux.nu/portdb/?a=search&q=%s"
"Cygwin" = "https://cygwin.com/cgit/cygwin-packages/%s/tree"
Debian = "https://tracker.debian.org/pkg/%s"
"Devuan" = "https://pkginfo.devuan.org/cgi-bin/policy-query.html?c=package&q=^%s$&x=submit"
Docker = "https://hub.docker.com/r/%s"
Fedora = "https://src.fedoraproject.org/rpms/%s"
"Fedora EPEL" = "https://src.fedoraproject.org/rpms/%s"
Flathub = "https://flathub.org/apps/details/%s"
"FreeBSD" = "https://ports.freebsd.org/cgi/ports.cgi?query=^%s-&stype=name"
"Freedesktop SDK" = "https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/master/elements/components/%s.bst"
"FZUG" = "https://github.com/FZUG/repo/tree/master/rpms/%s"
Gentoo = "https://packages.gentoo.org/packages/search?q=%s"
Homebrew = "https://formulae.brew.sh/formula/%s#default"
MacPorts = "https://ports.macports.org/port/%s/"
Mageia = "https://svnweb.mageia.org/packages/cauldron/%s/current/"
"Manjaro Linux" = "https://software.manjaro.org/package/%s"
"NixOS" = "https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=%s"
"OpenMandriva" = "https://github.com/OpenMandrivaAssociation/%s/"
openSuse = "https://software.opensuse.org/package/%s"
"openSUSE Leap" = "https://software.opensuse.org/package/%s"
"openSUSE Tumbleweed" = "https://software.opensuse.org/package/%s"
PLD-Linux = "https://github.com/pld-linux/%s"
"RPM Fusion" = "https://admin.rpmfusion.org/pkgdb/search/?term=%s"
Spack = "https://github.com/spack/spack/tree/develop/var/spack/repos/builtin/packages/%s"
Ubuntu = "https://launchpad.net/ubuntu/+source/%s"
Void = "https://github.com/void-linux/void-packages/tree/master/srcpkgs/%s"
Wolfi = "https://github.com/wolfi-dev/os/blob/main/%s.yaml"


# The logging configuration, in dictConfig format.
[anitya_log_config]
version = 1
disable_existing_loggers = false

[anitya_log_config.formatters.simple]
format = "[%(asctime)s %(name)s %(levelname)s] %(message)s"

[anitya_log_config.handlers.console]
class = "logging.StreamHandler"
formatter = "simple"
stream = "ext://sys.stdout"

[anitya_log_config.loggers.anitya]
level = "INFO"
propagate = false
handlers = ["console"]

[anitya_log_config.loggers.fedmsg]
level = "INFO"
propagate = false
handlers = ["console"]

[anitya_log_config.root]
level = "INFO"
handlers = ["console"]
