mirror of
https://github.com/pischule/memevizor.git
synced 2025-12-19 06:56:42 +00:00
Move S3 connection details from hardcoded values to application properties.
This allows for greater flexibility in configuring the S3 storage provider for different environments without requiring code changes. - Add `endpoint` and `region` to `S3Props` - Update `S3Config` to use the new properties - Add new S3 properties to `application-local.properties.dist`
This commit is contained in:
@@ -11,8 +11,8 @@ class S3Config {
|
||||
@Bean
|
||||
fun s3Client(s3Props: S3Props): MinioClient =
|
||||
MinioClient.builder()
|
||||
.endpoint("https://storage.yandexcloud.net")
|
||||
.region("ru-central1")
|
||||
.endpoint(s3Props.endpoint)
|
||||
.region(s3Props.region)
|
||||
.credentials(s3Props.accessKeyId, s3Props.secretAccessKey)
|
||||
.build()
|
||||
}
|
||||
|
||||
@@ -3,4 +3,10 @@ package com.pischule.memevizor.upload
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties
|
||||
|
||||
@ConfigurationProperties("s3")
|
||||
data class S3Props(val accessKeyId: String, val secretAccessKey: String, val bucket: String)
|
||||
data class S3Props(
|
||||
val endpoint: String,
|
||||
val region: String,
|
||||
val accessKeyId: String,
|
||||
val secretAccessKey: String,
|
||||
val bucket: String,
|
||||
)
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
bot.forward-chat-id=<?>
|
||||
bot.approver<?>
|
||||
bot.token=<bot token>
|
||||
bot.approver-user-ids[0]=<?>
|
||||
bot.token=
|
||||
s3.endpoint=https://storage.yandexcloud.net
|
||||
s3.region=ru-central1
|
||||
s3.bucket=memevizor-test
|
||||
s3.access-key-id=<?>
|
||||
s3.secret-access-key=<?>
|
||||
|
||||
Reference in New Issue
Block a user