configuration.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. Configuration
  2. =============
  3. Pagure offers a wide varieties of options that must or can be used to
  4. adjust its behavior.
  5. Must options
  6. ------------
  7. Here are the options you must set up in order to get pagure running.
  8. SECRET_KEY
  9. ~~~~~~~~~~
  10. This key is used by flask to create the session. It should be kept secret
  11. and set as a long and random string.
  12. SALT_EMAIL
  13. ~~~~~~~~~~
  14. This key is used for when sending notification to ensure that when sending
  15. notifications to different users, each one of them has a different, unique
  16. and un-fakable ``Reply-To`` header that is then used by the milter to find
  17. out if the response received is a real one or a fake/invalid one.
  18. DB_URL
  19. ~~~~~~
  20. This key indicates to the framework how and where to connect to the database
  21. server. Pagure using `SQLAchemy <http://www.sqlalchemy.org/>`_ it can connect
  22. to a wide range of database server including MySQL, PostgreSQL and SQLite.
  23. Examples values:
  24. ::
  25. DB_URL=mysql://user:pass@host/db_name
  26. DB_URL=postgres://user:pass@host/db_name
  27. DB_URL = 'sqlite:////var/tmp/pagure_dev.sqlite'
  28. Defaults to ``sqlite:////var/tmp/pagure_dev.sqlite``
  29. APP_URL
  30. ~~~~~~~
  31. This key indicates the URL at which this pagure instance will be made available.
  32. Defaults to: ``https://pagure.org/``
  33. EMAIL_ERROR
  34. ~~~~~~~~~~~
  35. Pagure sends email when it caches an un-expected error (which saves you from
  36. having to monitor the logs regularly but if you like, the error is still
  37. present in the logs).
  38. This setting allows you to specify to which email address to send these error
  39. reports.
  40. GIT_URL_SSH
  41. ~~~~~~~~~~~
  42. This configuration key provides the information to the user on how to clone
  43. the git repos hosted on pagure via `SSH <https://en.wikipedia.org/wiki/Secure_Shell>`_.
  44. The URL should end with a slash ``/``.
  45. Defaults to: ``'ssh://git@pagure.org/'``
  46. GIT_URL_GIT
  47. ~~~~~~~~~~~
  48. This configuration key provides the information to the user on how to clone
  49. the git repos hosted on pagure anonymously. This access can be granted via
  50. the ``git://`` or ``http(s)://`` protocols.
  51. The URL should end with a slash ``/``.
  52. Defaults to: ``'git://pagure.org/'``
  53. GIT_FOLDER
  54. ~~~~~~~~~~
  55. This configuration key points to where the folders containing the git repos
  56. of the projects are located.
  57. Each project in pagure has 4 git repositories:
  58. - the main repo for the code
  59. - the doc repo showed in the doc server
  60. - the ticket and request repos storing the metadata of the
  61. tickets/pull-requests
  62. There are then another 2 folders specifying the locations of the forks and
  63. remote git repo used for the remotes pull-requests (ie: pull-request coming
  64. from a project not hosted on this instance of pagure).
  65. FORK_FOLDER
  66. ~~~~~~~~~~~
  67. This configuration key points to the folder where the git repos of forks of
  68. the projects are stored.
  69. DOCS_FOLDER
  70. ~~~~~~~~~~~
  71. This configuration key points to the folder where the git repos for the
  72. documentation of the projects are stored.
  73. TICKETS_FOLDER
  74. ~~~~~~~~~~~~~~
  75. This configuration key points to the folder where the git repos storing the
  76. metadata of the tickets opened against the project are stored .
  77. REQUESTS_FOLDER
  78. ~~~~~~~~~~~~~~~
  79. This configuration key points to the folder where the git repos storing the
  80. metadata of the pull-requests opened against the project are stored.
  81. REMOTE_GIT_FOLDER
  82. ~~~~~~~~~~~~~~~~~
  83. This configuration key points to the folder where the remote git repos (ie:
  84. not hosted on pagure) that someone used to open a pull-request against a
  85. project hosted on pagure are stored.
  86. SESSION_COOKIE_SECURE
  87. ~~~~~~~~~~~~~~~~~~~~~
  88. When this is set to True, the session cookie will only be returned to the
  89. server via ssl (https). If you connect to the server via plain http, the
  90. cookie will not be sent. This prevents sniffing of the cookie contents.
  91. This may be set to False when testing your application but should always
  92. be set to True in production.
  93. Defaults to: ``False`` for development, must be ``True`` in production with
  94. https.
  95. FROM_EMAIL
  96. ~~~~~~~~~~
  97. This setting allows to specify the email address used by this pagure instance
  98. when sending emails (notifications).
  99. Defaults to: ``pagure@pagure.org``
  100. DOMAIN_EMAIL_NOTIFICATIONS
  101. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  102. This setting allows to specify the domain used by this pagure instance
  103. when sending emails (notifications). More precisely, this setting is used
  104. when building the ``msg-id`` header of the emails sent.
  105. Defaults to: ``pagure.org``
  106. VIRUS_SCAN_ATTACHMENTS
  107. ~~~~~~~~~~~~~~~~~~~~~~
  108. This setting configures whether attachments are scanned for viruses on
  109. upload. For more information, see the install.rst guide.
  110. Defaults to: ``False``
  111. Configure Gitolite
  112. ------------------
  113. Pagure uses `gitolite <http://gitolite.com/>`_ as an authorization layer.
  114. Gitolite relies on `SSH <https://en.wikipedia.org/wiki/Secure_Shell>`_ for
  115. the authentication. In other words, SSH let you in and gitolite check if you
  116. are allowed to do what you are trying to do once you are inside.
  117. GITOLITE_HOME
  118. ~~~~~~~~~~~~~
  119. This configuration key should point to the home of the user under which
  120. gitolite is ran.
  121. GITOLITE_VERSION
  122. ~~~~~~~~~~~~~~~~
  123. This configuration key allows to specify which version of gitolite you are
  124. using, it can be either ``2`` or ``3``.
  125. Defaults to: ``3``.
  126. GITOLITE_KEYDIR
  127. ~~~~~~~~~~~~~~~
  128. This configuration key points to the folder where gitolite stores and accesses
  129. the public SSH keys of all the user have access to the server.
  130. Since pagure is the user interface, it is pagure that writes down the files
  131. in this directory effectively setting up the users to be able to use gitolite.
  132. GL_RC
  133. ~~~~~
  134. This configuration key must point to the file ``gitolite.rc`` used by gitolite
  135. to record who has access to what (ie: who has access to which repo/branch).
  136. GL_BINDIR
  137. ~~~~~~~~~
  138. This configuration key indicates the folder in which the gitolite tools can
  139. be found. It can be as simple as ``/usr/bin/`` if the tools have been installed
  140. using a package manager or something like ``/opt/bin/`` for a more custom
  141. install.
  142. EventSource options
  143. -------------------
  144. EVENTSOURCE_SOURCE
  145. ~~~~~~~~~~~~~~~~~~
  146. This configuration key indicates the URL at which the EventSource server is
  147. available. If not defined, pagure will behave as if there are no EventSource
  148. server running.
  149. EVENTSOURCE_PORT
  150. ~~~~~~~~~~~~~~~~
  151. This configuration key indicates the port at which the EventSource server is
  152. running. This allows adjusting the port via the configuration file instead
  153. of hard-coding it in the code.
  154. .. note:: The EventSource server requires a redis server (see ``Redis options``
  155. below)
  156. Web-hooks notifications
  157. -----------------------
  158. WEBHOOK
  159. ~~~~~~~
  160. This configuration key allows turning on or off web-hooks notifications for
  161. this pagure instance.
  162. Defaults to: ``False``.
  163. .. note:: The Web-hooks server requires a redis server (see ``Redis options``
  164. below)
  165. Redis options
  166. -------------
  167. REDIS_HOST
  168. ~~~~~~~~~~
  169. This configuration key indicates the host at which the `redis <http://redis.io/>`_
  170. server is running.
  171. Defaults to: ``0.0.0.0``.
  172. REDIS_PORT
  173. ~~~~~~~~~~
  174. This configuration key indicates the port at which the reds server can be
  175. contacted.
  176. Defaults to: ``6379``.
  177. REDIS_DB
  178. ~~~~~~~~
  179. This configuration key indicates the name of the redis database to use to
  180. communicate with the EventSource server.
  181. Defaults to: ``0``.
  182. Authentication options
  183. ----------------------
  184. ADMIN_GROUP
  185. ~~~~~~~~~~~
  186. List of groups, local or remotes (if the openid server used supports the
  187. group extension), that are site admin. These admins can regenerate the
  188. gitolite configuration, the ssh key files, the hook-token for every project
  189. as well as manage users and groups.
  190. PAGURE_ADMIN_USERS
  191. ~~~~~~~~~~~~~~~~~~
  192. List of usernames that are site admin. These admins have the same rights as
  193. the user in the admin groups (listed above) as well as admin rights to
  194. every projects hosted on this pagure instance.
  195. Optional options
  196. ----------------
  197. SSH_KEYS
  198. ~~~~~~~~
  199. It is a good pratice to publish the fingerprint and public SSH key of a
  200. server you provide access to.
  201. Pagure offers the possibility to expose this information based on the values
  202. set in the configuration file, in the ``SSH_KEYS`` configuration key.
  203. See the `SSH hostkeys/Fingerprints page on pagure.io <https://pagure.io/ssh_info>`_.
  204. .. warning: The format is important
  205. SSH_KEYS = {'RSA': {'fingerprint': '<foo>', 'pubkey': '<bar>'}}
  206. Where `<foo>` and `<bar>` must be replaced by your values.
  207. ITEM_PER_PAGE
  208. ~~~~~~~~~~~~~
  209. This configuration key allows you to configure the length of a page by
  210. setting the number of items on the page. Items can be commits, users, groups
  211. or projects for example.
  212. Defaults to: ``50``.
  213. SMTP_SERVER
  214. ~~~~~~~~~~~
  215. This configuration key allows to configure the SMTP server to use when
  216. sending emails.
  217. Defaults to: ``localhost``.
  218. SMTP_PORT
  219. ~~~~~~~~~
  220. This configuration key allow to define the SMTP server port.
  221. SMTP by default uses TCP port 25. The protocol for mail submission is
  222. the same, but uses port 587.
  223. SMTP connections secured by SSL, known as SMTPS, default to port 465
  224. (nonstandard, but sometimes used for legacy reasons).
  225. Defaults to: ``25``
  226. SMTP_SSL
  227. ~~~~~~~~
  228. This configuration key allows to specify whether the SMTP connections
  229. should secured over SSL
  230. Defaults to: ``False``
  231. SMTP_USERNAME
  232. ~~~~~~~~~~~~~
  233. This configuration key allows usage of SMTP with auth
  234. Note: Specify SMTP_USERNAME and SMTP_PASSWORD for using SMTP auth
  235. Defaults to: ``None``
  236. SMTP_PASSWORD
  237. ~~~~~~~~~~~~~
  238. This configuration key allows usage of SMTP with auth
  239. Note: Specify SMTP_USERNAME and SMTP_PASSWORD for using SMTP auth
  240. Defaults to: ``None``
  241. SHORT_LENGTH
  242. ~~~~~~~~~~~~
  243. This configuration key allows to configure the length of the commit ids or
  244. file hex displayed in the user interface.
  245. Defaults to: ``6``.
  246. BLACKLISTED_PROJECTS
  247. ~~~~~~~~~~~~~~~~~~~~
  248. This configuration key allows to set a list of project name that are forbidden.
  249. This list is used for example to avoid conflicts at the URL level between the
  250. static files located under ``/static/`` and a project that would be named
  251. ``static`` and thus be located at ``/static``.
  252. Defaults to:
  253. ::
  254. [
  255. 'static', 'pv', 'releases', 'new', 'api', 'settings',
  256. 'logout', 'login', 'users', 'groups'
  257. ]
  258. CHECK_SESSION_IP
  259. ~~~~~~~~~~~~~~~~
  260. This configuration key allows to configure whether to check the user's IP
  261. address when retrieving its session. This makes things more secure but
  262. under certain setup it might not work (for example if there are proxies
  263. in front of the application).
  264. Defaults to: ``True``.
  265. PAGURE_AUTH
  266. ~~~~~~~~~~~~
  267. This configuration key allows to specify which authentication method to use.
  268. Pagure supports currently two authentication methods, one relying on the
  269. Fedora Account System `FAS <https://admin.fedoraproject.org/accounts>`_,
  270. the other relying on local user accounts.
  271. It can therefore be either ``fas`` or ``local``.
  272. Defaults to: ``fas``.
  273. IP_ALLOWED_INTERNAL
  274. ~~~~~~~~~~~~~~~~~~~
  275. This configuration key allows to specify which IP addresses are allowed
  276. to access the internal API endpoint. These endpoints are accessed by the
  277. milters for example and allow to perform action in the name of someone else.
  278. So they are sensitive, thus the check for the origin of the request using
  279. these endpoints.
  280. Defaults to: ``['127.0.0.1', 'localhost', '::1']``.
  281. MAX_CONTENT_LENGTH
  282. ~~~~~~~~~~~~~~~~~~
  283. This configuration key allows to specify the maximum size allowed when
  284. uploading content to pagure (for example, screenshots to a ticket).
  285. Defaults to: ``4 * 1024 * 1024`` which corresponds to 4 megabytes.
  286. ENABLE_TICKETS
  287. ~~~~~~~~~~~~~~
  288. This configuration key allows to activate or de-activate the ticketing system
  289. for all the projects hosted on this pagure instance.
  290. Defaults to: ``True``
  291. ENABLE_NEW_PROJECTS
  292. ~~~~~~~~~~~~~~~~~~~
  293. This configuration key allows to create or forbids creating new projects in
  294. the user interface of this pagure instance.
  295. Defaults to: ``True``
  296. ENABLE_DEL_PROJECTS
  297. ~~~~~~~~~~~~~~~~~~~
  298. This configuration key allows to delete or forbids deleting projects in
  299. the user interface of this pagure instance.
  300. Defaults to: ``True``
  301. EMAIL_SEND
  302. ~~~~~~~~~~
  303. This configuration key allows turning on or off all email notification for
  304. this pagure instance. This can be useful to turn off when developing on
  305. pagure, or for test or pre-production instances.
  306. Defaults to: ``True``.
  307. OLD_VIEW_COMMIT_ENABLED
  308. ~~~~~~~~~~~~~~~~~~~~~~~
  309. In version 1.3, pagure changed its URL scheme to view the commit of a
  310. project in order to add support for pseudo-namespaced projects.
  311. For pagure instances older than 1.3, who care about backward compatibility,
  312. we added an endpoint ``view_commit_old`` that brings URL backward
  313. compatibility for URLs using the complete git hash (the 40 characters).
  314. For URLs using a shorter hash, the URLs will remain broken.
  315. This configuration key allows turning on or off this backward compatibility
  316. which is useful for pagure instances running since before 1.3 but is not
  317. for newer instances.
  318. Defaults to: ``False``.
  319. PAGURE_CI_SERVICES
  320. ~~~~~~~~~~~~~~~~~~
  321. Pagure can be configure to integrate results of a Continuous Integration (CI)
  322. service to pull-requests open against a project.
  323. To enable this integration, follow the documentation on how to install
  324. pagure-ci and set this configuration key to ``['jenkins']`` (Jenkins being
  325. the only CI service supported at the moment).
  326. Defaults to: ``None``.
  327. .. warning:: Requires `Redis` to be configured and running.