defaults.py 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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 = ["admin", "misago:admin"]
  113. # How long (in minutes) since previous request to admin namespace should admin session last.
  114. MISAGO_ADMIN_SESSION_EXPIRATION = 60
  115. # Display threads on forum index
  116. # Change this to false to display categories list instead
  117. MISAGO_THREADS_ON_INDEX = True
  118. # Max age of notifications in days
  119. # Notifications older than this are deleted. On very active forums its better to keep this smaller.
  120. MISAGO_NOTIFICATIONS_MAX_AGE = 40
  121. # Fail-safe limits in case forum is raided by spambot
  122. # No user may exceed those limits, however you may disable them by changing them to 0.
  123. MISAGO_DIALY_POST_LIMIT = 600
  124. MISAGO_HOURLY_POST_LIMIT = 100
  125. # Function used for generating individual avatar for user
  126. MISAGO_DYNAMIC_AVATAR_DRAWER = "misago.users.avatars.dynamic.draw_default"
  127. # Path to directory containing avatar galleries
  128. # Those galleries can be loaded by running loadavatargallery command
  129. MISAGO_AVATAR_GALLERY = None
  130. # Save user avatars for sizes
  131. # Keep sizes ordered from greatest to smallest
  132. # Max size also controls min size of uploaded image as well as crop size
  133. MISAGO_AVATARS_SIZES = [400, 200, 150, 100, 64, 50, 30]
  134. # Path to blank avatar image used for guests and removed users.
  135. MISAGO_BLANK_AVATAR = "blank-avatar.png"
  136. # Threads lists pagination settings
  137. MISAGO_THREADS_PER_PAGE = 25
  138. MISAGO_THREADS_TAIL = 15
  139. # Posts lists pagination settings
  140. MISAGO_POSTS_PER_PAGE = 18
  141. MISAGO_POSTS_TAIL = 6
  142. # Number of events displayed on single thread page
  143. # If there's more events than specified, oldest events will be trimmed
  144. MISAGO_EVENTS_PER_PAGE = 20
  145. # Number of attachments possible to assign to single post
  146. MISAGO_POST_ATTACHMENTS_LIMIT = 16
  147. # Max allowed size of image before Misago will generate thumbnail for it
  148. MISAGO_ATTACHMENT_IMAGE_SIZE_LIMIT = (500, 500)
  149. # Length of secret used for attachments url tokens and filenames
  150. MISAGO_ATTACHMENT_SECRET_LENGTH = 64
  151. # How old (in minutes) should attachments unassociated with any be before they'll
  152. # automatically deleted by "clearattachments" task
  153. MISAGO_ATTACHMENT_ORPHANED_EXPIRE = 24 * 60
  154. # Names of files served when user requests file that doesn't exist or is unavailable
  155. # Those files will be sought within STATIC_ROOT directory
  156. MISAGO_404_IMAGE = "misago/img/error-404.png"
  157. MISAGO_403_IMAGE = "misago/img/error-403.png"
  158. # Controls max age in days of items that Misago has to process to make rankings
  159. # Used for active posters and most liked users lists
  160. # If your forum runs out of memory when trying to generate users rankings list
  161. # or you want those to be more dynamic, give this setting lower value
  162. # You don't have to be overzelous with this as user rankings are cached for 24h
  163. MISAGO_RANKING_LENGTH = 30
  164. # Controls max number of items displayed on ranked lists
  165. MISAGO_RANKING_SIZE = 50
  166. # Specifies the number of days that IP addresses are stored in the database before removing.
  167. # Change this setting to None to never remove old IP addresses.
  168. MISAGO_IP_STORE_TIME = None
  169. # Controls number of users displayed on single page
  170. MISAGO_USERS_PER_PAGE = 12
  171. # Controls amount of data used by readtracking system
  172. # Items older than number of days specified below are considered read
  173. # Depending on amount of new content being posted on your forum you may want
  174. # To decrease or increase this number to fine-tune readtracker performance
  175. MISAGO_READTRACKER_CUTOFF = 40
  176. # Available Moment.js locales
  177. MISAGO_MOMENT_JS_LOCALES = [
  178. "af",
  179. "ar-ma",
  180. "ar-sa",
  181. "ar-tn",
  182. "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",
  196. "de",
  197. "el",
  198. "en-au",
  199. "en-ca",
  200. "en-gb",
  201. "eo",
  202. "es",
  203. "et",
  204. "eu",
  205. "fa",
  206. "fi",
  207. "fo",
  208. "fr-ca",
  209. "fr",
  210. "fy",
  211. "gl",
  212. "he",
  213. "hi",
  214. "hr",
  215. "hu",
  216. "hy-am",
  217. "id",
  218. "is",
  219. "it",
  220. "ja",
  221. "ka",
  222. "km",
  223. "ko",
  224. "lb",
  225. "lt",
  226. "lv",
  227. "mk",
  228. "ml",
  229. "mr",
  230. "ms-my",
  231. "my",
  232. "nb",
  233. "ne",
  234. "nl",
  235. "nn",
  236. "pl",
  237. "pt-br",
  238. "pt",
  239. "ro",
  240. "ru",
  241. "sk",
  242. "sl",
  243. "sq",
  244. "sr-cyrl",
  245. "sr",
  246. "sv",
  247. "ta",
  248. "th",
  249. "tl-ph",
  250. "tr",
  251. "tzm-latn",
  252. "tzm",
  253. "uk",
  254. "uz",
  255. "vi",
  256. "zh-cn",
  257. "zh-hans",
  258. "zh-tw",
  259. ]