summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/endpoints/admin
diff options
context:
space:
mode:
authorMarie <github@yuugi.dev>2024-11-02 02:20:35 +0100
committerMarie <github@yuugi.dev>2024-11-02 02:20:35 +0100
commitd786e96c2bb6d637be7289efdb6766ae4406af1f (patch)
tree806e3bd85e7b63c7c3e657e80c9ae4fcda5d91b9 /packages/backend/src/server/api/endpoints/admin
parentmerge: Add a clear filter option to the search widget if set (!722) (diff)
downloadsharkey-d786e96c2bb6d637be7289efdb6766ae4406af1f.tar.gz
sharkey-d786e96c2bb6d637be7289efdb6766ae4406af1f.tar.bz2
sharkey-d786e96c2bb6d637be7289efdb6766ae4406af1f.zip
upd: add FriendlyCaptcha as a captcha solution
FriendlyCaptcha is a german captcha solution which is GDPR compliant and has a non-commerical free license
Diffstat (limited to 'packages/backend/src/server/api/endpoints/admin')
-rw-r--r--packages/backend/src/server/api/endpoints/admin/meta.ts15
-rw-r--r--packages/backend/src/server/api/endpoints/admin/update-meta.ts15
2 files changed, 30 insertions, 0 deletions
diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts
index 21116ba402..6e368eff43 100644
--- a/packages/backend/src/server/api/endpoints/admin/meta.ts
+++ b/packages/backend/src/server/api/endpoints/admin/meta.ts
@@ -73,6 +73,14 @@ export const meta = {
type: 'string',
optional: false, nullable: true,
},
+ enableFC: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ fcSiteKey: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
swPublickey: {
type: 'string',
optional: false, nullable: true,
@@ -219,6 +227,10 @@ export const meta = {
type: 'string',
optional: false, nullable: true,
},
+ fcSecretKey: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
sensitiveMediaDetection: {
type: 'string',
optional: false, nullable: false,
@@ -600,6 +612,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
recaptchaSiteKey: instance.recaptchaSiteKey,
enableTurnstile: instance.enableTurnstile,
turnstileSiteKey: instance.turnstileSiteKey,
+ enableFC: instance.enableFC,
+ fcSiteKey: instance.fcSiteKey,
swPublickey: instance.swPublicKey,
themeColor: instance.themeColor,
mascotImageUrl: instance.mascotImageUrl,
@@ -634,6 +648,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
mcaptchaSecretKey: instance.mcaptchaSecretKey,
recaptchaSecretKey: instance.recaptchaSecretKey,
turnstileSecretKey: instance.turnstileSecretKey,
+ fcSecretKey: instance.fcSecretKey,
sensitiveMediaDetection: instance.sensitiveMediaDetection,
sensitiveMediaDetectionSensitivity: instance.sensitiveMediaDetectionSensitivity,
setSensitiveFlagAutomatically: instance.setSensitiveFlagAutomatically,
diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts
index 1a55dec322..98760bbcc3 100644
--- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts
+++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts
@@ -81,6 +81,9 @@ export const paramDef = {
enableTurnstile: { type: 'boolean' },
turnstileSiteKey: { type: 'string', nullable: true },
turnstileSecretKey: { type: 'string', nullable: true },
+ enableFC: { type: 'boolean' },
+ fcSiteKey: { type: 'string', nullable: true },
+ fcSecretKey: { type: 'string', nullable: true },
sensitiveMediaDetection: { type: 'string', enum: ['none', 'all', 'local', 'remote'] },
sensitiveMediaDetectionSensitivity: { type: 'string', enum: ['medium', 'low', 'high', 'veryLow', 'veryHigh'] },
setSensitiveFlagAutomatically: { type: 'boolean' },
@@ -383,6 +386,18 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.turnstileSecretKey = ps.turnstileSecretKey;
}
+ if (ps.enableFC !== undefined) {
+ set.enableFC = ps.enableFC;
+ }
+
+ if (ps.fcSiteKey !== undefined) {
+ set.fcSiteKey = ps.fcSiteKey;
+ }
+
+ if (ps.fcSecretKey !== undefined) {
+ set.fcSecretKey = ps.fcSecretKey;
+ }
+
if (ps.enableBotTrending !== undefined) {
set.enableBotTrending = ps.enableBotTrending;
}