Blame doc/configuration.rst

Pierre-Yves Chibon 2cf341
Configuration
Pierre-Yves Chibon 2cf341
=============
Pierre-Yves Chibon 2cf341
Pierre-Yves Chibon 2cf341
Pagure offers a wide-varieties of options that must or can be used to
Pierre-Yves Chibon 2cf341
adjust its behavior.
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon 909a5f
Pierre-Yves Chibon a6079f
Must options
Pierre-Yves Chibon a6079f
------------
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon a6079f
Here are listed the options you must set-up in order to get pagure running.
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon a6079f
SECRET_KEY
Pierre-Yves Chibon a6079f
~~~~~~~~~~
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon a6079f
This key is used by flask to create the session. It should be kept secret
Pierre-Yves Chibon a6079f
and set as a long and random string.
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon 764459
SALT_EMAIL
Pierre-Yves Chibon 764459
~~~~~~~~~~
Pierre-Yves Chibon 764459
Pierre-Yves Chibon 764459
This key is used for when sending notification to ensure that when sending
Pierre-Yves Chibon 764459
notifications to different users, each one of them has a different, unique
Pierre-Yves Chibon 764459
and un-fakable ``Reply-To`` header that is then used by the milter to find
Pierre-Yves Chibon 764459
out if the response received is a real one or a fake/invalid one.
Pierre-Yves Chibon 764459
Pierre-Yves Chibon 764459
Pierre-Yves Chibon a6079f
DB_URL
Pierre-Yves Chibon a6079f
~~~~~~
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon a6079f
This key indicates to the framework how and where to connect to the database
Pierre-Yves Chibon a6079f
server. Pagure using `SQLAchemy <http: www.sqlalchemy.org="">`_ it can connect</http:>
Pierre-Yves Chibon a6079f
to a wide range of database server including MySQL, PostgreSQL and SQLite.
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon a6079f
Examples values:
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon a6079f
::
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon a6079f
    DB_URL=mysql://user:pass@host/db_name
Pierre-Yves Chibon a6079f
    DB_URL=postgres://user:pass@host/db_name
Pierre-Yves Chibon a6079f
    DB_URL = 'sqlite:////var/tmp/pagure_dev.sqlite'
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon a6079f
Defaults to ``sqlite:////var/tmp/pagure_dev.sqlite``
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon a6079f
APP_URL
Pierre-Yves Chibon a6079f
~~~~~~~
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon a6079f
This key indicates the URL at which this pagure instance will be made available.
Pierre-Yves Chibon a6079f
Pierre-Yves Chibon 7a3469
Defaults to: ``https://pagure.org/``
Pierre-Yves Chibon 2e4eca
Pierre-Yves Chibon 2e4eca
Pierre-Yves Chibon 2e4eca
EMAIL_ERROR
Pierre-Yves Chibon 2e4eca
~~~~~~~~~~~
Pierre-Yves Chibon 2e4eca
Pierre-Yves Chibon 2e4eca
Pagure sends email when it caches an un-expected error (which saves you from
Pierre-Yves Chibon 2e4eca
having to monitor the logs regularly but if you like, the error is still
Pierre-Yves Chibon 2e4eca
present in the logs).
Pierre-Yves Chibon 2e4eca
This setting allows you to specify to which email address to send these error
Pierre-Yves Chibon 2e4eca
reports.
Pierre-Yves Chibon 7a3469
Pierre-Yves Chibon 7a3469
Pierre-Yves Chibon 7a3469
GIT_URL_SSH
Pierre-Yves Chibon 7a3469
~~~~~~~~~~~
Pierre-Yves Chibon 7a3469
Pierre-Yves Chibon 7a3469
This configuration key provides the information to the user on how to clone
Pierre-Yves Chibon 7a3469
the git repos hosted on pagure via `SSH <>`_.
Pierre-Yves Chibon 7a3469
Pierre-Yves Chibon 7a3469
The URL should end with a slash ``/``.
Pierre-Yves Chibon 7a3469
Pierre-Yves Chibon 7a3469
Defaults to: ``'ssh://git@pagure.org/'``
Pierre-Yves Chibon 7a3469
Pierre-Yves Chibon 7a3469
Pierre-Yves Chibon 7a3469
GIT_URL_GIT
Pierre-Yves Chibon 7a3469
~~~~~~~~~~~
Pierre-Yves Chibon 7a3469
This configuration key provides the information to the user on how to clone
Pierre-Yves Chibon 7a3469
the git repos hosted on pagure anonymously. These access can be granted via
Pierre-Yves Chibon 7a3469
the ``git://`` or ``http(s)://`` protocols.
Pierre-Yves Chibon 7a3469
Pierre-Yves Chibon 7a3469
The URL should end with a slash ``/``.
Pierre-Yves Chibon 7a3469
Pierre-Yves Chibon 7a3469
Defaults to: ``'git://pagure.org/'``
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
GIT_FOLDER
Pierre-Yves Chibon d4c756
~~~~~~~~~~
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
This configuration key points to the folder where are stored the git repos
Pierre-Yves Chibon d4c756
of the projects.
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
Each project in pagure has 4 git repositories:
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
- the main repo for the code
Pierre-Yves Chibon d4c756
- the doc repo showed in the doc server
Pierre-Yves Chibon d4c756
- the ticket and request repos storing the metadata of the
Pierre-Yves Chibon d4c756
  tickets/pull-requests
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
There are then another 2 folders specifying the locations of the forks and
Pierre-Yves Chibon d4c756
remote git repo used for the remotes pull-requests (ie: pull-request coming
Pierre-Yves Chibon d4c756
from a project not hosted on pagure).
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
FORK_FOLDER
Pierre-Yves Chibon d4c756
~~~~~~~~~~~
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
This configuration key points to the folder where are stored the git repos
Pierre-Yves Chibon d4c756
of forks of the projects.
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
DOCS_FOLDER
Pierre-Yves Chibon d4c756
~~~~~~~~~~~
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
This configuration key points to the folder where are stored the git repos
Pierre-Yves Chibon d4c756
for the documentation of the projects.
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
TICKETS_FOLDER
Pierre-Yves Chibon d4c756
~~~~~~~~~~~~~~
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
This configuration key points to the folder where are stored the git repos
Pierre-Yves Chibon d4c756
storing the metadata of the tickets opened against the project.
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
REQUESTS_FOLDER
Pierre-Yves Chibon d4c756
~~~~~~~~~~~~~~~
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
This configuration key points to the folder where are stored the git repos
Pierre-Yves Chibon d4c756
storing the metadata of the pull-requests opened against the project.
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
REMOTE_GIT_FOLDER
Pierre-Yves Chibon d4c756
~~~~~~~~~~~~~~~~~
Pierre-Yves Chibon d4c756
Pierre-Yves Chibon d4c756
This configuration key points to the folder where are stored the remote git
Pierre-Yves Chibon d4c756
repos (ie: not hosted on pagure) that someone used to open a pull-request
Pierre-Yves Chibon d4c756
against a project hosted on pagure.
Pierre-Yves Chibon 0928d4
Pierre-Yves Chibon 0928d4
Pierre-Yves Chibon 0928d4
SESSION_COOKIE_SECURE
Pierre-Yves Chibon 0928d4
~~~~~~~~~~~~~~~~~~~~~
Pierre-Yves Chibon 0928d4
Pierre-Yves Chibon 0928d4
When this is set to True, the session cookie will only be returned to the
Pierre-Yves Chibon 0928d4
server via ssl (https). If you connect to the server via plain http, the
Pierre-Yves Chibon 0928d4
cookie will not be sent. This prevents sniffing of the cookie contents.
Pierre-Yves Chibon 0928d4
This may be set to False when testing your application but should always
Pierre-Yves Chibon 0928d4
be set to True in production.
Pierre-Yves Chibon 0928d4
Pierre-Yves Chibon 0928d4
Defaults to: ``False`` for development, must be ``True`` in production with
Pierre-Yves Chibon 0928d4
https.
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon 909a5f
FROM_EMAIL
Pierre-Yves Chibon 909a5f
~~~~~~~~~~
Pierre-Yves Chibon 909a5f
Pierre-Yves Chibon 909a5f
This setting allows to specify the email address used by this pagure instance
Pierre-Yves Chibon 909a5f
when sending emails (notifications).
Pierre-Yves Chibon 909a5f
Pierre-Yves Chibon 909a5f
Defaults to: ``pagure@pagure.org``
Pierre-Yves Chibon 909a5f
Pierre-Yves Chibon 909a5f
Pierre-Yves Chibon 1b7aad
DOMAIN_EMAIL_NOTIFICATIONS
Pierre-Yves Chibon 1b7aad
~~~~~~~~~~~~~~~~~~~~~~~~~~
Pierre-Yves Chibon 1b7aad
Pierre-Yves Chibon 1b7aad
This setting allows to specify the domain used by this pagure instance
Pierre-Yves Chibon 1b7aad
when sending emails (notifications). More precisely, this setting is used
Pierre-Yves Chibon 1b7aad
when building the ``msg-id`` header of the emails sent.
Pierre-Yves Chibon 1b7aad
Pierre-Yves Chibon 1b7aad
Defaults to: ``pagure.org``
Pierre-Yves Chibon 1b7aad
Pierre-Yves Chibon 1b7aad
Pierre-Yves Chibon f17ee3
Configure Gitolite
Pierre-Yves Chibon f17ee3
------------------
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
Pagure uses `gitolite <http: gitolite.com="">`_ as an authorization layer.</http:>
Pierre-Yves Chibon f17ee3
Gitolite relies on `SSH <https: en.wikipedia.org="" secure_shell="" wiki="">`_ for</https:>
Pierre-Yves Chibon f17ee3
the authentication. In other words, SSH let you in and gitolite check if you
Pierre-Yves Chibon f17ee3
are allowed to do what you are trying to do once you are inside.
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
GITOLITE_HOME
Pierre-Yves Chibon f17ee3
~~~~~~~~~~~~~
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
This configuration key should point to the home of the user under which
Pierre-Yves Chibon f17ee3
gitolite is ran.
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
GITOLITE_VERSION
Pierre-Yves Chibon f17ee3
~~~~~~~~~~~~~~~~
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
This configuration key allows to specify which version of gitolite you are
Pierre-Yves Chibon f17ee3
using, it can be either ``2`` or ``3``.
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
Defaults to: ``3``.
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
GITOLITE_KEYDIR
Pierre-Yves Chibon f17ee3
~~~~~~~~~~~~~~~
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
This configuration key points to the folder where gitolite stores and accesses
Pierre-Yves Chibon f17ee3
the public SSH keys of all the user have access to the server.
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
Since pagure is the user interface, it is pagure that writes down the files
Pierre-Yves Chibon f17ee3
in this directory effectively setting up the users to be able to use gitolite.
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
GL_RC
Pierre-Yves Chibon f17ee3
~~~~~
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
This configuration key must point to the file ``gitolite.rc`` used by gitolite
Pierre-Yves Chibon f17ee3
to record who has access to what (ie: who has access to which repo/branch).
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
GL_BINDIR
Pierre-Yves Chibon f17ee3
~~~~~~~~~
Pierre-Yves Chibon f17ee3
Pierre-Yves Chibon f17ee3
This configuration key indicates the folder in which the gitolite tools can
Pierre-Yves Chibon f17ee3
be found. It can be as simple as ``/usr/bin/`` if the tools have been installed
Pierre-Yves Chibon f17ee3
using a package manager or something like ``/opt/bin/`` for a more custom
Pierre-Yves Chibon f17ee3
install.
Pierre-Yves Chibon a9a543
Pierre-Yves Chibon a9a543
Pierre-Yves Chibon a9a543
Optional options
Pierre-Yves Chibon a9a543
----------------
Pierre-Yves Chibon a9a543
Pierre-Yves Chibon a9a543
SSH_KEYS
Pierre-Yves Chibon a9a543
~~~~~~~~
Pierre-Yves Chibon a9a543
Pierre-Yves Chibon a9a543
It is a good pratice to publish the fingerprint and public SSH key of a
Pierre-Yves Chibon a9a543
server you provide access to.
Pierre-Yves Chibon a9a543
Pagure offers the possibility to expose this information based on the values
Pierre-Yves Chibon a9a543
set in the configuration file, in the ``SSH_KEYS`` configuration key.
Pierre-Yves Chibon a9a543
Pierre-Yves Chibon a9a543
See the `SSH hostkeys/Fingerprints page on pagure.io <https: pagure.io="" ssh_info="">`_.</https:>
Pierre-Yves Chibon a9a543
Pierre-Yves Chibon a9a543
.. warning: The format is important
Pierre-Yves Chibon a9a543
Pierre-Yves Chibon a9a543
    SSH_KEYS = {'RSA': {'fingerprint': '<foo>', 'pubkey': '<bar>'}}</bar></foo>
