Changeset - b4dd4c16c12d
[Not reviewed]
stable
1 6 1
Brandon Jones - 9 years ago 2016-12-21 15:56:09
bjones14@gmail.com
middleware: replace references to Errormator with AppEnlight.

Errormator has been rebranded as AppEnlight a while back.

Errormator is no longer available. This is just a trivial rename that can't
make things worse.
7 files changed with 82 insertions and 82 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -342,149 +342,149 @@ beaker.cache.short_term.type = memory
 
beaker.cache.short_term.expire = 60
 
beaker.cache.short_term.key_length = 256
 

	
 
beaker.cache.long_term.type = memory
 
beaker.cache.long_term.expire = 36000
 
beaker.cache.long_term.key_length = 256
 

	
 
beaker.cache.sql_cache_short.type = memory
 
beaker.cache.sql_cache_short.expire = 10
 
beaker.cache.sql_cache_short.key_length = 256
 

	
 
####################################
 
###       BEAKER SESSION        ####
 
####################################
 

	
 
## Name of session cookie. Should be unique for a given host and path, even when running
 
## on different ports. Otherwise, cookie sessions will be shared and messed up.
 
beaker.session.key = kallithea
 
## Sessions should always only be accessible by the browser, not directly by JavaScript.
 
beaker.session.httponly = true
 
## Session lifetime. 2592000 seconds is 30 days.
 
beaker.session.timeout = 2592000
 

	
 
## Server secret used with HMAC to ensure integrity of cookies.
 
beaker.session.secret = development-not-secret
 
## Further, encrypt the data with AES.
 
#beaker.session.encrypt_key = <key_for_encryption>
 
#beaker.session.validate_key = <validation_key>
 

	
 
## Type of storage used for the session, current types are
 
## dbm, file, memcached, database, and memory.
 

	
 
## File system storage of session data. (default)
 
#beaker.session.type = file
 

	
 
## Cookie only, store all session data inside the cookie. Requires secure secrets.
 
#beaker.session.type = cookie
 

	
 
## Database storage of session data.
 
#beaker.session.type = ext:database
 
#beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea
 
#beaker.session.table_name = db_session
 

	
 
############################
 
## ERROR HANDLING SYSTEMS ##
 
############################
 

	
 
####################
 
### [errormator] ###
 
### [appenlight] ###
 
####################
 

	
 
## Errormator is tailored to work with Kallithea, see
 
## http://errormator.com for details how to obtain an account
 
## you must install python package `errormator_client` to make it work
 
## AppEnlight is tailored to work with Kallithea, see
 
## http://appenlight.com for details how to obtain an account
 
## you must install python package `appenlight_client` to make it work
 

	
 
## errormator enabled
 
errormator = false
 
## appenlight enabled
 
appenlight = false
 

	
 
errormator.server_url = https://api.errormator.com
 
errormator.api_key = YOUR_API_KEY
 
appenlight.server_url = https://api.appenlight.com
 
appenlight.api_key = YOUR_API_KEY
 

	
 
## TWEAK AMOUNT OF INFO SENT HERE
 

	
 
## enables 404 error logging (default False)
 
errormator.report_404 = false
 
appenlight.report_404 = false
 

	
 
## time in seconds after request is considered being slow (default 1)
 
errormator.slow_request_time = 1
 
appenlight.slow_request_time = 1
 

	
 
## record slow requests in application
 
## (needs to be enabled for slow datastore recording and time tracking)
 
errormator.slow_requests = true
 
appenlight.slow_requests = true
 

	
 
## enable hooking to application loggers
 
#errormator.logging = true
 
#appenlight.logging = true
 

	
 
## minimum log level for log capture
 
#errormator.logging.level = WARNING
 
#appenlight.logging.level = WARNING
 

	
 
## send logs only from erroneous/slow requests
 
## (saves API quota for intensive logging)
 
errormator.logging_on_error = false
 
appenlight.logging_on_error = false
 

	
 
## list of additonal keywords that should be grabbed from environ object
 
## can be string with comma separated list of words in lowercase
 
## (by default client will always send following info:
 
## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
 
## start with HTTP* this list be extended with additional keywords here
 
errormator.environ_keys_whitelist =
 
appenlight.environ_keys_whitelist =
 

	
 
## list of keywords that should be blanked from request object
 
## can be string with comma separated list of words in lowercase
 
## (by default client will always blank keys that contain following words
 
## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
 
## this list be extended with additional keywords set here
 
errormator.request_keys_blacklist =
 
appenlight.request_keys_blacklist =
 

	
 
## list of namespaces that should be ignores when gathering log entries
 
## can be string with comma separated list of namespaces
 
