1
0

configuration.rst 57 KB

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