diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-11-07 00:08:21 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-11-07 00:08:21 +0900 |
| commit | a6f8327aa263022ed5d079f8e413bb17480feb7b (patch) | |
| tree | e0f75658f50da107627b838b10832764e71c192c /src/models | |
| parent | 10.42.2 (diff) | |
| download | sharkey-a6f8327aa263022ed5d079f8e413bb17480feb7b.tar.gz sharkey-a6f8327aa263022ed5d079f8e413bb17480feb7b.tar.bz2 sharkey-a6f8327aa263022ed5d079f8e413bb17480feb7b.zip | |
reCAPTCHAの設定をDBに保存するように
Diffstat (limited to 'src/models')
| -rw-r--r-- | src/models/meta.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/models/meta.ts b/src/models/meta.ts index 073be7de82..3eb73681ac 100644 --- a/src/models/meta.ts +++ b/src/models/meta.ts @@ -61,6 +61,19 @@ if ((config as any).preventCacheRemoteFiles) { } }); } +if ((config as any).recaptcha) { + Meta.findOne({}).then(m => { + if (m != null && m.enableRecaptcha == null) { + Meta.update({}, { + $set: { + enableRecaptcha: (config as any).recaptcha != null, + recaptchaSiteKey: (config as any).recaptcha.site_key, + recaptchaSecretKey: (config as any).recaptcha.secret_key, + } + }); + } + }); +} export type IMeta = { name?: string; @@ -79,6 +92,10 @@ export type IMeta = { cacheRemoteFiles?: boolean; + enableRecaptcha?: boolean; + recaptchaSiteKey?: string; + recaptchaSecretKey?: string; + /** * Drive capacity of a local user (MB) */ |