## (by default the client ignores own entries: errormator_client.client)
 
errormator.log_namespace_blacklist =
 
## (by default the client ignores own entries: appenlight_client.client)
 
appenlight.log_namespace_blacklist =
 

	
 
################
 
### [sentry] ###
 
################
 

	
 
## sentry is a alternative open source error aggregator
 
## you must install python packages `sentry` and `raven` to enable
 

	
 
sentry.dsn = YOUR_DNS
 
sentry.servers =
 
sentry.name =
 
sentry.key =
 
sentry.public_key =
 
sentry.secret_key =
 
sentry.project =
 
sentry.site =
 
sentry.include_paths =
 
sentry.exclude_paths =
 

	
 
################################################################################
 
## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*  ##
 
## Debug mode will enable the interactive debugging tool, allowing ANYONE to  ##
 
## execute malicious code after an exception is raised.                       ##
 
################################################################################
 
#set debug = false
 
set debug = true
 

	
 
##################################
 
###       LOGVIEW CONFIG       ###
 
##################################
 

	
 
logview.sqlalchemy = #faa
 
logview.pylons.templating = #bfb
 
logview.pylons.util = #eee
 

	
 
#########################################################
 
### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG    ###
 
#########################################################
 

	
 
# SQLITE [default]
 
sqlalchemy.db1.url = sqlite:///%(here)s/kallithea.db?timeout=60
 

	
 
# POSTGRESQL
 
#sqlalchemy.db1.url = postgresql://user:pass@localhost/kallithea
 

	
 
# MySQL
 
#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea
 

	
kallithea/bin/template.ini.mako
Show inline comments
 
@@ -335,155 +335,155 @@ beaker.cache.data_dir = ${here}/data/cac
 
beaker.cache.lock_dir = ${here}/data/cache/lock
 

	
 
beaker.cache.regions = short_term,long_term,sql_cache_short
 

	
 
beaker.cache.short_term.type = memory
 
beaker.cache.short_term.expire = 60
 
beaker.cache.short_term.key_length = 256
 

	
 
beaker.cache.long_term.type = memory
 
beaker.cache.long_term.expire = 36000
 
beaker.cache.long_term.key_length = 256
 

	
 
beaker.cache.sql_cache_short.type = memory
 
beaker.cache.sql_cache_short.expire = 10
 
beaker.cache.sql_cache_short.key_length = 256
 

	
 
<%text>####################################</%text>
 
<%text>###       BEAKER SESSION        ####</%text>
 
<%text>####################################</%text>
 

	
 
<%text>## Name of session cookie. Should be unique for a given host and path, even when running</%text>
 
<%text>## on different ports. Otherwise, cookie sessions will be shared and messed up.</%text>
 
beaker.session.key = kallithea
 
<%text>## Sessions should always only be accessible by the browser, not directly by JavaScript.</%text>
 
beaker.session.httponly = true
 
<%text>## Session lifetime. 2592000 seconds is 30 days.</%text>
 
beaker.session.timeout = 2592000
 

	
 
<%text>## Server secret used with HMAC to ensure integrity of cookies.</%text>
 
beaker.session.secret = ${uuid()}
 
<%text>## Further, encrypt the data with AES.</%text>
 
#beaker.session.encrypt_key = <key_for_encryption>
 
#beaker.session.validate_key = <validation_key>
 

	
 
<%text>## Type of storage used for the session, current types are</%text>
 
<%text>## dbm, file, memcached, database, and memory.</%text>
 

	
 
<%text>## File system storage of session data. (default)</%text>
 
#beaker.session.type = file
 

	
 
<%text>## Cookie only, store all session data inside the cookie. Requires secure secrets.</%text>
 
#beaker.session.type = cookie
 

	
 
<%text>## Database storage of session data.</%text>
 
#beaker.session.type = ext:database
 
#beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea
 
#beaker.session.table_name = db_session
 

	
 
%if error_aggregation_service == 'errormator':
 
%if error_aggregation_service == 'appenlight':
 
<%text>############################</%text>
 
<%text>## ERROR HANDLING SYSTEMS ##</%text>
 
<%text>############################</%text>
 

	
 
<%text>####################</%text>
 
<%text>### [errormator] ###</%text>
 
<%text>### [appenlight] ###</%text>
 
<%text>####################</%text>
 

	
 
<%text>## Errormator is tailored to work with Kallithea, see</%text>
 
<%text>## http://errormator.com for details how to obtain an account</%text>
 
<%text>## you must install python package `errormator_client` to make it work</%text>
 
<%text>## AppEnlight is tailored to work with Kallithea, see</%text>
 
<%text>## http://appenlight.com for details how to obtain an account</%text>
 
