configuration.rst 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028
  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. EMAIL_SEND
  709. ~~~~~~~~~~
  710. This configuration key enables or disables all email notifications for
  711. this pagure instance. This can be useful to turn off when developing on
  712. pagure, or for test or pre-production instances.
  713. Defaults to: ``False``.
  714. .. note::
  715. This does not disable emails to the email address set in ``EMAIL_ERROR``.
  716. FEDMSG_NOTIFICATIONS
  717. ~~~~~~~~~~~~~~~~~~~~
  718. This configuration key allows to turn on or off notifications via `fedmsg
  719. <http://www.fedmsg.com/>`_.
  720. Defaults to: ``False``.
  721. FEDORA_MESSAGING_NOTIFICATIONS
  722. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  723. This configuration key allows to turn on or off sending notifications via
  724. `fedora-messaging <>`_.
  725. Defaults to: ``False``.
  726. ALWAYS_FEDMSG_ON_COMMITS
  727. ~~~~~~~~~~~~~~~~~~~~~~~~
  728. This configuration key allows to enforce `fedmsg <http://www.fedmsg.com/>`_
  729. notifications on commits made on all projects in a pagure instance.
  730. Defaults to: ``True``.
  731. ALLOW_DELETE_BRANCH
  732. ~~~~~~~~~~~~~~~~~~~
  733. This configuration keys enables or disables allowing users to delete git
  734. branches from the user interface. In sensible pagure instance you may
  735. want to turn this off and with a customized gitolite configuration you can
  736. prevent users from deleting branches in their git repositories.
  737. Defaults to: ``True``.
  738. ALLOW_ADMIN_IGNORE_EXISTING_REPOS
  739. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  740. This enables a checkbox "Ignore existing repos" for admins when creating a new
  741. project. When this is checkbox is checked, existing repositories will not cause
  742. project creation to fail.
  743. This could be used to assume responsibility of existing repositories.
  744. Defaults to: ``False``.
  745. USERS_IGNORE_EXISTING_REPOS
  746. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  747. List of users who can al create a project while ignoring existing repositories.
  748. Defaults to: ``[]``.
  749. LOCAL_SSH_KEY
  750. ~~~~~~~~~~~~~
  751. This configuration key allows to let pagure administrate the user's ssh keys
  752. or have a third party tool do it for you.
  753. In most cases, it will be fine to let pagure handle it.
  754. Defaults to ``True``.
  755. DEPLOY_KEY
  756. ~~~~~~~~~~
  757. This configuration key allows to disable the deploy keys feature of an
  758. entire pagure instance. This feature enable to add extra public ssh keys
  759. that a third party could use to push to a project.
  760. Defaults to ``True``.
  761. OLD_VIEW_COMMIT_ENABLED
  762. ~~~~~~~~~~~~~~~~~~~~~~~
  763. In version 1.3, pagure changed its URL scheme to view the commit of a
  764. project in order to add support for pseudo-namespaced projects.
  765. For pagure instances older than 1.3, who care about backward compatibility,
  766. we added an endpoint ``view_commit_old`` that brings URL backward
  767. compatibility for URLs using the complete git hash (the 40 characters).
  768. For URLs using a shorter hash, the URLs will remain broken.
  769. This configuration key enables or disables this backward compatibility
  770. which is useful for pagure instances running since before 1.3 but is not
  771. for newer instances.
  772. Defaults to: ``False``.
  773. DISABLE_REMOTE_PR
  774. ~~~~~~~~~~~~~~~~~
  775. In some pagure deployments remote pull requests need to be disabled
  776. due to legal / policy reasons.
  777. Defaults to: ``False``.
  778. PAGURE_CI_SERVICES
  779. ~~~~~~~~~~~~~~~~~~
  780. Pagure can be configure to integrate results of a Continuous Integration (CI)
  781. service to pull-requests open against a project.
  782. To enable this integration, follow the documentation on how to install
  783. pagure-ci and set this configuration key to ``['jenkins']`` (Jenkins being
  784. the only CI service supported at the moment).
  785. Defaults to: ``None``.
  786. .. warning:: Requires `Redis` to be configured and running.
  787. INSTANCE_NAME
  788. ~~~~~~~~~~~~~
  789. This allows giving a name to this running instance of pagure. The name is
  790. then used in the welcome screen shown upon first login.
  791. Defaults to: ``Pagure``
  792. .. note: the welcome screen currently does not work with the `local`
  793. authentication.
  794. ADMIN_EMAIL
  795. ~~~~~~~~~~~
  796. This configuration key allows you to change the default administrator email
  797. which is displayed on the "about" page. It can also be used elsewhere.
  798. Defaults to: ``root@localhost.localdomain``
  799. USER_NAMESPACE
  800. ~~~~~~~~~~~~~~
  801. This configuration key allows to enforce that project are namespaced under
  802. the user's username, behaving in this way in a similar fashion as github.com
  803. or gitlab.com.
  804. Defaults to: ``False``
  805. DOC_APP_URL
  806. ~~~~~~~~~~~
  807. This configuration key allows you to specify where the documentation server
  808. is running (preferably in a different domain name entirely).
  809. If not set, the documentation page will show an error message saying that
  810. this pagure instance does not have a documentation server.
  811. Defaults to: ``None``
  812. PRIVATE_PROJECTS
  813. ~~~~~~~~~~~~~~~~
  814. This configuration key allows you to host private repositories. These
  815. repositories are visible only to the creator of the repository and to the
  816. users who are given access to the repository. No information is leaked about the
  817. private repository which means redis doesn't have the access to the repository
  818. and even fedmsg doesn't get any notifications.
  819. Defaults to: ``True``
  820. EXCLUDE_GROUP_INDEX
  821. ~~~~~~~~~~~~~~~~~~~
  822. This configuration key can be used to hide project an user has access to via
  823. one of the groups listed in this key.
  824. The use-case is the following: the Fedora project is deploying pagure has a
  825. front-end for the git repos of the packages in the distribution, that means
  826. about 17,000 git repositories in pagure. The project has a group of people
  827. that have access to all of these repositories, so when viewing the user's
  828. page of one member of that group, instead of seeing all the project that
  829. this user works on, you can see all the projects hosted in that pagure
  830. instance. Using this configuration key, pagure will hide all the projects
  831. that this user has access to via the specified groups and thus return only
  832. the groups of forks of that users.
  833. Defaults to: ``[]``
  834. TRIGGER_CI
  835. ~~~~~~~~~~
  836. A run of pagure-ci can be manually triggered if some key sentences are added
  837. as comment to a pull-request, either manually or via the "Rerun CI" dropdown.
  838. This allows to re-run a test that failed due to some network outage or other
  839. unexpected issues unrelated to the test suite.
  840. This configuration key allows to define all the sentences that can be used
  841. to trigger this pagure-ci run. The format is following: ``{"<sentence>":
  842. {"name": "<name of the CI>", "description": "<short description>"}}``
  843. Sentences which have ``None`` as value won't show up in the "Rerun CI"
  844. dropdown. Additionally, it's possible to add a ``requires_project_hook_attr``
  845. key to the dict with data about a sentence. For example, having
  846. ``"requires_project_hook_attr": ("ci_hook", "active_pr", True)`` would make
  847. the "Rerun CI" dropdown have a button for this specific CI only if the
  848. project has ``ci_hook`` activated and its ``active_pr`` value is ``True``.
  849. In versions before 5.2, this was a list containing just the sentences.
  850. Defaults to: ``{"pretty please pagure-ci rebuild": {"name": "Default CI",
  851. "description": "Rerun default CI"}}``
  852. .. note:: The sentences defined in this configuration key should be lower
  853. case only!
  854. FLAG_STATUSES_LABELS
  855. ~~~~~~~~~~~~~~~~~~~~
  856. By default, Pagure has ``success``, ``failure``, ``error``, ``pending`` and
  857. ``canceled`` statuses of PR and commit flags. This setting allows you to
  858. define a custom mapping of statuses to their respective Bootstrap labels.
  859. FLAG_SUCCESS
  860. ~~~~~~~~~~~~
  861. Holds name of PR/commit flag that is considered a success.
  862. Defaults to: ``success``
  863. FLAG_FAILURE
  864. ~~~~~~~~~~~~
  865. Holds name of PR/commit flag that is considered a failure.
  866. Defaults to: ``failure``
  867. FLAG_PENDING
  868. ~~~~~~~~~~~~
  869. Holds name of PR/commit flag that is considered a pending state.
  870. Defaults to: ``pending``
  871. EXTERNAL_COMMITTER
  872. ~~~~~~~~~~~~~~~~~~
  873. The external committer feature is a way to allow members of groups defined
  874. outside pagure (and provided to pagure upon login by the authentication
  875. system) to be consider committers on pagure.
  876. This feature can give access to all the projects on the instance, all but
  877. some or just some.
  878. Defaults to: ``{}``
  879. To give access to all the projects to a group named ``fedora-altarch`` use
  880. a such a structure::
  881. EXTERNAL_COMMITTER = {
  882. 'fedora-altarch': {}
  883. }
  884. To give access to all the projects but one (named ``rpms/test``) to a group
  885. named ``provenpackager`` use a such a structure::
  886. EXTERNAL_COMMITTER = {
  887. 'fedora-altarch': {},
  888. 'provenpackager': {
  889. 'exclude': ['rpms/test']
  890. }
  891. }
  892. To give access to just some projects (named ``rpms/test`` and
  893. ``modules/test``) to a group named ``testers`` use a such a structure::
  894. EXTERNAL_COMMITTER = {
  895. 'fedora-altarch': {},
  896. 'provenpackager': {
  897. 'exclude': ['rpms/test']
  898. },
  899. 'testers': {
  900. 'restrict': ['rpms/test', 'modules/test']
  901. }
  902. }
  903. REQUIRED_GROUPS
  904. ~~~~~~~~~~~~~~~
  905. The required groups allows to specify in which group an user must be to be
  906. added to a project with commit or admin access.
  907. Defaults to: ``{}``
  908. Example configuration::
  909. REQUIRED_GROUPS = {
  910. 'rpms/kernel': ['packager', 'kernel-team'],
  911. 'modules/*': ['module-packager', 'packager'],
  912. 'rpms/*': ['packager'],
  913. '*': ['contributor'],
  914. }
  915. With this configuration (evaluated in the provided order):
  916. * only users that are in the groups ``packager`` and ``kernel-team`` will be
  917. allowed to be added the ``rpms/kernel`` project (where ``rpms`` is the
  918. namespace and ``kernel`` the project name).
  919. * only users that are in the groups ``module-packager`` and ``packager``
  920. will be allowed to be added to projects in the ``modules`` namespace.
  921. * only users that are in the group ``packager`` will be allowed to be added
  922. to projects in the ``rpms`` namespace.
  923. * only users in the ``contributor`` group will be allowed to be added to
  924. any project on this pagure instance.
  925. GITOLITE_PRE_CONFIG
  926. ~~~~~~~~~~~~~~~~~~~
  927. This configuration key allows you to include some content at the *top* of
  928. the gitolite configuration file (such as some specific group definition),
  929. thus allowing to customize the gitolite configuration file with elements
  930. and information that are outside of pagure's control.
  931. This can be used in combination with ``GITOLITE_POST_CONFIG`` to further
  932. customize gitolite's configuration file. It can also be used with
  933. ``EXTERNAL_COMMITTER`` to give commit access to git repos based on external
  934. information.
  935. Defaults to: ``None``
  936. GITOLITE_POST_CONFIG
  937. ~~~~~~~~~~~~~~~~~~~~
  938. This configuration key allows you to include some content at the *end* of
  939. the gitolite configuration file (such as some project definition or access),
  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_PRE_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. GIT_GARBAGE_COLLECT
  948. ~~~~~~~~~~~~~~~~~~~
  949. This configuration key allows for explicit running of ``git gc --auto``
  950. after every operation that adds new objects to any git repository -
  951. that is after pushing and merging. The reason for having this functionality
  952. in Pagure is that gc is not guaranteed to be run by git after every
  953. object-adding operation.
  954. The garbage collection run by Pagure will respect git settings, so you
  955. can tweak ``gc.auto`` and ``gc.autoPackLimit`` to your liking
  956. and that will have immediate effect on the task that runs the garbage
  957. collection. These values can be configured system-wide in ``/etc/gitconfig``.
  958. See https://git-scm.com/docs/git-gc#git-gc---auto for more details.
  959. This is especially useful if repositories are stored on NFS (or similar
  960. network storage), where file metadata access is expensive - having unpacked
  961. objects in repositories requires *a lot* of metadata reads.
  962. Note that the garbage collection is only run on repos that are not on
  963. repoSpanner.
  964. Defaults to: ``False``
  965. CELERY_CONFIG
  966. ~~~~~~~~~~~~~
  967. This configuration key allows you to tweak the configuration of celery for
  968. your needs.
  969. See the documentation about `celery configuration
  970. <http://docs.celeryproject.org/en/latest/userguide/configuration.html>`_ for
  971. more information.
  972. Defaults to: ``{}``
  973. CASE_SENSITIVE
  974. ~~~~~~~~~~~~~~
  975. This configuration key allows to make this pagure instance case sensitive
  976. instead of its default: case-insensitive.
  977. Defaults to: ``False``
  978. PROJECT_NAME_REGEX
  979. ~~~~~~~~~~~~~~~~~~
  980. This configuration key allows to customize the regular expression used to
  981. validate new project name.
  982. Defaults to: ``^[a-zA-z0-9_][a-zA-Z0-9-_]*$``
  983. APPLICATION_ROOT
  984. ~~~~~~~~~~~~~~~~
  985. This configuration key is used in the path of the cookie used by pagure.
  986. Defaults to: ``'/'``
  987. ALLOWED_PREFIX
  988. ~~~~~~~~~~~~~~
  989. This configuration key allows to specify a list of allowed namespaces that
  990. will not require creating a group for users to create projects in.
  991. Defaults to: ``[]``
  992. ADMIN_SESSION_LIFETIME
  993. ~~~~~~~~~~~~~~~~~~~~~~
  994. This configuration key allows specifying the lifetime of the session during
  995. which the user won't have to re-login for admin actions.
  996. In other words, the maximum time between which an user can access a project's
  997. settings page without re-login.
  998. Defaults to: ``timedelta(minutes=20)``
  999. where timedelta comes from the python datetime module
  1000. BLACKLISTED_GROUPS
  1001. ~~~~~~~~~~~~~~~~~~
  1002. This configuration key allows to blacklist some group names.
  1003. Defaults to: ``['forks', 'group']``
  1004. ENABLE_GROUP_MNGT
  1005. ~~~~~~~~~~~~~~~~~
  1006. This configuration key allows to turn on or off managing (ie: creating a
  1007. group, adding or removing users in that group) groups in this pagure instance.
  1008. If turned off, groups and group members are to be managed outside of pagure
  1009. and synced upon login.
  1010. Defaults to: ``True``
  1011. ENABLE_USER_MNGT
  1012. ~~~~~~~~~~~~~~~~
  1013. This configuration key allows to turn on or off managing users (adding or
  1014. removing them from a project) in this pagure instance.
  1015. If turned off, users are managed outside of pagure.
  1016. Defaults to: ``True``
  1017. SESSION_COOKIE_NAME
  1018. ~~~~~~~~~~~~~~~~~~~
  1019. This configuration key allows to specify the name of the session cookie used
  1020. by pagure.
  1021. Defaults to: ``'pagure'``
  1022. SHOW_PROJECTS_INDEX
  1023. ~~~~~~~~~~~~~~~~~~~
  1024. This configuration key allows to specify what is shown in the index page of
  1025. logged in users.
  1026. Defaults to: ``['repos', 'myrepos', 'myforks']``
  1027. EMAIL_ON_WATCHCOMMITS
  1028. ~~~~~~~~~~~~~~~~~~~~~
  1029. By default pagure sends an email to every one watch commits on a project when a
  1030. commit is made.
  1031. However some pagure instances may be using a different notification mechanism on
  1032. commits and thus may not want this feature to double the notifications received.
  1033. This configuration key allows to turn on or off email being sent to people
  1034. watching commits on a project upon commits.
  1035. Defaults to: ``True``
  1036. ALLOW_HTTP_PULL_PUSH
  1037. ~~~~~~~~~~~~~~~~~~~~
  1038. This configuration key controls whether any HTTP access to repositories is provided
  1039. via the support for that that's embedded in Pagure.
  1040. This provides HTTP pull access via <pagureurl>/<reponame>.git if nothing else
  1041. serves this URL.
  1042. Defaults to: ``True``
  1043. ALLOW_HTTP_PUSH
  1044. ~~~~~~~~~~~~~~~
  1045. This configuration key controls whether pushing is possible via the HTTP interface.
  1046. This is disabled by default, as it requires setting up an authentication mechanism
  1047. on the webserver that sets REMOTE_USER.
  1048. Defaults to: ``False``
  1049. HTTP_REPO_ACCESS_GITOLITE
  1050. ~~~~~~~~~~~~~~~~~~~~~~~~~
  1051. This configuration key configures the path to the gitolite-shell binary.
  1052. If this is set to None, Git http-backend is used directly.
  1053. Only set this to ``None`` if you intend to provide HTTP push access via Pagure, and
  1054. are using a dynamic ACL backend.
  1055. Defaults to: ``/usr/share/gitolite3/gitolite-shell``
  1056. MIRROR_SSHKEYS_FOLDER
  1057. ~~~~~~~~~~~~~~~~~~~~~
  1058. This configuration key specificies where pagure should store the ssh keys
  1059. generated for the mirroring feature. This folder should be properly backed up
  1060. and kept secure.
  1061. Defaults to: ``/var/lib/pagure/sshkeys/``
  1062. LOG_ALL_COMMITS
  1063. ~~~~~~~~~~~~~~~
  1064. This configuration key will make pagure log all commits pushed to all
  1065. branches of all repositories instead of logging only the once that are
  1066. pushed to the default branch.
  1067. Defaults to: ``False``
  1068. DISABLE_MIRROR_IN
  1069. ~~~~~~~~~~~~~~~~~
  1070. This configuration key allows a pagure instance to not support mirroring in
  1071. projects (from third party git server).
  1072. Defaults to: ``False``
  1073. SYNTAX_ALIAS_OVERRIDES
  1074. ~~~~~~~~~~~~~~~~~~~~~~
  1075. This configuration key allows to force highlight.js to use a certain logic
  1076. on certain files based on their extensions.
  1077. It should be a dictionary containing the file extensions as keys and
  1078. the highlighting language/category to use as values.
  1079. Defaults to: ``{".spec": "specfile", ".patch": "diff"}``
  1080. RepoSpanner Options
  1081. -------------------
  1082. Pagure can be integrated with `repoSpanner <https://repospanner.org>`_
  1083. allowing to deploy pagure in a load-balanced environment since the git
  1084. repositories are then synced accross multiple servers simultaneously.
  1085. Support for this integration has been included in Pagure version 5.0 and higher.
  1086. Here below are the different options one can/should use to integrate pagure
  1087. with repoSpanner.
  1088. REPOBRIDGE_BINARY
  1089. ~~~~~~~~~~~~~~~~~
  1090. This should contain the path to the repoBridge binary, which is used for pushing
  1091. and pulling to/from repoSpanner.
  1092. Defaults to: ``/usr/libexec/repobridge``.
  1093. REPOSPANNER_NEW_REPO
  1094. ~~~~~~~~~~~~~~~~~~~~
  1095. This configuration key instructs pagure to create new git repositories on
  1096. repoSpanner or not.
  1097. Its value should be the region in which the new git repositories should be
  1098. created on.
  1099. Defaults to: ``None``.
  1100. REPOSPANNER_NEW_REPO_ADMIN_OVERRIDE
  1101. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1102. This configuration key can be used to let pagure admin override the default
  1103. region used when creating new git repositories on repoSpanner.
  1104. Its value should be a boolean.
  1105. Defaults to: ``False``
  1106. REPOSPANNER_NEW_FORK
  1107. ~~~~~~~~~~~~~~~~~~~~
  1108. This configuration key instructs pagure on where/how to create new git
  1109. repositories for the forks with repoSpanner.
  1110. If ``None``, git repositories for forks are created outside of repoSpanner
  1111. entirely.
  1112. If ``True``, git repositories for forks are created in the same region as
  1113. the parent project.
  1114. Otherwise, a region can be directly specified where git repositories for
  1115. forks will be created.
  1116. Defaults to: ``True``
  1117. REPOSPANNER_ADMIN_MIGRATION
  1118. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1119. This configuration key can be used to let admin manually migrate individual
  1120. project into repoSpanner once it is set up.
  1121. Defaults to: ``False``
  1122. REPOSPANNER_REGIONS
  1123. ~~~~~~~~~~~~~~~~~~~
  1124. This configuration key allows to specify the different region where repoSpanner
  1125. is deployed and thus with which this pagure instance can be integrated.
  1126. An example entry could look like:
  1127. ::
  1128. REPOSPANNER_REGIONS = {
  1129. 'default': {'url': 'https://nodea.regiona.repospanner.local:8444',
  1130. 'repo_prefix': 'pagure/',
  1131. 'hook': None,
  1132. 'ca': '/etc/pki/repospanner/pki/ca.crt',
  1133. 'admin_cert': {'cert': '/etc/pki/repospanner/pki/admin.crt',
  1134. 'key': '/etc/pki/repospanner/pki/admin.key'},
  1135. 'push_cert': {'cert': '/etc/pki/repospanner/pki/pagure.crt',
  1136. 'key': '/etc/pki/repospanner/pki/pagure.key'}}
  1137. }
  1138. If this configuration key is not defined, pagure will consider that it is
  1139. not set to be integrated with repoSpanner.
  1140. Defaults to: ``{}``
  1141. SSH_KEYS_USERNAME_LOOKUP
  1142. ~~~~~~~~~~~~~~~~~~~~~~~~
  1143. This configuration key is used by the keyhelper script to indicate that the
  1144. git username should be used and looked up. Use this if the username that is sent
  1145. to ssh is specific for a unique Pagure user (i.e. not using a single "git@" user
  1146. for all git operations).
  1147. SSH_KEYS_USERNAME_FORBIDDEN
  1148. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1149. A list of usernames that are exempted from being verified via the keyhelper.
  1150. SSH_KEYS_USERNAME_EXPECT
  1151. ~~~~~~~~~~~~~~~~~~~~~~~~
  1152. This configuration key should contain the username that is used for git if a single
  1153. SSH user is used for all git ssh traffic (i.e. "git").
  1154. SSH_KEYS_OPTIONS
  1155. ~~~~~~~~~~~~~~~~
  1156. This configuration key provides the options added to keys as they are returned
  1157. to sshd, in the same format as AuthorizedKeysFile
  1158. (see "AUTHORIZED_KEYS FILE FORMAT" in sshd(8)).
  1159. SSH_ADMIN_TOKEN
  1160. ~~~~~~~~~~~~~~~
  1161. If not set to ``None``, ``aclchecker`` and ``keyhelper`` will use this api
  1162. admin token to get authorized to internal endpoints that they use. The token
  1163. must have the ``internal_access`` ACL.
  1164. This is useful when the IP address of sshd service is not predictable
  1165. (e.g. because of running in a distributed cloud environment) and so
  1166. it's not possible to use the ``IP_ALLOWED_INTERNAL`` address list.
  1167. Defaults to: ``None``
  1168. SSH_COMMAND_REPOSPANNER
  1169. ~~~~~~~~~~~~~~~~~~~~~~~
  1170. The command to run if a repository is on repospanner when aclchecker is in use.
  1171. SSH_COMMAND_NON_REPOSPANNER
  1172. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1173. The command to run if a repository is not on repospanner when aclchecker is in use.
  1174. MQTT Options
  1175. ------------
  1176. If approprietly configured pagure supports sending messages to an MQTT
  1177. message queue.
  1178. Here below are the different configuration options to make it so.
  1179. MQTT_NOTIFICATIONS
  1180. ~~~~~~~~~~~~~~~~~~
  1181. Global configuration key to turn on or off the code to send notifications
  1182. to an MQTT message queue.
  1183. Defaults to: ``False``
  1184. MQTT_HOST
  1185. ~~~~~~~~~
  1186. Host name of the MQTT server to send the MQTT notifications to.
  1187. Defaults to: ``None``
  1188. MQTT_PORT
  1189. ~~~~~~~~~
  1190. Port of the MQTT server to use to send the MQTT notifications to.
  1191. Defaults to: ``None``
  1192. MQTT_USERNAME
  1193. ~~~~~~~~~~~~~
  1194. Username to authenticate to the MQTT server as.
  1195. Defaults to: ``None``
  1196. MQTT_PASSWORD
  1197. ~~~~~~~~~~~~~
  1198. Password to authenticate to the MQTT server with.
  1199. Defaults to: ``None``
  1200. MQTT_CA_CERTS
  1201. ~~~~~~~~~~~~~
  1202. When using SSL-based authentication to the MQTT server, use this
  1203. configuration key to point to the CA cert to use.
  1204. Defaults to: ``None``
  1205. MQTT_CERTFILE
  1206. ~~~~~~~~~~~~~
  1207. When using SSL-based authentication to the MQTT server, use this
  1208. configuration key to point to the cert file to use.
  1209. Defaults to: ``None``
  1210. MQTT_KEYFILE
  1211. ~~~~~~~~~~~~~
  1212. When using SSL-based authentication to the MQTT server, use this
  1213. configuration key to point to the key file to use.
  1214. Defaults to: ``None``
  1215. MQTT_CERT_REQS
  1216. ~~~~~~~~~~~~~~
  1217. When using SSL-based authentication to the MQTT server, use this
  1218. configuration key to specify if the CERT is required.
  1219. Defaults to: ``ssl.CERT_REQUIRED`` (from python's ssl library)
  1220. MQTT_TLS_VERSION
  1221. ~~~~~~~~~~~~~~~~
  1222. When using SSL-based authentication to the MQTT server, use this
  1223. configuration key to specify the TLS protocols to support/use.
  1224. Defaults to: ``ssl.PROTOCOL_TLSv1_2`` (from python's ssl library)
  1225. MQTT_CIPHERS
  1226. ~~~~~~~~~~~~
  1227. When using SSL-based authentication to the MQTT server, use this
  1228. configuration key to specify the ciphers.
  1229. Defaults to: ``None``
  1230. MQTT_TOPIC_PREFIX
  1231. ~~~~~~~~~~~~~~~~~
  1232. This configuration key allows to specify a prefix to the mqtt messages sent.
  1233. This prefix will be added to the topic used by pagure thus allowing the mqtt
  1234. admins to specify a parent topic for all pagure-related messages.
  1235. Defaults to: ``None``
  1236. ALWAYS_MQTT_ON_COMMITS
  1237. ~~~~~~~~~~~~~~~~~~~~~~
  1238. This configuration key allows to enforce `mqtt <https://mqtt.org/>`_
  1239. notifications on commits made on all projects in a pagure instance.
  1240. Defaults to: ``False``.
  1241. Deprecated configuration keys
  1242. -----------------------------
  1243. FORK_FOLDER
  1244. ~~~~~~~~~~~
  1245. This configuration key used to be use to specify the folder where the forks
  1246. are placed. Since the release 2.0 of pagure, it has been deprecated, forks
  1247. are now automatically placed in a sub-folder of the folder containing the
  1248. mains git repositories (ie ``GIT_FOLDER``).
  1249. See the ``UPGRADING.rst`` file for more information about this change and
  1250. how to handle it.
  1251. UPLOAD_FOLDER
  1252. ~~~~~~~~~~~~~
  1253. This configuration key used to be use to specify where the uploaded releases
  1254. are available. It has been replaced by `UPLOAD_FOLDER_PATH` in the release
  1255. 2.10 of pagure.
  1256. GITOLITE_VERSION
  1257. ~~~~~~~~~~~~~~~~
  1258. This configuration key specifies which version of gitolite you are
  1259. using, it can be either ``2`` or ``3``.
  1260. Defaults to: ``3``.
  1261. This has been replaced by `GITOLITE_BACKEND` in the release 3.0 of pagure.
  1262. DOCS_FOLDER, REQUESTS_FOLDER, TICKETS_FOLDER
  1263. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1264. These configuration values were removed. It has been found out that
  1265. due to how Pagure writes repo names in the gitolite configuration file,
  1266. these must have fixed paths relative to `GIT_FOLDER`. Specifically, they
  1267. must occupy subdirectories `docs`, `requests` and `tickets` under `GIT_FOLDER`.
  1268. They are now computed automatically based on value of `GIT_FOLDER`.
  1269. Usage of docs and tickets can be triggered by setting `ENABLE_DOCS` and
  1270. `ENABLE_TICKETS` to `True` (this is the default).
  1271. FILE_SIZE_HIGHLIGHT
  1272. ~~~~~~~~~~~~~~~~~~~
  1273. This configuration key allows to specify the maximum number of characters a file
  1274. or diff should have to have syntax highlighting. Everything above this limit
  1275. will not have syntax highlighting as this is a memory intensive procedure that
  1276. easily leads to out of memory error on large files or diff.
  1277. Defaults to: ``5000``
  1278. BOOTSTRAP_URLS_CSS
  1279. ~~~~~~~~~~~~~~~~~~
  1280. This configuration key allows to specify the URL where are hosted the bootstrap
  1281. CSS file since the files hosted on apps.fedoraproject.org used in pagure.io
  1282. are not restricted in browser access.
  1283. Defaults to: ``'https://apps.fedoraproject.org/global/fedora-bootstrap-1.1.1/fedora-bootstrap.css'``
  1284. This has been deprecated by the new way of theming pagure, see the `theming
  1285. documentation <https://docs.pagure.org/pagure/usage/theming.html>`_
  1286. BOOTSTRAP_URLS_JS
  1287. ~~~~~~~~~~~~~~~~~
  1288. This configuration key allows to specify the URL where are hosted the bootstrap
  1289. JS file since the files hosted on apps.fedoraproject.org used in pagure.io
  1290. are not restricted in browser access.
  1291. Defaults to: ``'https://apps.fedoraproject.org/global/fedora-bootstrap-1.1.1/fedora-bootstrap.js'``
  1292. This has been deprecated by the new way of theming pagure, see the `theming
  1293. documentation <https://docs.pagure.org/pagure/usage/theming.html>`_
  1294. HTML_TITLE
  1295. ~~~~~~~~~~
  1296. This configuration key allows you to customize the HTML title of all the
  1297. pages, from ``... - pagure`` (default) to ``... - <your value>``.
  1298. Defaults to: ``Pagure``
  1299. This has been deprecated by the new way of theming pagure, see the `theming
  1300. documentation <https://docs.pagure.org/pagure/usage/theming.html>`_
  1301. GITOLITE_BACKEND
  1302. ~~~~~~~~~~~~~~~~
  1303. This configuration key allowed specifying the gitolite backend.
  1304. This has now been replaced by GIT_AUTH_BACKEND, please see that option
  1305. for information on valid values.