summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/endpoints/admin/update-meta.ts
diff options
context:
space:
mode:
authorJulia <julia@insertdomain.name>2025-05-29 00:07:38 +0000
committerJulia <julia@insertdomain.name>2025-05-29 00:07:38 +0000
commit6b554c178b81f13f83a69b19d44b72b282a0c119 (patch)
treef5537f1a56323a4dd57ba150b3cb84a2d8b5dc63 /packages/backend/src/server/api/endpoints/admin/update-meta.ts
parentmerge: Security fixes (!970) (diff)
parentbump version for release (diff)
downloadsharkey-6b554c178b81f13f83a69b19d44b72b282a0c119.tar.gz
sharkey-6b554c178b81f13f83a69b19d44b72b282a0c119.tar.bz2
sharkey-6b554c178b81f13f83a69b19d44b72b282a0c119.zip
merge: release 2025.4.2 (!1051)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1051 Approved-by: Hazelnoot <acomputerdog@gmail.com> Approved-by: Marie <github@yuugi.dev> Approved-by: Julia <julia@insertdomain.name>
Diffstat (limited to 'packages/backend/src/server/api/endpoints/admin/update-meta.ts')
-rw-r--r--packages/backend/src/server/api/endpoints/admin/update-meta.ts58
1 files changed, 47 insertions, 11 deletions
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 b3733d3d39..7c3d485a0f 100644
--- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts
+++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts
@@ -8,6 +8,7 @@ import type { MiMeta } from '@/models/Meta.js';
import { ModerationLogService } from '@/core/ModerationLogService.js';
import { Endpoint } from '@/server/api/endpoint-base.js';
import { MetaService } from '@/core/MetaService.js';
+import { instanceUnsignedFetchOptions } from '@/const.js';
export const meta = {
tags: ['admin'],
@@ -68,7 +69,7 @@ export const paramDef = {
description: { type: 'string', nullable: true },
defaultLightTheme: { type: 'string', nullable: true },
defaultDarkTheme: { type: 'string', nullable: true },
- defaultLike: { type: 'string', nullable: true },
+ defaultLike: { type: 'string' },
cacheRemoteFiles: { type: 'boolean' },
cacheRemoteSensitiveFiles: { type: 'boolean' },
emailRequiredForSignup: { type: 'boolean' },
@@ -95,7 +96,6 @@ export const paramDef = {
setSensitiveFlagAutomatically: { type: 'boolean' },
enableSensitiveMediaDetectionForVideos: { type: 'boolean' },
enableBotTrending: { type: 'boolean' },
- proxyAccountId: { type: 'string', format: 'misskey:id', nullable: true },
maintainerName: { type: 'string', nullable: true },
maintainerEmail: { type: 'string', nullable: true },
langs: {
@@ -103,10 +103,13 @@ export const paramDef = {
type: 'string',
},
},
+ translationTimeout: { type: 'number' },
deeplAuthKey: { type: 'string', nullable: true },
deeplIsPro: { type: 'boolean' },
deeplFreeMode: { type: 'boolean' },
deeplFreeInstance: { type: 'string', nullable: true },
+ libreTranslateURL: { type: 'string', nullable: true },
+ libreTranslateKey: { type: 'string', nullable: true },
enableEmail: { type: 'boolean' },
email: { type: 'string', nullable: true },
smtpSecure: { type: 'boolean' },
@@ -127,7 +130,7 @@ export const paramDef = {
useObjectStorage: { type: 'boolean' },
objectStorageBaseUrl: { type: 'string', nullable: true },
objectStorageBucket: { type: 'string', nullable: true },
- objectStoragePrefix: { type: 'string', nullable: true },
+ objectStoragePrefix: { type: 'string', pattern: /^[a-zA-Z0-9-._\/]*$/.source, nullable: true },
objectStorageEndpoint: { type: 'string', nullable: true },
objectStorageRegion: { type: 'string', nullable: true },
objectStoragePort: { type: 'integer', nullable: true },
@@ -203,6 +206,15 @@ export const paramDef = {
type: 'string',
},
},
+ allowUnsignedFetch: {
+ type: 'string',
+ enum: instanceUnsignedFetchOptions,
+ nullable: false,
+ },
+ enableProxyAccount: {
+ type: 'boolean',
+ nullable: false,
+ },
},
required: [],
} as const;
@@ -397,14 +409,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.turnstileSecretKey = ps.turnstileSecretKey;
}
- if (ps.enableFC !== undefined) {
- set.enableFC = ps.enableFC;
- }
-
if (ps.enableTestcaptcha !== undefined) {
set.enableTestcaptcha = ps.enableTestcaptcha;
}
+ if (ps.enableFC !== undefined) {
+ set.enableFC = ps.enableFC;
+ }
+
if (ps.fcSiteKey !== undefined) {
set.fcSiteKey = ps.fcSiteKey;
}
@@ -417,10 +429,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.enableBotTrending = ps.enableBotTrending;
}
- if (ps.proxyAccountId !== undefined) {
- set.proxyAccountId = ps.proxyAccountId;
- }
-
if (ps.maintainerName !== undefined) {
set.maintainerName = ps.maintainerName;
}
@@ -553,6 +561,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.objectStorageS3ForcePathStyle = ps.objectStorageS3ForcePathStyle;
}
+ if (ps.translationTimeout !== undefined) {
+ set.translationTimeout = ps.translationTimeout;
+ }
+
if (ps.deeplAuthKey !== undefined) {
if (ps.deeplAuthKey === '') {
set.deeplAuthKey = null;
@@ -577,6 +589,22 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
}
+ if (ps.libreTranslateURL !== undefined) {
+ if (ps.libreTranslateURL === '') {
+ set.libreTranslateURL = null;
+ } else {
+ set.libreTranslateURL = ps.libreTranslateURL;
+ }
+ }
+
+ if (ps.libreTranslateKey !== undefined) {
+ if (ps.libreTranslateKey === '') {
+ set.libreTranslateKey = null;
+ } else {
+ set.libreTranslateKey = ps.libreTranslateKey;
+ }
+ }
+
if (ps.enableIpLogging !== undefined) {
set.enableIpLogging = ps.enableIpLogging;
}
@@ -735,6 +763,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.federationHosts = ps.federationHosts.filter(Boolean).map(x => x.toLowerCase());
}
+ if (ps.allowUnsignedFetch !== undefined) {
+ set.allowUnsignedFetch = ps.allowUnsignedFetch;
+ }
+
+ if (ps.enableProxyAccount !== undefined) {
+ set.enableProxyAccount = ps.enableProxyAccount;
+ }
+
const before = await this.metaService.fetch(true);
await this.metaService.update(set);