<%text>## you must install python package `appenlight_client` to make it work</%text>
 

	
 
<%text>## errormator enabled</%text>
 
errormator = false
 
<%text>## appenlight enabled</%text>
 
appenlight = false
 

	
 
errormator.server_url = https://api.errormator.com
 
errormator.api_key = YOUR_API_KEY
 
appenlight.server_url = https://api.appenlight.com
 
appenlight.api_key = YOUR_API_KEY
 

	
 
<%text>## TWEAK AMOUNT OF INFO SENT HERE</%text>
 

	
 
<%text>## enables 404 error logging (default False)</%text>
 
errormator.report_404 = false
 
appenlight.report_404 = false
 

	
 
<%text>## time in seconds after request is considered being slow (default 1)</%text>
 
errormator.slow_request_time = 1
 
appenlight.slow_request_time = 1
 

	
 
<%text>## record slow requests in application</%text>
 
<%text>## (needs to be enabled for slow datastore recording and time tracking)</%text>
 
errormator.slow_requests = true
 
appenlight.slow_requests = true
 

	
 
<%text>## enable hooking to application loggers</%text>
 
#errormator.logging = true
 
#appenlight.logging = true
 

	
 
<%text>## minimum log level for log capture</%text>
 
#errormator.logging.level = WARNING
 
#appenlight.logging.level = WARNING
 

	
 
<%text>## send logs only from erroneous/slow requests</%text>
 
<%text>## (saves API quota for intensive logging)</%text>
 
errormator.logging_on_error = false
 
appenlight.logging_on_error = false
 

	
 
<%text>## list of additonal keywords that should be grabbed from environ object</%text>
 
<%text>## can be string with comma separated list of words in lowercase</%text>
 
<%text>## (by default client will always send following info:</%text>
 
<%text>## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that</%text>
 
<%text>## start with HTTP* this list be extended with additional keywords here</%text>
 
errormator.environ_keys_whitelist =
 
appenlight.environ_keys_whitelist =
 

	
 
<%text>## list of keywords that should be blanked from request object</%text>
 
<%text>## can be string with comma separated list of words in lowercase</%text>
 
<%text>## (by default client will always blank keys that contain following words</%text>
 
<%text>## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'</%text>
 
<%text>## this list be extended with additional keywords set here</%text>
 
errormator.request_keys_blacklist =
 
appenlight.request_keys_blacklist =
 

	
 
<%text>## list of namespaces that should be ignores when gathering log entries</%text>
 
<%text>## can be string with comma separated list of namespaces</%text>
 
<%text>## (by default the client ignores own entries: errormator_client.client)</%text>
 
errormator.log_namespace_blacklist =
 
<%text>## (by default the client ignores own entries: appenlight_client.client)</%text>
 
appenlight.log_namespace_blacklist =
 

	
 
%elif error_aggregation_service == 'sentry':
 
<%text>################</%text>
 
<%text>### [sentry] ###</%text>
 
<%text>################</%text>
 

	
 
<%text>## sentry is a alternative open source error aggregator</%text>
 
<%text>## you must install python packages `sentry` and `raven` to enable</%text>
 

	
 
sentry.dsn = YOUR_DNS
 
sentry.servers =
 
sentry.name =
 
sentry.key =
 
sentry.public_key =
 
sentry.secret_key =
 
sentry.project =
 
sentry.site =
 
sentry.include_paths =
 
sentry.exclude_paths =
 

	
 
%endif
 
<%text>################################################################################</%text>
 
<%text>## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*  ##</%text>
 
<%text>## Debug mode will enable the interactive debugging tool, allowing ANYONE to  ##</%text>
 
<%text>## execute malicious code after an exception is raised.                       ##</%text>
 
<%text>################################################################################</%text>
 
set debug = false
 

	
 
<%text>##################################</%text>
 
<%text>###       LOGVIEW CONFIG       ###</%text>
 
<%text>##################################</%text>
 

	
 
logview.sqlalchemy = #faa
 
logview.pylons.templating = #bfb
 
logview.pylons.util = #eee
 

	
 
<%text>#########################################################</%text>
 
<%text>### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG    ###</%text>
 
<%text>#########################################################</%text>
 

	
 
%if database_engine == 'sqlite':
 
# SQLITE [default]
 
sqlalchemy.db1.url = sqlite:///${here}/kallithea.db?timeout=60
 

	
 
%elif database_engine == 'postgres':
 
# POSTGRESQL
 
sqlalchemy.db1.url = postgresql://user:pass@localhost/kallithea
 

	
kallithea/config/deployment.ini_tmpl
Show inline comments
 
@@ -336,149 +336,149 @@ beaker.cache.short_term.type = memory
 
