This commit is contained in:
syuilo 2019-05-16 01:07:32 +09:00
parent 3d8bbedf1b
commit 3f5b96bf62
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
12 changed files with 370 additions and 160 deletions

View file

@ -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: {