Pierre-Yves Chibon a9a543
Pierre-Yves Chibon a9a543
Where `<foo>` and `<bar>` must be replaced by your values.</bar></foo>
Pierre-Yves Chibon b1260e
Pierre-Yves Chibon b1260e
Pierre-Yves Chibon b1260e
ITEM_PER_PAGE
Pierre-Yves Chibon b1260e
~~~~~~~~~~~~~
Pierre-Yves Chibon b1260e
This configuration key allows you to configure the length of a page by
Pierre-Yves Chibon b1260e
setting the number of items on the page. Items can be commits, users, groups
Pierre-Yves Chibon b1260e
or projects for example.
Pierre-Yves Chibon b1260e
Pierre-Yves Chibon b1260e
Defaults to: ``50``.
Pierre-Yves Chibon 1435af
Pierre-Yves Chibon 1435af
Pierre-Yves Chibon 1435af
SMTP_SERVER
Pierre-Yves Chibon 1435af
~~~~~~~~~~~
Pierre-Yves Chibon 1435af
Pierre-Yves Chibon 1435af
This configuration key allows to configure the SMTP server to use when
Pierre-Yves Chibon 1435af
sending emails.
Pierre-Yves Chibon 1435af
Pierre-Yves Chibon 1435af
Defaults to: ``localhost``.
Pierre-Yves Chibon ae1519
Pierre-Yves Chibon ae1519
Pierre-Yves Chibon ae1519
SHORT_LENGTH
Pierre-Yves Chibon ae1519
~~~~~~~~~~~~
Pierre-Yves Chibon ae1519
Pierre-Yves Chibon ae1519
This configuration key allows to configure the length of the commit ids or
Pierre-Yves Chibon ae1519
file hex displayed in the user interface.
Pierre-Yves Chibon ae1519
Pierre-Yves Chibon ae1519
Defaults to: ``6``.
Pierre-Yves Chibon a0e179
Pierre-Yves Chibon a0e179
Pierre-Yves Chibon a0e179
BLACKLISTED_PROJECTS
Pierre-Yves Chibon a0e179
~~~~~~~~~~~~~~~~~~~~
Pierre-Yves Chibon a0e179
Pierre-Yves Chibon a0e179
This configuration key allows to set a list of project name that are forbiden.
Pierre-Yves Chibon a0e179
This list is used for example to avoid conflicts at the URL level between the
Pierre-Yves Chibon a0e179
static files located under ``/static/`` and a project that would be named
Pierre-Yves Chibon a0e179
``static`` and thus be located at ``/static``.
Pierre-Yves Chibon a0e179
Pierre-Yves Chibon a0e179
Defaults to:
Pierre-Yves Chibon a0e179
Pierre-Yves Chibon a0e179
::
Pierre-Yves Chibon a0e179
Pierre-Yves Chibon a0e179
    [
Pierre-Yves Chibon a0e179
        'static', 'pv', 'releases', 'new', 'api', 'settings',
Pierre-Yves Chibon a0e179
        'logout', 'login', 'users', 'groups'
Pierre-Yves Chibon a0e179
    ]