beaker.cache.short_term.expire = 60
 
beaker.cache.short_term.key_length = 256
 

	
 
beaker.cache.long_term.type = memory
 
beaker.cache.long_term.expire = 36000
 
beaker.cache.long_term.key_length = 256
 

	
 
beaker.cache.sql_cache_short.type = memory
 
beaker.cache.sql_cache_short.expire = 10
 
beaker.cache.sql_cache_short.key_length = 256
 

	
 
####################################
 
###       BEAKER SESSION        ####
 
####################################
 

	
 
## Name of session cookie. Should be unique for a given host and path, even when running
 
## on different ports. Otherwise, cookie sessions will be shared and messed up.
 
beaker.session.key = kallithea
 
## Sessions should always only be accessible by the browser, not directly by JavaScript.
 
beaker.session.httponly = true
 
## Session lifetime. 2592000 seconds is 30 days.
 
beaker.session.timeout = 2592000
 

	
 
## Server secret used with HMAC to ensure integrity of cookies.
 
beaker.session.secret = ${app_instance_uuid}
 
## Further, encrypt the data with AES.
 
#beaker.session.encrypt_key = <key_for_encryption>
 
#beaker.session.validate_key = <validation_key>
 

	
 
## Type of storage used for the session, current types are
 
## dbm, file, memcached, database, and memory.
 

	
 
## File system storage of session data. (default)
 
#beaker.session.type = file
 

	
 
## Cookie only, store all session data inside the cookie. Requires secure secrets.
 
#beaker.session.type = cookie
 

	
 
## Database storage of session data.
 
#beaker.session.type = ext:database
 
#beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea
 
#beaker.session.table_name = db_session
 

	
 
############################
 
## ERROR HANDLING SYSTEMS ##
 
############################
 

	
 
####################
 
### [errormator] ###
 
### [appenlight] ###
 
####################
 

	
 
## Errormator is tailored to work with Kallithea, see
 
## http://errormator.com for details how to obtain an account
 
## you must install python package `errormator_client` to make it work
 
## AppEnlight is tailored to work with Kallithea, see
 
## http://appenlight.com for details how to obtain an account
 
## you must install python package `appenlight_client` to make it work
 

	
 
## errormator enabled
 
errormator = false
 
## appenlight enabled
 
appenlight = false
 

	
 
errormator.server_url = https://api.errormator.com
 
errormator.api_key = YOUR_API_KEY
 
appenlight.server_url = https://api.appenlight.com
 
appenlight.api_key = YOUR_API_KEY
 

	
 
## TWEAK AMOUNT OF INFO SENT HERE
 

	
 
## enables 404 error logging (default False)
 
errormator.report_404 = false
 
appenlight.report_404 = false
 

	
 
## time in seconds after request is considered being slow (default 1)
 
errormator.slow_request_time = 1
 
appenlight.slow_request_time = 1
 

	
 
## record slow requests in application
 
## (needs to be enabled for slow datastore recording and time tracking)
 
errormator.slow_requests = true
 
appenlight.slow_requests = true
 

	
 
## enable hooking to application loggers
 
#errormator.logging = true
 
#appenlight.logging = true
 

	
 
## minimum log level for log capture
 
#errormator.logging.level = WARNING
 
#appenlight.logging.level = WARNING
 

	
 
## send logs only from erroneous/slow requests
 
## (saves API quota for intensive logging)
 
errormator.logging_on_error = false
 
appenlight.logging_on_error = false
 

	
 
## list of additonal keywords that should be grabbed from environ object
 
## can be string with comma separated list of words in lowercase
 
## (by default client will always send following info:
 
## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
 
## start with HTTP* this list be extended with additional keywords here
 
errormator.environ_keys_whitelist =
 
appenlight.environ_keys_whitelist =
 

	
 
## list of keywords that should be blanked from request object
 
## can be string with comma separated list of words in lowercase
 
## (by default client will always blank keys that contain following words
 
## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
 
## this list be extended with additional keywords set here
 
errormator.request_keys_blacklist =
 
appenlight.request_keys_blacklist =
 

	
 
## list of namespaces that should be ignores when gathering log entries
 
## can be string with comma separated list of namespaces
 
## (by default the client ignores own entries: errormator_client.client)
 
errormator.log_namespace_blacklist =
 
## (by default the client ignores own entries: appenlight_client.client)
 
appenlight.log_namespace_blacklist =
 

	
 
################
 
### [sentry] ###
 
################
 

	
 
## sentry is a alternative open source error aggregator
 
## you must install python packages `sentry` and `raven` to enable
 

	
 
sentry.dsn = YOUR_DNS
 
sentry.servers =
 
sentry.name =
 
