###
# app configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html
###

[filter:proxy-prefix]
use = egg:PasteDeploy#prefix
prefix = /fas3
scheme = https

[app:main]
use = egg:fas
filter-with = proxy-prefix

project.name = fedoraproject
project.organisation = Fedora Project
project.admin = fas-admin
project.moderator = accounts-modo
project.group.admin = sysadmin
project.domain.name = fedoraproject.org
project.url = https://admin.stg.fedoraproject.org/fas3/
project.admin.email = admin@fedoraproject.org
project.group.cert.always_renew = false

project.api.data.secret = {{fas3_stg_project_api_data_secret}}

geoip.4.data.city = /usr/share/GeoIP/GeoLiteCity.dat
geoip.6.data.city = /usr/share/GeoIP/GeoLiteCityv6.dat

# Captcha - if 'captcha.secret' is not None, then it will be used for comments
# captcha.secret must be 32 url-safe base64-encoded bytes
# you can generate a fresh one with >>> cryptography.fernet.Fernet.generate_key()
captcha.secret = {{fas3_captcha_secret}}
captcha.image.width = 300
captcha.image.height = 80
# Any truetype font will do.
captcha.font.path = /usr/share/fonts/liberation/LiberationMono-Regular.ttf
captcha.font.size = 36
captcha.font.color = #000000
captcha.font.padding = 5
captcha.background.color = #ffffff
captcha.encoding = utf-8
# If a captcha sits around for this many seconds, it will stop working.
captcha.ttl = 300

github.organization = fedora-infra
github.client.user-agent = Fedora Project\FAS 3.0
github.client.id =
github.client.secret =
github.token =

###
# Session settings
###
session.max_age = 1200
session.timeout = 120
session.renew_time = 20
session.secret = {{fas3_stg_session_secret}}
session.auth.timeout = 1200
session.auth.digest = sha512
session.auth.secret = {{fas3_stg_session_auth_secret}}

cache.max_age = 3600

###
# Log-in settings
###
login.failed_attempt = 3
# Set account lock timeout in minute
login.lock.timeout = 15
user.security_change.timeout = 60

###
# Database settings
###
sqlalchemy.url = postgresql://{{fas3_stg_user}}:{{fas3_stg_pass}}@db-fas01.stg:5432/fas3
#sqlalchemy.url = sqlite:///%(here)s/fas.sqlite


###
# Templates settings
###
mako.directories = fas:templates/fedoraproject
mako.module_directory = /tmp


###
# i18n
###
locale.default = en
#locale.available = en_US,en_GB,fr

###
# Blacklist items
###
blacklist.email.domain = fedoraproject.org
blacklist.country = ["--", "A1", "A2", "AN", "AS", "AX", "BI", "BL", "BV", "CC", "CU", "CV", "CX", "DM", "FK", "FO", "GF", "GG", "GP", "GS", "GW", "HM", "IO", "IR", "IQ", "JE", "KI", "KP", "MF", "MP", "MS", "MW", "NF", "NR", "NU", "PM", "PN", "RE", "SB", "SD", "SH", "SJ", "SY", "TC", "TF", "TK", "TL", "TV", "UM", "VC", "VG", "WF", "YT"]
blacklist.username = "abuse,accounts,adm,admin,amanda,apache,askfedora,asterisk,bin,board,bodhi2,canna,chair,chairman,cvsdirsec,cvsdocs,cvseclipse,cvsextras,cvsfont,daemon,dbus,decode,desktop,dgilmore,directors,dovecot,dumper,fama,famsco,fax,fedora,fedorarewards,fesco,freemedia,ftbfs,ftp,ftpadm,ftpadmin,games,gdm,gopher,gregdek,halt,hostmaster,ident,info,ingres,jaboutboul,jan,keys,kojiadmin,ldap,legal,logo,lp,mail,mailnull,manager,marketing,mysql,nagios,named,netdump,news,newsadm,newsadmin,nfsnobody,nobody,noc,nrpe,nscd,ntp,nut,openvideo,operator,packager,pcap,pkgdb,pkgsigner,postfix,postgres,postmaster,press,privoxy,pvm,quagga,radiusd,radvd,relnotes,root,rpc,rpcuser,rpm,sales,scholarship,secalert,security,shutdown,smmsp,squid,sshd,support,sync,system,tickets,toor,updates,usenet,uucp,vcsa,vendors,voting,webalizer,webmaster,wikiadmin,wnn,www,xfs,zabbix"

###
# OpenSSL 
###
# Valid TYPE value:
# 6: RSA
# 5: DSA
certificate.type = 6
certificate.digest = sha256
certificate.size = 2048
certificate.expiry = 15552000
certificate.public_exponent = 65537
# example:
# 60*60*24*180 = 6 months

# By default, the toolbar only appears for clients from IP addresses
# '127.0.0.1' and '::1'.
# debugtoolbar.hosts = 127.0.0.1 ::1

###
# Pyramid settings
###
pyramid.reload_templates = true
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.default_locale_name = en
pyramid.includes =
    pyramid_mako
    pyramid_tm

###
# Email notifications settings
###

email.smtp.server = localhost
email.from = Fedora Account System <noreply@fedoraproject.org>
email.subject_prefix = [Staging Env]


###
# Fedmenu stuff
###

fedmenu.url = https://apps.fedoraproject.org/fedmenu
fedmenu.data_url = https://apps.fedoraproject.org/js/data.js


[app:plugins]

###
# wsgi server configuration
###

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
#port = 80

###
# logging configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html
###

[loggers]
keys = root, fas, sqlalchemy

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = DEBUG
handlers = console

[logger_fas]
level = DEBUG
handlers =
qualname = fas

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither.  (Recommended for production systems.)

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = DEBUG
formatter = generic
#class = rainbow_logging_handler.RainbowLoggingHandler

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(threadName)s:%(process)s][%(name)s:%(module)s][%(funcName)s:%(lineno)s] %(message)s
