ghostの設定をDBに保存するように

This commit is contained in:
syuilo 2018-11-07 00:44:56 +09:00
parent 87d4452d19
commit 2de48110bb
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
9 changed files with 55 additions and 21 deletions

View file

@ -98,17 +98,24 @@ export const meta = {
},
recaptchaSiteKey: {
validator: $.str.optional,
validator: $.str.optional.nullable,
desc: {
'ja-JP': 'reCAPTCHA site key'
}
},
recaptchaSecretKey: {
validator: $.str.optional,
validator: $.str.optional.nullable,
desc: {
'ja-JP': 'reCAPTCHA secret key'
}
},
proxyAccount: {
validator: $.str.optional.nullable,
desc: {
'ja-JP': 'Proxy account username'
}
}
}
};
@ -172,6 +179,10 @@ export default define(meta, (ps) => new Promise(async (res, rej) => {
set.recaptchaSecretKey = ps.recaptchaSecretKey;
}
if (ps.proxyAccount !== undefined) {
set.proxyAccount = ps.proxyAccount;
}
await Meta.update({}, {
$set: set
}, { upsert: true });