summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/admin/update-meta.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-05-16 01:07:32 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-05-16 01:07:32 +0900
commit3f5b96bf629da5f736c09b10058802eed28cca18 (patch)
tree9ee346f40ba93b252396b6b58ce724be54362c7c /src/server/api/endpoints/admin/update-meta.ts
parentGIFのサムネイルが生成されないのを修正 (diff)
downloadsharkey-3f5b96bf629da5f736c09b10058802eed28cca18.tar.gz
sharkey-3f5b96bf629da5f736c09b10058802eed28cca18.tar.bz2
sharkey-3f5b96bf629da5f736c09b10058802eed28cca18.zip
Resolve #4928
Diffstat (limited to 'src/server/api/endpoints/admin/update-meta.ts')
-rw-r--r--src/server/api/endpoints/admin/update-meta.ts82
1 files changed, 81 insertions, 1 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: {