sentry.key =
 
sentry.public_key =
 
sentry.secret_key =
 
sentry.project =
 
sentry.site =
 
sentry.include_paths =
 
sentry.exclude_paths =
 

	
 
################################################################################
 
## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*  ##
 
## Debug mode will enable the interactive debugging tool, allowing ANYONE to  ##
 
## execute malicious code after an exception is raised.                       ##
 
################################################################################
 
set debug = false
 

	
 
##################################
 
###       LOGVIEW CONFIG       ###
 
##################################
 

	
 
logview.sqlalchemy = #faa
 
logview.pylons.templating = #bfb
 
logview.pylons.util = #eee
 

	
 
#########################################################
 
### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG    ###
 
#########################################################
 

	
 
# SQLITE [default]
 
sqlalchemy.db1.url = sqlite:///%(here)s/kallithea.db?timeout=60
 

	
 
# POSTGRESQL
 
#sqlalchemy.db1.url = postgresql://user:pass@localhost/kallithea
 

	
 
# MySQL
 
#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea
 

	
 
# see sqlalchemy docs for others
kallithea/config/middleware.py
Show inline comments
 
@@ -25,88 +25,88 @@ from paste.gzipper import make_gzip_midd
 
from pylons.middleware import ErrorHandler, StatusCodeRedirect
 
from pylons.wsgiapp import PylonsApp
 

	
 
from kallithea.lib.middleware.simplehg import SimpleHg
 
from kallithea.lib.middleware.simplegit import SimpleGit
 
from kallithea.lib.middleware.https_fixup import HttpsFixup
 
from kallithea.lib.middleware.sessionmiddleware import SecureSessionMiddleware
 
from kallithea.config.environment import load_environment
 
from kallithea.lib.middleware.wrapper import RequestWrapper
 

	
 

	
 
def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
 
    """Create a Pylons WSGI application and return it
 

	
 
    ``global_conf``
 
        The inherited configuration for this application. Normally from
 
        the [DEFAULT] section of the Paste ini file.
 

	
 
    ``full_stack``
 
        Whether or not this application provides a full WSGI stack (by
 
        default, meaning it handles its own exceptions and errors).
 
        Disable full_stack when this application is "managed" by
 
        another WSGI middleware.
 

	
 
    ``app_conf``
 
        The application's local configuration. Normally specified in
 
        the [app:<name>] section of the Paste ini file (where <name>
 
        defaults to main).
 

	
 
    """
 
    # Configure the Pylons environment
 
    config = load_environment(global_conf, app_conf)
 

	
 
    # The Pylons WSGI app
 
    app = PylonsApp(config=config)
 

	
 
    # Routing/Session/Cache Middleware
 
    app = RoutesMiddleware(app, config['routes.map'])
 
    app = SecureSessionMiddleware(app, config)
 

	
 
    # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
 
    if asbool(config['pdebug']):
 
        from kallithea.lib.profiler import ProfilingMiddleware
 
        app = ProfilingMiddleware(app)
 

	
 
    if asbool(full_stack):
 

	
 
        from kallithea.lib.middleware.sentry import Sentry
 
        from kallithea.lib.middleware.errormator import Errormator
 
        if Errormator and asbool(config['app_conf'].get('errormator')):
 
            app = Errormator(app, config)
 
        from kallithea.lib.middleware.appenlight import AppEnlight
 
        if AppEnlight and asbool(config['app_conf'].get('appenlight')):
 
            app = AppEnlight(app, config)
 
        elif Sentry:
 
            app = Sentry(app, config)
 

	
 
        # Handle Python exceptions
 
        app = ErrorHandler(app, global_conf, **config['pylons.errorware'])
 

	
 
        # Display error documents for 401, 403, 404 status codes (and
 
        # 500 when debug is disabled)
 
        # Note: will buffer the output in memory!
 
        if asbool(config['debug']):
 
            app = StatusCodeRedirect(app)
 
        else:
 
            app = StatusCodeRedirect(app, [400, 401, 403, 404, 500])
 

	
 
        # we want our low level middleware to get to the request ASAP. We don't
 
        # need any pylons stack middleware in them - especially no StatusCodeRedirect buffering
 
        app = SimpleHg(app, config)
 
        app = SimpleGit(app, config)
 

	
 
        # Enable https redirects based on HTTP_X_URL_SCHEME set by proxy
 
        if any(asbool(config.get(x)) for x in ['https_fixup', 'force_https', 'use_htsts']):
 
            app = HttpsFixup(app, config)
 

	
 
        app = RequestWrapper(app, config) # logging
 

	
 
    # Establish the Registry for this application
 
    app = RegistryManager(app) # thread / request-local module globals / variables
 

	
 
    if asbool(static_files):
 
        # Serve static files
 
        static_app = StaticURLParser(config['pylons.paths']['static_files'])
 
        app = Cascade([static_app, app])
 
        app = make_gzip_middleware(app, global_conf, compress_level=1)
 

	
 
    app.config = config
 

	
 
    return app
