@@ -85,258 +85,230 @@ max_request_body_size = 107374182400
## 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
@@ -275,260 +275,252 @@ Certificate Checks : optional
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
E-mail Attribute = mail
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
@@ -82,258 +82,230 @@ http = 127.0.0.1:5000
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
%endif
<%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>
</%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
@@ -79,258 +79,230 @@ max_request_body_size = 107374182400
#pidfile = ./uwsgi_kallithea.pid
host = 127.0.0.1
app_instance_uuid = ${app_instance_uuid}
@@ -83,258 +83,230 @@ max_request_body_size = 107374182400
app_instance_uuid = change-me
app_instance_uuid = test
#vcs_full_cache = true
vcs_full_cache = false
Status change: