@ -15,9 +15,9 @@ module.exports = async (req, res, next) => {
const oldSettings = config . get ;
const newSettings = {
... oldSettings ,
filters : arraySetting ( req . body . filters , oldSettings . filters ) ,
filterMode : numberSetting ( req . body . filter _mode , oldSettings . filterMode ) ,
strictFiltering : booleanSetting ( req . body . strict _filtering , oldSettings . strictFiltering ) ,
filterBanDuration : numberSetting ( req . body . ban _duration , oldSettings . filterBanDuration ) ,
allowedHosts : arraySetting ( req . body . allowed _hosts , oldSettings . allowedHosts ) ,
countryCodeHeader : trimSetting ( req . body . country _code _header , oldSettings . countryCodeHeader ) ,
@ -49,7 +49,6 @@ module.exports = async (req, res, next) => {
} ,
disableAnonymizerFilePosting : booleanSetting ( req . body . disable _anonymizer _file _posting , oldSettings . disableAnonymizerFilePosting ) ,
statsCountAnonymizers : booleanSetting ( req . body . stats _count _anonymizers , oldSettings . statsCountAnonymizers ) ,
floodTimers : {
sameContentSameIp : numberSetting ( req . body . flood _timers _same _content _same _ip , oldSettings . floodTimers . sameContentSameIp ) ,
sameContentAnyIp : numberSetting ( req . body . flood _timers _same _content _any _ip , oldSettings . floodTimers . sameContentAnyIp ) ,
@ -87,6 +86,45 @@ module.exports = async (req, res, next) => {
} ,
themes : arraySetting ( req . body . themes , oldSettings . themes ) ,
codeThemes : arraySetting ( req . body . code _themes , oldSettings . codeThemes ) ,
frontendScriptDefault : {
embedsEnabled : booleanSetting ( req . body . frontend _script _default _embeds _enabled , oldSettings . frontendScriptDefault . embedsEnabled ) ,
heightUnlimit : booleanSetting ( req . body . frontend _script _default _height _unlimit , oldSettings . frontendScriptDefault . heightUnlimit ) ,
hideRecursive : booleanSetting ( req . body . frontend _script _default _hide _recursive , oldSettings . frontendScriptDefault . hideRecursive ) ,
crispImages : booleanSetting ( req . body . frontend _script _default _crisp _images , oldSettings . frontendScriptDefault . crispImages ) ,
hideThumbnails : booleanSetting ( req . body . frontend _script _default _hide _thumbnails , oldSettings . frontendScriptDefault . hideThumbnails ) ,
nonColorIds : booleanSetting ( req . body . frontend _script _default _non _color _ids , oldSettings . frontendScriptDefault . nonColorIds ) ,
alwaysShowSpoilers : booleanSetting ( req . body . frontend _script _default _always _show _spoilers , oldSettings . frontendScriptDefault . alwaysShowSpoilers ) ,
hidePostStubs : booleanSetting ( req . body . frontend _script _default _hide _post _stubs , oldSettings . frontendScriptDefault . hidePostStubs ) ,
smoothScrolling : booleanSetting ( req . body . frontend _script _default _smooth _scrolling , oldSettings . frontendScriptDefault . smoothScrolling ) ,
defaultVolume : numberSetting ( req . body . frontend _script _default _volume , oldSettings . frontendScriptDefault . defaultVolume ) ,
loop : booleanSetting ( req . body . frontend _script _default _loop , oldSettings . frontendScriptDefault . loop ) ,
imageLoadingBars : booleanSetting ( req . body . frontend _script _default _image _loading _bars , oldSettings . frontendScriptDefault . imageLoadingBars ) ,
live : booleanSetting ( req . body . frontend _script _default _live , oldSettings . frontendScriptDefault . live ) ,
scrollToPosts : booleanSetting ( req . body . frontend _script _default _scroll _to _posts , oldSettings . frontendScriptDefault . scrollToPosts ) ,
localTime : booleanSetting ( req . body . frontend _script _default _local _time , oldSettings . frontendScriptDefault . localTime ) ,
hour24Time : booleanSetting ( req . body . frontend _script _default _hour _24 _time , oldSettings . frontendScriptDefault . hour24Time ) ,
relativeTime : booleanSetting ( req . body . frontend _script _default _relative _time , oldSettings . frontendScriptDefault . relativeTime ) ,
notificationsEnabled : booleanSetting ( req . body . frontend _script _default _notifications _embed , oldSettings . frontendScriptDefault . notificationsEnabled ) ,
notificationsYousOnly : booleanSetting ( req . body . frontend _script _default _notifications _yous _only , oldSettings . frontendScriptDefault . notificationsYousOnly ) ,
showYous : booleanSetting ( req . body . frontend _script _default _show _yous , oldSettings . frontendScriptDefault . showYous ) ,
} ,
animatedGifThumbnails : booleanSetting ( req . body . animated _gif _thumbnails , oldSettings . animatedGifThumbnails ) ,
audioThumbnails : booleanSetting ( req . body . audio _thumbnails , oldSettings . audioThumbnails ) ,
ffmpegGifThumbnails : booleanSetting ( req . body . ffmpeg _gif _thumbnails , oldSettings . ffmpegGifThumbnails ) ,
thumbSize : numberSetting ( req . body . thumb _size , oldSettings . thumbSize ) ,
videoThumbPercentage : numberSetting ( req . body . video _thumb _percentage , oldSettings . videoThumbPercentage ) ,
otherMimeTypes : arraySetting ( req . body . other _mime _types , oldSettings . otherMimeTypes ) ,
checkRealMimeTypes : booleanSetting ( req . body . check _real _mime _types , oldSettings . checkRealMimeTypes ) ,
allowMimeNoMatch : booleanSetting ( req . body . allow _mime _no _match , oldSettings . allowMimeNoMatch ) ,
defaultBanDuration : numberSetting ( req . body . default _ban _duration , oldSettings . defaultBanDuration ) ,
quoteLimit : numberSetting ( req . body . quote _limit , oldSettings . quoteLimit ) ,
previewReplies : numberSetting ( req . body . preview _replies , oldSettings . previewReplies ) ,
stickyPreviewReplies : numberSetting ( req . body . sticky _preview _replies , oldSettings . stickyPreviewReplies ) ,
early404Fraction : numberSetting ( req . body . early _404 _fraction , oldSettings . early404Fraction ) ,
early404Replies : numberSetting ( req . body . early _404 _replies , oldSettings . early404Replies ) ,
maxRecentNews : numberSetting ( req . body . max _recent _news , oldSettings . maxRecentNews ) ,
filterFileNames : booleanSetting ( req . body . filter _file _names , oldSettings . filterFileNames ) ,
spaceFileNameReplacement : trimSetting ( req . body . space _file _name _replacement , oldSettings . spaceFileNameReplacement ) ,
globalLimits : {
... oldSettings . globalLimits ,
customCss : {
@ -95,15 +133,6 @@ module.exports = async (req, res, next) => {
strict : booleanSetting ( req . body . global _limits _custom _css _strict , oldSettings . globalLimits . customCss . strict ) ,
filters : arraySetting ( req . body . global _limits _custom _css _filters , oldSettings . globalLimits . customCss . filters ) ,
} ,
} ,
boardDefaults : {
... oldSettings . boardDefaults ,
theme : trimSetting ( req . body . board _defaults _theme , oldSettings . boardDefaults . theme ) ,
codeTheme : trimSetting ( req . body . board _defaults _code _theme , oldSettings . boardDefaults . codeTheme ) ,
}
/ *
globalLimits : {
threadLimit : {
min : numberSetting ( req . body . global _limits _thread _limit _min , oldSettings . globalLimits . threadLimit . min ) ,
max : numberSetting ( req . body . global _limits _thread _limit _max , oldSettings . globalLimits . threadLimit . max ) ,
@ -156,46 +185,13 @@ module.exports = async (req, res, next) => {
maxLength : numberSetting ( req . body . global _limits _custom _pages _max _length , oldSettings . globalLimits . customPages . maxLength ) ,
}
} ,
animatedGifThumbnails : booleanSetting ( req . body . animated _gif _thumbnails , oldSettings . animatedGifThumbnails ) ,
audioThumbnails : booleanSetting ( req . body . audio _thumbnails , oldSettings . audioThumbnails ) ,
ffmpegGifThumbnails : booleanSetting ( req . body . ffmpeg _gif _thumbnails , oldSettings . ffmpegGifThumbnails ) ,
thumbSize : numberSetting ( req . body . thumb _size , oldSettings . thumbSize ) ,
videoThumbPercentage : numberSetting ( req . body . video _thumb _percentage , oldSettings . videoThumbPercentage ) ,
otherMimeTypes : arraySetting ( req . body . other _mime _types , oldSettings . otherMimeTypes ) ,
checkRealMimeTypes : booleanSetting ( req . body . check _real _mime _types , oldSettings . checkRealMimeTypes ) ,
allowMimeNoMatch : booleanSetting ( req . body . allow _mime _no _match , oldSettings . allowMimeNoMatch ) ,
defaultBanDuration : numberSetting ( req . body . default _ban _duration , oldSettings . defaultBanDuration ) ,
quoteLimit : numberSetting ( req . body . quote _limit , oldSettings . quoteLimit ) ,
strictFiltering : booleanSetting ( req . body . strict _filtering , oldSettings . strictFiltering ) ,
previewReplies : numberSetting ( req . body . preview _replies , oldSettings . previewReplies ) ,
stickyPreviewReplies : numberSetting ( req . body . sticky _preview _replies , oldSettings . stickyPreviewReplies ) ,
early404Fraction : numberSetting ( req . body . early _404 _fraction , oldSettings . early404Fraction ) ,
early404Replies : numberSetting ( req . body . early _404 _replies , oldSettings . early404Replies ) ,
maxRecentNews : numberSetting ( req . body . max _recent _news , oldSettings . maxRecentNews ) ,
filterFileNames : booleanSetting ( req . body . filter _file _names , oldSettings . filterFileNames ) ,
spaceFileNameReplacement : trimSetting ( req . body . space _file _name _replacement , oldSettings . spaceFileNameReplacement ) ,
frontendScriptDefault : {
embedsEnabled : booleanSetting ( req . body . frontend _script _default _embeds _enabled , oldSettings . frontendScriptDefault . embedsEnabled ) ,
heightUnlimit : booleanSetting ( req . body . frontend _script _default _height _unlimit , oldSettings . frontendScriptDefault . heightUnlimit ) ,
hideRecursive : booleanSetting ( req . body . frontend _script _default _hide _recursive , oldSettings . frontendScriptDefault . hideRecursive ) ,
crispImages : booleanSetting ( req . body . frontend _script _default _crisp _images , oldSettings . frontendScriptDefault . crispImages ) ,
hideThumbnails : booleanSetting ( req . body . frontend _script _default _hide _thumbnails , oldSettings . frontendScriptDefault . hideThumbnails ) ,
nonColorIds : booleanSetting ( req . body . frontend _script _default _non _color _ids , oldSettings . frontendScriptDefault . nonColorIds ) ,
alwaysShowSpoilers : booleanSetting ( req . body . frontend _script _default _always _show _spoilers , oldSettings . frontendScriptDefault . alwaysShowSpoilers ) ,
hidePostStubs : booleanSetting ( req . body . frontend _script _default _hide _post _stubs , oldSettings . frontendScriptDefault . hidePostStubs ) ,
smoothScrolling : booleanSetting ( req . body . frontend _script _default _smooth _scrolling , oldSettings . frontendScriptDefault . smoothScrolling ) ,
defaultVolume : numberSetting ( req . body . frontend _script _default _volume , oldSettings . frontendScriptDefault . defaultVolume ) ,
loop : booleanSetting ( req . body . frontend _script _default _loop , oldSettings . frontendScriptDefault . loop ) ,
imageLoadingBars : booleanSetting ( req . body . frontend _script _default _image _loading _bars , oldSettings . frontendScriptDefault . imageLoadingBars ) ,
live : booleanSetting ( req . body . frontend _script _default _live , oldSettings . frontendScriptDefault . live ) ,
scrollToPosts : booleanSetting ( req . body . frontend _script _default _scroll _to _posts , oldSettings . frontendScriptDefault . scrollToPosts ) ,
localTime : booleanSetting ( req . body . frontend _script _default _local _time , oldSettings . frontendScriptDefault . localTime ) ,
hour24Time : booleanSetting ( req . body . frontend _script _default _hour _24 _time , oldSettings . frontendScriptDefault . hour24Time ) ,
relativeTime : booleanSetting ( req . body . frontend _script _default _relative _time , oldSettings . frontendScriptDefault . relativeTime ) ,
notificationsEnabled : booleanSetting ( req . body . frontend _script _default _notifications _embed , oldSettings . frontendScriptDefault . notificationsEnabled ) ,
notificationsYousOnly : booleanSetting ( req . body . frontend _script _default _notifications _yous _only , oldSettings . frontendScriptDefault . notificationsYousOnly ) ,
showYous : booleanSetting ( req . body . frontend _script _default _show _yous , oldSettings . frontendScriptDefault . showYous ) ,
} ,
boardDefaults : {
... oldSettings . boardDefaults ,
theme : trimSetting ( req . body . board _defaults _theme , oldSettings . boardDefaults . theme ) ,
codeTheme : trimSetting ( req . body . board _defaults _code _theme , oldSettings . boardDefaults . codeTheme ) ,
}
/ *
boardDefaults : {
sfw : booleanSetting ( req . body . board _defaults _sfw , oldSettings . boardDefaults . sfw ) ,
lockMode : numberSetting ( req . body . board _defaults _lock _mode , oldSettings . boardDefaults . lockMode ) ,
@ -252,8 +248,8 @@ module.exports = async (req, res, next) => {
other : booleanSetting ( req . body . board _defaults _allowed _file _types _other , oldSettings . boardDefaults . allowedFileTypes . other )
}
} ,
* /
} ;
redis . set ( 'globalsettings' , newSettings ) ;