kallithea/lib/middleware/appenlight.py
Show inline comments
 
file renamed from kallithea/lib/middleware/errormator.py to kallithea/lib/middleware/appenlight.py
 
# -*- coding: utf-8 -*-
 
# This program is free software: you can redistribute it and/or modify
 
# it under the terms of the GNU General Public License as published by
 
# the Free Software Foundation, either version 3 of the License, or
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
"""
 
kallithea.lib.middleware.errormator
 
kallithea.lib.middleware.appenlight
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
middleware to handle errormator publishing of errors
 
middleware to handle appenlight publishing of errors
 

	
 
This file was forked by the Kallithea project in July 2014.
 
Original author and date, and relevant copyright and licensing information is below:
 
:created_on: October 18, 2012
 
:author: marcink
 
:copyright: (c) 2013 RhodeCode GmbH, and others.
 
:license: GPLv3, see LICENSE.md for more details.
 
"""
 

	
 

	
 
try:
 
    from errormator_client import make_errormator_middleware
 
    from appenlight_client import make_appenlight_middleware
 
except ImportError:
 
    Errormator = None
 
    AppEnlight = None
 
else:
 
    Errormator = make_errormator_middleware
 
    AppEnlight = make_appenlight_middleware
kallithea/tests/test.ini
Show inline comments
 
@@ -342,149 +342,149 @@ beaker.cache.short_term.type = memory
 
beaker.cache.short_term.expire = 60
 
beaker.cache.short_term.key_length = 256
 

	
 
beaker.cache.long_term.type = memory
 
beaker.cache.long_term.expire = 36000
 
beaker.cache.long_term.key_length = 256
 

	
 
beaker.cache.sql_cache_short.type = memory
 
beaker.cache.sql_cache_short.expire = 1
 
beaker.cache.sql_cache_short.key_length = 256
 

	
 
####################################
 
###       BEAKER SESSION        ####
 
####################################
 

	
 
## Name of session cookie. Should be unique for a given host and path, even when running
 
## on different ports. Otherwise, cookie sessions will be shared and messed up.
 
beaker.session.key = kallithea
 
## Sessions should always only be accessible by the browser, not directly by JavaScript.
 
beaker.session.httponly = true
 
## Session lifetime. 2592000 seconds is 30 days.
 
beaker.session.timeout = 2592000
 

	
 
## Server secret used with HMAC to ensure integrity of cookies.
 
beaker.session.secret = {74e0cd75-b339-478b-b129-07dd221def1f}
 
## Further, encrypt the data with AES.
 
#beaker.session.encrypt_key = <key_for_encryption>
 
#beaker.session.validate_key = <validation_key>
 

	
 
## Type of storage used for the session, current types are
 
## dbm, file, memcached, database, and memory.
 

	
 
## File system storage of session data. (default)
 
#beaker.session.type = file
 

	
 
## Cookie only, store all session data inside the cookie. Requires secure secrets.
 
#beaker.session.type = cookie
 

	
 
## Database storage of session data.
 
#beaker.session.type = ext:database
 
#beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea
 
#beaker.session.table_name = db_session
 

	
 
############################
 
## ERROR HANDLING SYSTEMS ##
 
############################
 

	
 
####################
 
### [errormator] ###
 
### [appenlight] ###
 
####################
 

	
 
## Errormator is tailored to work with Kallithea, see
 
## http://errormator.com for details how to obtain an account
 
## you must install python package `errormator_client` to make it work
 
## AppEnlight is tailored to work with Kallithea, see
 
## http://appenlight.com for details how to obtain an account
 
## you must install python package `appenlight_client` to make it work
 

	
 
## errormator enabled
 
errormator = false
 
## appenlight enabled
 
appenlight = false
 

	
 
errormator.server_url = https://api.errormator.com
 
errormator.api_key = YOUR_API_KEY
 
appenlight.server_url = https://api.appenlight.com
 
appenlight.api_key = YOUR_API_KEY
 

	
 
## TWEAK AMOUNT OF INFO SENT HERE
 

	
 
## enables 404 error logging (default False)
 
errormator.report_404 = false
 
appenlight.report_404 = false
 

	
 
## time in seconds after request is considered being slow (default 1)
 
errormator.slow_request_time = 1
 
appenlight.slow_request_time = 1
 

	
 
## record slow requests in application
 
## (needs to be enabled for slow datastore recording and time tracking)
 
errormator.slow_requests = true
 
appenlight.slow_requests = true
 

	
 
## enable hooking to application loggers
 
#errormator.logging = true
 
#appenlight.logging = true
 

	
 
## minimum log level for log capture
 
#errormator.logging.level = WARNING
 
#appenlight.logging.level = WARNING
 

	
 
## send logs only from erroneous/slow requests
 
## (saves API quota for intensive logging)
 
errormator.logging_on_error = false
 
appenlight.logging_on_error = false
 

	
 
## list of additonal keywords that should be grabbed from environ object
 
## can be string with comma separated list of words in lowercase
 
## (by default client will always send following info:
 
## 'REMOTE_USER', 'REMOTE_ADDR', 'SERVER_NAME', 'CONTENT_TYPE' + all keys that
 
## start with HTTP* this list be extended with additional keywords here
 
errormator.environ_keys_whitelist =
 
appenlight.environ_keys_whitelist =
 

	
 
## list of keywords that should be blanked from request object
 
## can be string with comma separated list of words in lowercase
 
## (by default client will always blank keys that contain following words
 
## 'password', 'passwd', 'pwd', 'auth_tkt', 'secret', 'csrf'
 
## this list be extended with additional keywords set here
 
errormator.request_keys_blacklist =
 
appenlight.request_keys_blacklist =
 

	
 
## list of namespaces that should be ignores when gathering log entries
 
## can be string with comma separated list of namespaces
 
## (by default the client ignores own entries: errormator_client.client)
 
errormator.log_namespace_blacklist =
 
## (by default the client ignores own entries: appenlight_client.client)
 
appenlight.log_namespace_blacklist =
 

	
 
################
 
### [sentry] ###
 
################
 

	
 
## sentry is a alternative open source error aggregator
 
## you must install python packages `sentry` and `raven` to enable
 

	
 
sentry.dsn = YOUR_DNS
 
sentry.servers =
 
sentry.name =
 
sentry.key =
 
sentry.public_key =
 
sentry.secret_key =
 
sentry.project =
 
sentry.site =
 
sentry.include_paths =
 
sentry.exclude_paths =
 

	
 
################################################################################
 
## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*  ##
 
## Debug mode will enable the interactive debugging tool, allowing ANYONE to  ##
 
## execute malicious code after an exception is raised.                       ##
 
################################################################################
 
set debug = false
 

	
 
##################################
 
###       LOGVIEW CONFIG       ###
 
##################################
 

	
 
logview.sqlalchemy = #faa
 
logview.pylons.templating = #bfb
 
logview.pylons.util = #eee
 

	
 
#########################################################
 
### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG    ###
 
#########################################################
 

	
 
# SQLITE [default]
 
#sqlalchemy.db1.url = sqlite:///%(here)s/kallithea.db?timeout=60
 
sqlalchemy.db1.url = sqlite:///%(here)s/kallithea_test.sqlite
 

	
 
# POSTGRESQL
 
#sqlalchemy.db1.url = postgresql://user:pass@localhost/kallithea
 

	
 
# MySQL
 
#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea
 

	
scripts/manifest
Show inline comments
 
@@ -293,97 +293,97 @@ kallithea/lib/dbmigrate/schema/db_2_1_0.
 
kallithea/lib/dbmigrate/schema/db_2_2_0.py
 
kallithea/lib/dbmigrate/schema/db_2_2_3.py
 
kallithea/lib/dbmigrate/versions/
 
kallithea/lib/dbmigrate/versions/001_initial_release.py
 
kallithea/lib/dbmigrate/versions/002_version_1_1_0.py
 
kallithea/lib/dbmigrate/versions/003_version_1_2_0.py
 
kallithea/lib/dbmigrate/versions/004_version_1_3_0.py
 
kallithea/lib/dbmigrate/versions/005_version_1_3_0.py
 
kallithea/lib/dbmigrate/versions/006_version_1_4_0.py
 
kallithea/lib/dbmigrate/versions/007_version_1_4_0.py
 
kallithea/lib/dbmigrate/versions/008_version_1_5_0.py
 
kallithea/lib/dbmigrate/versions/009_version_1_5_1.py
 
kallithea/lib/dbmigrate/versions/010_version_1_5_2.py
 
kallithea/lib/dbmigrate/versions/011_version_1_6_0.py
 
kallithea/lib/dbmigrate/versions/012_version_1_7_0.py
 
kallithea/lib/dbmigrate/versions/013_version_1_7_0.py
 
kallithea/lib/dbmigrate/versions/014_version_1_7_1.py
 
kallithea/lib/dbmigrate/versions/015_version_1_8_0.py
 
