defaults.py 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. """
  2. Default Misago settings. Override these with settings in the module pointed to
  3. by the DJANGO_SETTINGS_MODULE environment variable.
  4. If you rely on any of those in your code, make sure you use `misago.conf.settings`
  5. instead of Django's `django.conf.settings`.
  6. """
  7. # Permissions system extensions
  8. # https://misago.readthedocs.io/en/latest/developers/acls.html#extending-permissions-system
  9. MISAGO_ACL_EXTENSIONS = [
  10. 'misago.users.permissions.account',
  11. 'misago.users.permissions.profiles',
  12. 'misago.users.permissions.moderation',
  13. 'misago.users.permissions.delete',
  14. 'misago.categories.permissions',
  15. 'misago.threads.permissions.attachments',
  16. 'misago.threads.permissions.polls',
  17. 'misago.threads.permissions.threads',
  18. 'misago.threads.permissions.privatethreads',
  19. 'misago.threads.permissions.bestanswers',
  20. 'misago.search.permissions',
  21. ]
  22. # Anonymous name used to replace deleted user's name in places that are keeping it
  23. MISAGO_ANONYMOUS_USERNAME = "Ghost"
  24. # Allow users to delete their own accounts?
  25. # Providing such feature is required by EU law from entities that process europeans personal data.
  26. MISAGO_ENABLE_DELETE_OWN_ACCOUNT = False
  27. # Custom markup extensions
  28. MISAGO_MARKUP_EXTENSIONS = []
  29. # Bleach callbacks for linkifying paragraphs
  30. MISAGO_BLEACH_CALLBACKS = []
  31. # Custom post validators
  32. MISAGO_POST_VALIDATORS = []
  33. # Post search filters
  34. MISAGO_POST_SEARCH_FILTERS = []
  35. # Posting middlewares
  36. # https://misago.readthedocs.io/en/latest/developers/posting_process.html
  37. MISAGO_POSTING_MIDDLEWARES = [
  38. # Always keep FloodProtectionMiddleware middleware first one
  39. 'misago.threads.api.postingendpoint.floodprotection.FloodProtectionMiddleware',
  40. 'misago.threads.api.postingendpoint.category.CategoryMiddleware',
  41. 'misago.threads.api.postingendpoint.privatethread.PrivateThreadMiddleware',
  42. 'misago.threads.api.postingendpoint.reply.ReplyMiddleware',
  43. 'misago.threads.api.postingendpoint.moderationqueue.ModerationQueueMiddleware',
  44. 'misago.threads.api.postingendpoint.attachments.AttachmentsMiddleware',
  45. 'misago.threads.api.postingendpoint.participants.ParticipantsMiddleware',
  46. 'misago.threads.api.postingendpoint.pin.PinMiddleware',
  47. 'misago.threads.api.postingendpoint.close.CloseMiddleware',
  48. 'misago.threads.api.postingendpoint.hide.HideMiddleware',
  49. 'misago.threads.api.postingendpoint.protect.ProtectMiddleware',
  50. 'misago.threads.api.postingendpoint.recordedit.RecordEditMiddleware',
  51. 'misago.threads.api.postingendpoint.updatestats.UpdateStatsMiddleware',
  52. 'misago.threads.api.postingendpoint.mentions.MentionsMiddleware',
  53. 'misago.threads.api.postingendpoint.subscribe.SubscribeMiddleware',
  54. 'misago.threads.api.postingendpoint.syncprivatethreads.SyncPrivateThreadsMiddleware',
  55. # Always keep SaveChangesMiddleware middleware after all state-changing middlewares
  56. 'misago.threads.api.postingendpoint.savechanges.SaveChangesMiddleware',
  57. # Those middlewares are last because they don't change app state
  58. 'misago.threads.api.postingendpoint.emailnotification.EmailNotificationMiddleware',
  59. ]
  60. # Configured thread types
  61. MISAGO_THREAD_TYPES = [
  62. 'misago.threads.threadtypes.thread.Thread',
  63. 'misago.threads.threadtypes.privatethread.PrivateThread',
  64. ]
  65. # Search extensions
  66. MISAGO_SEARCH_EXTENSIONS = [
  67. 'misago.threads.search.SearchThreads',
  68. 'misago.users.search.SearchUsers',
  69. ]
  70. # Misago-admin specific date formats
  71. MISAGO_COMPACT_DATE_FORMAT_DAY_MONTH = 'j M'
  72. MISAGO_COMPACT_DATE_FORMAT_DAY_MONTH_YEAR = 'M \'y'
  73. # Additional registration validators
  74. # https://misago.readthedocs.io/en/latest/developers/validating_registrations.html
  75. MISAGO_NEW_REGISTRATIONS_VALIDATORS = [
  76. 'misago.users.validators.validate_gmail_email',
  77. 'misago.users.validators.validate_with_sfs',
  78. ]
  79. # Custom profile fields
  80. MISAGO_PROFILE_FIELDS = []
  81. # Stop Forum Spam settings
  82. MISAGO_USE_STOP_FORUM_SPAM = True
  83. MISAGO_STOP_FORUM_SPAM_MIN_CONFIDENCE = 80
  84. # Social Auth Backends Names Overrides
  85. # This seeting may be used to customise auth backends names displayed in the UI
  86. MISAGO_SOCIAL_AUTH_BACKENDS_NAMES = {}
  87. # Login API URL
  88. MISAGO_LOGIN_API_URL = 'auth'
  89. # Misago Admin Path
  90. # Omit starting and trailing slashes. To disable Misago admin, empty this value.
  91. MISAGO_ADMIN_PATH = 'admincp'
  92. # Admin urls namespaces that Misago's AdminAuthMiddleware should protect
  93. MISAGO_ADMIN_NAMESPACES = [
  94. 'admin',
  95. 'misago:admin',
  96. ]
  97. # How long (in minutes) since previous request to admin namespace should admin session last.
  98. MISAGO_ADMIN_SESSION_EXPIRATION = 60
  99. # Display threads on forum index
  100. # Change this to false to display categories list instead
  101. MISAGO_THREADS_ON_INDEX = True
  102. # Max age of notifications in days
  103. # Notifications older than this are deleted. On very active forums its better to keep this smaller.
  104. MISAGO_NOTIFICATIONS_MAX_AGE = 40
  105. # Fail-safe limits in case forum is raided by spambot
  106. # No user may exceed those limits, however you may disable them by changing them to 0.
  107. MISAGO_DIALY_POST_LIMIT = 600
  108. MISAGO_HOURLY_POST_LIMIT = 100
  109. # Function used for generating individual avatar for user
  110. MISAGO_DYNAMIC_AVATAR_DRAWER = 'misago.users.avatars.dynamic.draw_default'
  111. # Path to directory containing avatar galleries
  112. # Those galleries can be loaded by running loadavatargallery command
  113. MISAGO_AVATAR_GALLERY = None
  114. # Save user avatars for sizes
  115. # Keep sizes ordered from greatest to smallest
  116. # Max size also controls min size of uploaded image as well as crop size
  117. MISAGO_AVATARS_SIZES = [400, 200, 150, 100, 64, 50, 30]
  118. # Path to blank avatar image used for guests and removed users.
  119. MISAGO_BLANK_AVATAR = 'blank-avatar.png'
  120. # Threads lists pagination settings
  121. MISAGO_THREADS_PER_PAGE = 25
  122. MISAGO_THREADS_TAIL = 15
  123. # Posts lists pagination settings
  124. MISAGO_POSTS_PER_PAGE = 18
  125. MISAGO_POSTS_TAIL = 6
  126. # Number of events displayed on single thread page
  127. # If there's more events than specified, oldest events will be trimmed
  128. MISAGO_EVENTS_PER_PAGE = 20
  129. # Number of attachments possible to assign to single post
  130. MISAGO_POST_ATTACHMENTS_LIMIT = 16
  131. # Max allowed size of image before Misago will generate thumbnail for it
  132. MISAGO_ATTACHMENT_IMAGE_SIZE_LIMIT = (500, 500)
  133. # Length of secret used for attachments url tokens and filenames
  134. MISAGO_ATTACHMENT_SECRET_LENGTH = 64
  135. # How old (in minutes) should attachments unassociated with any be before they'll
  136. # automatically deleted by "clearattachments" task
  137. MISAGO_ATTACHMENT_ORPHANED_EXPIRE = 24 * 60
  138. # Names of files served when user requests file that doesn't exist or is unavailable
  139. # Those files will be sought within STATIC_ROOT directory
  140. MISAGO_404_IMAGE = 'misago/img/error-404.png'
  141. MISAGO_403_IMAGE = 'misago/img/error-403.png'
  142. # Controls max age in days of items that Misago has to process to make rankings
  143. # Used for active posters and most liked users lists
  144. # If your forum runs out of memory when trying to generate users rankings list
  145. # or you want those to be more dynamic, give this setting lower value
  146. # You don't have to be overzelous with this as user rankings are cached for 24h
  147. MISAGO_RANKING_LENGTH = 30
  148. # Controls max number of items displayed on ranked lists
  149. MISAGO_RANKING_SIZE = 50
  150. # Controls number of users displayed on single page
  151. MISAGO_USERS_PER_PAGE = 12
  152. # Controls amount of data used by readtracking system
  153. # Items older than number of days specified below are considered read
  154. # Depending on amount of new content being posted on your forum you may want
  155. # To decrease or increase this number to fine-tune readtracker performance
  156. MISAGO_READTRACKER_CUTOFF = 40
  157. # Available Moment.js locales
  158. MISAGO_MOMENT_JS_LOCALES = [
  159. 'af',
  160. 'ar-ma', 'ar-sa', 'ar-tn', 'ar',
  161. 'az',
  162. 'be',
  163. 'bg',
  164. 'bn',
  165. 'bo',
  166. 'br',
  167. 'bs',
  168. 'ca',
  169. 'cs',
  170. 'cv',
  171. 'cy',
  172. 'da',
  173. 'de-at', 'de',
  174. 'el',
  175. 'en-au', 'en-ca', 'en-gb',
  176. 'eo',
  177. 'es',
  178. 'et',
  179. 'eu',
  180. 'fa',
  181. 'fi',
  182. 'fo',
  183. 'fr-ca',
  184. 'fr',
  185. 'fy',
  186. 'gl',
  187. 'he',
  188. 'hi',
  189. 'hr',
  190. 'hu', 'hy-am',
  191. 'id',
  192. 'is',
  193. 'it',
  194. 'ja',
  195. 'ka',
  196. 'km',
  197. 'ko',
  198. 'lb',
  199. 'lt',
  200. 'lv',
  201. 'mk',
  202. 'ml',
  203. 'mr',
  204. 'ms-my', 'my',
  205. 'nb',
  206. 'ne',
  207. 'nl',
  208. 'nn',
  209. 'pl',
  210. 'pt-br', 'pt',
  211. 'ro',
  212. 'ru',
  213. 'sk',
  214. 'sl',
  215. 'sq',
  216. 'sr-cyrl', 'sr',
  217. 'sv',
  218. 'ta',
  219. 'th',
  220. 'tl-ph',
  221. 'tr',
  222. 'tzm-latn', 'tzm',
  223. 'uk',
  224. 'uz',
  225. 'vi',
  226. 'zh-cn', 'zh-hans', 'zh-tw',
  227. ]