Pierre-Yves Chibon 969487
Pierre-Yves Chibon 969487
Pierre-Yves Chibon 969487
Pierre-Yves Chibon 969487
CHECK_SESSION_IP
Pierre-Yves Chibon 969487
~~~~~~~~~~~~~~~~
Pierre-Yves Chibon 969487
Pierre-Yves Chibon 969487
This configuration key allows to configure wether to check the user's IP
Pierre-Yves Chibon 969487
address when retrieving its session. This make things more secure but
Pierre-Yves Chibon 969487
under certain setup it might not work (for example is there are proxies
Pierre-Yves Chibon 969487
in front of the application).
Pierre-Yves Chibon 969487
Pierre-Yves Chibon 969487
Defaults to: ``True``.
Pierre-Yves Chibon bf4ab5
Pierre-Yves Chibon bf4ab5
Pierre-Yves Chibon bf4ab5
PAGURE_AUTH
Pierre-Yves Chibon bf4ab5
~~~~~~~~~~~~
Pierre-Yves Chibon bf4ab5
Pierre-Yves Chibon bf4ab5
This configuration key allows to specify which authentication method to use.
Pierre-Yves Chibon bf4ab5
Pagure supports currently two authentication methods, one relying on the
Pierre-Yves Chibon bf4ab5
Fedora Account System `FAS <https: accounts="" admin.fedoraproject.org="">`_,</https:>
Pierre-Yves Chibon bf4ab5
the other relying on local user accounts.
Pierre-Yves Chibon bf4ab5
It can therefore be either ``fas`` or ``local``.
Pierre-Yves Chibon bf4ab5
Pierre-Yves Chibon bf4ab5
Defaults to: ``fas``.
Pierre-Yves Chibon f271cd
Pierre-Yves Chibon f271cd
Pierre-Yves Chibon f271cd
IP_ALLOWED_INTERNAL
Pierre-Yves Chibon f271cd
~~~~~~~~~~~~~~~~~~~
Pierre-Yves Chibon f271cd
Pierre-Yves Chibon f271cd
This configuration key allows to specify which IP addresses are allowed
Pierre-Yves Chibon f271cd
to access the internal API endpoint. These endpoints are accessed by the
Pierre-Yves Chibon f271cd
milters for example and allow to perform action in the name of someone else.
Pierre-Yves Chibon f271cd
So they are sensitive, thus the check for the origin of the request using
Pierre-Yves Chibon f271cd
these endpoints.
Pierre-Yves Chibon f271cd
Pierre-Yves Chibon f271cd
Defaults to: ``['127.0.0.1', 'localhost', '::1']``.
Pierre-Yves Chibon c297f0
Pierre-Yves Chibon c297f0
Pierre-Yves Chibon c297f0
MAX_CONTENT_LENGTH
Pierre-Yves Chibon c297f0
~~~~~~~~~~~~~~~~~~
Pierre-Yves Chibon c297f0
Pierre-Yves Chibon c297f0
This configuration key allows to specify the maximum size allowed when
Pierre-Yves Chibon c297f0
uploading content to pagure (for example, screenshots to a ticket).
Pierre-Yves Chibon c297f0
Pierre-Yves Chibon c297f0
Defaults to: ``4 * 1024 * 1024`` which corresponds to 4 megabytes.