kallithea/lib/dbmigrate/versions/016_version_2_0_0.py
 
kallithea/lib/dbmigrate/versions/017_version_2_0_0.py
 
kallithea/lib/dbmigrate/versions/018_version_2_0_0.py
 
kallithea/lib/dbmigrate/versions/019_version_2_0_0.py
 
kallithea/lib/dbmigrate/versions/020_version_2_0_1.py
 
kallithea/lib/dbmigrate/versions/021_version_2_0_2.py
 
kallithea/lib/dbmigrate/versions/022_version_2_0_2.py
 
kallithea/lib/dbmigrate/versions/023_version_2_1_0.py
 
kallithea/lib/dbmigrate/versions/024_version_2_1_0.py
 
kallithea/lib/dbmigrate/versions/025_version_2_1_0.py
 
kallithea/lib/dbmigrate/versions/026_version_2_2_0.py
 
kallithea/lib/dbmigrate/versions/027_version_2_2_0.py
 
kallithea/lib/dbmigrate/versions/028_version_2_2_3.py
 
kallithea/lib/dbmigrate/versions/029_version_2_2_3.py
 
kallithea/lib/dbmigrate/versions/030_version_2_2_3.py
 
kallithea/lib/dbmigrate/versions/031_version_2_2_3.py
 
kallithea/lib/dbmigrate/versions/__init__.py
 
kallithea/lib/diffs.py
 
kallithea/lib/exceptions.py
 
kallithea/lib/ext_json.py
 
kallithea/lib/graphmod.py
 
kallithea/lib/helpers.py
 
kallithea/lib/hooks.py
 
kallithea/lib/indexers/
 
kallithea/lib/indexers/__init__.py
 
kallithea/lib/indexers/daemon.py
 
kallithea/lib/ipaddr.py
 
kallithea/lib/markup_renderer.py
 
kallithea/lib/middleware/
 
kallithea/lib/middleware/__init__.py
 
kallithea/lib/middleware/errormator.py
 
kallithea/lib/middleware/appenlight.py
 
kallithea/lib/middleware/https_fixup.py
 
kallithea/lib/middleware/pygrack.py
 
kallithea/lib/middleware/sentry.py
 
kallithea/lib/middleware/sessionmiddleware.py
 
kallithea/lib/middleware/simplegit.py
 
kallithea/lib/middleware/simplehg.py
 
kallithea/lib/middleware/wrapper.py
 
kallithea/lib/paster_commands/
 
kallithea/lib/paster_commands/__init__.py
 
kallithea/lib/paster_commands/cache_keys.py
 
kallithea/lib/paster_commands/cleanup.py
 
kallithea/lib/paster_commands/install_iis.py
 
kallithea/lib/paster_commands/ishell.py
 
kallithea/lib/paster_commands/make_index.py
 
kallithea/lib/paster_commands/make_rcextensions.py
 
kallithea/lib/paster_commands/repo_scan.py
 
kallithea/lib/paster_commands/setup_db.py
 
kallithea/lib/paster_commands/update_repoinfo.py
 
kallithea/lib/pidlock.py
 
kallithea/lib/profiler.py
 
kallithea/lib/rcmail/
 
kallithea/lib/rcmail/__init__.py
 
kallithea/lib/rcmail/exceptions.py
 
kallithea/lib/rcmail/message.py
 
kallithea/lib/rcmail/response.py
 
kallithea/lib/rcmail/smtp_mailer.py
 
kallithea/lib/rcmail/utils.py
 
kallithea/lib/recaptcha.py
 
kallithea/lib/timerproxy.py
 
kallithea/lib/utils.py
 
kallithea/lib/utils2.py
 
kallithea/lib/vcs/
 
kallithea/lib/vcs/__init__.py
 
kallithea/lib/vcs/backends/
 
kallithea/lib/vcs/backends/__init__.py
 
kallithea/lib/vcs/backends/base.py
 
kallithea/lib/vcs/backends/git/
 
kallithea/lib/vcs/backends/git/__init__.py
 
kallithea/lib/vcs/backends/git/changeset.py
 
kallithea/lib/vcs/backends/git/inmemory.py
 
kallithea/lib/vcs/backends/git/repository.py
 
kallithea/lib/vcs/backends/git/workdir.py
 
kallithea/lib/vcs/backends/hg/
 
kallithea/lib/vcs/backends/hg/__init__.py
 
kallithea/lib/vcs/backends/hg/changeset.py
 
kallithea/lib/vcs/backends/hg/inmemory.py
 
kallithea/lib/vcs/backends/hg/repository.py
 
kallithea/lib/vcs/backends/hg/workdir.py
0 comments (0 inline, 0 general)