################################################################################
# Kallithea - Development config: #
# listening on *:5000 #
# sqlite and kallithea.db #
# initial_repo_scan = true #
# set debug = true #
# verbose and colorful logging #
# #
# The %(here)s variable will be replaced with the parent directory of this file#
[DEFAULT]
debug = true
pdebug = false
## Uncomment and replace with the address which should receive ##
## any error reports after application crash ##
## Additionally those settings will be used by Kallithea mailing system ##
#email_to = admin@localhost
#error_email_from = paste_error@localhost
#app_email_from = kallithea-noreply@localhost
#error_message =
#email_prefix = [Kallithea]
#smtp_server = mail.server.com
#smtp_username =
#smtp_password =
#smtp_port =
#smtp_use_tls = false
#smtp_use_ssl = true
## Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)
#smtp_auth =
[server:main]
## PASTE ##
#use = egg:Paste#http
## nr of worker threads to spawn
#threadpool_workers = 5
## max request before thread respawn
#threadpool_max_requests = 10
## option to use threads of process
#use_threadpool = true
## WAITRESS ##
use = egg:waitress#main
## number of worker threads
threads = 5
## MAX BODY SIZE 100GB
max_request_body_size = 107374182400
## use poll instead of select, fixes fd limits, may not work on old
## windows systems.
#asyncore_use_poll = True
## GUNICORN ##
#use = egg:gunicorn#main
## number of process workers. You must set `instance_id = *` when this option
## is set to more than one worker
#workers = 1
## process name
#proc_name = kallithea
## type of worker class, one of sync, eventlet, gevent, tornado
## recommended for bigger setup is using of of other than sync one
#worker_class = sync
#max_requests = 1000
## ammount of time a worker can handle request before it gets killed and
## restarted
#timeout = 3600
## UWSGI ##
## run with uwsgi --ini-paste-logged <inifile.ini>
#[uwsgi]
#socket = /tmp/uwsgi.sock
#master = true
#http = 127.0.0.1:5000
## set as deamon and redirect all output to file
#daemonize = ./uwsgi_kallithea.log
## master process PID
#pidfile = ./uwsgi_kallithea.pid
## stats server with workers statistics, use uwsgitop
## for monitoring, `uwsgitop 127.0.0.1:1717`
#stats = 127.0.0.1:1717
#memory-report = true
## log 5XX errors
#log-5xx = true
## Set the socket listen queue size.
#listen = 256
## Gracefully Reload workers after the specified amount of managed requests
## (avoid memory leaks).
#max-requests = 1000
## enable large buffers
#buffer-size=65535
## socket and http timeouts ##
#http-timeout=3600
#socket-timeout=3600
## Log requests slower than the specified number of milliseconds.
#log-slow = 10
## Exit if no app can be loaded.
#need-app = true
## Set lazy mode (load apps in workers instead of master).
#lazy = true
## scaling ##
## set cheaper algorithm to use, if not set default will be used
#cheaper-algo = spare
## minimum number of workers to keep at all times
#cheaper = 1
## number of workers to spawn at startup
#cheaper-initial = 1
## maximum number of workers that can be spawned
#workers = 4
## how many workers should be spawned at a time
#cheaper-step = 1
## COMMON ##
host = 0.0.0.0
port = 5000
## prefix middleware for rc
#[filter:proxy-prefix]
#use = egg:PasteDeploy#prefix
#prefix = /<your-prefix>
[app:main]
use = egg:kallithea
## enable proxy prefix middleware
#filter-with = proxy-prefix
full_stack = true
static_files = true
## Available Languages:
## de en fr ja pl pt_BR ru zh_CN zh_TW
lang = en
cache_dir = %(here)s/data
index_dir = %(here)s/data/index
## perform a full repository scan on each server start, this should be
## set to false after first startup, to allow faster server restarts.
#initial_repo_scan = false
initial_repo_scan = true
## uncomment and set this path to use archive download cache
archive_cache_dir = %(here)s/tarballcache
## change this to unique ID for security
app_instance_uuid = development-not-secret
## cut off limit for large diffs (size in bytes)
cut_off_limit = 256000
## use cache version of scm repo everywhere
vcs_full_cache = true
## force https in Kallithea, fixes https redirects, assumes it's always https
force_https = false
## use Strict-Transport-Security headers
use_htsts = false
## number of commits stats will parse on each iteration
commit_parse_limit = 25
## use gravatar service to display avatars
use_gravatar = true
## path to git executable
git_path = git
## git rev filter option, --all is the default filter, if you need to
## hide all refs in changelog switch this to --branches --tags
#git_rev_filter = --branches --tags
## RSS feed options
rss_cut_off_limit = 256000
rss_items_per_page = 10
rss_include_diff = false
## options for showing and identifying changesets
show_sha_length = 12
show_revision_number = true
## gist URL alias, used to create nicer urls for gist. This should be an
## url that does rewrites to _admin/gists/<gistid>.
## example: http://gist.kallithea.server/{gistid}. Empty means use the internal
## Kallithea url, ie. http[s]://your.kallithea.server/_admin/gists/<gistid>
gist_alias_url =
## white list of API enabled controllers. This allows to add list of
## controllers to which access will be enabled by api_key. eg: to enable
## api access to raw_files put `FilesController:raw`, to enable access to patches
## add `ChangesetController:changeset_patch`. This list should be "," separated
## Syntax is <ControllerClass>:<function>. Check debug logs for generated names
## Recommended settings below are commented out:
api_access_controllers_whitelist =
# ChangesetController:changeset_patch,
# ChangesetController:changeset_raw,
# FilesController:raw,
# FilesController:archivefile
## alternative_gravatar_url allows you to use your own avatar server application
## the following parts of the URL will be replaced
## {email} user email
## {md5email} md5 hash of the user email (like at gravatar.com)
## {size} size of the image that is expected from the server application
## {scheme} http/https from Kallithea server
## {netloc} network location from Kallithea server
#alternative_gravatar_url = http://myavatarserver.com/getbyemail/{email}/{size}
#alternative_gravatar_url = http://myavatarserver.com/getbymd5/{md5email}?s={size}
## container auth options
container_auth_enabled = false
proxypass_auth_enabled = false
## default encoding used to convert from and to unicode
## can be also a comma seperated list of encoding in case of mixed encodings
default_encoding = utf8
## overwrite schema of clone url
## available vars:
## scheme - http/https
## user - current user
## pass - password
## netloc - network location
## path - usually repo_name
#clone_uri = {scheme}://{user}{pass}{netloc}{path}
## issue tracker for Kallithea (leave blank to disable, absent for default)
#bugtracker = https://bitbucket.org/conservancy/kallithea/issues
## issue tracking mapping for commits messages
## comment out issue_pat, issue_server, issue_prefix to enable
## pattern to get the issues from commit messages
## default one used here is #<numbers> with a regex passive group for `#`
## {id} will be all groups matched from this pattern
issue_pat = (?:\s*#)(\d+)
## server url to the issue, each {id} will be replaced with match
## fetched from the regex and {repo} is replaced with full repository name
## including groups {repo_name} is replaced with just name of repo
issue_server_link = https://myissueserver.com/{repo}/issue/{id}
## prefix to add to link to indicate it's an url
## #314 will be replaced by <issue_prefix><id>
issue_prefix = #
## issue_pat, issue_server_link, issue_prefix can have suffixes to specify
## multiple patterns, to other issues server, wiki or others
## below an example how to create a wiki pattern
# wiki-some-id -> https://mywiki.com/some-id
#issue_pat_wiki = (?:wiki-)(.+)
#issue_server_link_wiki = https://mywiki.com/{id}
#issue_prefix_wiki = WIKI-
## instance-id prefix
## a prefix key for this instance used for cache invalidation when running
## multiple instances of kallithea, make sure it's globally unique for
## all running kallithea instances. Leave empty if you don't use it
instance_id =
## alternative return HTTP header for failed authentication. Default HTTP
## response is 401 HTTPUnauthorized. Currently HG clients have troubles with
## handling that. Set this variable to 403 to return HTTPForbidden
auth_ret_code =
## locking return code. When repository is locked return this HTTP code. 2XX
## codes don't break the transactions while 4XX codes do
lock_ret_code = 423
## allows to change the repository location in settings page
allow_repo_location_change = True
## allows to setup custom hooks in settings page
allow_custom_hooks_settings = True
####################################
### CELERY CONFIG ####
use_celery = false
broker.host = localhost
broker.vhost = rabbitmqhost
broker.port = 5672
broker.user = rabbitmq
broker.password = qweqwe
celery.imports = kallithea.lib.celerylib.tasks
celery.result.backend = amqp
celery.result.dburi = amqp://
celery.result.serialier = json
#celery.send.task.error.emails = true
#celery.amqp.task.result.expires = 18000
celeryd.concurrency = 2
#celeryd.log.file = celeryd.log
celeryd.log.level = debug
celeryd.max.tasks.per.child = 1
## tasks will never be sent to the queue, but executed locally instead.
celery.always.eager = false
### BEAKER CACHE ####
beaker.cache.data_dir=%(here)s/data/cache/data
beaker.cache.lock_dir=%(here)s/data/cache/lock
beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
beaker.cache.super_short_term.type=memory
beaker.cache.super_short_term.expire=10
beaker.cache.super_short_term.key_length = 256
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.cache.sql_cache_med.type=memory
beaker.cache.sql_cache_med.expire=360
beaker.cache.sql_cache_med.key_length = 256
beaker.cache.sql_cache_long.type=file
beaker.cache.sql_cache_long.expire=3600
beaker.cache.sql_cache_long.key_length = 256
### BEAKER SESSION ####
## Type of storage used for the session, current types are
## dbm, file, memcached, database, and memory.
## The storage uses the Container API
## that is also used by the cache system.
## db session ##
#beaker.session.type = ext:database
#beaker.session.sa.url = postgresql://postgres:qwe@localhost/kallithea
#beaker.session.table_name = db_session
## encrypted cookie client side session, good for many instances ##
#beaker.session.type = cookie
## file based cookies (default) ##
#beaker.session.type = file
beaker.session.key = kallithea
beaker.session.secret = development-not-secret
## Secure encrypted cookie. Requires AES and AES python libraries
## you must disable beaker.session.secret to use this
#beaker.session.encrypt_key = <key_for_encryption>
#beaker.session.validate_key = <validation_key>
## sets session as invalid if it haven't been accessed for given amount of time
beaker.session.timeout = 2592000
beaker.session.httponly = true
#beaker.session.cookie_path = /<your-prefix>
## uncomment for https secure cookie
beaker.session.secure = false
## auto save the session to not to use .save()
beaker.session.auto = False
## default cookie expiration time in seconds `true` expire at browser close ##
#beaker.session.cookie_expires = 3600
############################
## ERROR HANDLING SYSTEMS ##
####################
### [errormator] ###
## 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
## errormator enabled
errormator = false
errormator.server_url = https://api.errormator.com
errormator.api_key = YOUR_API_KEY
## TWEAK AMOUNT OF INFO SENT HERE
## enables 404 error logging (default False)
errormator.report_404 = false
## time in seconds after request is considered being slow (default 1)
errormator.slow_request_time = 1
## record slow requests in application
## (needs to be enabled for slow datastore recording and time tracking)
errormator.slow_requests = true
## enable hooking to application loggers
# errormator.logging = true
## minimum log level for log capture
@@ -179,452 +179,444 @@ Here's a typical ldap setup::
Connection settings
Enable LDAP = checked
Host = host.example.org
Port = 389
Account = <account>
Password = <password>
Connection Security = LDAPS connection
Certificate Checks = DEMAND
Search settings
Base DN = CN=users,DC=host,DC=example,DC=org
LDAP Filter = (&(objectClass=user)(!(objectClass=computer)))
LDAP Search Scope = SUBTREE
Attribute mappings
Login Attribute = uid
First Name Attribute = firstName
Last Name Attribute = lastName
E-mail Attribute = mail
If your user groups are placed in a Organisation Unit (OU) structure the Search Settings configuration differs::
Base DN = DC=host,DC=example,DC=org
LDAP Filter = (&(memberOf=CN=your user group,OU=subunit,OU=unit,DC=host,DC=example,DC=org)(objectClass=user))
.. _enable_ldap:
Enable LDAP : required
Whether to use LDAP for authenticating users.
.. _ldap_host:
Host : required
LDAP server hostname or IP address. Can be also a comma separated
list of servers to support LDAP fail-over.
.. _Port:
Port : required
389 for un-encrypted LDAP, 636 for SSL-encrypted LDAP.
.. _ldap_account:
Account : optional
Only required if the LDAP server does not allow anonymous browsing of
records. This should be a special account for record browsing. This
will require `LDAP Password`_ below.
.. _LDAP Password:
Password : optional
records.
.. _Enable LDAPS:
Connection Security : required
Defines the connection to LDAP server
No encryption
Plain non encrypted connection
LDAPS connection
Enable ldaps connection. It will likely require `Port`_ to be set to
a different value (standard LDAPS port is 636). When LDAPS is enabled
then `Certificate Checks`_ is required.
START_TLS on LDAP connection
START TLS connection
.. _Certificate Checks:
Certificate Checks : optional
How SSL certificates verification is handled - this is only useful when
`Enable LDAPS`_ is enabled. Only DEMAND or HARD offer full SSL security
while the other options are susceptible to man-in-the-middle attacks. SSL
certificates can be installed to /etc/openldap/cacerts so that the
DEMAND or HARD options can be used with self-signed certificates or
certificates that do not have traceable certificates of authority.
NEVER
A serve certificate will never be requested or checked.
ALLOW
A server certificate is requested. Failure to provide a
certificate or providing a bad certificate will not terminate the
session.
TRY
certificate does not halt the session; providing a bad certificate
halts the session.
DEMAND
A server certificate is requested and must be provided and
authenticated for the session to proceed.
HARD
The same as DEMAND.
.. _Base DN:
Base DN : required
The Distinguished Name (DN) where searches for users will be performed.
Searches can be controlled by `LDAP Filter`_ and `LDAP Search Scope`_.
.. _LDAP Filter:
LDAP Filter : optional
A LDAP filter defined by RFC 2254. This is more useful when `LDAP
Search Scope`_ is set to SUBTREE. The filter is useful for limiting
which LDAP objects are identified as representing Users for
authentication. The filter is augmented by `Login Attribute`_ below.
This can commonly be left blank.
.. _LDAP Search Scope:
LDAP Search Scope : required
This limits how far LDAP will search for a matching object.
BASE
Only allows searching of `Base DN`_ and is usually not what you
want.
ONELEVEL
Searches all entries under `Base DN`_, but not Base DN itself.
SUBTREE
Searches all entries below `Base DN`_, but not Base DN itself.
When using SUBTREE `LDAP Filter`_ is useful to limit object
location.
.. _Login Attribute:
Login Attribute : required
The LDAP record attribute that will be matched as the USERNAME or
ACCOUNT used to connect to Kallithea. This will be added to `LDAP
Filter`_ for locating the User object. If `LDAP Filter`_ is specified as
"LDAPFILTER", `Login Attribute`_ is specified as "uid" and the user has
connected as "jsmith" then the `LDAP Filter`_ will be augmented as below
::
(&(LDAPFILTER)(uid=jsmith))
.. _ldap_attr_firstname:
First Name Attribute : required
The LDAP record attribute which represents the user's first name.
.. _ldap_attr_lastname:
Last Name Attribute : required
The LDAP record attribute which represents the user's last name.
.. _ldap_attr_email:
Email Attribute : required
The LDAP record attribute which represents the user's email address.
If all data are entered correctly, and python-ldap_ is properly installed
users should be granted access to Kallithea with ldap accounts. At this
time user information is copied from LDAP into the Kallithea user database.
This means that updates of an LDAP user object may not be reflected as a
user update in Kallithea.
If You have problems with LDAP access and believe You entered correct
information check out the Kallithea logs, any error messages sent from LDAP
will be saved there.
Active Directory
''''''''''''''''
Kallithea can use Microsoft Active Directory for user authentication. This
is done through an LDAP or LDAPS connection to Active Directory. The
following LDAP configuration settings are typical for using Active
Directory ::
Base DN = OU=SBSUsers,OU=Users,OU=MyBusiness,DC=v3sys,DC=local
Login Attribute = sAMAccountName
First Name Attribute = givenName
Last Name Attribute = sn
All other LDAP settings will likely be site-specific and should be
appropriately configured.
Authentication by container or reverse-proxy
--------------------------------------------
Starting with version 1.3, Kallithea supports delegating the authentication
Kallithea supports delegating the authentication
of users to its WSGI container, or to a reverse-proxy server through which all
clients access the application.
When these authentication methods are enabled in Kallithea, it uses the
username that the container/proxy (Apache/Nginx/etc) authenticated and doesn't
perform the authentication itself. The authorization, however, is still done by
Kallithea according to its settings.
When a user logs in for the first time using these authentication methods,
a matching user account is created in Kallithea with default permissions. An
administrator can then modify it using Kallithea's admin interface.
It's also possible for an administrator to create accounts and configure their
permissions before the user logs in for the first time.
Container-based authentication
''''''''''''''''''''''''''''''
In a container-based authentication setup, Kallithea reads the user name from
the ``REMOTE_USER`` server variable provided by the WSGI container.
After setting up your container (see `Apache's WSGI config`_), you'd need
to configure it to require authentication on the location configured for
Kallithea.
In order for Kallithea to start using the provided username, you should set the
following in the [app:main] section of your .ini file::
container_auth_enabled = true
Proxy pass-through authentication
'''''''''''''''''''''''''''''''''
In a proxy pass-through authentication setup, Kallithea reads the user name
from the ``X-Forwarded-User`` request header, which should be configured to be
sent by the reverse-proxy server.
After setting up your proxy solution (see `Apache virtual host reverse proxy example`_,
`Apache as subdirectory`_ or `Nginx virtual host example`_), you'd need to
configure the authentication and add the username in a request header named
``X-Forwarded-User``.
For example, the following config section for Apache sets a subdirectory in a
reverse-proxy setup with basic auth::
<Location /<someprefix> >
ProxyPass http://127.0.0.1:5000/<someprefix>
ProxyPassReverse http://127.0.0.1:5000/<someprefix>
SetEnvIf X-Url-Scheme https HTTPS=1
AuthType Basic
AuthName "Kallithea authentication"
AuthUserFile /home/web/kallithea/.htpasswd
require valid-user
RequestHeader unset X-Forwarded-User
RewriteEngine On
RewriteCond %{LA-U:REMOTE_USER} (.+)
RewriteRule .* - [E=RU:%1]
RequestHeader set X-Forwarded-User %{RU}e
</Location>
In order for Kallithea to start using the forwarded username, you should set
the following in the [app:main] section of your .ini file::
proxypass_auth_enabled = true
.. note::
If you enable proxy pass-through authentication, make sure your server is
only accessible through the proxy. Otherwise, any client would be able to
forge the authentication header and could effectively become authenticated
using any account of their liking.
Integration with Issue trackers
-------------------------------
Kallithea provides a simple integration with issue trackers. It's possible
to define a regular expression that will fetch issue id stored in commit
messages and replace that with an url to this issue. To enable this simply
uncomment following variables in the ini file::
issue_pat = (?:^#|\s#)(\w+)
`issue_pat` is the regular expression that will fetch issues from commit messages.
Default regex will match issues in format of #<number> eg. #300.
Matched issues will be replace with the link specified as `issue_server_link`
{id} will be replaced with issue id, and {repo} with repository name.
Since the # is striped `issue_prefix` is added as a prefix to url.
`issue_prefix` can be something different than # if you pass
ISSUE- as issue prefix this will generate an url in format::
<a href="https://myissueserver.com/example_repo/issue/300">ISSUE-300</a>
Hook management
---------------
Hooks can be managed in similar way to this used in .hgrc files.
To access hooks setting click `advanced setup` on Hooks section of Mercurial
Settings in Admin.
There are 4 built in hooks that cannot be changed (only enable/disable by
checkboxes on previos section).
To add another custom hook simply fill in first section with
<name>.<hook_type> and the second one with hook path. Example hooks
can be found at *kallithea.lib.hooks*.
Changing default encoding
-------------------------
By default Kallithea uses utf8 encoding, starting from 1.3 series this
can be changed, simply edit default_encoding in .ini file to desired one.
This affects many parts in Kallithea including committers names, filenames,
encoding of commit messages. In addition Kallithea can detect if `chardet`
library is installed. If `chardet` is detected Kallithea will fallback to it
when there are encode/decode errors.
Setting Up Celery
-----------------
Since version 1.1 celery is configured by the Kallithea ini configuration files.
Simply set use_celery=true in the ini file then add / change the configuration
variables inside the ini file.
Remember that the ini files use the format with '.' not with '_' like celery.
So for example setting `BROKER_HOST` in celery means setting `broker.host` in
the config file.
In order to start using celery run::
paster celeryd <configfile.ini>
Make sure you run this command from the same virtualenv, and with the same
user that Kallithea runs.
HTTPS support
-------------
Kallithea will by default generate URLs based on the WSGI environment.
Alternatively, you can use some special configuration settings to control
directly which scheme/protocol Kallithea will use when generating URLs:
- With `https_fixup = true`, the scheme will be taken from the HTTP_X_URL_SCHEME,
HTTP_X_FORWARDED_SCHEME or HTTP_X_FORWARDED_PROTO HTTP header (default 'http').
- With `force_https = true` the default will be 'https'.
- With `use_htsts = true`, it will set Strict-Transport-Security when using https.
Nginx virtual host example
--------------------------
Sample config for nginx using proxy::
upstream rc {
server 127.0.0.1:5000;
# add more instances for load balancing
#server 127.0.0.1:5001;
#server 127.0.0.1:5002;
}
## gist alias
server {
listen 443;
server_name gist.myserver.com;
access_log /var/log/nginx/gist.access.log;
error_log /var/log/nginx/gist.error.log;
ssl on;
ssl_certificate gist.your.kallithea.server.crt;
ssl_certificate_key gist.your.kallithea.server.key;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5;
ssl_prefer_server_ciphers on;
rewrite ^/(.+)$ https://your.kallithea.server/_admin/gists/$1;
rewrite (.*) https://your.kallithea.server/_admin/gists;
server_name your.kallithea.server;
access_log /var/log/nginx/kallithea.access.log;
error_log /var/log/nginx/kallithea.error.log;
ssl_certificate your.kallithea.server.crt;
ssl_certificate_key your.kallithea.server.key;
## uncomment root directive if you want to serve static files by nginx
## requires static_files = false in .ini file
#root /path/to/installation/kallithea/public;
include /etc/nginx/proxy.conf;
location / {
try_files $uri @rhode;
location @rhode {
proxy_pass http://rc;
Here's the proxy.conf. It's tuned so it will not timeout on long
pushes or large pushes::
proxy_redirect off;
proxy_set_header Host $host;
## needed for container auth
#proxy_set_header REMOTE_USER $remote_user;
#proxy_set_header X-Forwarded-User $remote_user;
proxy_set_header X-Url-Scheme $scheme;
proxy_set_header X-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Proxy-host $proxy_host;
proxy_buffering off;
proxy_connect_timeout 7200;
proxy_send_timeout 7200;
proxy_read_timeout 7200;
proxy_buffers 8 32k;
client_max_body_size 1024m;
client_body_buffer_size 128k;
large_client_header_buffers 8 64k;
Apache virtual host reverse proxy example
-----------------------------------------
Here is a sample configuration file for apache using proxy::
<VirtualHost *:80>
ServerName hg.myserver.com
ServerAlias hg.myserver.com
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
#important !
#Directive to properly generate url (clone url) for pylons
ProxyPreserveHost On
## -*- coding: utf-8 -*-
<%text>################################################################################
# Kallithea - config file generated with kallithea-config #
</%text>
<%text>
################################################################################</%text>
<%text>## Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.)</%text>
%if http_server == 'paste':
<%text>## PASTE ##</%text>
use = egg:Paste#http
<%text>## nr of worker threads to spawn</%text>
threadpool_workers = 5
<%text>## max request before thread respawn</%text>
threadpool_max_requests = 10
<%text>## option to use threads of process</%text>
use_threadpool = true
%endif
%if http_server == 'waitress':
<%text>## WAITRESS ##</%text>
<%text>## number of worker threads</%text>
<%text>## MAX BODY SIZE 100GB</%text>
<%text>## use poll instead of select, fixes fd limits, may not work on old</%text>
<%text>## windows systems.</%text>
%if http_server == 'gunicorn':
<%text>## GUNICORN ##</%text>
use = egg:gunicorn#main
<%text>## number of process workers. You must set `instance_id = *` when this option</%text>
<%text>## is set to more than one worker</%text>
workers = 1
<%text>## process name</%text>
proc_name = kallithea
<%text>## type of worker class, one of sync, eventlet, gevent, tornado</%text>
<%text>## recommended for bigger setup is using of of other than sync one</%text>
worker_class = sync
max_requests = 1000
<%text>## ammount of time a worker can handle request before it gets killed and</%text>
<%text>## restarted</%text>
timeout = 3600
%if http_server == 'uwsgi':
<%text>## UWSGI ##</%text>
<%text>## run with uwsgi --ini-paste-logged <inifile.ini></%text>
[uwsgi]
socket = /tmp/uwsgi.sock
master = true
http = 127.0.0.1:5000
<%text>## set as deamon and redirect all output to file</%text>
<%text>## master process PID</%text>
pidfile = ./uwsgi_kallithea.pid
<%text>## stats server with workers statistics, use uwsgitop</%text>
<%text>## for monitoring, `uwsgitop 127.0.0.1:1717`</%text>
stats = 127.0.0.1:1717
memory-report = true
<%text>## log 5XX errors</%text>
log-5xx = true
<%text>## Set the socket listen queue size.</%text>
listen = 256
<%text>## Gracefully Reload workers after the specified amount of managed requests</%text>
<%text>## (avoid memory leaks).</%text>
max-requests = 1000
<%text>## enable large buffers</%text>
buffer-size=65535
<%text>## socket and http timeouts ##</%text>
http-timeout=3600
socket-timeout=3600
<%text>## Log requests slower than the specified number of milliseconds.</%text>
log-slow = 10
<%text>## Exit if no app can be loaded.</%text>
need-app = true
<%text>## Set lazy mode (load apps in workers instead of master).</%text>
lazy = true
<%text>## scaling ##</%text>
<%text>## set cheaper algorithm to use, if not set default will be used</%text>
cheaper-algo = spare
<%text>## minimum number of workers to keep at all times</%text>
cheaper = 1
<%text>## number of workers to spawn at startup</%text>
cheaper-initial = 1
<%text>## maximum number of workers that can be spawned</%text>
workers = 4
<%text>## how many workers should be spawned at a time</%text>
cheaper-step = 1
<%text>## COMMON ##</%text>
host = ${host}
port = ${port}
<%text>## prefix middleware for rc</%text>
<%text>## enable proxy prefix middleware</%text>
<%text>## Available Languages:</%text>
<%text>## de en fr ja pl pt_BR ru zh_CN zh_TW</%text>
lang = ${lang}
cache_dir = ${here}/data
index_dir = ${here}/data/index
<%text>## perform a full repository scan on each server start, this should be</%text>
<%text>## set to false after first startup, to allow faster server restarts.</%text>
initial_repo_scan = false
<%text>## uncomment and set this path to use archive download cache</%text>
archive_cache_dir = ${here}/tarballcache
<%text>## change this to unique ID for security</%text>
app_instance_uuid = ${uuid()}
<%text>## cut off limit for large diffs (size in bytes)</%text>
<%text>## use cache version of scm repo everywhere</%text>
<%text>## force https in Kallithea, fixes https redirects, assumes it's always https</%text>
<%text>## use Strict-Transport-Security headers</%text>
<%text>## number of commits stats will parse on each iteration</%text>
<%text>## use gravatar service to display avatars</%text>
<%text>## path to git executable</%text>
<%text>## git rev filter option, --all is the default filter, if you need to</%text>
<%text>## hide all refs in changelog switch this to --branches --tags</%text>
<%text>## RSS feed options</%text>
<%text>## options for showing and identifying changesets</%text>
<%text>## gist URL alias, used to create nicer urls for gist. This should be an</%text>
<%text>## url that does rewrites to _admin/gists/<gistid>.</%text>
<%text>## example: http://gist.kallithea.server/{gistid}. Empty means use the internal</%text>
<%text>## Kallithea url, ie. http[s]://your.kallithea.server/_admin/gists/<gistid></%text>
<%text>## white list of API enabled controllers. This allows to add list of</%text>
<%text>## controllers to which access will be enabled by api_key. eg: to enable</%text>
<%text>## api access to raw_files put `FilesController:raw`, to enable access to patches</%text>
<%text>## add `ChangesetController:changeset_patch`. This list should be "," separated</%text>
<%text>## Syntax is <ControllerClass>:<function>. Check debug logs for generated names</%text>
<%text>## Recommended settings below are commented out:</%text>
<%text>## alternative_gravatar_url allows you to use your own avatar server application</%text>
<%text>## the following parts of the URL will be replaced</%text>
<%text>## {email} user email</%text>
<%text>## {md5email} md5 hash of the user email (like at gravatar.com)</%text>
<%text>## {size} size of the image that is expected from the server application</%text>
<%text>## {scheme} http/https from Kallithea server</%text>
<%text>## {netloc} network location from Kallithea server</%text>
<%text>## container auth options</%text>
<%text>## default encoding used to convert from and to unicode</%text>
<%text>## can be also a comma seperated list of encoding in case of mixed encodings</%text>
<%text>## overwrite schema of clone url</%text>
<%text>## available vars:</%text>
<%text>## scheme - http/https</%text>
<%text>## user - current user</%text>
<%text>## pass - password</%text>
<%text>## netloc - network location</%text>
<%text>## path - usually repo_name</%text>
<%text>## issue tracker for Kallithea (leave blank to disable, absent for default)</%text>
<%text>## issue tracking mapping for commits messages</%text>
<%text>## comment out issue_pat, issue_server, issue_prefix to enable</%text>
<%text>## pattern to get the issues from commit messages</%text>
<%text>## default one used here is #<numbers> with a regex passive group for `#`</%text>
<%text>## {id} will be all groups matched from this pattern</%text>
<%text>## server url to the issue, each {id} will be replaced with match</%text>
<%text>## fetched from the regex and {repo} is replaced with full repository name</%text>
<%text>## including groups {repo_name} is replaced with just name of repo</%text>
<%text>## prefix to add to link to indicate it's an url</%text>
<%text>## #314 will be replaced by <issue_prefix><id></%text>
<%text>## issue_pat, issue_server_link, issue_prefix can have suffixes to specify</%text>
<%text>## multiple patterns, to other issues server, wiki or others</%text>
<%text>## below an example how to create a wiki pattern</%text>
<%text>## instance-id prefix</%text>
<%text>## a prefix key for this instance used for cache invalidation when running</%text>
<%text>## multiple instances of kallithea, make sure it's globally unique for</%text>
<%text>## all running kallithea instances. Leave empty if you don't use it</%text>
<%text>## alternative return HTTP header for failed authentication. Default HTTP</%text>
<%text>## response is 401 HTTPUnauthorized. Currently HG clients have troubles with</%text>
<%text>## handling that. Set this variable to 403 to return HTTPForbidden</%text>
<%text>## locking return code. When repository is locked return this HTTP code. 2XX</%text>
<%text>## codes don't break the transactions while 4XX codes do</%text>
<%text>## allows to change the repository location in settings page</%text>
<%text>## allows to setup custom hooks in settings page</%text>
<%text>## tasks will never be sent to the queue, but executed locally instead.</%text>
beaker.cache.data_dir=${here}/data/cache/data
beaker.cache.lock_dir=${here}/data/cache/lock
<%text>## db session ##</%text>
<%text>## encrypted cookie client side session, good for many instances ##</%text>
<%text>## file based cookies (default) ##</%text>
beaker.session.secret = ${uuid()}
<%text>## Secure encrypted cookie. Requires AES and AES python libraries</%text>
<%text>## you must disable beaker.session.secret to use this</%text>
<%text>## sets session as invalid if it haven't been accessed for given amount of time</%text>
<%text>## uncomment for https secure cookie</%text>
<%text>## auto save the session to not to use .save()</%text>
<%text>## default cookie expiration time in seconds `true` expire at browser close ##</%text>
%if error_aggregation_service == 'errormator':
<%text>## errormator enabled</%text>
<%text>## TWEAK AMOUNT OF INFO SENT HERE</%text>
<%text>## enables 404 error logging (default False)</%text>
<%text>## time in seconds after request is considered being slow (default 1)</%text>
<%text>## record slow requests in application</%text>
<%text>## (needs to be enabled for slow datastore recording and time tracking)</%text>
<%text>## enable hooking to application loggers</%text>
# Kallithea - Example config #
host = 127.0.0.1
app_instance_uuid = ${app_instance_uuid}
beaker.session.secret = ${app_instance_uuid}
# Exactly as generated with "paster make-config Kallithea production.ini" #
# using sqlite and kallithea.db .
# Note: you should generate your own config with your own UUIDs for security #
# and consider not using sqlite for production. #
app_instance_uuid = change-me
beaker.session.secret = change-me
# Kallithea - config for tests: #
# vcs_full_cache = false #
# sqlalchemy and kallithea_test.sqlite #
# custom logging #
app_instance_uuid = test
#vcs_full_cache = true
vcs_full_cache = false
beaker.session.secret = {74e0cd75-b339-478b-b129-07dd221def1f}
Status change: