summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/endpoints/admin
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/server/api/endpoints/admin')
-rw-r--r--packages/backend/src/server/api/endpoints/admin/meta.ts34
-rw-r--r--packages/backend/src/server/api/endpoints/admin/update-meta.ts41
2 files changed, 69 insertions, 6 deletions
diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts
index 88c5907bcc..f4ff573271 100644
--- a/packages/backend/src/server/api/endpoints/admin/meta.ts
+++ b/packages/backend/src/server/api/endpoints/admin/meta.ts
@@ -434,6 +434,8 @@ export const meta = {
summalyProxy: {
type: 'string',
optional: false, nullable: true,
+ deprecated: true,
+ description: '[Deprecated] Use "urlPreviewSummaryProxyUrl" instead.',
},
themeColor: {
type: 'string',
@@ -451,6 +453,30 @@ export const meta = {
type: 'string',
optional: false, nullable: false,
},
+ urlPreviewEnabled: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ urlPreviewTimeout: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ urlPreviewMaximumContentLength: {
+ type: 'number',
+ optional: false, nullable: false,
+ },
+ urlPreviewRequireContentLength: {
+ type: 'boolean',
+ optional: false, nullable: false,
+ },
+ urlPreviewUserAgent: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
+ urlPreviewSummaryProxyUrl: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
},
},
} as const;
@@ -533,7 +559,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
setSensitiveFlagAutomatically: instance.setSensitiveFlagAutomatically,
enableSensitiveMediaDetectionForVideos: instance.enableSensitiveMediaDetectionForVideos,
proxyAccountId: instance.proxyAccountId,
- summalyProxy: instance.summalyProxy,
email: instance.email,
smtpSecure: instance.smtpSecure,
smtpHost: instance.smtpHost,
@@ -577,6 +602,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
perUserHomeTimelineCacheMax: instance.perUserHomeTimelineCacheMax,
perUserListTimelineCacheMax: instance.perUserListTimelineCacheMax,
notesPerOneAd: instance.notesPerOneAd,
+ summalyProxy: instance.urlPreviewSummaryProxyUrl,
+ urlPreviewEnabled: instance.urlPreviewEnabled,
+ urlPreviewTimeout: instance.urlPreviewTimeout,
+ urlPreviewMaximumContentLength: instance.urlPreviewMaximumContentLength,
+ urlPreviewRequireContentLength: instance.urlPreviewRequireContentLength,
+ urlPreviewUserAgent: instance.urlPreviewUserAgent,
+ urlPreviewSummaryProxyUrl: instance.urlPreviewSummaryProxyUrl,
};
});
}
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 bffceef815..2f62d30ada 100644
--- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts
+++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts
@@ -90,7 +90,6 @@ export const paramDef = {
type: 'string',
},
},
- summalyProxy: { type: 'string', nullable: true },
deeplAuthKey: { type: 'string', nullable: true },
deeplIsPro: { type: 'boolean' },
enableEmail: { type: 'boolean' },
@@ -150,6 +149,16 @@ export const paramDef = {
type: 'string',
},
},
+ summalyProxy: {
+ type: 'string', nullable: true,
+ description: '[Deprecated] Use "urlPreviewSummaryProxyUrl" instead.',
+ },
+ urlPreviewEnabled: { type: 'boolean' },
+ urlPreviewTimeout: { type: 'integer' },
+ urlPreviewMaximumContentLength: { type: 'integer' },
+ urlPreviewRequireContentLength: { type: 'boolean' },
+ urlPreviewUserAgent: { type: 'string', nullable: true },
+ urlPreviewSummaryProxyUrl: { type: 'string', nullable: true },
},
required: [],
} as const;
@@ -353,10 +362,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.langs = ps.langs.filter(Boolean);
}
- if (ps.summalyProxy !== undefined) {
- set.summalyProxy = ps.summalyProxy;
- }
-
if (ps.enableEmail !== undefined) {
set.enableEmail = ps.enableEmail;
}
@@ -581,6 +586,32 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.bannedEmailDomains = ps.bannedEmailDomains;
}
+ if (ps.urlPreviewEnabled !== undefined) {
+ set.urlPreviewEnabled = ps.urlPreviewEnabled;
+ }
+
+ if (ps.urlPreviewTimeout !== undefined) {
+ set.urlPreviewTimeout = ps.urlPreviewTimeout;
+ }
+
+ if (ps.urlPreviewMaximumContentLength !== undefined) {
+ set.urlPreviewMaximumContentLength = ps.urlPreviewMaximumContentLength;
+ }
+
+ if (ps.urlPreviewRequireContentLength !== undefined) {
+ set.urlPreviewRequireContentLength = ps.urlPreviewRequireContentLength;
+ }
+
+ if (ps.urlPreviewUserAgent !== undefined) {
+ const value = (ps.urlPreviewUserAgent ?? '').trim();
+ set.urlPreviewUserAgent = value === '' ? null : ps.urlPreviewUserAgent;
+ }
+
+ if (ps.summalyProxy !== undefined || ps.urlPreviewSummaryProxyUrl !== undefined) {
+ const value = ((ps.urlPreviewSummaryProxyUrl ?? ps.summalyProxy) ?? '').trim();
+ set.urlPreviewSummaryProxyUrl = value === '' ? null : value;
+ }
+
const before = await this.metaService.fetch(true);
await this.metaService.update(set);