configuration.rst 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067
  1. Configuration
  2. =============
  3. Pagure offers a wide varieties of options that must or can be used to
  4. adjust its behavior.
  5. All of these options can be edited or added to your configuration file.
  6. If you have installed pagure, this configuration file is likely located in
  7. ``/etc/pagure/pagure.cfg``. Otherwise, it will depend on your
  8. setup/deployment.
  9. Must options
  10. ------------
  11. Here are the options you must set up in order to get pagure running.
  12. SECRET_KEY
  13. ~~~~~~~~~~
  14. This configuration key is used by flask to create the session. It should be kept secret
  15. and set as a long and random string.
  16. SALT_EMAIL
  17. ~~~~~~~~~~
  18. This configuration key is used to ensure that when sending
  19. notifications to different users, each one of them has a different, unique
  20. and unfakeable ``Reply-To`` header. This header is then used by the milter to find
  21. out if the response received is a real one or a fake/invalid one.
  22. DB_URL
  23. ~~~~~~
  24. This configuration key indicates to the framework how and where to connect to the database
  25. server. Pagure uses `SQLAchemy <http://www.sqlalchemy.org/>`_ to connect
  26. to a wide range of database server including MySQL, PostgreSQL, and SQLite.
  27. Examples values:
  28. ::
  29. DB_URL = 'mysql://user:pass@host/db_name'
  30. DB_URL = 'postgres://user:pass@host/db_name'
  31. DB_URL = 'sqlite:////var/tmp/pagure_dev.sqlite'
  32. Defaults to ``sqlite:////var/tmp/pagure_dev.sqlite``
  33. APP_URL
  34. ~~~~~~~
  35. This configuration key indicates the URL at which this pagure instance will be made available.
  36. Defaults to: ``http://localhost.localdomain/``
  37. EMAIL_ERROR
  38. ~~~~~~~~~~~
  39. Pagure sends email when it catches an unexpected error (which saves you from
  40. having to monitor the logs regularly; but if you like, the error is still
  41. present in the logs).
  42. This configuration key allows you to specify to which email address to send
  43. these error reports.
  44. GIT_URL_SSH
  45. ~~~~~~~~~~~
  46. This configuration key provides the information to the user on how to clone
  47. the git repos hosted on pagure via `SSH <https://en.wikipedia.org/wiki/Secure_Shell>`_.
  48. The URL should end with a slash ``/``.
  49. Defaults to: ``'ssh://git@llocalhost.localdomain/'``
  50. .. note:: If you are using a custom setup for your deployment where every
  51. user has an account on the machine you may want to tweak this URL
  52. to include the username. If that is the case, you can use
  53. ``{username}`` in the URL and it will be expanded to the username
  54. of the user viewing the page when rendered.
  55. For example: ``'ssh://{username}@pagure.org/'``
  56. GIT_URL_GIT
  57. ~~~~~~~~~~~
  58. This configuration key provides the information to the user on how to clone
  59. the git repos hosted on pagure anonymously. This access can be granted via
  60. the ``git://`` or ``http(s)://`` protocols.
  61. The URL should end with a slash ``/``.
  62. Defaults to: ``'git://localhost.localdomain/'``
  63. BROKER_URL
  64. ~~~~~~~~~~
  65. This configuration key is used to point celery to the broker to use. This
  66. is the broker that is used to communicate between the web application and
  67. its workers.
  68. Defaults to: ``'redis://%s' % APP.config['REDIS_HOST']``
  69. .. note:: See the :ref:`redis-section` for the ``REDIS_HOST`` configuration
  70. key
  71. Repo Directories
  72. ----------------
  73. Each project in pagure has 2 to 4 git repositories, depending on configuration
  74. of the Pagure instance (see below):
  75. - the main repo for the code
  76. - the doc repo showed in the doc server (optional)
  77. - the ticket repo storing the metadata of the tickets (optional)
  78. - the request repo storing the metadata of the pull-requests
  79. There are then another 3 folders: one for specifying the locations of the forks, one
  80. for the remote git repo used for the remotes pull-requests (ie: those coming from
  81. a project not hosted on this instance of pagure), and one for user-uploaded tarballs.
  82. GIT_FOLDER
  83. ~~~~~~~~~~
  84. This configuration key points to the folder where the git repos are stored.
  85. For every project, two to four repos are created:
  86. * a repo with source code of the project
  87. * a repo with documentation of the project
  88. (if ``ENABLE_DOCS`` is ``True``)
  89. * a repo with metadata of tickets opened against the project
  90. (if ``ENABLE_TICKETS`` is ``True``)
  91. * a repo with metadata of pull requests opened against the project
  92. Note that gitolite config value ``GL_REPO_BASE`` (if using gitolite 3)
  93. or ``$REPO_BASE`` (if using gitolite 2) **must** have exactly the same
  94. value as ``GIT_FOLDER``.
  95. REMOTE_GIT_FOLDER
  96. ~~~~~~~~~~~~~~~~~
  97. This configuration key points to the folder where the remote git repos (ie:
  98. not hosted on pagure) that someone used to open a pull-request against a
  99. project hosted on pagure are stored.
  100. UPLOAD_FOLDER_PATH
  101. ~~~~~~~~~~~~~~~~~~
  102. This configuration key points to the folder where user-uploaded tarballs
  103. are stored and served from.
  104. ATTACHMENTS_FOLDER
  105. ~~~~~~~~~~~~~~~~~~
  106. This configuration key points to the folder where attachments can be cached
  107. for easier access by the web-server (allowing to not interact with the git
  108. repo having it to serve it).
  109. UPLOAD_FOLDER_URL
  110. ~~~~~~~~~~~~~~~~~~
  111. Full URL to where the uploads are available. It is highly recommended for
  112. security reasons that this URL lives on a different domain than the main
  113. application (an entirely different domain, not just a sub-domain).
  114. Defaults to: ``/releases/``, unsafe for production!
  115. .. warning:: both `UPLOAD_FOLDER_PATH` and `UPLOAD_FOLDER_URL` must be
  116. specified for the upload release feature to work
  117. SESSION_COOKIE_SECURE
  118. ~~~~~~~~~~~~~~~~~~~~~
  119. When this is set to True, the session cookie will only be returned to the
  120. server via ssl (https). If you connect to the server via plain http, the
  121. cookie will not be sent. This prevents sniffing of the cookie contents.
  122. This may be set to False when testing your application but should always
  123. be set to True in production.
  124. Defaults to: ``False`` for development, must be ``True`` in production with
  125. https.
  126. SESSION_TYPE
  127. ~~~~~~~~~~~~
  128. Enables the `flask-session <https://pythonhosted.org/Flask-Session/>`_
  129. extension if set to a value other than ``None``. The ``flask-session``
  130. package needs to be installed and proper
  131. `configuration <https://pythonhosted.org/Flask-Session/#configuration>`_
  132. needs to be included in the Pagure config file.
  133. This is useful when the Pagure server needs to be scaled up to multiple
  134. instances, which requires the flask session keys to be shared between those.
  135. Flask-session allows you to use Redis, Memcached, relational database
  136. or MongoDB for storing shared session keys.
  137. FROM_EMAIL
  138. ~~~~~~~~~~
  139. This configuration key specifies the email address used by this pagure instance
  140. when sending emails (notifications).
  141. Defaults to: ``pagure@localhost.localdomain``
  142. DOMAIN_EMAIL_NOTIFICATIONS
  143. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  144. This configuration key specifies the domain used by this pagure instance
  145. when sending emails (notifications). More precisely, it is used
  146. when building the ``msg-id`` header of the emails sent.
  147. Defaults to: ``localhost.localdomain``
  148. VIRUS_SCAN_ATTACHMENTS
  149. ~~~~~~~~~~~~~~~~~~~~~~
  150. This configuration key configures whether attachments are scanned for viruses on
  151. upload. For more information, see the install.rst guide.
  152. Defaults to: ``False``
  153. GIT_AUTH_BACKEND
  154. ^^^^^^^^^^^^^^^^
  155. This configuration key allows specifying which git auth backend to use.
  156. Git auth backends can either be static (like gitolite), where a file is
  157. generated when something changed and then used on login, or dynamic,
  158. where the actual ACLs are checked in a git hook before being applied.
  159. By default pagure provides the following backends:
  160. - `test_auth`: simple debugging backend printing and returning the string ``Called GitAuthTestHelper.generate_acls()``
  161. - `gitolite2`: allows deploying pagure on the top of gitolite 2
  162. - `gitolite3`: allows deploying pagure on the top of gitolite 3
  163. - `pagure`: Pagure git auth implementation (using keyhelper.py and aclchecker.py)
  164. Defaults to: ``gitolite3``
  165. .. note:: The option GITOLITE_BACKEND is the legacy name, and for backwards compatibility reasons will override this setting
  166. .. note:: These options can be expended, cf :ref:`custom-gitolite`.
  167. Configure Gitolite
  168. ------------------
  169. Pagure can use `gitolite <http://gitolite.com/>`_ as an authorization layer.
  170. Gitolite relies on `SSH <https://en.wikipedia.org/wiki/Secure_Shell>`_ for
  171. the authentication. In other words, SSH lets you in and gitolite checks if
  172. you are allowed to do what you are trying to do once you are inside.
  173. Pagure supports both gitolite 2 and gitolite 3 and the code generating
  174. the gitolite configuration can be customized for easier integration with
  175. other systems (cf :ref:`custom-gitolite`).
  176. **gitolite 2 and 3**
  177. ~~~~~~~~~~~~~~~~~~~~
  178. GITOLITE_HOME
  179. ^^^^^^^^^^^^^
  180. This configuration key points to the home directory of the user under which
  181. gitolite is ran.
  182. GITOLITE_KEYDIR
  183. ^^^^^^^^^^^^^^^
  184. This configuration key points to the folder where gitolite stores and accesses
  185. the public SSH keys of all the user have access to the server.
  186. Since pagure is the user interface, it is pagure that writes down the files
  187. in this directory, effectively setting up the users to be able to use gitolite.
  188. GITOLITE_CONFIG
  189. ^^^^^^^^^^^^^^^
  190. This configuration key points to the gitolite.conf file where pagure writes
  191. the gitolite repository access configuration.
  192. GITOLITE_CELERY_QUEUE
  193. ^^^^^^^^^^^^^^^^^^^^^
  194. This configuration is useful for large pagure deployment where recompiling
  195. the gitolite config file can take a long time. By default the compilation
  196. of gitolite's configuration file is done by the pagure_worker, which spawns
  197. by default 4 concurrent workers. If it takes a while to recompile the
  198. gitolite configuration file, these workers may be stepping on each others'
  199. toes.
  200. In this situation, this configuration key allows you to direct the messages
  201. asking for the gitolite configuration file to be compiled to a different
  202. queue which can then be handled by a different service/worker.
  203. Pagure provides a ``pagure_gitolite_worker.service`` systemd service file
  204. pre-configured to handles these messages if this configuration key is set
  205. to ``gitolite_queue``.
  206. **gitolite 2 only**
  207. ~~~~~~~~~~~~~~~~~~~
  208. GL_RC
  209. ^^^^^
  210. This configuration key points to the file ``gitolite.rc`` used by gitolite
  211. to record who has access to what (ie: who has access to which repo/branch).
  212. GL_BINDIR
  213. ^^^^^^^^^
  214. This configuration key indicates the folder in which the gitolite tools can
  215. be found. It can be as simple as ``/usr/bin/`` if the tools have been installed
  216. using a package manager or something like ``/opt/bin/`` for a more custom
  217. install.
  218. **gitolite 3 only**
  219. ~~~~~~~~~~~~~~~~~~~
  220. GITOLITE_HAS_COMPILE_1
  221. ^^^^^^^^^^^^^^^^^^^^^^
  222. By setting this configuration key to ``True``, you can turn on using the
  223. gitolite ``compile-1`` binary. This speeds up gitolite task when it recompiles
  224. configuration after new project is created. In order to use this, you need to
  225. have the ``compile-1`` gitolite command.
  226. There are two ways to have it,
  227. #. You distribution already has the file installed for you and you can then
  228. just use it.
  229. #. You need to download and install it yourself. We are describing what
  230. needs to be done for this here below.
  231. Installing the ``compile-1`` command:
  232. * You also have to make sure that your distribution of gitolite contains
  233. `patch <https://github.com/sitaramc/gitolite/commit/c4b6521a4b82e639f6ed776abad79c>`_
  234. which makes gitolite respect ``ALLOW_ORPHAN_GL_CONF`` configuration variable,
  235. if this patch isn't already present, you will have to make the change yourself.
  236. * In your ``gitolite.rc`` set ``ALLOW_ORPHAN_GL_CONF`` to ``1`` (you may
  237. have to add it yourself).
  238. * Still in your ``gitolite.rc`` file, uncomment ``LOCAL_CODE`` file and set
  239. it to a full path of a directory that you choose (for example
  240. ``/usr/local/share/gitolite3``).
  241. * Create a subdirectory ``commands`` under the path you picked for ``LOCAL_CODE``
  242. (in our example, you will need to do: ``mkdir -p /usr/local/share/gitolite3/commands``)
  243. * Finally, install the ``compile-1`` command in this ``commands`` subdirectory
  244. If your installation doesn't ship this file, you can `download it
  245. <https://github.com/sitaramc/gitolite/blob/master/contrib/commands/compile-1>`_.
  246. (Ensure the file is executable, otherwise gitolite will not find it)
  247. Defaults to: ``False``
  248. EventSource options
  249. -------------------
  250. EVENTSOURCE_SOURCE
  251. ~~~~~~~~~~~~~~~~~~
  252. This configuration key indicates the URL at which the EventSource server is
  253. available. If not defined, pagure will behave as if there are no EventSource
  254. server running.
  255. EVENTSOURCE_PORT
  256. ~~~~~~~~~~~~~~~~
  257. This configuration key indicates the port at which the EventSource server is
  258. running.
  259. .. note:: The EventSource server requires a redis server (see ``Redis options``
  260. below)
  261. Web-hooks notifications
  262. -----------------------
  263. WEBHOOK
  264. ~~~~~~~
  265. This configuration key allows turning on or off web-hooks notifications for
  266. this pagure instance.
  267. Defaults to: ``False``.
  268. .. note:: The Web-hooks server requires a redis server (see ``Redis options``
  269. below)
  270. .. _redis-section:
  271. Redis options
  272. -------------
  273. REDIS_HOST
  274. ~~~~~~~~~~
  275. This configuration key indicates the host at which the `redis <http://redis.io/>`_
  276. server is running.
  277. Defaults to: ``0.0.0.0``.
  278. REDIS_PORT
  279. ~~~~~~~~~~
  280. This configuration key indicates the port at which the redis server can be
  281. contacted.
  282. Defaults to: ``6379``.
  283. REDIS_DB
  284. ~~~~~~~~
  285. This configuration key indicates the name of the redis database to use for
  286. communicating with the EventSource server.
  287. Defaults to: ``0``.
  288. Authentication options
  289. ----------------------
  290. ADMIN_GROUP
  291. ~~~~~~~~~~~
  292. List of groups, either local or remote (if the openid server used supports the
  293. group extension), that are the site admins. These admins can regenerate the
  294. gitolite configuration, the ssh key files, and the hook-token for every project
  295. as well as manage users and groups.
  296. PAGURE_ADMIN_USERS
  297. ~~~~~~~~~~~~~~~~~~
  298. List of local users that are the site admins. These admins have the same rights as
  299. the users in the admin groups listed above as well as admin rights to
  300. all projects hosted on this pagure instance.
  301. Celery Queue options
  302. --------------------
  303. In order to help prioritize between tasks having a direct impact on the user
  304. experience and tasks needed to be run on the background but not directly
  305. impacting the users, we have split the generic tasks triggered by the web
  306. application into three possible queues: Fast, Medium, Slow.
  307. If none of these options are set, a single queue will be used for all tasks.
  308. FAST_CELERY_QUEUE
  309. ~~~~~~~~~~~~~~~~~
  310. This configuration key can be used to specify a dedicated queue for tasks that
  311. are triggered by the web frontend and need to be processed quickly for the
  312. best user experience.
  313. This will be used for tasks such as creating a new project, forking or
  314. merging a pull-request.
  315. Defaults to: ``None``.
  316. MEDIUM_CELERY_QUEUE
  317. ~~~~~~~~~~~~~~~~~~~
  318. This configuration key can be used to specify a dedicated queue for tasks that
  319. are triggered by the web frontend and need to be processed but aren't critical
  320. for the best user experience.
  321. This will be used for tasks such as updating a file in a git repository.
  322. Defaults to: ``None``.
  323. SLOW_CELERY_QUEUE
  324. ~~~~~~~~~~~~~~~~~
  325. This configuration key can be used to specify a dedicated queue for tasks that
  326. are triggered by the web frontend, are slow and do not impact the user
  327. experience in the user interface.
  328. This will be used for tasks such as updating the ticket git repo based on
  329. the content posted in the user interface.
  330. Defaults to: ``None``.
  331. Stomp Options
  332. -------------
  333. Pagure integration with Stomp allows you to emit messages to any
  334. stomp-compliant message bus.
  335. STOMP_NOTIFICATIONS
  336. ~~~~~~~~~~~~~~~~~~~
  337. This configuration key can be used to turn on or off notifications via
  338. `stomp protocol <https://stomp.github.io/>`_. All other stomp-related
  339. settings don't need to be present if this is set to ``False``.
  340. Defaults to: ``False``.
  341. STOMP_BROKERS
  342. ~~~~~~~~~~~~~
  343. List of 2-tuples with broker domain names and ports. For example
  344. ``[('primary.msg.bus.com', 6543), ('backup.msg.bus.com`, 6543)]``.
  345. STOMP_HIERARCHY
  346. ~~~~~~~~~~~~~~~
  347. Base name of the hierarchy to emit messages to. For example
  348. ``/queue/some.hierarchy.``. Note that this **must** end with
  349. a dot. Pagure will append queue names such as ``project.new``
  350. to this value, resulting in queue names being e.g.
  351. ``/queue/some.hierarchy.project.new``.
  352. STOMP_SSL
  353. ~~~~~~~~~
  354. Whether or not to use SSL when connecting to message brokers.
  355. Defaults to: ``False``.
  356. STOMP_KEY_FILE
  357. ~~~~~~~~~~~~~~
  358. Absolute path to key file for SSL connection. Only required if
  359. ``STOMP_SSL`` is set to ``True``.
  360. STOMP_CERT_FILE
  361. ~~~~~~~~~~~~~~~
  362. Absolute path to certificate file for SSL connection. Only required if
  363. ``STOMP_SSL`` is set to ``True``.
  364. STOMP_CREDS_PASSWORD
  365. ~~~~~~~~~~~~~~~~~~~~
  366. Password for decoding ``STOMP_CERT_FILE`` and ``STOMP_KEY_FILE``. Only
  367. required if ``STOMP_SSL`` is set to ``True`` and credentials files are
  368. password-encoded.
  369. ALWAYS_STOMP_ON_COMMITS
  370. ~~~~~~~~~~~~~~~~~~~~~~~
  371. This configuration key can be used to enforce `stomp <https://stomp.github.io/>`_
  372. notifications on commits made on all projects in a pagure instance.
  373. Defaults to: ``False``.
  374. API token ACLs
  375. --------------
  376. ACLS
  377. ~~~~
  378. This configuration key lists all the ACLs that can be associated with an API
  379. token with a short description of what the ACL allows one to do.
  380. This key it not really meant to be changed unless you really know what you
  381. are doing.
  382. USER_ACLS
  383. ~~~~~~~~~
  384. This configuration key can be used to list which of the ACLs listed in ``ACLS``
  385. can be associated with an API token of a project in the (web) user interface.
  386. Use this configuration key in combination with ``ADMIN_API_ACLS`` to disable
  387. certain ACLs for users while allowing admins to generate keys with them.
  388. Defaults to: ``[key for key in ACLS.keys() if key != 'generate_acls_project']``
  389. (ie: all the ACLs in ``ACLS`` except for ``generate_acls_project``)
  390. ADMIN_API_ACLS
  391. ~~~~~~~~~~~~~~
  392. This configuration key can be used to list which of the ACLs listed in ``ACLS``
  393. can be generated by the ``pagure-admin`` CLI tool by admins.
  394. Defaults to: ``['issue_comment', 'issue_create', 'issue_change_status', 'pull_request_flag', 'pull_request_comment', 'pull_request_merge', 'generate_acls_project', 'commit_flag', 'create_branch']``
  395. CROSS_PROJECT_ACLS
  396. ~~~~~~~~~~~~~~~~~~
  397. This configuration key can be used to list which of the ACLs listed in ``ACLS``
  398. can be associated with a project-less API token in the (web) user interface.
  399. These project-less API tokens can be generated in the user's settings page
  400. and allows action in multiple projects instead of being restricted to a
  401. specific one.
  402. Defaults to: ``['create_project', 'fork_project', 'modify_project']``
  403. Optional options
  404. ----------------
  405. Theming
  406. ~~~~~~~
  407. THEME
  408. ^^^^^
  409. This configuration key allows you to specify the theme to be used. The
  410. string specified is the name of the theme directory in ``pagure/themes/``
  411. For more information about theming see the :doc:`usage/theming`
  412. Default options:
  413. - ``chameleon`` The OpenSUSE theme for pagure
  414. - ``default`` The default theme for pagure
  415. - ``pagureio`` The theme used at https://pagure.io
  416. - ``srcfpo`` The theme used at https://src.fedoraproject.org
  417. Defaults to: ``default``
  418. Git repository templates
  419. ~~~~~~~~~~~~~~~~~~~~~~~~
  420. PROJECT_TEMPLATE_PATH
  421. ^^^^^^^^^^^^^^^^^^^^^
  422. This configuration key allows you to specify the path to a git repository
  423. to use as a template when creating new repository for new projects.
  424. This template will not be used for forks nor any of the git repository but
  425. the one used for the sources (ie: it will not be used for the tickets,
  426. requests or docs repositories).
  427. FORK_TEMPLATE_PATH
  428. ^^^^^^^^^^^^^^^^^^
  429. This configuration key allows you to specify the path to a git repository
  430. to use as a template when creating new repository for new forks.
  431. This template will not be used for any of the git repository but
  432. the one used for the sources of forks (ie: it will not be used for the
  433. tickets, requests or docs repositories).
  434. SSH_KEYS
  435. ~~~~~~~~
  436. It is a good practice to publish the fingerprint and public SSH key of a
  437. server you provide access to.
  438. Pagure offers the possibility to expose this information based on the values
  439. set in the configuration file, in the ``SSH_KEYS`` configuration key.
  440. See the `SSH hostkeys/Fingerprints page on pagure.io <https://pagure.io/ssh_info>`_.
  441. .. warning: The format is important
  442. SSH_KEYS = {'RSA': {'fingerprint': '<foo>', 'pubkey': '<bar>'}}
  443. Where `<foo>` and `<bar>` must be replaced by your values.
  444. CSP_HEADERS
  445. ~~~~~~~~~~~
  446. Content Security Policy (CSP) is a computer security standard introduced to
  447. prevent cross-site scripting (XSS), clickjacking and other code injection
  448. attacks resulting from execution of malicious content in the trusted web page
  449. context
  450. Source: https://en.wikipedia.org/wiki/Content_Security_Policy
  451. Defaults to:
  452. ::
  453. CSP_HEADERS = (
  454. "default-src 'self' https:; "
  455. "script-src 'self' 'nonce-{nonce}'; "
  456. "style-src 'self' 'nonce-{nonce}'"
  457. )
  458. Where ``{nonce}`` is dynamically set by pagure.
  459. LOGGING
  460. ~~~~~~~
  461. This configuration key allows you to set up the logging of the application.
  462. It relies on the standard `python logging module
  463. <https://docs.python.org/2/library/logging.html>`_.
  464. The default value is:
  465. ::
  466. LOGGING = {
  467. 'version': 1,
  468. 'disable_existing_loggers': False,
  469. 'formatters': {
  470. 'standard': {
  471. 'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
  472. },
  473. 'email_format': {
  474. 'format': MSG_FORMAT
  475. }
  476. },
  477. 'filters': {
  478. 'myfilter': {
  479. '()': ContextInjector,
  480. }
  481. },
  482. 'handlers': {
  483. 'console': {
  484. 'level': 'INFO',
  485. 'formatter': 'standard',
  486. 'class': 'logging.StreamHandler',
  487. 'stream': 'ext://sys.stdout',
  488. },
  489. 'email': {
  490. 'level': 'ERROR',
  491. 'formatter': 'email_format',
  492. 'class': 'logging.handlers.SMTPHandler',
  493. 'mailhost': 'localhost',
  494. 'fromaddr': 'pagure@localhost',
  495. 'toaddrs': 'root@localhost',
  496. 'subject': 'ERROR on pagure',
  497. 'filters': ['myfilter'],
  498. },
  499. },
  500. # The root logger configuration; this is a catch-all configuration
  501. # that applies to all log messages not handled by a different logger
  502. 'root': {
  503. 'level': 'INFO',
  504. 'handlers': ['console'],
  505. },
  506. 'loggers': {
  507. 'pagure': {
  508. 'handlers': ['console'],
  509. 'level': 'DEBUG',
  510. 'propagate': True
  511. },
  512. 'flask': {
  513. 'handlers': ['console'],
  514. 'level': 'INFO',
  515. 'propagate': False
  516. },
  517. 'sqlalchemy': {
  518. 'handlers': ['console'],
  519. 'level': 'WARN',
  520. 'propagate': False
  521. },
  522. 'binaryornot': {
  523. 'handlers': ['console'],
  524. 'level': 'WARN',
  525. 'propagate': True
  526. },
  527. 'pagure.lib.encoding_utils': {
  528. 'handlers': ['console'],
  529. 'level': 'WARN',
  530. 'propagate': False
  531. },
  532. }
  533. }
  534. .. note:: as you can see there is an ``email`` handler defined. It's not used
  535. anywhere by default but you can use it to get report of errors by email
  536. and thus monitor your pagure instance.
  537. To do this the easiest is to set, on the ``root`` logger:
  538. ::
  539. 'handlers': ['console', 'email'],
  540. ITEM_PER_PAGE
  541. ~~~~~~~~~~~~~
  542. This configuration key allows you to configure the length of a page by
  543. setting the number of items on the page. Items can be commits, users, groups,
  544. or projects for example.
  545. Defaults to: ``50``.
  546. PR_TARGET_MATCHING_BRANCH
  547. ~~~~~~~~~~~~~~~~~~~~~~~~~
  548. If set to ``True``, the default target branch for all pull requests in UI
  549. is the branch that is longest substring of the branch that the pull request
  550. is created from. For example, a ``mybranch`` branch in original repo will
  551. be the default target of a pull request from branch ``mybranch-feature-1``
  552. in a fork when opening a new pull request. If this is set to ``False``,
  553. the default branch of the repo will be the default target of all pull requests.
  554. Defaults to: ``False``.
  555. SMTP configuration
  556. ~~~~~~~~~~~~~~~~~~
  557. SMTP_SERVER
  558. ^^^^^^^^^^^
  559. This configuration key specifies the SMTP server to use when
  560. sending emails.
  561. Defaults to: ``localhost``.
  562. SMTP_PORT
  563. ^^^^^^^^^
  564. This configuration key specifies the SMTP server port.
  565. SMTP by default uses TCP port 25. The protocol for mail submission is
  566. the same, but uses port 587.
  567. SMTP connections secured by SSL, known as SMTPS, default to port 465
  568. (nonstandard, but sometimes used for legacy reasons).
  569. Defaults to: ``25``
  570. SMTP_SSL
  571. ^^^^^^^^
  572. This configuration key specifies whether the SMTP connections
  573. should be secured over SSL.
  574. Defaults to: ``False``
  575. SMTP_USERNAME
  576. ^^^^^^^^^^^^^
  577. This configuration key allows usage of SMTP with auth.
  578. Note: Specify SMTP_USERNAME and SMTP_PASSWORD for using SMTP auth
  579. Defaults to: ``None``
  580. SMTP_PASSWORD
  581. ^^^^^^^^^^^^^
  582. This configuration key allows usage of SMTP with auth.
  583. Note: Specify SMTP_USERNAME and SMTP_PASSWORD for using SMTP auth
  584. Defaults to: ``None``
  585. SHORT_LENGTH
  586. ~~~~~~~~~~~~
  587. This configuration key specifies the length of the commit ids or
  588. file hex displayed in the user interface.
  589. Defaults to: ``6``.
  590. BLACKLISTED_PROJECTS
  591. ~~~~~~~~~~~~~~~~~~~~
  592. This configuration key specifies a list of project names that are forbidden.
  593. This list is used for example to avoid conflicts at the URL level between the
  594. static files located under ``/static/`` and a project that would be named
  595. ``static`` and thus be located at ``/static``.
  596. Defaults to:
  597. ::
  598. [
  599. 'static', 'pv', 'releases', 'new', 'api', 'settings',
  600. 'logout', 'login', 'users', 'groups', 'about'
  601. ]
  602. CHECK_SESSION_IP
  603. ~~~~~~~~~~~~~~~~
  604. This configuration key specifies whether to check the user's IP
  605. address when retrieving its session. This makes things more secure but
  606. under certain setups it might not work (for example if there
  607. are proxies in front of the application).
  608. Defaults to: ``True``.
  609. PAGURE_AUTH
  610. ~~~~~~~~~~~~
  611. This configuration key specifies which authentication method to use.
  612. Valid options are ``fas``, ``openid``, ``oidc``, or ``local``.
  613. * ``fas`` uses the Fedora Account System `FAS <https://admin.fedoraproject.org/accounts>`
  614. to provide user authentication and enforces that users sign the FPCA.
  615. * ``openid`` uses OpenID authentication. Any provider may be used by
  616. changing the FAS_OPENID_ENDPOINT configuration key. By default
  617. FAS (without FPCA) will be used.
  618. * ``oidc`` enables OpenID Connect using any provider. This provider requires
  619. the configuration options starting with ``OIDC_`` (see below) to be provided.
  620. * ``local`` causes pagure to use the local pagure database for user management.
  621. Defaults to: ``local``.
  622. OIDC Settings
  623. ~~~~~~~~~~~~~
  624. .. note:: Pagure uses `flask-oidc <https://github.com/puiterwijk/flask-oidc/>`_
  625. to support OIDC authentication. This extension has a `number of configuration
  626. keys <http://flask-oidc.readthedocs.io/en/latest/#settings-reference>`_
  627. that may be useful depending on your set-up
  628. OIDC_CLIENT_SECRETS
  629. ^^^^^^^^^^^^^^^^^^^
  630. Provide a path to client secrets file on local filesystem. This file can be
  631. obtained from your OpenID Connect identity provider. Note that some providers
  632. don't fill in ``userinfo_uri``. If that is the case, you need to add it to
  633. the secrets file manually.
  634. OIDC_ID_TOKEN_COOKIE_SECURE
  635. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  636. When this is set to True, the cookie with OpenID Connect Token will only be
  637. returned to the server via ssl (https). If you connect to the server via plain
  638. http, the cookie will not be sent. This prevents sniffing of the cookie contents.
  639. This may be set to False when testing your application but should always
  640. be set to True in production.
  641. Defaults to: ``True`` for production with https, can be set to ``False`` for
  642. convenient development.
  643. OIDC_SCOPES
  644. ^^^^^^^^^^^
  645. List of `OpenID Connect scopes http://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims`
  646. to request from identity provider.
  647. OIDC_PAGURE_EMAIL
  648. ^^^^^^^^^^^^^^^^^
  649. Name of key of user's email in userinfo JSON returned by identity provider.
  650. OIDC_PAGURE_FULLNAME
  651. ^^^^^^^^^^^^^^^^^^^^
  652. Name of key of user's full name in userinfo JSON returned by identity provider.
  653. OIDC_PAGURE_USERNAME
  654. ^^^^^^^^^^^^^^^^^^^^
  655. Name of key of user's preferred username in userinfo JSON returned by identity
  656. provider.
  657. OIDC_PAGURE_SSH_KEY
  658. ^^^^^^^^^^^^^^^^^^^
  659. Name of key of user's ssh key in userinfo JSON returned by identity provider.
  660. OIDC_PAGURE_GROUPS
  661. ^^^^^^^^^^^^^^^^^^
  662. Name of key of user's groups in userinfo JSON returned by identity provider.
  663. OIDC_PAGURE_USERNAME_FALLBACK
  664. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  665. This specifies fallback for getting username assuming ``OIDC_PAGURE_USERNAME``
  666. is empty - can be ``email`` (to use the part before ``@``) or ``sub``
  667. (IdP-specific user id, can be a nickname, email or a numeric ID
  668. depending on identity provider).
  669. IP_ALLOWED_INTERNAL
  670. ~~~~~~~~~~~~~~~~~~~
  671. This configuration key specifies which IP addresses are allowed
  672. to access the internal API endpoint. These endpoints are accessed by the
  673. milters for example and allow performing actions in the name of someone else
  674. which is sensitive, thus the origin of the request using
  675. these endpoints is validated.
  676. Defaults to: ``['127.0.0.1', 'localhost', '::1']``.
  677. MAX_CONTENT_LENGTH
  678. ~~~~~~~~~~~~~~~~~~
  679. This configuration key specifies the maximum file size allowed when
  680. uploading content to pagure (for example, screenshots to a ticket).
  681. Defaults to: ``4 * 1024 * 1024`` which corresponds to 4 megabytes.
  682. ENABLE_TICKETS
  683. ~~~~~~~~~~~~~~
  684. This configuration key activates or deactivates the ticketing system
  685. for all the projects hosted on this pagure instance.
  686. Defaults to: ``True``
  687. ENABLE_TICKETS_NAMESPACE
  688. ~~~~~~~~~~~~~~~~~~~~~~~~
  689. This configuration key can be used to restrict the namespace in which the ticketing
  690. system is enabled.
  691. So if your pagure instance has ``ENABLE_TICKETS`` as ``True`` and sets
  692. ``ENABLE_TICKETS_NAMESPACE`` to ``['tests', 'infra']`` only the projects opened
  693. in these two namespaces will have the ticketing system enabled. All the other
  694. namespaces will not.
  695. Defaults to: ``[]``
  696. ENABLE_DOCS
  697. ~~~~~~~~~~~
  698. This configuration key activates or deactivates creation of git repos
  699. for documentation for all the projects hosted on this pagure instance.
  700. Defaults to: ``True``
  701. ENABLE_NEW_PROJECTS
  702. ~~~~~~~~~~~~~~~~~~~
  703. This configuration key permits or forbids creation of new projects via
  704. the user interface and the API of this pagure instance.
  705. Defaults to: ``True``
  706. ENABLE_UI_NEW_PROJECTS
  707. ~~~~~~~~~~~~~~~~~~~~~~
  708. This configuration key permits or forbids creation of new projects via
  709. the user interface (only) of this pagure instance. It allows forbidding
  710. to create new project in the user interface while letting a set of trusted
  711. person to create projects via the API granted they have the API token with
  712. the corresponding ACL.
  713. Defaults to: ``True``
  714. ENABLE_DEL_PROJECTS
  715. ~~~~~~~~~~~~~~~~~~~
  716. This configuration key permits or forbids deletion of projects via
  717. the user interface of this pagure instance.
  718. Defaults to: ``True``
  719. ENABLE_DEL_FORKS
  720. ~~~~~~~~~~~~~~~~
  721. This configuration key permits or forbids deletion of forks via
  722. the user interface of this pagure instance.
  723. Defaults to: ``ENABLE_DEL_PROJECTS``
  724. GIT_HOOK_DB_RO
  725. ~~~~~~~~~~~~~~
  726. This configuration key specifies if the git hook have a read-only (RO) access
  727. to the database or not.
  728. Some pagure deployment provide an actual shell account on the host and thus the
  729. git hook called upon git push are executed under that account. If the user
  730. manages to by-pass git and is able to access the configuration file, they could
  731. have access to "private" information. So in those deployments the git hooks
  732. have a specific configuration file with a database access that is read-only,
  733. making pagure behave differently in those situations.
  734. Defaults to: ``False``
  735. EMAIL_SEND
  736. ~~~~~~~~~~
  737. This configuration key enables or disables all email notifications for
  738. this pagure instance. This can be useful to turn off when developing on
  739. pagure, or for test or pre-production instances.
  740. Defaults to: ``False``.
  741. .. note::
  742. This does not disable emails to the email address set in ``EMAIL_ERROR``.
  743. FEDMSG_NOTIFICATIONS
  744. ~~~~~~~~~~~~~~~~~~~~
  745. This configuration key can be used to turn on or off notifications via `fedmsg
  746. <http://www.fedmsg.com/>`_.
  747. Defaults to: ``False``.
  748. FEDORA_MESSAGING_NOTIFICATIONS
  749. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  750. This configuration key can be used to turn on or off sending notifications via
  751. `fedora-messaging <>`_.
  752. Defaults to: ``False``.
  753. ALWAYS_FEDMSG_ON_COMMITS
  754. ~~~~~~~~~~~~~~~~~~~~~~~~
  755. This configuration key can be used to enforce `fedmsg <http://www.fedmsg.com/>`_
  756. notifications on commits made on all projects in a pagure instance.
  757. Defaults to: ``True``.
  758. ALLOW_DELETE_BRANCH
  759. ~~~~~~~~~~~~~~~~~~~
  760. This configuration keys enables or disables allowing users to delete git
  761. branches from the user interface. In sensible pagure instance you may
  762. want to turn this off and with a customized gitolite configuration you can
  763. prevent users from deleting branches in their git repositories.
  764. Defaults to: ``True``.
  765. ALLOW_ADMIN_IGNORE_EXISTING_REPOS
  766. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  767. This enables a checkbox "Ignore existing repos" for admins when creating a new
  768. project. When this is checkbox is checked, existing repositories will not cause
  769. project creation to fail.
  770. This could be used to assume responsibility of existing repositories.
  771. Defaults to: ``False``.
  772. USERS_IGNORE_EXISTING_REPOS
  773. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  774. List of users who can al create a project while ignoring existing repositories.
  775. Defaults to: ``[]``.
  776. LOCAL_SSH_KEY
  777. ~~~~~~~~~~~~~
  778. This configuration key can be used to let pagure administrate the user's ssh keys
  779. or have a third party tool do it for you.
  780. In most cases, it will be fine to let pagure handle it.
  781. Defaults to ``True``.
  782. DEPLOY_KEY
  783. ~~~~~~~~~~
  784. This configuration key can be used to disable the deploy keys feature of an
  785. entire pagure instance. This feature enable to add extra public ssh keys
  786. that a third party could use to push to a project.
  787. Defaults to ``True``.
  788. OLD_VIEW_COMMIT_ENABLED
  789. ~~~~~~~~~~~~~~~~~~~~~~~
  790. In version 1.3, pagure changed its URL scheme to view the commit of a
  791. project in order to add support for pseudo-namespaced projects.
  792. For pagure instances older than 1.3, who care about backward compatibility,
  793. we added an endpoint ``view_commit_old`` that brings URL backward
  794. compatibility for URLs using the complete git hash (the 40 characters).
  795. For URLs using a shorter hash, the URLs will remain broken.
  796. This configuration key enables or disables this backward compatibility
  797. which is useful for pagure instances running since before 1.3 but is not
  798. for newer instances.
  799. Defaults to: ``False``.
  800. DISABLE_REMOTE_PR
  801. ~~~~~~~~~~~~~~~~~
  802. In some pagure deployments remote pull requests need to be disabled
  803. due to legal / policy reasons.
  804. Defaults to: ``False``.
  805. PAGURE_CI_SERVICES
  806. ~~~~~~~~~~~~~~~~~~
  807. Pagure can be configure to integrate results of a Continuous Integration (CI)
  808. service to pull-requests open against a project.
  809. To enable this integration, follow the documentation on how to install
  810. pagure-ci and set this configuration key to ``['jenkins']`` (Jenkins being
  811. the only CI service supported at the moment).
  812. Defaults to: ``None``.
  813. .. warning:: Requires `Redis` to be configured and running.
  814. INSTANCE_NAME
  815. ~~~~~~~~~~~~~
  816. This allows giving a name to this running instance of pagure. The name is
  817. then used in the welcome screen shown upon first login.
  818. Defaults to: ``Pagure``
  819. .. note: the welcome screen currently does not work with the `local`
  820. authentication.
  821. ADMIN_EMAIL
  822. ~~~~~~~~~~~
  823. This configuration key allows you to change the default administrator email
  824. which is displayed on the "about" page. It can also be used elsewhere.
  825. Defaults to: ``root@localhost.localdomain``
  826. USER_NAMESPACE
  827. ~~~~~~~~~~~~~~
  828. This configuration key can be used to enforce that project are namespaced under
  829. the user's username, behaving in this way in a similar fashion as github.com
  830. or gitlab.com.
  831. Defaults to: ``False``
  832. DOC_APP_URL
  833. ~~~~~~~~~~~
  834. This configuration key allows you to specify where the documentation server
  835. is running (preferably in a different domain name entirely).
  836. If not set, the documentation page will show an error message saying that
  837. this pagure instance does not have a documentation server.
  838. Defaults to: ``None``
  839. PRIVATE_PROJECTS
  840. ~~~~~~~~~~~~~~~~
  841. This configuration key allows you to host private repositories. These
  842. repositories are visible only to the creator of the repository and to the
  843. users who are given access to the repository. No information is leaked about the
  844. private repository which means redis doesn't have the access to the repository
  845. and even fedmsg doesn't get any notifications.
  846. Defaults to: ``True``
  847. EXCLUDE_GROUP_INDEX
  848. ~~~~~~~~~~~~~~~~~~~
  849. This configuration key can be used to hide project an user has access to via
  850. one of the groups listed in this key.
  851. The use-case is the following: the Fedora project is deploying pagure has a
  852. front-end for the git repos of the packages in the distribution, that means
  853. about 17,000 git repositories in pagure. The project has a group of people
  854. that have access to all of these repositories, so when viewing the user's
  855. page of one member of that group, instead of seeing all the project that
  856. this user works on, you can see all the projects hosted in that pagure
  857. instance. Using this configuration key, pagure will hide all the projects
  858. that this user has access to via the specified groups and thus return only
  859. the groups of forks of that users.
  860. Defaults to: ``[]``
  861. TRIGGER_CI
  862. ~~~~~~~~~~
  863. A run of pagure-ci can be manually triggered if some key sentences are added
  864. as comment to a pull-request, either manually or via the "Rerun CI" dropdown.
  865. This allows one to re-run a test that failed due to some network outage or other
  866. unexpected issues unrelated to the test suite.
  867. This configuration key can be used to define all the sentences that can be used
  868. to trigger this pagure-ci run. The format is following: ``{"<sentence>":
  869. {"name": "<name of the CI>", "description": "<short description>"}}``
  870. Sentences which have ``None`` as value won't show up in the "Rerun CI"
  871. dropdown. Additionally, it's possible to add a ``requires_project_hook_attr``
  872. key to the dict with data about a sentence. For example, having
  873. ``"requires_project_hook_attr": ("ci_hook", "active_pr", True)`` would make
  874. the "Rerun CI" dropdown have a button for this specific CI only if the
  875. project has ``ci_hook`` activated and its ``active_pr`` value is ``True``.
  876. In versions before 5.2, this was a list containing just the sentences.
  877. Defaults to: ``{"pretty please pagure-ci rebuild": {"name": "Default CI",
  878. "description": "Rerun default CI"}}``
  879. .. note:: The sentences defined in this configuration key should be lower
  880. case only!
  881. FLAG_STATUSES_LABELS
  882. ~~~~~~~~~~~~~~~~~~~~
  883. By default, Pagure has ``success``, ``failure``, ``error``, ``pending`` and
  884. ``canceled`` statuses of PR and commit flags. This setting allows you to
  885. define a custom mapping of statuses to their respective Bootstrap labels.
  886. FLAG_SUCCESS
  887. ~~~~~~~~~~~~
  888. Holds name of PR/commit flag that is considered a success.
  889. Defaults to: ``success``
  890. FLAG_FAILURE
  891. ~~~~~~~~~~~~
  892. Holds name of PR/commit flag that is considered a failure.
  893. Defaults to: ``failure``
  894. FLAG_PENDING
  895. ~~~~~~~~~~~~
  896. Holds name of PR/commit flag that is considered a pending state.
  897. Defaults to: ``pending``
  898. EXTERNAL_COMMITTER
  899. ~~~~~~~~~~~~~~~~~~
  900. The external committer feature is a way to allow members of groups defined
  901. outside pagure (and provided to pagure upon login by the authentication
  902. system) to be consider committers on pagure.
  903. This feature can give access to all the projects on the instance, all but
  904. some or just some.
  905. Defaults to: ``{}``
  906. To give access to all the projects to a group named ``fedora-altarch`` use
  907. a such a structure::
  908. EXTERNAL_COMMITTER = {
  909. 'fedora-altarch': {}
  910. }
  911. To give access to all the projects but one (named ``rpms/test``) to a group
  912. named ``provenpackager`` use a such a structure::
  913. EXTERNAL_COMMITTER = {
  914. 'fedora-altarch': {},
  915. 'provenpackager': {
  916. 'exclude': ['rpms/test']
  917. }
  918. }
  919. To give access to just some projects (named ``rpms/test`` and
  920. ``modules/test``) to a group named ``testers`` use a such a structure::
  921. EXTERNAL_COMMITTER = {
  922. 'fedora-altarch': {},
  923. 'provenpackager': {
  924. 'exclude': ['rpms/test']
  925. },
  926. 'testers': {
  927. 'restrict': ['rpms/test', 'modules/test']
  928. }
  929. }
  930. REQUIRED_GROUPS
  931. ~~~~~~~~~~~~~~~
  932. The required groups allows one to specify in which group an user must be to be
  933. added to a project with commit or admin access.
  934. Defaults to: ``{}``
  935. Example configuration::
  936. REQUIRED_GROUPS = {
  937. 'rpms/kernel': ['packager', 'kernel-team'],
  938. 'modules/*': ['module-packager', 'packager'],
  939. 'rpms/*': ['packager'],
  940. '*': ['contributor'],
  941. }
  942. With this configuration (evaluated in the provided order):
  943. * only users that are in the groups ``packager`` and ``kernel-team`` will be
  944. allowed to be added the ``rpms/kernel`` project (where ``rpms`` is the
  945. namespace and ``kernel`` the project name).
  946. * only users that are in the groups ``module-packager`` and ``packager``
  947. will be allowed to be added to projects in the ``modules`` namespace.
  948. * only users that are in the group ``packager`` will be allowed to be added
  949. to projects in the ``rpms`` namespace.
  950. * only users in the ``contributor`` group will be allowed to be added to
  951. any project on this pagure instance.
  952. GITOLITE_PRE_CONFIG
  953. ~~~~~~~~~~~~~~~~~~~
  954. This configuration key allows you to include some content at the *top* of
  955. the gitolite configuration file (such as some specific group definition),
  956. thus allowing to customize the gitolite configuration file with elements
  957. and information that are outside of pagure's control.
  958. This can be used in combination with ``GITOLITE_POST_CONFIG`` to further
  959. customize gitolite's configuration file. It can also be used with
  960. ``EXTERNAL_COMMITTER`` to give commit access to git repos based on external
  961. information.
  962. Defaults to: ``None``
  963. GITOLITE_POST_CONFIG
  964. ~~~~~~~~~~~~~~~~~~~~
  965. This configuration key allows you to include some content at the *end* of
  966. the gitolite configuration file (such as some project definition or access),
  967. thus allowing to customize the gitolite configuration file with elements
  968. and information that are outside of pagure's control.
  969. This can be used in combination with ``GITOLITE_PRE_CONFIG`` to further
  970. customize gitolite's configuration file. It can also be used with
  971. ``EXTERNAL_COMMITTER`` to give commit access to git repos based on external
  972. information.
  973. Defaults to: ``None``
  974. GIT_GARBAGE_COLLECT
  975. ~~~~~~~~~~~~~~~~~~~
  976. This configuration key allows for explicit running of ``git gc --auto``
  977. after every operation that adds new objects to any git repository -
  978. that is after pushing and merging. The reason for having this functionality
  979. in Pagure is that gc is not guaranteed to be run by git after every
  980. object-adding operation.
  981. The garbage collection run by Pagure will respect git settings, so you
  982. can tweak ``gc.auto`` and ``gc.autoPackLimit`` to your liking
  983. and that will have immediate effect on the task that runs the garbage
  984. collection. These values can be configured system-wide in ``/etc/gitconfig``.
  985. See https://git-scm.com/docs/git-gc#git-gc---auto for more details.
  986. This is especially useful if repositories are stored on NFS (or similar
  987. network storage), where file metadata access is expensive - having unpacked
  988. objects in repositories requires *a lot* of metadata reads.
  989. Note that the garbage collection is only run on repos that are not on
  990. repoSpanner.
  991. Defaults to: ``False``
  992. CELERY_CONFIG
  993. ~~~~~~~~~~~~~
  994. This configuration key allows you to tweak the configuration of celery for
  995. your needs.
  996. See the documentation about `celery configuration
  997. <http://docs.celeryproject.org/en/latest/userguide/configuration.html>`_ for
  998. more information.
  999. Defaults to: ``{}``
  1000. CASE_SENSITIVE
  1001. ~~~~~~~~~~~~~~
  1002. This configuration key can be used to make this pagure instance case sensitive
  1003. instead of its default: case-insensitive.
  1004. Defaults to: ``False``
  1005. PROJECT_NAME_REGEX
  1006. ~~~~~~~~~~~~~~~~~~
  1007. This configuration key can be used to customize the regular expression used to
  1008. validate new project name.
  1009. Defaults to: ``^[a-zA-z0-9_][a-zA-Z0-9-_]*$``
  1010. APPLICATION_ROOT
  1011. ~~~~~~~~~~~~~~~~
  1012. This configuration key is used in the path of the cookie used by pagure.
  1013. Defaults to: ``'/'``
  1014. ALLOWED_PREFIX
  1015. ~~~~~~~~~~~~~~
  1016. This configuration key can be used to specify a list of allowed namespaces that
  1017. will not require creating a group for users to create projects in.
  1018. Defaults to: ``[]``
  1019. ADMIN_SESSION_LIFETIME
  1020. ~~~~~~~~~~~~~~~~~~~~~~
  1021. This configuration key allows specifying the lifetime of the session during
  1022. which the user won't have to re-login for admin actions.
  1023. In other words, the maximum time between which an user can access a project's
  1024. settings page without re-login.
  1025. Defaults to: ``timedelta(minutes=20)``
  1026. where timedelta comes from the python datetime module
  1027. BLACKLISTED_GROUPS
  1028. ~~~~~~~~~~~~~~~~~~
  1029. This configuration key can be used to blacklist some group names.
  1030. Defaults to: ``['forks', 'group']``
  1031. ENABLE_GROUP_MNGT
  1032. ~~~~~~~~~~~~~~~~~
  1033. This configuration key can be used to turn on or off managing (ie: creating a
  1034. group, adding or removing users in that group) groups in this pagure instance.
  1035. If turned off, groups and group members are to be managed outside of pagure
  1036. and synced upon login.
  1037. Defaults to: ``True``
  1038. ENABLE_USER_MNGT
  1039. ~~~~~~~~~~~~~~~~
  1040. This configuration key can be used to turn on or off managing users (adding or
  1041. removing them from a project) in this pagure instance.
  1042. If turned off, users are managed outside of pagure.
  1043. Defaults to: ``True``
  1044. SESSION_COOKIE_NAME
  1045. ~~~~~~~~~~~~~~~~~~~
  1046. This configuration key can be used to specify the name of the session cookie used
  1047. by pagure.
  1048. Defaults to: ``'pagure'``
  1049. SHOW_PROJECTS_INDEX
  1050. ~~~~~~~~~~~~~~~~~~~
  1051. This configuration key can be used to specify what is shown in the index page of
  1052. logged in users.
  1053. Defaults to: ``['repos', 'myrepos', 'myforks']``
  1054. EMAIL_ON_WATCHCOMMITS
  1055. ~~~~~~~~~~~~~~~~~~~~~
  1056. By default pagure sends an email to every one watch commits on a project when a
  1057. commit is made.
  1058. However some pagure instances may be using a different notification mechanism on
  1059. commits and thus may not want this feature to double the notifications received.
  1060. This configuration key can be used to turn on or off email being sent to people
  1061. watching commits on a project upon commits.
  1062. Defaults to: ``True``
  1063. ALLOW_HTTP_PULL_PUSH
  1064. ~~~~~~~~~~~~~~~~~~~~
  1065. This configuration key controls whether any HTTP access to repositories is provided
  1066. via the support for that that's embedded in Pagure.
  1067. This provides HTTP pull access via <pagureurl>/<reponame>.git if nothing else
  1068. serves this URL.
  1069. Defaults to: ``True``
  1070. ALLOW_HTTP_PUSH
  1071. ~~~~~~~~~~~~~~~
  1072. This configuration key controls whether pushing is possible via the HTTP interface.
  1073. This is disabled by default, as it requires setting up an authentication mechanism
  1074. on the webserver that sets REMOTE_USER.
  1075. Defaults to: ``False``
  1076. HTTP_REPO_ACCESS_GITOLITE
  1077. ~~~~~~~~~~~~~~~~~~~~~~~~~
  1078. This configuration key configures the path to the gitolite-shell binary.
  1079. If this is set to None, Git http-backend is used directly.
  1080. Only set this to ``None`` if you intend to provide HTTP push access via Pagure, and
  1081. are using a dynamic ACL backend.
  1082. Defaults to: ``/usr/share/gitolite3/gitolite-shell``
  1083. MIRROR_SSHKEYS_FOLDER
  1084. ~~~~~~~~~~~~~~~~~~~~~
  1085. This configuration key specificies where pagure should store the ssh keys
  1086. generated for the mirroring feature. This folder should be properly backed up
  1087. and kept secure.
  1088. Defaults to: ``/var/lib/pagure/sshkeys/``
  1089. LOG_ALL_COMMITS
  1090. ~~~~~~~~~~~~~~~
  1091. This configuration key will make pagure log all commits pushed to all
  1092. branches of all repositories instead of logging only the once that are
  1093. pushed to the default branch.
  1094. Defaults to: ``False``
  1095. DISABLE_MIRROR_IN
  1096. ~~~~~~~~~~~~~~~~~
  1097. This configuration key allows a pagure instance to not support mirroring in
  1098. projects (from third party git server).
  1099. Defaults to: ``False``
  1100. SYNTAX_ALIAS_OVERRIDES
  1101. ~~~~~~~~~~~~~~~~~~~~~~
  1102. This configuration key can be used to force highlight.js to use a certain logic
  1103. on certain files based on their extensions.
  1104. It should be a dictionary containing the file extensions as keys and
  1105. the highlighting language/category to use as values.
  1106. Defaults to: ``{".spec": "specfile", ".patch": "diff"}``
  1107. RepoSpanner Options
  1108. -------------------
  1109. Pagure can be integrated with `repoSpanner <https://repospanner.org>`_
  1110. allowing to deploy pagure in a load-balanced environment since the git
  1111. repositories are then synced across multiple servers simultaneously.
  1112. Support for this integration has been included in Pagure version 5.0 and higher.
  1113. Here below are the different options one can/should use to integrate pagure
  1114. with repoSpanner.
  1115. REPOBRIDGE_BINARY
  1116. ~~~~~~~~~~~~~~~~~
  1117. This should contain the path to the repoBridge binary, which is used for pushing
  1118. and pulling to/from repoSpanner.
  1119. Defaults to: ``/usr/libexec/repobridge``.
  1120. REPOSPANNER_NEW_REPO
  1121. ~~~~~~~~~~~~~~~~~~~~
  1122. This configuration key instructs pagure to create new git repositories on
  1123. repoSpanner or not.
  1124. Its value should be the region in which the new git repositories should be
  1125. created on.
  1126. Defaults to: ``None``.
  1127. REPOSPANNER_NEW_REPO_ADMIN_OVERRIDE
  1128. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1129. This configuration key can be used to let pagure admin override the default
  1130. region used when creating new git repositories on repoSpanner.
  1131. Its value should be a boolean.
  1132. Defaults to: ``False``
  1133. REPOSPANNER_NEW_FORK
  1134. ~~~~~~~~~~~~~~~~~~~~
  1135. This configuration key instructs pagure on where/how to create new git
  1136. repositories for the forks with repoSpanner.
  1137. If ``None``, git repositories for forks are created outside of repoSpanner
  1138. entirely.
  1139. If ``True``, git repositories for forks are created in the same region as
  1140. the parent project.
  1141. Otherwise, a region can be directly specified where git repositories for
  1142. forks will be created.
  1143. Defaults to: ``True``
  1144. REPOSPANNER_ADMIN_MIGRATION
  1145. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1146. This configuration key can be used to let admin manually migrate individual
  1147. project into repoSpanner once it is set up.
  1148. Defaults to: ``False``
  1149. REPOSPANNER_REGIONS
  1150. ~~~~~~~~~~~~~~~~~~~
  1151. This configuration key can be used to specify the different region where repoSpanner
  1152. is deployed and thus with which this pagure instance can be integrated.
  1153. An example entry could look like:
  1154. ::
  1155. REPOSPANNER_REGIONS = {
  1156. 'default': {'url': 'https://nodea.regiona.repospanner.local:8444',
  1157. 'repo_prefix': 'pagure/',
  1158. 'hook': None,
  1159. 'ca': '/etc/pki/repospanner/pki/ca.crt',
  1160. 'admin_cert': {'cert': '/etc/pki/repospanner/pki/admin.crt',
  1161. 'key': '/etc/pki/repospanner/pki/admin.key'},
  1162. 'push_cert': {'cert': '/etc/pki/repospanner/pki/pagure.crt',
  1163. 'key': '/etc/pki/repospanner/pki/pagure.key'}}
  1164. }
  1165. If this configuration key is not defined, pagure will consider that it is
  1166. not set to be integrated with repoSpanner.
  1167. Defaults to: ``{}``
  1168. SSH_KEYS_USERNAME_LOOKUP
  1169. ~~~~~~~~~~~~~~~~~~~~~~~~
  1170. This configuration key is used by the keyhelper script to indicate that the
  1171. git username should be used and looked up. Use this if the username that is sent
  1172. to ssh is specific for a unique Pagure user (i.e. not using a single "git@" user
  1173. for all git operations).
  1174. SSH_KEYS_USERNAME_FORBIDDEN
  1175. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1176. A list of usernames that are exempted from being verified via the keyhelper.
  1177. SSH_KEYS_USERNAME_EXPECT
  1178. ~~~~~~~~~~~~~~~~~~~~~~~~
  1179. This configuration key should contain the username that is used for git if a single
  1180. SSH user is used for all git ssh traffic (i.e. "git").
  1181. SSH_KEYS_OPTIONS
  1182. ~~~~~~~~~~~~~~~~
  1183. This configuration key provides the options added to keys as they are returned
  1184. to sshd, in the same format as AuthorizedKeysFile
  1185. (see "AUTHORIZED_KEYS FILE FORMAT" in sshd(8)).
  1186. SSH_ADMIN_TOKEN
  1187. ~~~~~~~~~~~~~~~
  1188. If not set to ``None``, ``aclchecker`` and ``keyhelper`` will use this api
  1189. admin token to get authorized to internal endpoints that they use. The token
  1190. must have the ``internal_access`` ACL.
  1191. This is useful when the IP address of sshd service is not predictable
  1192. (e.g. because of running in a distributed cloud environment) and so
  1193. it's not possible to use the ``IP_ALLOWED_INTERNAL`` address list.
  1194. Defaults to: ``None``
  1195. SSH_COMMAND_REPOSPANNER
  1196. ~~~~~~~~~~~~~~~~~~~~~~~
  1197. The command to run if a repository is on repospanner when aclchecker is in use.
  1198. SSH_COMMAND_NON_REPOSPANNER
  1199. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1200. The command to run if a repository is not on repospanner when aclchecker is in use.
  1201. MQTT Options
  1202. ------------
  1203. If approprietly configured pagure supports sending messages to an MQTT
  1204. message queue.
  1205. Here below are the different configuration options to make it so.
  1206. MQTT_NOTIFICATIONS
  1207. ~~~~~~~~~~~~~~~~~~
  1208. Global configuration key to turn on or off the code to send notifications
  1209. to an MQTT message queue.
  1210. Defaults to: ``False``
  1211. MQTT_HOST
  1212. ~~~~~~~~~
  1213. Host name of the MQTT server to send the MQTT notifications to.
  1214. Defaults to: ``None``
  1215. MQTT_PORT
  1216. ~~~~~~~~~
  1217. Port of the MQTT server to use to send the MQTT notifications to.
  1218. Defaults to: ``None``
  1219. MQTT_USERNAME
  1220. ~~~~~~~~~~~~~
  1221. Username to authenticate to the MQTT server as.
  1222. Defaults to: ``None``
  1223. MQTT_PASSWORD
  1224. ~~~~~~~~~~~~~
  1225. Password to authenticate to the MQTT server with.
  1226. Defaults to: ``None``
  1227. MQTT_CA_CERTS
  1228. ~~~~~~~~~~~~~
  1229. When using SSL-based authentication to the MQTT server, use this
  1230. configuration key to point to the CA cert to use.
  1231. Defaults to: ``None``
  1232. MQTT_CERTFILE
  1233. ~~~~~~~~~~~~~
  1234. When using SSL-based authentication to the MQTT server, use this
  1235. configuration key to point to the cert file to use.
  1236. Defaults to: ``None``
  1237. MQTT_KEYFILE
  1238. ~~~~~~~~~~~~~
  1239. When using SSL-based authentication to the MQTT server, use this
  1240. configuration key to point to the key file to use.
  1241. Defaults to: ``None``
  1242. MQTT_CERT_REQS
  1243. ~~~~~~~~~~~~~~
  1244. When using SSL-based authentication to the MQTT server, use this
  1245. configuration key to specify if the CERT is required.
  1246. Defaults to: ``ssl.CERT_REQUIRED`` (from python's ssl library)
  1247. MQTT_TLS_VERSION
  1248. ~~~~~~~~~~~~~~~~
  1249. When using SSL-based authentication to the MQTT server, use this
  1250. configuration key to specify the TLS protocols to support/use.
  1251. Defaults to: ``ssl.PROTOCOL_TLSv1_2`` (from python's ssl library)
  1252. MQTT_CIPHERS
  1253. ~~~~~~~~~~~~
  1254. When using SSL-based authentication to the MQTT server, use this
  1255. configuration key to specify the ciphers.
  1256. Defaults to: ``None``
  1257. MQTT_TOPIC_PREFIX
  1258. ~~~~~~~~~~~~~~~~~
  1259. This configuration key can be used to specify a prefix to the mqtt messages sent.
  1260. This prefix will be added to the topic used by pagure thus allowing the mqtt
  1261. admins to specify a parent topic for all pagure-related messages.
  1262. Defaults to: ``None``
  1263. ALWAYS_MQTT_ON_COMMITS
  1264. ~~~~~~~~~~~~~~~~~~~~~~
  1265. This configuration key can be used to enforce `mqtt <https://mqtt.org/>`_
  1266. notifications on commits made on all projects in a pagure instance.
  1267. Defaults to: ``False``.
  1268. Deprecated configuration keys
  1269. -----------------------------
  1270. FORK_FOLDER
  1271. ~~~~~~~~~~~
  1272. This configuration key used to be use to specify the folder where the forks
  1273. are placed. Since the release 2.0 of pagure, it has been deprecated, forks
  1274. are now automatically placed in a sub-folder of the folder containing the
  1275. mains git repositories (ie ``GIT_FOLDER``).
  1276. See the ``UPGRADING.rst`` file for more information about this change and
  1277. how to handle it.
  1278. UPLOAD_FOLDER
  1279. ~~~~~~~~~~~~~
  1280. This configuration key used to be use to specify where the uploaded releases
  1281. are available. It has been replaced by `UPLOAD_FOLDER_PATH` in the release
  1282. 2.10 of pagure.
  1283. GITOLITE_VERSION
  1284. ~~~~~~~~~~~~~~~~
  1285. This configuration key specifies which version of gitolite you are
  1286. using, it can be either ``2`` or ``3``.
  1287. Defaults to: ``3``.
  1288. This has been replaced by `GITOLITE_BACKEND` in the release 3.0 of pagure.
  1289. DOCS_FOLDER, REQUESTS_FOLDER, TICKETS_FOLDER
  1290. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1291. These configuration values were removed. It has been found out that
  1292. due to how Pagure writes repo names in the gitolite configuration file,
  1293. these must have fixed paths relative to `GIT_FOLDER`. Specifically, they
  1294. must occupy subdirectories `docs`, `requests` and `tickets` under `GIT_FOLDER`.
  1295. They are now computed automatically based on value of `GIT_FOLDER`.
  1296. Usage of docs and tickets can be triggered by setting `ENABLE_DOCS` and
  1297. `ENABLE_TICKETS` to `True` (this is the default).
  1298. FILE_SIZE_HIGHLIGHT
  1299. ~~~~~~~~~~~~~~~~~~~
  1300. This configuration key can be used to specify the maximum number of characters a file
  1301. or diff should have to have syntax highlighting. Everything above this limit
  1302. will not have syntax highlighting as this is a memory intensive procedure that
  1303. easily leads to out of memory error on large files or diff.
  1304. Defaults to: ``5000``
  1305. BOOTSTRAP_URLS_CSS
  1306. ~~~~~~~~~~~~~~~~~~
  1307. This configuration key can be used to specify the URL where are hosted the bootstrap
  1308. CSS file since the files hosted on apps.fedoraproject.org used in pagure.io
  1309. are not restricted in browser access.
  1310. Defaults to: ``'https://apps.fedoraproject.org/global/fedora-bootstrap-1.1.1/fedora-bootstrap.css'``
  1311. This has been deprecated by the new way of theming pagure, see the `theming
  1312. documentation <https://docs.pagure.org/pagure/usage/theming.html>`_
  1313. BOOTSTRAP_URLS_JS
  1314. ~~~~~~~~~~~~~~~~~
  1315. This configuration key can be used to specify the URL where are hosted the bootstrap
  1316. JS file since the files hosted on apps.fedoraproject.org used in pagure.io
  1317. are not restricted in browser access.
  1318. Defaults to: ``'https://apps.fedoraproject.org/global/fedora-bootstrap-1.1.1/fedora-bootstrap.js'``
  1319. This has been deprecated by the new way of theming pagure, see the `theming
  1320. documentation <https://docs.pagure.org/pagure/usage/theming.html>`_
  1321. HTML_TITLE
  1322. ~~~~~~~~~~
  1323. This configuration key allows you to customize the HTML title of all the
  1324. pages, from ``... - pagure`` (default) to ``... - <your value>``.
  1325. Defaults to: ``Pagure``
  1326. This has been deprecated by the new way of theming pagure, see the `theming
  1327. documentation <https://docs.pagure.org/pagure/usage/theming.html>`_
  1328. GITOLITE_BACKEND
  1329. ~~~~~~~~~~~~~~~~
  1330. This configuration key allowed specifying the gitolite backend.
  1331. This has now been replaced by GIT_AUTH_BACKEND, please see that option
  1332. for information on valid values.