Make the defaults and maximums for phish configurable

This commit is contained in:
hgw 2023-10-09 05:39:17 +00:00
parent 064b52ad3c
commit 744d27783b
Signed by: hgw
SSH Key Fingerprint: SHA256:diG7RVYHjd3aDYkZWHYcBJbImu+6zfptuUP+3k/wol4
2 changed files with 14 additions and 8 deletions

View File

@ -45,20 +45,20 @@ function gen(height, width, type) {
sendUpstream(output)
}
if (height > 100) {
if (height > config.phish.max_height) {
consoleLog('[phish] Height requesteed was over the maximum allowable amount, defaulting to maximum')
height = 100
height = config.phish.max_height
}
if (width > 100) {
if (width > config.phish.max_width) {
consoleLog('[phish] Width requesteed was over the maximum allowable amount, defaulting to maximum')
width = 100
width = config.phish.max_width
}
if (height == undefined) {
consoleLog('[phish] Height was not specified, defaulting to 5')
height = 6
consoleLog('[phish] Height was not specified, defaulting to '+config.phish.default_height)
height = config.phish.default_height
}
if (width == undefined) {
consoleLog('[phish] Width was not specified, defaulting to 5')
width = 10
consoleLog('[phish] Width was not specified, defaulting to '+config.phish.default_width)
width = config.phish.default_width
}
gen(height, width, type)

View File

@ -30,5 +30,11 @@
},
"misc": {
"logging": "true"
},
"phish": {
"default_height": "6",
"default_width": "10",
"max_height": "100",
"max_width": "100"
}
}