Rework the https refresh logic

- puts the node version check first
 - validates the refresh interval and keeps it in valid range
 - simplifies the error messages
 - uses parseFloat not parseInt so we can use fractions of hour
This commit is contained in:
Nick O'Leary
2020-05-29 16:50:53 +01:00
parent 40101df6ec
commit bb41ab482c
3 changed files with 46 additions and 43 deletions

View File

@@ -49,14 +49,12 @@
"headless-mode": "Running in headless mode",
"httpadminauth-deprecated": "use of httpAdminAuth is deprecated. Use adminAuth instead",
"https": {
"missing-fields": "Cannot refresh the https settings when the https property function doesn't return a 'key' and 'cert'",
"settings-refreshed": "The https settings have been refreshed",
"apply-failed": "Failed to apply the refreshed https settings: __message__",
"get-failed": "Failed to get the refreshed https settings: __message__",
"refresh-interval": "Refreshing https settings every __interval__ seconds",
"nodejs-version": "Cannot refresh the https settings automatically, because NodeJs version 11 or above is required",
"function-required": "Cannot refresh the https settings automatically (at httpsRefreshInterval), because the https property needs to be a function"
}
"refresh-interval": "Refreshing https settings every __interval__ hours",
"settings-refreshed": "Server https settings have been refreshed",
"refresh-failed": "Failed to refresh https settings: __message__",
"nodejs-version": "httpsRefreshInterval requires Node.js 11 or later",
"function-required": "httpsRefreshInterval requires https property to be a function"
}
},
"api": {