[pipeline:main]
pipeline =
    moksha
    tw2
    tahrir

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

[filter:tw2]
use = egg:tw2.core#middleware
script_name =

[filter:moksha]
use = egg:moksha.wsgi#middleware

[app:tahrir]

use = egg:tahrir

filter-with = proxy-prefix

#pyramid.reload_templates = true
pyramid.default_locale_name = en
pyramid.includes =
    pyramid_tm

sqlalchemy.url = postgresql://{{tahrirDBUser}}:{{tahrirDBPassword}}@db-tahrir/tahrir

mako.directories=tahrir:templates

tahrir.admin = ralph@fedoraproject.org, oddshocks@fedoraproject.org, puiterwijk@fedoraproject.org
tahrir.pngs.uri = /usr/share/badges/pngs

dogpile.cache.backend = dogpile.cache.memcached
dogpile.cache.expiration_time = 100
dogpile.cache.arguments.url = memcached01:11211
dogpile.cache.arguments.distributed_lock = True


{% if env == 'staging' %}
tahrir.title = Fedora Badges (staging!)
tahrir.base_url = https://badges.stg.fedoraproject.org
tahrir.openid_identifier = http://id.stg.fedoraproject.org/
tahrir.trusted_openid = ^http(s)?:\/\/([a-zA-Z0-9]+\.)?id\.stg\.fedoraproject\.org\/?$
tahrir.openid_realm = https://badges.stg.fedoraproject.org
tahrir.websocket.topic = org.fedoraproject.stg.fedbadges.badge.award
{% else %}
tahrir.title = Fedora Badges
tahrir.base_url = https://badges.fedoraproject.org
tahrir.openid_identifier = http://id.fedoraproject.org/
tahrir.trusted_openid = ^http(s)?:\/\/([a-zA-Z0-9]+\.)?id\.fedoraproject\.org(/)?$
tahrir.openid_realm = https://badges.fedoraproject.org
tahrir.websocket.topic = org.fedoraproject.prod.fedbadges.badge.award
{% endif %}
tahrir.secure_cookies = True
tahrir.allow_changenick = False

# Only allow @fedoraproject.org emails
tahrir.use_openid_email = False

# For auto-updating the frontpage.
tahrir.use_websockets = True

# For emitting messages when users claim badge invitations.
tahrir.use_fedmsg = True

tahrir.default_issuer = fedora-project
tahrir.sitedocs_dir = /usr/share/badges/sitedocs/

tahrir.social.twitter = True
tahrir.social.twitter_user_text = Check out all these #fedorabadges :trophy:
tahrir.social.twitter_user_hash = #fedora
tahrir.social.gplus = True


session.secret="{{tahrirSessionSecret}}"
authnsecret="{{tahrirAuthnSecret}}"

moksha.domain = fedoraproject.org

moksha.notifications = False
moksha.socket.notify = False

moksha.livesocket = True
moksha.livesocket.backend = websocket
moksha.livesocket.reconnect_interval = 5000
moksha.livesocket.websocket.scheme = wss
moksha.livesocket.websocket.port = 9939
{% if env == 'staging' %}
moksha.livesocket.websocket.host = stg.fedoraproject.org
{% else %}
moksha.livesocket.websocket.host = hub.fedoraproject.org
{% endif %}



# Begin logging configuration

[loggers]
keys = root, tahrir, sqlalchemy

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_tahrir]
level = DEBUG
handlers =
qualname = tahrir

[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 = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s

# End logging configuration
