summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/endpoints')
-rw-r--r--src/server/api/endpoints/admin/update-meta.ts82
-rw-r--r--src/server/api/endpoints/meta.ts12
2 files changed, 92 insertions, 2 deletions
diff --git a/src/server/api/endpoints/admin/update-meta.ts b/src/server/api/endpoints/admin/update-meta.ts
index e4f2e86aaa..8e98d203ff 100644
--- a/src/server/api/endpoints/admin/update-meta.ts
+++ b/src/server/api/endpoints/admin/update-meta.ts
@@ -357,7 +357,47 @@ export const meta = {
desc: {
'ja-JP': 'フィードバックのURL'
}
- }
+ },
+
+ useObjectStorage: {
+ validator: $.optional.bool
+ },
+
+ objectStorageBaseUrl: {
+ validator: $.optional.nullable.str
+ },
+
+ objectStorageBucket: {
+ validator: $.optional.nullable.str
+ },
+
+ objectStoragePrefix: {
+ validator: $.optional.nullable.str
+ },
+
+ objectStorageEndpoint: {
+ validator: $.optional.nullable.str
+ },
+
+ objectStorageRegion: {
+ validator: $.optional.nullable.str
+ },
+
+ objectStoragePort: {
+ validator: $.optional.nullable.num
+ },
+
+ objectStorageAccessKey: {
+ validator: $.optional.nullable.str
+ },
+
+ objectStorageSecretKey: {
+ validator: $.optional.nullable.str
+ },
+
+ objectStorageUseSSL: {
+ validator: $.optional.bool
+ },
}
};
@@ -560,6 +600,46 @@ export default define(meta, async (ps) => {
set.feedbackUrl = ps.feedbackUrl;
}
+ if (ps.useObjectStorage !== undefined) {
+ set.useObjectStorage = ps.useObjectStorage;
+ }
+
+ if (ps.objectStorageBaseUrl !== undefined) {
+ set.objectStorageBaseUrl = ps.objectStorageBaseUrl;
+ }
+
+ if (ps.objectStorageBucket !== undefined) {
+ set.objectStorageBucket = ps.objectStorageBucket;
+ }
+
+ if (ps.objectStoragePrefix !== undefined) {
+ set.objectStoragePrefix = ps.objectStoragePrefix;
+ }
+
+ if (ps.objectStorageEndpoint !== undefined) {
+ set.objectStorageEndpoint = ps.objectStorageEndpoint;
+ }
+
+ if (ps.objectStorageRegion !== undefined) {
+ set.objectStorageRegion = ps.objectStorageRegion;
+ }
+
+ if (ps.objectStoragePort !== undefined) {
+ set.objectStoragePort = ps.objectStoragePort;
+ }
+
+ if (ps.objectStorageAccessKey !== undefined) {
+ set.objectStorageAccessKey = ps.objectStorageAccessKey;
+ }
+
+ if (ps.objectStorageSecretKey !== undefined) {
+ set.objectStorageSecretKey = ps.objectStorageSecretKey;
+ }
+
+ if (ps.objectStorageUseSSL !== undefined) {
+ set.objectStorageUseSSL = ps.objectStorageUseSSL;
+ }
+
await getConnection().transaction(async transactionalEntityManager => {
const meta = await transactionalEntityManager.findOne(Meta, {
order: {
diff --git a/src/server/api/endpoints/meta.ts b/src/server/api/endpoints/meta.ts
index 1bd88a1e6d..4f418c63c1 100644
--- a/src/server/api/endpoints/meta.ts
+++ b/src/server/api/endpoints/meta.ts
@@ -153,7 +153,7 @@ export default define(meta, async (ps, me) => {
globalTimeLine: !instance.disableGlobalTimeline,
elasticsearch: config.elasticsearch ? true : false,
recaptcha: instance.enableRecaptcha,
- objectStorage: config.drive && config.drive.storage === 'minio',
+ objectStorage: instance.useObjectStorage,
twitter: instance.enableTwitterIntegration,
github: instance.enableGithubIntegration,
discord: instance.enableDiscordIntegration,
@@ -182,6 +182,16 @@ export default define(meta, async (ps, me) => {
response.smtpUser = instance.smtpUser;
response.smtpPass = instance.smtpPass;
response.swPrivateKey = instance.swPrivateKey;
+ response.useObjectStorage = instance.useObjectStorage;
+ response.objectStorageBaseUrl = instance.objectStorageBaseUrl;
+ response.objectStorageBucket = instance.objectStorageBucket;
+ response.objectStoragePrefix = instance.objectStoragePrefix;
+ response.objectStorageEndpoint = instance.objectStorageEndpoint;
+ response.objectStorageRegion = instance.objectStorageRegion;
+ response.objectStoragePort = instance.objectStoragePort;
+ response.objectStorageAccessKey = instance.objectStorageAccessKey;
+ response.objectStorageSecretKey = instance.objectStorageSecretKey;
+ response.objectStorageUseSSL = instance.objectStorageUseSSL;
}
return response;