defaults.py 9.1 KB

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