pagure.cfg 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. import os
  2. from datetime import timedelta
  3. from pagure.mail_logging import ContextInjector
  4. ### Set the time after which the admin session expires
  5. # There are two sessions on pagure, login that holds for 31 days and
  6. # the session defined here after which an user has to log in again.
  7. # This session is used when accessing all administrative parts of pagure
  8. # (ie: changing a project's or a user's settings)
  9. ADMIN_SESSION_LIFETIME = timedelta(minutes=20000000)
  10. # Enable tickets and docs for all repos
  11. ENABLE_TICKETS = True
  12. ENABLE_DOCS = True
  13. ### Secret key for the Flask application
  14. SECRET_KEY='<The web application secret key>'
  15. ### url to the database server:
  16. #DB_URL=mysql://user:pass@host/db_name
  17. #DB_URL=postgresql://user:pass@host/db_name
  18. DB_URL = 'sqlite:////srv/git/pagure_dev.sqlite'
  19. ### The FAS group in which the admin of pagure are
  20. ADMIN_GROUP = ['sysadmin-main']
  21. ### Hard-coded list of global admins
  22. PAGURE_ADMIN_USERS = []
  23. ### The URL at which the project is available.
  24. APP_URL = 'http://127.0.0.1:5000'
  25. ### The URL at which the documentation of projects will be available
  26. ## This should be in a different domain to avoid XSS issues since we want
  27. ## to allow raw html to be displayed (different domain, ie not a sub-domain).
  28. DOC_APP_URL = '*'
  29. # Avoid sending emails while developing by default
  30. EMAIL_SEND = False
  31. EMAIL_ERROR = 'vagrant@localhost'
  32. ### The URL to use to clone git repositories.
  33. GIT_URL_SSH = 'ssh://git@pagure-dev.example.com/'
  34. GIT_URL_GIT = 'http://pagure-dev.example.com:5000/'
  35. ### Folder containing to the git repos
  36. STORAGE_ROOT = '/srv/git/'
  37. GIT_FOLDER = os.path.join(STORAGE_ROOT, 'repositories')
  38. ### Folder containing the clones for the remote pull-requests
  39. REMOTE_GIT_FOLDER = os.path.join(STORAGE_ROOT, 'remotes')
  40. ### Whether to enable scanning for viruses in attachments
  41. VIRUS_SCAN_ATTACHMENTS = False
  42. SSH_FOLDER = "/srv/git/.ssh/"
  43. GIT_AUTH_BACKEND = "pagure_authorized_keys"
  44. SSH_KEYS_OPTIONS = (
  45. 'restrict,command="/usr/bin/python3 /srv/pagure/files/aclchecker.py %(username)s"'
  46. )
  47. SSH_COMMAND = ([
  48. "/usr/bin/%(cmd)s",
  49. "/srv/git/repositories/%(reponame)s",
  50. ], {"GL_USER": "%(username)s"})
  51. # SSH Information
  52. ### The ssh certificates of the git server to be provided to the user
  53. ### /!\ format is important
  54. # SSH_KEYS = {'RSA': {'fingerprint': '<foo>', 'pubkey': '<bar>'}}
  55. # Optional configuration
  56. ### Maximum size of the uploaded content
  57. # Used to limit the size of file attached to a ticket for example
  58. MAX_CONTENT_LENGTH = 4 * 1024 * 1024 # 4 megabytes
  59. ### Lenght for short commits ids or file hex
  60. SHORT_LENGTH = 7
  61. ### IP addresses allowed to access the internal endpoints
  62. ### These endpoints are used by the milter and are security sensitive, thus
  63. ### the IP filter
  64. IP_ALLOWED_INTERNAL = ['127.0.0.1', 'localhost', '::1',]
  65. ### EventSource/Web-Hook/Redis configuration
  66. # The eventsource integration is what allows pagure to refresh the content
  67. # on your page when someone else comments on the ticket (and this without
  68. # asking you to reload the page.
  69. # By default it is off, ie: EVENTSOURCE_SOURCE is None, to turn it on, specify
  70. # here what the URL of the eventsource server is, for example:
  71. # https://ev.pagure.io or https://pagure.io:8080 or whatever you are using
  72. # (Note: the urls sent to it start with a '/' so no need to add one yourself)
  73. EVENTSOURCE_SOURCE = 'http://localhost:8080'
  74. # Port where the event source server is running (maybe be the same port
  75. # as the one specified in EVENTSOURCE_SOURCE or a different one if you
  76. # have something running in front of the server such as apache or stunnel).
  77. EVENTSOURCE_PORT = 8080
  78. # If this port is specified, the event source server will run another server
  79. # at this port and will provide information about the number of active
  80. # connections running on the first (main) event source server
  81. #EV_STATS_PORT = 8888
  82. # Web-hook can be turned on or off allowing using them for notifications, or
  83. # not.
  84. WEBHOOK = True
  85. ### Redis configuration
  86. # A redis server is required for both the Event-Source server or the web-hook
  87. # server.
  88. REDIS_HOST = '127.0.0.1'
  89. REDIS_PORT = 6379
  90. REDIS_DB = 0
  91. # Authentication related configuration option
  92. ### Switch the authentication method
  93. # Specify which authentication method to use, defaults to `fas` can be or
  94. # `local`
  95. # Default: ``fas``.
  96. PAGURE_AUTH = 'local'
  97. # When this is set to True, the session cookie will only be returned to the
  98. # server via ssl (https). If you connect to the server via plain http, the
  99. # cookie will not be sent. This prevents sniffing of the cookie contents.
  100. # This may be set to False when testing your application but should always
  101. # be set to True in production.
  102. # Default: ``True``.
  103. SESSION_COOKIE_SECURE = False
  104. # The name of the cookie used to store the session id.
  105. # Default: ``.pagure``.
  106. SESSION_COOKIE_NAME = 'pagure'
  107. # Boolean specifying whether to check the user's IP address when retrieving
  108. # its session. This make things more secure (thus is on by default) but
  109. # under certain setup it might not work (for example is there are proxies
  110. # in front of the application).
  111. CHECK_SESSION_IP = True
  112. # Used by SESSION_COOKIE_PATH
  113. APPLICATION_ROOT = '/'
  114. # Allow the backward compatiblity endpoints for the old URLs schema to
  115. # see the commits of a repo. This is only interesting if you pagure instance
  116. # was running since before version 1.3 and if you care about backward
  117. # compatibility in your URLs.
  118. OLD_VIEW_COMMIT_ENABLED = False
  119. LOGGING = {
  120. "version": 1,
  121. "disable_existing_loggers": False,
  122. "formatters": {
  123. "standard": {
  124. "format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s"
  125. },
  126. },
  127. "filters": {"myfilter": {"()": ContextInjector}},
  128. "handlers": {
  129. "console": {
  130. "formatter": "standard",
  131. "class": "logging.StreamHandler",
  132. "stream": "ext://sys.stdout",
  133. },
  134. },
  135. # The root logger configuration; this is a catch-all configuration
  136. # that applies to all log messages not handled by a different logger
  137. "root": {"handlers": ["console"]},
  138. "loggers": {
  139. "pagure": {
  140. "handlers": ["console"],
  141. "level": "DEBUG",
  142. "propagate": True,
  143. },
  144. "flask": {
  145. "handlers": ["console"],
  146. "level": "INFO",
  147. "propagate": False,
  148. },
  149. "sqlalchemy": {
  150. "handlers": ["console"],
  151. "level": "WARN",
  152. "propagate": False,
  153. },
  154. "pagure.lib.encoding_utils": {
  155. "handlers": ["console"],
  156. "level": "WARN",
  157. "propagate": False,
  158. },
  159. },
  160. }
  161. SSH_KEYS_USERNAME_EXPECT = "git"
  162. ALLOW_HTTP_PUSH = True