mirror of https://gitgud.io/fatchan/jschan.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
343 lines
11 KiB
343 lines
11 KiB
module.exports = {
|
|
|
|
//mongodb connection string
|
|
dbURL: 'mongodb://username:password@localhost:27017',
|
|
|
|
//redis connection info
|
|
redis: {
|
|
host: '127.0.0.1',
|
|
port: '6379',
|
|
password: 'long random string'
|
|
},
|
|
|
|
//backend webserver port
|
|
port: 7000,
|
|
|
|
//secrets/salts for various things
|
|
cookieSecret: 'long random string',
|
|
tripcodeSecret: 'long random string',
|
|
ipHashSecret: 'long random string',
|
|
postPasswordSecret: 'long random string',
|
|
|
|
//enable secure cookies, only use with https/not tor
|
|
secureCookies: true,
|
|
|
|
//check referrer to prevent some CSRF attack
|
|
refererCheck: true,
|
|
//list of allowed host for checking referrer
|
|
allowedHosts: ['domain.com', 'www.domain.com'],
|
|
|
|
//header for country codes
|
|
countryCodeHeader: 'x-country-code',
|
|
//header for visitor IP
|
|
ipHeader: 'x-real-ip',
|
|
|
|
//data used in opengraph meta tags. used to generate link previews in e.g. discord, twitter, etc
|
|
meta: {
|
|
siteName: 'imageboard',
|
|
url: 'https://domain.com'
|
|
},
|
|
|
|
//settings for captchas
|
|
captchaOptions: {
|
|
type: 'grid', //"text", "grid" or "google". If using google, make sure your CSP header in nginx config allows the google domain.
|
|
generateLimit: 1000, //max number of captchas to have generated at any time, prevent mass unsolved captcha spam, especially on TOR.
|
|
google: { //options for google captcha, when captcha type is google
|
|
siteKey: 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz',
|
|
secretKey: 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
|
|
},
|
|
grid: {
|
|
size: 4,
|
|
imageSize: 120,
|
|
iconYOffset: 15,
|
|
},
|
|
numDistorts: {
|
|
min: 3,
|
|
max: 4
|
|
},
|
|
distortion: 9,
|
|
},
|
|
|
|
/* dnsbl, will add a small delay for uncached requests. You could also install some
|
|
kind of dns cache e.g. unbound to improve performance. DNSBL only checked for posting */
|
|
dnsbl: {
|
|
enabled: false,
|
|
blacklists: ['tor.dan.me.uk', 'zen.spamhaus.org'],
|
|
cacheTime: 3600 //in seconds, idk whats a good value
|
|
},
|
|
|
|
//block bypasses
|
|
blockBypass: {
|
|
enabled: false,
|
|
expireAfterUses: 40, //however many (attempted) posts per block bypass captcha
|
|
expireAfterTime: 86400000, //expiry in ms regardless if the limit was reached, default 1 day
|
|
bypassDnsbl: false,
|
|
},
|
|
|
|
// permission level required to see UNHASHED ips. -1 for ips to be hashed even for root user. not recommended to change after installation
|
|
ipHashPermLevel: 0,
|
|
|
|
/* delete files immediately rather than pruning later. usually disabled to prevent re-thumbnailing and processing commonly
|
|
uploaded files, but deleting immediately is better if you are concerned about "deleted" content not being immediately removed */
|
|
pruneImmediately: false,
|
|
|
|
rateLimitCost: { //Cost out of 100 per minute e.g. cost of 25 means 4 per minute. Cost is separate for each.
|
|
captcha: 10,
|
|
boardSettings: 30,
|
|
editPost: 30,
|
|
},
|
|
|
|
//how many threads to show on overboard
|
|
overboardLimit: 20,
|
|
|
|
//cache templates in memory. disable only if editing templates and doing dev work
|
|
cacheTemplates: true,
|
|
|
|
//log extra info for debugging
|
|
debugLogs: true,
|
|
|
|
//max wait time in ms for obtaining locks for saving files
|
|
lockWait: 3000,
|
|
|
|
//optionally prune oldest modlog entries (prunes when newer modlog entries are generated i.e. dead boards wont have older logs pruned)
|
|
pruneModlogs: true,
|
|
pruneAfterDays: 30,
|
|
|
|
//enable the webring (also copy configs/webring.json.example -> configs/webring.json and edit)
|
|
enableWebring: false,
|
|
|
|
//let all users create new boards
|
|
enableUserBoardCreation: true,
|
|
//let all users register new accounts
|
|
enableUserAccountCreation: true,
|
|
|
|
/* extension for thumbnails. this value is used UNLESS the image contains transparency,
|
|
in which case png is used. */
|
|
thumbExtension: '.jpg',
|
|
|
|
//max thumb dimensions (square) in px. images smaller than this are not thumbnailed
|
|
thumbSize: 250,
|
|
|
|
//0-100 percent through a video to try taking video thumbnails from, to remedy black first frames or fade-ins
|
|
videoThumbPercentage: 5,
|
|
|
|
/* extra mime types for files to be uploaded as attachments (no thumbnails) e.g. text files/archives
|
|
NOTE: appropriate extensions will need to be added to nginx configuration, and uncommend the provided
|
|
"other files" section which includes an example configuration for .txt files to match this default config.
|
|
mime types and file extention does not always correspond exactly this cant be done automatically. */
|
|
otherMimeTypes: [
|
|
'text/plain',
|
|
'application/pdf'
|
|
],
|
|
|
|
//check the real mime type of uploaded files
|
|
checkRealMimeTypes: false,
|
|
//if checking real mime types, and the real type is unknown, allow it anyway
|
|
allowMimeNoMatch: false,
|
|
|
|
//default ban duration in ms if ban duration field is left blank (default value is 1 year)
|
|
defaultBanDuration: 31536000000,
|
|
|
|
//max number of quotes that will be linked in a post. 0 for unlimited (not recommended)
|
|
quoteLimit: 25,
|
|
|
|
//aply global filters more aggressively, trying against extra text that strips diacritics and some ZWS chars
|
|
strictFiltering: false,
|
|
|
|
//how many replies to show on index pages under each OP
|
|
previewReplies: 5,
|
|
stickyPreviewReplies: 5, //choose a different amount for sticky posts if desired
|
|
|
|
/* the fraction of threadLimit beyond which early404 prunes posts
|
|
e.g. 3 means after the first third, so if you had 6 pages,
|
|
anything after page 2 with less than early404Replies gets pruned */
|
|
early404Fraction: 3,
|
|
//how many replies a thread needs to not get removed by early404
|
|
early404Replies: 5,
|
|
|
|
//how many of the most recent newsposts to show on the homepage
|
|
maxRecentNews: 3,
|
|
|
|
/* filter filenames on posts and banners
|
|
false=no filtering
|
|
true=allow only A-Za-z0-9_-
|
|
regex=custom regex of what to replace e.g. /[^\w\s-]+/g */
|
|
filterFileNames: false,
|
|
/* replace spaces and multiple spaces with some character default _ for better filenames
|
|
(spaces dont belong in filenames) */
|
|
spaceFileNameReplacement: '_',
|
|
|
|
//options for code block highlighting in posts
|
|
highlightOptions: {
|
|
|
|
//subset of languages to allow.
|
|
languageSubset: [
|
|
'javascript',
|
|
'typescript',
|
|
'perl',
|
|
'js',
|
|
'c++',
|
|
'c',
|
|
'java',
|
|
'kotlin',
|
|
'php',
|
|
'h',
|
|
'csharp',
|
|
'bash',
|
|
'sh',
|
|
'zsh',
|
|
'python',
|
|
'ruby',
|
|
'css',
|
|
'html',
|
|
'json',
|
|
'golang',
|
|
'rust'
|
|
],
|
|
|
|
//threshold below which auto language is ignored
|
|
threshold: 5
|
|
|
|
},
|
|
|
|
//uses names of css in gulp/res/css. if blank, all themes are enabled.
|
|
themes: [],
|
|
codeThemes: [],
|
|
|
|
//global limits for board settings
|
|
globalLimits: {
|
|
threadLimit: { //number of threads, 10 per page
|
|
min: 10,
|
|
max: 200
|
|
},
|
|
replyLimit: { //number of replies to a thread, thread is locked after this limit is reached
|
|
min: 10,
|
|
max: 500
|
|
},
|
|
bumpLimit: { //number of replies to a thread before it wont get bumped anymore
|
|
min: 10,
|
|
max: 500
|
|
},
|
|
postFiles: { //number of files in a post
|
|
max: 3
|
|
},
|
|
postFilesSize: { //in bytes, 10MB default
|
|
max: 10485760
|
|
},
|
|
bannerFiles: { //max number of banners uploadable at once
|
|
max: 10
|
|
},
|
|
bannerFilesSize: { //in bytes, 10MB default
|
|
max: 10485760
|
|
},
|
|
/* NOTE: postFilesSize and bannerFilesSize counts in bytes the amount of total data in form submission including
|
|
other fields like message, name, etc. Therefore a very long message would reduce the space left for files very slightly.
|
|
To counteract this, consider increasing postFilesSize and bannerFilesSize beyond your desired max filesize by a small margin */
|
|
fieldLength: { //max length of fields in some forms
|
|
//post form
|
|
name: 100,
|
|
email: 100,
|
|
subject: 100,
|
|
postpassword: 100,
|
|
message: 4000,
|
|
//reports/post actions
|
|
report_reason: 100,
|
|
ban_reason: 100,
|
|
log_message: 100,
|
|
//board creation
|
|
uri: 50,
|
|
boardname: 50,
|
|
description: 100,
|
|
},
|
|
customCss: {
|
|
enabled: true, //allow custom css by board owners
|
|
max: 10000, //max number of characters to allow
|
|
strict: true, //enables filters to block certain strings in custom css
|
|
filters: [
|
|
'@',
|
|
'url(',
|
|
]
|
|
}
|
|
},
|
|
|
|
//default frontend script settings
|
|
frontendScriptDefault: {
|
|
heightUnlimit: false, //allow images [M -1taller than window height
|
|
hideRecursive: true, //hide replies to hidden OPs
|
|
crispImages: false, //use crisp/pixelated image rendering
|
|
hideThumbnails: false, //hide thumbnails
|
|
nonColorIds: false, //dont color ids
|
|
alwaysShowSpoilers: false , //always reveal spoiler text
|
|
hidePostStubs: false, //hide hidden posts completely, dont even show it minimized
|
|
smoothScrolling: false, //smooth scrolling. annoying for chrome users on long threads
|
|
defaultVolume: 100, //default video/audio volume
|
|
loop: true, //looping video/audio
|
|
imageLoadingBars: true, //show loading bar for images, changes behaviour of right click save/open
|
|
live: true, //update threads automatically
|
|
scrollToPosts: false, //scroll to new posts
|
|
localTime: true, //show local time for posts
|
|
hour24Time: false, //show 24 hour time for posts
|
|
relativeTime: true, //show relative time i.e. "5 minutes ago" for posts
|
|
//note: relative time overrides other time options, they show on hover in the tooltip/"title" property
|
|
notificationsEnabled: false, //show notifications for new posts in a thread
|
|
notificationsYousOnly: true, //only show notifications for posts that quote you
|
|
showYous: true, //show (You) next to name on your posts, and quotes linking to your post
|
|
},
|
|
|
|
//default board settings when a board is created
|
|
boardDefaults: {
|
|
theme: 'lain',
|
|
codeTheme: 'ir-black',
|
|
sfw: false, //safe for work board
|
|
lockMode: 0, //board lock mode
|
|
fileR9KMode: 0, //r9k for files, 0=off, 1=per thread, 2=whole board
|
|
unlistedLocal: false, //board hidden from on-site board list and frontpage
|
|
unlistedWebring: false, //board hidden from webring
|
|
captchaMode: 0, //0=disabled, 1=for threads, 2=for all posts
|
|
tphTrigger: 0, //numebr of threads in an hour before trigger action is activated
|
|
pphTrigger: 0, //number of posts in an hour before ^
|
|
triggerAction: 0, //0=nothing, 1=captcha enable for threads, 2=captcha enable for all posts, 3=lock board
|
|
resetTrigger: false, //reset captcha/lock settings back to original at the end of hour
|
|
forceAnon: false, //disable name and subject, only allow sage email
|
|
sageOnlyEmail: false, //only allow sage email
|
|
early404: true, //delete threads beyond the first 1/3 of pages with less than 5 replies
|
|
ids: false, //show per thread poster ID based on ip
|
|
flags: false, //show geo flags, requires nginx setup
|
|
userPostDelete: true, //allow users to delete their posts
|
|
userPostSpoiler: true, //allow user to spoiler their post files
|
|
userPostUnlink: true, //alow user to unlink files fomr their post
|
|
threadLimit: 200,
|
|
replyLimit: 500,
|
|
bumpLimit: 500,
|
|
maxFiles: 1,
|
|
forceReplyMessage: false,
|
|
forceReplyFile: false,
|
|
forceThreadMessage: false,
|
|
forceThreadFile: false,
|
|
forceThreadSubject: false,
|
|
disableReplySubject: false,
|
|
minThreadMessageLength: 0,
|
|
minReplyMessageLength: 0,
|
|
maxThreadMessageLength: 4000,
|
|
maxReplyMessageLength: 4000,
|
|
defaultName: 'Anon',
|
|
customCSS: null,
|
|
blockedCountries: [], //2 char ISO country codes to block
|
|
filters: [], //words/phrases to block
|
|
filterMode: 0, //0=nothing, 1=prevent post, 2=auto ban
|
|
filterBanDuration: 0, //duration (in ms) to ban if filter mode=2
|
|
strictFiltering: false,
|
|
announcement: {
|
|
raw: null,
|
|
markdown: null
|
|
},
|
|
allowedFileTypes: { //enable different types of files to be posted
|
|
animatedImage: true,
|
|
image: true,
|
|
video: true,
|
|
audio: true,
|
|
other: false
|
|
}
|
|
},
|
|
|
|
};
|
|
|