Make more resilient to missing captcha keys in secrets.json

merge-requests/346/merge
Thomas Lynch 1 year ago
parent 8f014940e9
commit de901f9b83
  1. 6
      gulpfile.js
  2. 6
      lib/build/render.js
  3. 6
      server.js

@ -431,9 +431,9 @@ async function custompages() {
defaultTheme: config.get.boardDefaults.theme,
defaultCodeTheme: config.get.boardDefaults.codeTheme,
postFilesSize: formatSize(config.get.globalLimits.postFilesSize.max),
googleRecaptchaSiteKey: google.siteKey,
hcaptchaSiteKey: hcaptcha.siteKey,
yandexSiteKey: yandex.siteKey,
googleRecaptchaSiteKey: google ? google.siteKey : '',
hcaptchaSiteKey: hcaptcha ? hcaptcha.siteKey : '',
yandexSiteKey: yandex ? yandex.siteKey : '',
globalAnnouncement: config.get.globalAnnouncement,
captchaOptions: config.get.captchaOptions,
commit,

@ -35,9 +35,9 @@ const updateLocals = () => {
postFilesSize: formatSize(globalLimits.postFilesSize.max),
globalLimits,
enableWebring,
googleRecaptchaSiteKey: google.siteKey,
hcaptchaSiteKey: hcaptcha.siteKey,
yandexSiteKey: yandex.siteKey,
googleRecaptchaSiteKey: google ? google.siteKey : '',
hcaptchaSiteKey: hcaptcha ? hcaptcha.siteKey : '',
yandexSiteKey: yandex ? yandex.siteKey : '',
captchaOptions,
globalAnnouncement,
globalLanguage: language,

@ -84,9 +84,9 @@ const config = require(__dirname+'/lib/misc/config.js')
app.locals.version = version;
app.locals.meta = meta;
app.locals.postFilesSize = formatSize(globalLimits.postFilesSize.max);
app.locals.googleRecaptchaSiteKey = google.siteKey;
app.locals.hcaptchaSiteKey = hcaptcha.siteKey;
app.locals.yandexSiteKey = yandex.siteKey;
app.locals.googleRecaptchaSiteKey = google ? google.siteKey : '';
app.locals.hcaptchaSiteKey = hcaptcha ? hcaptcha.siteKey : '';
app.locals.yandexSiteKey = yandex ? yandex.siteKey : '';
app.locals.globalAnnouncement = globalAnnouncement;
app.locals.captchaOptions = captchaOptions;
app.locals.globalLanguage = language;

Loading…
Cancel
Save