2022-09-03 13:38:43 +00:00
|
|
|
package s3
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/alist-org/alist/v3/internal/driver"
|
|
|
|
"github.com/alist-org/alist/v3/internal/op"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Addition struct {
|
2022-09-04 05:07:53 +00:00
|
|
|
driver.RootPath
|
2023-06-06 14:47:27 +00:00
|
|
|
Bucket string `json:"bucket" required:"true"`
|
|
|
|
Endpoint string `json:"endpoint" required:"true"`
|
|
|
|
Region string `json:"region"`
|
|
|
|
AccessKeyID string `json:"access_key_id" required:"true"`
|
|
|
|
SecretAccessKey string `json:"secret_access_key" required:"true"`
|
2023-07-13 07:58:19 +00:00
|
|
|
SessionToken string `json:"session_token"`
|
2023-06-06 14:47:27 +00:00
|
|
|
CustomHost string `json:"custom_host"`
|
2024-12-25 13:13:23 +00:00
|
|
|
EnableCustomHostPresign bool `json:"enable_custom_host_presign"`
|
2023-06-06 14:47:27 +00:00
|
|
|
SignURLExpire int `json:"sign_url_expire" type:"number" default:"4"`
|
|
|
|
Placeholder string `json:"placeholder"`
|
|
|
|
ForcePathStyle bool `json:"force_path_style"`
|
|
|
|
ListObjectVersion string `json:"list_object_version" type:"select" options:"v1,v2" default:"v1"`
|
|
|
|
RemoveBucket bool `json:"remove_bucket" help:"Remove bucket name from path when using custom host."`
|
|
|
|
AddFilenameToDisposition bool `json:"add_filename_to_disposition" help:"Add filename to Content-Disposition header."`
|
2022-09-03 13:38:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2022-12-13 10:03:30 +00:00
|
|
|
op.RegisterDriver(func() driver.Driver {
|
2024-03-25 14:53:44 +00:00
|
|
|
return &S3{
|
|
|
|
config: driver.Config{
|
|
|
|
Name: "S3",
|
|
|
|
DefaultRoot: "/",
|
|
|
|
LocalSort: true,
|
|
|
|
CheckStatus: true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
op.RegisterDriver(func() driver.Driver {
|
|
|
|
return &S3{
|
|
|
|
config: driver.Config{
|
|
|
|
Name: "Doge",
|
|
|
|
DefaultRoot: "/",
|
|
|
|
LocalSort: true,
|
|
|
|
CheckStatus: true,
|
|
|
|
},
|
|
|
|
}
|
2022-12-13 10:03:30 +00:00
|
|
|
})
|
2022-09-03 13:38:43 +00:00
|
|
|
}
|