X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonstat.git;a=blobdiff_plain;f=production.ini;h=a2da1cf785a9cb3b371955d2f5d1aa8418a7bdf8;hp=94c751fd74e7e0ade14c2c2aaf5a98d0f1a4fb6a;hb=21d2cd0226364323671fa283675f388a06949b25;hpb=1f151a5fa7e41cb8a2280d17a085f3ba9891a9c0 diff --git a/production.ini b/production.ini index 94c751f..a2da1cf 100644 --- a/production.ini +++ b/production.ini @@ -1,47 +1,49 @@ [app:XonStat] -use = egg:XonStat -reload_templates = false -debug_authorization = false -debug_notfound = false -debug_routematch = false -debug_templates = false -default_locale_name = en -sqlalchemy.url = sqlite:///%(here)s/XonStat.db -jinja2.directories = xonstat:templates -mako.directories = xonstat:templates - -xonstat.minimum_required_players = 2 -xonstat.leaderboard_lifetime = 7 -xonstat.verify_requests = true +use = egg:XonStat +reload_templates = false +debug_authorization = false +debug_notfound = false +debug_routematch = false +debug_templates = false +default_locale_name = en +sqlalchemy.url = postgresql+psycopg2://xonstat:PASSWORD@localhost:5432/xonstatdb +mako.directories = xonstat:templates + +# Beaker cache settings +# Default is to use one region with hourly cache invalidation +cache.regions = hourly_term +cache.type = memory +cache.hourly_term.expire = 3600 + +# XonStat-specific settings. See development.ini for their descriptions. +xonstat.minimum_required_players = 2 +xonstat.leaderboard_lifetime = 7 +xonstat.verify_requests = true [filter:weberror] -use = egg:WebError#error_catcher +use = egg:WebError#error_catcher debug = false -;error_log = -;show_exceptions_in_wsgi_errors = true -;smtp_server = localhost -;error_email = janitor@example.com -;smtp_username = janitor -;smtp_password = "janitor's password" -;from_address = paste@localhost -;error_subject_prefix = "Pyramid Error" -;smtp_use_tls = -;error_message = - -[filter:tm] -use = egg:repoze.tm2#tm -commit_veto = repoze.tm:default_commit_veto [pipeline:main] pipeline = - weberror - tm XonStat [server:main] -use = egg:Paste#http -host = 0.0.0.0 -port = 6543 +# Gunicorn settings. See http://docs.gunicorn.org/en/19.3/configure.html. +use = egg:gunicorn#main +user = xonstat +group = xonstat +proc_name = xonstat +daemon = True +bind = 0.0.0.0:6543 +workers = 4 +max_requests = 5000 +timeout = 30 +graceful_timeout = 30 +pidfile = /tmp/xonstat.pid +loglevel = INFO +accesslog = ~/xonstat/xonstat_access.log +errorlog = ~/xonstat/xonstat.log # Begin logging configuration @@ -55,27 +57,30 @@ keys = console keys = generic [logger_root] -level = WARN -handlers = console +level = WARN +handlers = console, error_file [logger_xonstat] -level = WARN +level = WARN handlers = qualname = xonstat [logger_sqlalchemy] +# INFO logs SQL queries, DEBUG logs queries and results, and WARN logs neither 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 +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[handler_error_file] +class = logging.handlers.RotatingFileHandler formatter = generic +args = ('~/xonstat/xonstat.log', 'a', 50000000, 5) [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s