defaults.py 9.8 KB

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