fix: update s3 config

main
wangqing 9 months ago
parent 0334c84e17
commit a5506e570a

@ -34,7 +34,7 @@ public class Constants {
public static final String TOKEN_ROLE_ADMIN_USER = "admin"; public static final String TOKEN_ROLE_ADMIN_USER = "admin";
// public static final String TOKEN_ROLE_TOURIST="tourist"; // public static final String TOKEN_ROLE_TOURIST="tourist";
public static final String RESOURCE_PREFIX = "http://cdn.indie.cn/"; public static final String RESOURCE_PREFIX = "http://cdn1.indie.cn:19000/indie/";
public static final String MUSIC_RESOURCE_PREFIX = RESOURCE_PREFIX + "music/"; public static final String MUSIC_RESOURCE_PREFIX = RESOURCE_PREFIX + "music/";
public static final String SONG_RESOURCE_PREFIX = RESOURCE_PREFIX + "song/"; public static final String SONG_RESOURCE_PREFIX = RESOURCE_PREFIX + "song/";

@ -19,14 +19,16 @@ public class AwsS3Config {
@Bean @Bean
public S3Client s3Client(){ public S3Client s3Client(){
AwsBasicCredentials awsBasicCredentials = AwsBasicCredentials.create("GLwHmLTZ05Kw9RyCGJXnIkua", "ynOBIqdNXH5HBgrVA29DTn4cUSh1wAI"); // AwsBasicCredentials awsBasicCredentials = AwsBasicCredentials.create("GLwHmLTZ05Kw9RyCGJXnIkua", "ynOBIqdNXH5HBgrVA29DTn4cUSh1wAI");
AwsBasicCredentials awsBasicCredentials = AwsBasicCredentials.create("YaUJkVdm3btJxproam5a", "sCkKJdcImazyae1aHWIMAGg9XZLRGh3XXYerAB48");
S3Configuration s3Config = S3Configuration.builder().pathStyleAccessEnabled(true).build(); S3Configuration s3Config = S3Configuration.builder().pathStyleAccessEnabled(true).build();
S3Client s3 = S3Client.builder() S3Client s3 = S3Client.builder()
.endpointOverride(URI.create("https://s3.bitiful.net/")) .endpointOverride(URI.create("http://cdn1.indie.cn:19000/"))
.credentialsProvider(StaticCredentialsProvider.create(awsBasicCredentials)) .credentialsProvider(StaticCredentialsProvider.create(awsBasicCredentials))
.region(region) .region(region)
.serviceConfiguration(s3Config) .serviceConfiguration(s3Config)
.build(); .build();
return s3; return s3;
} }
@ -34,9 +36,10 @@ public class AwsS3Config {
public S3Presigner s3Presigner(){ public S3Presigner s3Presigner(){
S3Configuration s3Config = S3Configuration.builder().pathStyleAccessEnabled(true).build(); S3Configuration s3Config = S3Configuration.builder().pathStyleAccessEnabled(true).build();
S3Presigner presigner = S3Presigner.builder() S3Presigner presigner = S3Presigner.builder()
.endpointOverride(URI.create("https://s3.bitiful.net/")) .endpointOverride(URI.create("http://cdn1.indie.cn:19000/"))
.region(region) .region(region)
.build(); .build();
return presigner; return presigner;
} }
} }

@ -28,10 +28,11 @@ public class AwsS3Config {
@Bean @Bean
public S3Client s3Client(){ public S3Client s3Client(){
AwsBasicCredentials awsBasicCredentials = AwsBasicCredentials.create("GLwHmLTZ05Kw9RyCGJXnIkua", "ynOBIqdNXH5HBgrVA29DTn4cUSh1wAI"); // AwsBasicCredentials awsBasicCredentials = AwsBasicCredentials.create("GLwHmLTZ05Kw9RyCGJXnIkua", "ynOBIqdNXH5HBgrVA29DTn4cUSh1wAI");
AwsBasicCredentials awsBasicCredentials = AwsBasicCredentials.create("YaUJkVdm3btJxproam5a", "sCkKJdcImazyae1aHWIMAGg9XZLRGh3XXYerAB48");
S3Configuration s3Config = S3Configuration.builder().pathStyleAccessEnabled(true).build(); S3Configuration s3Config = S3Configuration.builder().pathStyleAccessEnabled(true).build();
S3Client s3 = S3Client.builder() S3Client s3 = S3Client.builder()
.endpointOverride(URI.create("https://s3.bitiful.net/")) .endpointOverride(URI.create("http://cdn1.indie.cn:19000/"))
.credentialsProvider(StaticCredentialsProvider.create(awsBasicCredentials)) .credentialsProvider(StaticCredentialsProvider.create(awsBasicCredentials))
.region(region) .region(region)
.serviceConfiguration(s3Config) .serviceConfiguration(s3Config)
@ -44,7 +45,7 @@ public class AwsS3Config {
public S3Presigner s3Presigner(){ public S3Presigner s3Presigner(){
S3Configuration s3Config = S3Configuration.builder().pathStyleAccessEnabled(true).build(); S3Configuration s3Config = S3Configuration.builder().pathStyleAccessEnabled(true).build();
S3Presigner presigner = S3Presigner.builder() S3Presigner presigner = S3Presigner.builder()
.endpointOverride(URI.create("https://s3.bitiful.net/")) .endpointOverride(URI.create("http://cdn1.indie.cn:19000/"))
.region(region) .region(region)
.build(); .build();

Loading…
Cancel
Save