Merge branch 'develop' of https://github.com/syuilo/misskey into develop
This commit is contained in:
		
						commit
						fd9c7d525a
					
				
					 7 changed files with 34 additions and 0 deletions
				
			
		|  | @ -161,6 +161,7 @@ | |||
| 				</div> | ||||
| 				<mk-switch v-model="objectStorageUseSSL" :disabled="!useObjectStorage">{{ $t('objectStorageUseSSL') }}<template #desc>{{ $t('objectStorageUseSSLDesc') }}</template></mk-switch> | ||||
| 				<mk-switch v-model="objectStorageUseProxy" :disabled="!useObjectStorage">{{ $t('objectStorageUseProxy') }}<template #desc>{{ $t('objectStorageUseProxyDesc') }}</template></mk-switch> | ||||
| 				<mk-switch v-model="objectStorageSetPublicRead" :disabled="!useObjectStorage">{{ $t('objectStorageSetPublicRead') }}</mk-switch> | ||||
| 			</template> | ||||
| 		</div> | ||||
| 		<div class="_footer"> | ||||
|  | @ -306,6 +307,7 @@ export default Vue.extend({ | |||
| 			objectStorageSecretKey: null, | ||||
| 			objectStorageUseSSL: false, | ||||
| 			objectStorageUseProxy: false, | ||||
| 			objectStorageSetPublicRead: false, | ||||
| 			enableTwitterIntegration: false, | ||||
| 			twitterConsumerKey: null, | ||||
| 			twitterConsumerSecret: null, | ||||
|  | @ -373,6 +375,7 @@ export default Vue.extend({ | |||
| 		this.objectStorageSecretKey = this.meta.objectStorageSecretKey; | ||||
| 		this.objectStorageUseSSL = this.meta.objectStorageUseSSL; | ||||
| 		this.objectStorageUseProxy = this.meta.objectStorageUseProxy; | ||||
| 		this.objectStorageSetPublicRead = this.meta.objectStorageSetPublicRead; | ||||
| 		this.enableTwitterIntegration = this.meta.enableTwitterIntegration; | ||||
| 		this.twitterConsumerKey = this.meta.twitterConsumerKey; | ||||
| 		this.twitterConsumerSecret = this.meta.twitterConsumerSecret; | ||||
|  | @ -522,6 +525,7 @@ export default Vue.extend({ | |||
| 				objectStorageSecretKey: this.objectStorageSecretKey ? this.objectStorageSecretKey : null, | ||||
| 				objectStorageUseSSL: this.objectStorageUseSSL, | ||||
| 				objectStorageUseProxy: this.objectStorageUseProxy, | ||||
| 				objectStorageSetPublicRead: this.objectStorageSetPublicRead, | ||||
| 				enableTwitterIntegration: this.enableTwitterIntegration, | ||||
| 				twitterConsumerKey: this.twitterConsumerKey, | ||||
| 				twitterConsumerSecret: this.twitterConsumerSecret, | ||||
|  |  | |||
|  | @ -370,4 +370,9 @@ export class Meta { | |||
| 		default: true, | ||||
| 	}) | ||||
| 	public objectStorageUseProxy: boolean; | ||||
| 
 | ||||
| 	@Column('boolean', { | ||||
| 		default: false, | ||||
| 	}) | ||||
| 	public objectStorageSetPublicRead: boolean; | ||||
| } | ||||
|  |  | |||
|  | @ -418,6 +418,10 @@ export const meta = { | |||
| 
 | ||||
| 		objectStorageUseProxy: { | ||||
| 			validator: $.optional.bool | ||||
| 		}, | ||||
| 
 | ||||
| 		objectStorageSetPublicRead: { | ||||
| 			validator: $.optional.bool | ||||
| 		} | ||||
| 	} | ||||
| }; | ||||
|  | @ -673,6 +677,10 @@ export default define(meta, async (ps, me) => { | |||
| 		set.objectStorageUseProxy = ps.objectStorageUseProxy; | ||||
| 	} | ||||
| 
 | ||||
| 	if (ps.objectStorageSetPublicRead !== undefined) { | ||||
| 		set.objectStorageSetPublicRead = ps.objectStorageSetPublicRead; | ||||
| 	} | ||||
| 
 | ||||
| 	await getConnection().transaction(async transactionalEntityManager => { | ||||
| 		const meta = await transactionalEntityManager.findOne(Meta, { | ||||
| 			order: { | ||||
|  |  | |||
|  | @ -195,6 +195,7 @@ export default define(meta, async (ps, me) => { | |||
| 		response.objectStorageSecretKey = instance.objectStorageSecretKey; | ||||
| 		response.objectStorageUseSSL = instance.objectStorageUseSSL; | ||||
| 		response.objectStorageUseProxy = instance.objectStorageUseProxy; | ||||
| 		response.objectStorageSetPublicRead = instance.objectStorageSetPublicRead; | ||||
| 	} | ||||
| 
 | ||||
| 	return response; | ||||
|  |  | |||
|  | @ -212,6 +212,7 @@ async function upload(key: string, stream: fs.ReadStream | Buffer, type: string, | |||
| 	} as S3.PutObjectRequest; | ||||
| 
 | ||||
| 	if (filename) params.ContentDisposition = contentDisposition('inline', filename); | ||||
| 	if (meta.objectStorageSetPublicRead) params.ACL = 'public-read'; | ||||
| 
 | ||||
| 	const s3 = getS3(meta); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue