File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -150,10 +150,13 @@ tencent-cos:
150
150
base-url : ' https://gin.vue.admin'
151
151
path-prefix : ' github.com/flipped-aurora/gin-vue-admin/server'
152
152
153
- # aws s3 configuration
153
+ # aws s3 configuration (minio compatible)
154
154
aws-s3 :
155
155
bucket : xxxxx-10005608
156
156
region : ap-shanghai
157
+ endpoint : ' '
158
+ s3-force-path-style : false
159
+ disable-ssl : false
157
160
secret-id : xxxxxxxx
158
161
secret-key : xxxxxxxx
159
162
base-url : https://gin.vue.admin
Original file line number Diff line number Diff line change 1
1
package config
2
2
3
3
type AwsS3 struct {
4
- Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
5
- Region string `mapstructure:"region" json:"region" yaml:"region"`
6
- SecretID string `mapstructure:"secret-id" json:"secretID" yaml:"secret-id"`
7
- SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`
8
- BaseURL string `mapstructure:"base-url" json:"baseURL" yaml:"base-url"`
9
- PathPrefix string `mapstructure:"path-prefix" json:"pathPrefix" yaml:"path-prefix"`
4
+ Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
5
+ Region string `mapstructure:"region" json:"region" yaml:"region"`
6
+ Endpoint string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"`
7
+ S3ForcePathStyle bool `mapstructure:"s3-force-path-style" json:"s3ForcePathStyle" yaml:"s3-force-path-style"`
8
+ DisableSSL bool `mapstructure:"disable-ssl" json:"disableSSL" yaml:"disable-ssl"`
9
+ SecretID string `mapstructure:"secret-id" json:"secretID" yaml:"secret-id"`
10
+ SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`
11
+ BaseURL string `mapstructure:"base-url" json:"baseURL" yaml:"base-url"`
12
+ PathPrefix string `mapstructure:"path-prefix" json:"pathPrefix" yaml:"path-prefix"`
10
13
}
Original file line number Diff line number Diff line change @@ -83,7 +83,10 @@ func (*AwsS3) DeleteFile(key string) error {
83
83
// newSession Create S3 session
84
84
func newSession () * session.Session {
85
85
sess , _ := session .NewSession (& aws.Config {
86
- Region : aws .String (global .GVA_CONFIG .AwsS3 .Region ),
86
+ Region : aws .String (global .GVA_CONFIG .AwsS3 .Region ),
87
+ Endpoint : aws .String (global .GVA_CONFIG .AwsS3 .Endpoint ), //minio在这里设置地址,可以兼容
88
+ S3ForcePathStyle : aws .Bool (global .GVA_CONFIG .AwsS3 .S3ForcePathStyle ),
89
+ DisableSSL : aws .Bool (global .GVA_CONFIG .AwsS3 .DisableSSL ),
87
90
Credentials : credentials .NewStaticCredentials (
88
91
global .GVA_CONFIG .AwsS3 .SecretID ,
89
92
global .GVA_CONFIG .AwsS3 .SecretKey ,
You can’t perform that action at this time.
0 commit comments