defaults.py 9.7 KB

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