summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/endpoints/admin
diff options
context:
space:
mode:
authorMarie <marie@kaifa.ch>2024-01-09 02:57:57 +0100
committerMarie <marie@kaifa.ch>2024-01-09 02:57:57 +0100
commit7552cea69ae21b31799d54b246dcd45e96654926 (patch)
tree389031f25fee72180157869a9e60c31704e198a9 /packages/backend/src/server/api/endpoints/admin
parentmerge: additional authorised fetch logging (#328) (diff)
parentfeat(ci): api.jsonのバリデーションチェックCIを追加 (#12950) (diff)
downloadsharkey-7552cea69ae21b31799d54b246dcd45e96654926.tar.gz
sharkey-7552cea69ae21b31799d54b246dcd45e96654926.tar.bz2
sharkey-7552cea69ae21b31799d54b246dcd45e96654926.zip
merge: upstream
Diffstat (limited to 'packages/backend/src/server/api/endpoints/admin')
-rw-r--r--packages/backend/src/server/api/endpoints/admin/meta.ts35
-rw-r--r--packages/backend/src/server/api/endpoints/admin/update-meta.ts43
2 files changed, 78 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 4fd2a568ad..66b6799ed1 100644
--- a/packages/backend/src/server/api/endpoints/admin/meta.ts
+++ b/packages/backend/src/server/api/endpoints/admin/meta.ts
@@ -45,6 +45,18 @@ export const meta = {
type: 'string',
optional: false, nullable: true,
},
+ enableMcaptcha: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ mcaptchaSiteKey: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ mcaptchaInstanceUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
enableRecaptcha: {
type: 'boolean',
optional: false, nullable: false,
@@ -174,6 +186,10 @@ export const meta = {
type: 'string',
optional: false, nullable: true,
},
+ mcaptchaSecretKey: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
recaptchaSecretKey: {
type: 'string',
optional: false, nullable: true,
@@ -299,6 +315,18 @@ export const meta = {
type: 'string',
optional: false, nullable: true,
},
+ enableTruemailApi: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ truemailInstance: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ truemailAuthKey: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
enableChartsForRemoteUser: {
type: 'boolean',
optional: false, nullable: false,
@@ -476,6 +504,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
approvalRequiredForSignup: instance.approvalRequiredForSignup,
enableHcaptcha: instance.enableHcaptcha,
hcaptchaSiteKey: instance.hcaptchaSiteKey,
+ enableMcaptcha: instance.enableMcaptcha,
+ mcaptchaSiteKey: instance.mcaptchaSitekey,
+ mcaptchaInstanceUrl: instance.mcaptchaInstanceUrl,
enableRecaptcha: instance.enableRecaptcha,
recaptchaSiteKey: instance.recaptchaSiteKey,
enableTurnstile: instance.enableTurnstile,
@@ -508,6 +539,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
preservedUsernames: instance.preservedUsernames,
bubbleInstances: instance.bubbleInstances,
hcaptchaSecretKey: instance.hcaptchaSecretKey,
+ mcaptchaSecretKey: instance.mcaptchaSecretKey,
recaptchaSecretKey: instance.recaptchaSecretKey,
turnstileSecretKey: instance.turnstileSecretKey,
sensitiveMediaDetection: instance.sensitiveMediaDetection,
@@ -543,6 +575,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
enableActiveEmailValidation: instance.enableActiveEmailValidation,
enableVerifymailApi: instance.enableVerifymailApi,
verifymailAuthKey: instance.verifymailAuthKey,
+ enableTruemailApi: instance.enableTruemailApi,
+ truemailInstance: instance.truemailInstance,
+ truemailAuthKey: instance.truemailAuthKey,
enableChartsForRemoteUser: instance.enableChartsForRemoteUser,
enableChartsForFederatedInstances: instance.enableChartsForFederatedInstances,
enableServerMachineStats: instance.enableServerMachineStats,
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 5c916fe340..05d2cd61ca 100644
--- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts
+++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts
@@ -65,6 +65,10 @@ export const paramDef = {
enableHcaptcha: { type: 'boolean' },
hcaptchaSiteKey: { type: 'string', nullable: true },
hcaptchaSecretKey: { type: 'string', nullable: true },
+ enableMcaptcha: { type: 'boolean' },
+ mcaptchaSiteKey: { type: 'string', nullable: true },
+ mcaptchaInstanceUrl: { type: 'string', nullable: true },
+ mcaptchaSecretKey: { type: 'string', nullable: true },
enableRecaptcha: { type: 'boolean' },
recaptchaSiteKey: { type: 'string', nullable: true },
recaptchaSecretKey: { type: 'string', nullable: true },
@@ -119,6 +123,9 @@ export const paramDef = {
enableActiveEmailValidation: { type: 'boolean' },
enableVerifymailApi: { type: 'boolean' },
verifymailAuthKey: { type: 'string', nullable: true },
+ enableTruemailApi: { type: 'boolean' },
+ truemailInstance: { type: 'string', nullable: true },
+ truemailAuthKey: { type: 'string', nullable: true },
enableChartsForRemoteUser: { type: 'boolean' },
enableChartsForFederatedInstances: { type: 'boolean' },
enableServerMachineStats: { type: 'boolean' },
@@ -279,6 +286,22 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.hcaptchaSecretKey = ps.hcaptchaSecretKey;
}
+ if (ps.enableMcaptcha !== undefined) {
+ set.enableMcaptcha = ps.enableMcaptcha;
+ }
+
+ if (ps.mcaptchaSiteKey !== undefined) {
+ set.mcaptchaSitekey = ps.mcaptchaSiteKey;
+ }
+
+ if (ps.mcaptchaInstanceUrl !== undefined) {
+ set.mcaptchaInstanceUrl = ps.mcaptchaInstanceUrl;
+ }
+
+ if (ps.mcaptchaSecretKey !== undefined) {
+ set.mcaptchaSecretKey = ps.mcaptchaSecretKey;
+ }
+
if (ps.enableRecaptcha !== undefined) {
set.enableRecaptcha = ps.enableRecaptcha;
}
@@ -471,6 +494,26 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
}
+ if (ps.enableTruemailApi !== undefined) {
+ set.enableTruemailApi = ps.enableTruemailApi;
+ }
+
+ if (ps.truemailInstance !== undefined) {
+ if (ps.truemailInstance === '') {
+ set.truemailInstance = null;
+ } else {
+ set.truemailInstance = ps.truemailInstance;
+ }
+ }
+
+ if (ps.truemailAuthKey !== undefined) {
+ if (ps.truemailAuthKey === '') {
+ set.truemailAuthKey = null;
+ } else {
+ set.truemailAuthKey = ps.truemailAuthKey;
+ }
+ }
+
if (ps.enableChartsForRemoteUser !== undefined) {
set.enableChartsForRemoteUser = ps.enableChartsForRemoteUser;
}