Compare commits
33
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d376838f77 | ||
|
|
e7f11af1ca | ||
|
|
0b5c4cc442 | ||
|
|
178ddafdc7 | ||
|
|
ad316ec6e3 | ||
|
|
61b022dfc3 | ||
|
|
1903b4c1a2 | ||
|
|
f7cbcf556f | ||
|
|
3581e628c0 | ||
|
|
62c41bf449 | ||
|
|
c5864e113b | ||
|
|
39259a5bd1 | ||
|
|
2e376eb3b9 | ||
|
|
de8e9d4693 | ||
|
|
710cf49bc6 | ||
|
|
8dacac60ea | ||
|
|
3a80d4d4b4 | ||
|
|
a531f987a8 | ||
|
|
e906b8d0c4 | ||
|
|
a5932ef91a | ||
|
|
3afa563eaf | ||
|
|
9d9654b31f | ||
|
|
cfe257f13d | ||
|
|
0375efbd35 | ||
|
|
cad1954213 | ||
|
|
604e37caa5 | ||
|
|
b249d384b9 | ||
|
|
04e91838db | ||
|
|
94829aaec5 | ||
|
|
f574e3395c | ||
|
|
2bc155a96a | ||
|
|
adc8ea3427 | ||
|
|
068eea025c |
No files matched your search
+1
-1
@@ -628,7 +628,7 @@ You'll need to modify the following files
|
||||
- `backend/s3/s3.go`
|
||||
- Add the provider to `providerOption` at the top of the file
|
||||
- Add endpoints and other config for your provider gated on the provider in `fs.RegInfo`.
|
||||
- Exclude your provider from generic config questions (eg `region` and `endpoint).
|
||||
- Exclude your provider from generic config questions (eg `region` and `endpoint`).
|
||||
- Add the provider to the `setQuirks` function - see the documentation there.
|
||||
- `docs/content/s3.md`
|
||||
- Add the provider at the top of the page.
|
||||
|
||||
@@ -34,6 +34,7 @@ directories to and from different cloud storage providers.
|
||||
- China Mobile Ecloud Elastic Object Storage (EOS) [:page_facing_up:](https://rclone.org/s3/#china-mobile-ecloud-eos)
|
||||
- Cloudflare R2 [:page_facing_up:](https://rclone.org/s3/#cloudflare-r2)
|
||||
- Citrix ShareFile [:page_facing_up:](https://rclone.org/sharefile/)
|
||||
- Cubbit DS3 [:page_facing_up:](https://rclone.org/s3/#Cubbit)
|
||||
- DigitalOcean Spaces [:page_facing_up:](https://rclone.org/s3/#digitalocean-spaces)
|
||||
- Digi Storage [:page_facing_up:](https://rclone.org/koofr/#digi-storage)
|
||||
- Dreamhost [:page_facing_up:](https://rclone.org/s3/#dreamhost)
|
||||
@@ -50,6 +51,7 @@ directories to and from different cloud storage providers.
|
||||
- Google Drive [:page_facing_up:](https://rclone.org/drive/)
|
||||
- Google Photos [:page_facing_up:](https://rclone.org/googlephotos/)
|
||||
- HDFS (Hadoop Distributed Filesystem) [:page_facing_up:](https://rclone.org/hdfs/)
|
||||
- Hetzner Object Storage [:page_facing_up:](https://rclone.org/s3/#hetzner)
|
||||
- Hetzner Storage Box [:page_facing_up:](https://rclone.org/sftp/#hetzner-storage-box)
|
||||
- HiDrive [:page_facing_up:](https://rclone.org/hidrive/)
|
||||
- HTTP [:page_facing_up:](https://rclone.org/http/)
|
||||
@@ -95,6 +97,7 @@ directories to and from different cloud storage providers.
|
||||
- Proton Drive [:page_facing_up:](https://rclone.org/protondrive/)
|
||||
- QingStor [:page_facing_up:](https://rclone.org/qingstor/)
|
||||
- Qiniu Cloud Object Storage (Kodo) [:page_facing_up:](https://rclone.org/s3/#qiniu)
|
||||
- Rabata Cloud Storage [:page_facing_up:](https://rclone.org/s3/#Rabata)
|
||||
- Quatrix [:page_facing_up:](https://rclone.org/quatrix/)
|
||||
- Rackspace Cloud Files [:page_facing_up:](https://rclone.org/swift/)
|
||||
- RackCorp Object Storage [:page_facing_up:](https://rclone.org/s3/#RackCorp)
|
||||
@@ -104,6 +107,7 @@ directories to and from different cloud storage providers.
|
||||
- Seagate Lyve Cloud [:page_facing_up:](https://rclone.org/s3/#lyve)
|
||||
- SeaweedFS [:page_facing_up:](https://rclone.org/s3/#seaweedfs)
|
||||
- Selectel Object Storage [:page_facing_up:](https://rclone.org/s3/#selectel)
|
||||
- Servercore Object Storage [:page_facing_up:](https://rclone.org/s3/#servercore)
|
||||
- SFTP [:page_facing_up:](https://rclone.org/sftp/)
|
||||
- SMB / CIFS [:page_facing_up:](https://rclone.org/smb/)
|
||||
- Spectra Logic [:page_facing_up:](https://rclone.org/s3/#spectralogic)
|
||||
|
||||
@@ -252,6 +252,9 @@ Docs: https://cloud.google.com/storage/docs/bucket-policy-only
|
||||
}, {
|
||||
Value: "us-east4",
|
||||
Help: "Northern Virginia",
|
||||
}, {
|
||||
Value: "us-east5",
|
||||
Help: "Ohio",
|
||||
}, {
|
||||
Value: "us-west1",
|
||||
Help: "Oregon",
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
"sort"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -60,7 +60,7 @@ const (
|
||||
configVersion = 1
|
||||
|
||||
defaultTokenURL = "https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token"
|
||||
defaultClientID = "jottacli"
|
||||
defaultClientID = "jottacli" // Identified as "Jottacloud CLI" in "My logged in devices"
|
||||
|
||||
legacyTokenURL = "https://api.jottacloud.com/auth/v1/token"
|
||||
legacyRegisterURL = "https://api.jottacloud.com/auth/v1/register"
|
||||
@@ -69,27 +69,31 @@ const (
|
||||
legacyConfigVersion = 0
|
||||
)
|
||||
|
||||
func getWhitelabelServices() map[string]struct {
|
||||
name, domain, realm, clientID string
|
||||
scopes []string
|
||||
} {
|
||||
return map[string]struct {
|
||||
name string
|
||||
domain string
|
||||
realm string
|
||||
clientID string
|
||||
scopes []string
|
||||
}{
|
||||
"telia_se": {"Telia Cloud (Sweden)", "cloud-auth.telia.se", "telia_se", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
"telia_no": {"Telia Sky (Norway)", "sky-auth.telia.no", "get", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
"tele2": {"Tele2 Cloud (Sweden)", "mittcloud-auth.tele2.se", "comhem", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
"onlime": {"Onlime (Denmark)", "cloud-auth.onlime.dk", "onlime_wl", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
"elkjop": {"Elkjøp Cloud (Norway)", "cloud.elkjop.no", "elkjop", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
"elgiganten_se": {"Elgiganten Cloud (Sweden)", "cloud.elgiganten.se", "elgiganten", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
"elgiganten_dk": {"Elgiganten Cloud (Denmark)", "cloud.elgiganten.dk", "elgiganten", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
"gigantti": {"Gigantti Cloud (Finland)", "cloud.gigantti.fi", "gigantti", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
"elko": {"ELKO Cloud (Iceland)", "cloud.elko.is", "elko", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
"letsgo": {"Let's Go Cloud (Germany)", "letsgo.jotta.cloud", "letsgo", "desktop-win", []string{"openid", "offline_access"}},
|
||||
type service struct {
|
||||
key string
|
||||
name string
|
||||
domain string
|
||||
realm string
|
||||
clientID string
|
||||
scopes []string
|
||||
}
|
||||
|
||||
// The list of services and their settings for supporting traditional OAuth.
|
||||
// Please keep these in alphabetical order, but with jottacloud first.
|
||||
func getServices() []service {
|
||||
return []service{
|
||||
{"jottacloud", "Jottacloud", "id.jottacloud.com", "jottacloud", "desktop", []string{"openid", "jotta-default", "offline_access"}}, // Chose client id "desktop" here, will be identified as "Jottacloud for Desktop" in "My logged in devices", but could have used "jottacli" here as well.
|
||||
{"elgiganten_dk", "Elgiganten Cloud (Denmark)", "cloud.elgiganten.dk", "elgiganten", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
{"elgiganten_se", "Elgiganten Cloud (Sweden)", "cloud.elgiganten.se", "elgiganten", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
{"elkjop", "Elkjøp Cloud (Norway)", "cloud.elkjop.no", "elkjop", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
{"elko", "ELKO Cloud (Iceland)", "cloud.elko.is", "elko", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
{"gigantti", "Gigantti Cloud (Finland)", "cloud.gigantti.fi", "gigantti", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
{"letsgo", "Let's Go Cloud (Germany)", "letsgo.jotta.cloud", "letsgo", "desktop-win", []string{"openid", "offline_access"}},
|
||||
{"mediamarkt", "MediaMarkt Cloud (Multiregional)", "mediamarkt.jottacloud.com", "mediamarkt", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
{"onlime", "Onlime (Denmark)", "cloud-auth.onlime.dk", "onlime_wl", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
{"tele2", "Tele2 Cloud (Sweden)", "mittcloud-auth.tele2.se", "comhem", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
{"telia_no", "Telia Sky (Norway)", "sky-auth.telia.no", "get", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
{"telia_se", "Telia Cloud (Sweden)", "cloud-auth.telia.se", "telia_se", "desktop", []string{"openid", "jotta-default", "offline_access"}},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,20 +180,34 @@ func Config(ctx context.Context, name string, m configmap.Mapper, conf fs.Config
|
||||
}
|
||||
return fs.ConfigChooseExclusiveFixed("auth_type_done", "config_type", `Type of authentication.`, []fs.OptionExample{{
|
||||
Value: "standard",
|
||||
Help: "Standard authentication.\nUse this if you're a normal Jottacloud user.",
|
||||
Help: `Standard authentication.
|
||||
This is primarily supported by the official service, but may also be
|
||||
supported by some white-label services. It is designed for command-line
|
||||
applications, and you will be asked to enter a single-use personal login
|
||||
token which you must manually generate from the account security settings
|
||||
in the web interface of your service.`,
|
||||
}, {
|
||||
Value: "whitelabel",
|
||||
Help: "Whitelabel authentication.\nUse this if you are using the service offered by a third party such as Telia, Tele2, Onlime, Elkjøp, etc.",
|
||||
Value: "traditional",
|
||||
Help: `Traditional authentication.
|
||||
This is supported by the official service and all white-label services
|
||||
that rclone knows about. You will be asked which service to connect to.
|
||||
It has a limitation of only a single active authentication at a time. You
|
||||
need to be on, or have access to, a machine with an internet-connected
|
||||
web browser.`,
|
||||
}, {
|
||||
Value: "legacy",
|
||||
Help: "Legacy authentication.\nThis is no longer supported by any known services and not recommended for normal users.",
|
||||
Help: `Legacy authentication.
|
||||
This is no longer supported by any known services and not recommended
|
||||
used. You will be asked for your account's username and password.`,
|
||||
}})
|
||||
case "auth_type_done":
|
||||
// Jump to next state according to config chosen
|
||||
return fs.ConfigGoto(conf.Result)
|
||||
case "standard": // configure a jottacloud backend using the modern JottaCli token based authentication
|
||||
m.Set("configVersion", fmt.Sprint(configVersion))
|
||||
return fs.ConfigInput("standard_token", "config_login_token", "Personal login token.\nGenerate here: https://www.jottacloud.com/web/secure")
|
||||
return fs.ConfigInput("standard_token", "config_login_token", `Personal login token.
|
||||
Generate it from the account security settings in the web interface of your
|
||||
service, for the official service on https://www.jottacloud.com/web/secure.`)
|
||||
case "standard_token":
|
||||
loginToken := conf.Result
|
||||
m.Set(configClientID, defaultClientID)
|
||||
@@ -206,29 +224,28 @@ func Config(ctx context.Context, name string, m configmap.Mapper, conf fs.Config
|
||||
return nil, fmt.Errorf("error while saving token: %w", err)
|
||||
}
|
||||
return fs.ConfigGoto("choose_device")
|
||||
case "whitelabel":
|
||||
whitelabels := getWhitelabelServices()
|
||||
options := make([]fs.OptionExample, 0, len(whitelabels))
|
||||
for key, val := range whitelabels {
|
||||
case "traditional":
|
||||
services := getServices()
|
||||
options := make([]fs.OptionExample, 0, len(services))
|
||||
for _, service := range services {
|
||||
options = append(options, fs.OptionExample{
|
||||
Value: key,
|
||||
Help: val.name,
|
||||
Value: service.key,
|
||||
Help: service.name,
|
||||
})
|
||||
}
|
||||
sort.Slice(options, func(i, j int) bool {
|
||||
return options[i].Help < options[j].Help
|
||||
})
|
||||
return fs.ConfigChooseExclusiveFixed("whitelabel_type", "config_whitelabel",
|
||||
return fs.ConfigChooseExclusiveFixed("traditional_type", "config_traditional",
|
||||
"White-label service. This decides the domain name to connect to and\nthe authentication configuration to use.",
|
||||
options)
|
||||
case "whitelabel_type":
|
||||
whitelabel, ok := getWhitelabelServices()[conf.Result]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unexpected whitelabel %q", conf.Result)
|
||||
case "traditional_type":
|
||||
services := getServices()
|
||||
i := slices.IndexFunc(services, func(s service) bool { return s.key == conf.Result })
|
||||
if i == -1 {
|
||||
return nil, fmt.Errorf("unexpected service %q", conf.Result)
|
||||
}
|
||||
service := services[i]
|
||||
opts := rest.Opts{
|
||||
Method: "GET",
|
||||
RootURL: "https://" + whitelabel.domain + "/auth/realms/" + whitelabel.realm + "/.well-known/openid-configuration",
|
||||
RootURL: "https://" + service.domain + "/auth/realms/" + service.realm + "/.well-known/openid-configuration",
|
||||
}
|
||||
var wellKnown api.WellKnown
|
||||
srv := rest.NewClient(fshttp.NewClient(ctx))
|
||||
@@ -237,14 +254,14 @@ func Config(ctx context.Context, name string, m configmap.Mapper, conf fs.Config
|
||||
return nil, fmt.Errorf("failed to get authentication provider configuration: %w", err)
|
||||
}
|
||||
m.Set("configVersion", fmt.Sprint(configVersion))
|
||||
m.Set(configClientID, whitelabel.clientID)
|
||||
m.Set(configClientID, service.clientID)
|
||||
m.Set(configTokenURL, wellKnown.TokenEndpoint)
|
||||
return oauthutil.ConfigOut("choose_device", &oauthutil.Options{
|
||||
OAuth2Config: &oauthutil.Config{
|
||||
AuthURL: wellKnown.AuthorizationEndpoint,
|
||||
TokenURL: wellKnown.TokenEndpoint,
|
||||
ClientID: whitelabel.clientID,
|
||||
Scopes: whitelabel.scopes,
|
||||
ClientID: service.clientID,
|
||||
Scopes: service.scopes,
|
||||
RedirectURL: oauthutil.RedirectLocalhostURL,
|
||||
},
|
||||
})
|
||||
@@ -992,6 +1009,13 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
|
||||
f.features.ListR = nil
|
||||
}
|
||||
|
||||
cust, err := getCustomerInfo(ctx, f.apiSrv)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
f.user = cust.Username
|
||||
f.setEndpoints()
|
||||
|
||||
// Renew the token in the background
|
||||
f.tokenRenewer = oauthutil.NewRenew(f.String(), ts, func() error {
|
||||
_, err := f.readMetaDataForPath(ctx, "")
|
||||
@@ -1001,13 +1025,6 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
|
||||
return err
|
||||
})
|
||||
|
||||
cust, err := getCustomerInfo(ctx, f.apiSrv)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
f.user = cust.Username
|
||||
f.setEndpoints()
|
||||
|
||||
if root != "" && !rootIsDir {
|
||||
// Check to see if the root actually an existing file
|
||||
remote := path.Base(root)
|
||||
|
||||
@@ -13,6 +13,8 @@ import (
|
||||
protonDriveAPI "github.com/henrybear327/Proton-API-Bridge"
|
||||
"github.com/henrybear327/go-proton-api"
|
||||
|
||||
"github.com/pquerna/otp/totp"
|
||||
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/config"
|
||||
"github.com/rclone/rclone/fs/config/configmap"
|
||||
@@ -87,6 +89,17 @@ The value can also be provided with --protondrive-2fa=000000
|
||||
The 2FA code of your proton drive account if the account is set up with
|
||||
two-factor authentication`,
|
||||
Required: false,
|
||||
}, {
|
||||
Name: "otp_secret_key",
|
||||
Help: `The OTP secret key
|
||||
|
||||
The value can also be provided with --protondrive-otp-secret-key=ABCDEFGHIJKLMNOPQRSTUVWXYZ234567
|
||||
|
||||
The OTP secret key of your proton drive account if the account is set up with
|
||||
two-factor authentication`,
|
||||
Required: false,
|
||||
Sensitive: true,
|
||||
IsPassword: true,
|
||||
}, {
|
||||
Name: clientUIDKey,
|
||||
Help: "Client uid key (internal use only)",
|
||||
@@ -191,6 +204,7 @@ type Options struct {
|
||||
Password string `config:"password"`
|
||||
MailboxPassword string `config:"mailbox_password"`
|
||||
TwoFA string `config:"2fa"`
|
||||
OtpSecretKey string `config:"otp_secret_key"`
|
||||
|
||||
// advanced
|
||||
Enc encoder.MultiEncoder `config:"encoding"`
|
||||
@@ -356,7 +370,15 @@ func newProtonDrive(ctx context.Context, f *Fs, opt *Options, m configmap.Mapper
|
||||
config.FirstLoginCredential.Username = opt.Username
|
||||
config.FirstLoginCredential.Password = opt.Password
|
||||
config.FirstLoginCredential.MailboxPassword = opt.MailboxPassword
|
||||
// if 2FA code is provided, use it; otherwise, generate one using the OTP secret key if provided
|
||||
config.FirstLoginCredential.TwoFA = opt.TwoFA
|
||||
if opt.TwoFA == "" && opt.OtpSecretKey != "" {
|
||||
code, err := totp.GenerateCode(opt.OtpSecretKey, time.Now())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("couldn't generate 2FA code: %w", err)
|
||||
}
|
||||
config.FirstLoginCredential.TwoFA = code
|
||||
}
|
||||
protonDrive, auth, err := protonDriveAPI.NewProtonDrive(ctx, config, authHandler, deAuthHandler)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("couldn't initialize a new proton drive instance: %w", err)
|
||||
@@ -395,6 +417,14 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
|
||||
}
|
||||
}
|
||||
|
||||
if opt.OtpSecretKey != "" {
|
||||
var err error
|
||||
opt.OtpSecretKey, err = obscure.Reveal(opt.OtpSecretKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("couldn't decrypt OtpSecretKey: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
ci := fs.GetConfig(ctx)
|
||||
|
||||
root = strings.Trim(root, "/")
|
||||
|
||||
+234
-41
@@ -95,6 +95,9 @@ var providerOption = fs.Option{
|
||||
}, {
|
||||
Value: "Cloudflare",
|
||||
Help: "Cloudflare R2 Storage",
|
||||
}, {
|
||||
Value: "Cubbit",
|
||||
Help: "Cubbit DS3 Object Storage",
|
||||
}, {
|
||||
Value: "DigitalOcean",
|
||||
Help: "DigitalOcean Spaces",
|
||||
@@ -104,12 +107,18 @@ var providerOption = fs.Option{
|
||||
}, {
|
||||
Value: "Exaba",
|
||||
Help: "Exaba Object Storage",
|
||||
}, {
|
||||
Value: "FileLu",
|
||||
Help: "FileLu S5 (S3-Compatible Object Storage)",
|
||||
}, {
|
||||
Value: "FlashBlade",
|
||||
Help: "Pure Storage FlashBlade Object Storage",
|
||||
}, {
|
||||
Value: "GCS",
|
||||
Help: "Google Cloud Storage",
|
||||
}, {
|
||||
Value: "Hetzner",
|
||||
Help: "Hetzner Object Storage",
|
||||
}, {
|
||||
Value: "HuaweiOBS",
|
||||
Help: "Huawei Object Storage Service",
|
||||
@@ -158,6 +167,9 @@ var providerOption = fs.Option{
|
||||
}, {
|
||||
Value: "Petabox",
|
||||
Help: "Petabox Object Storage",
|
||||
}, {
|
||||
Value: "Rabata",
|
||||
Help: "Rabata Cloud Storage",
|
||||
}, {
|
||||
Value: "RackCorp",
|
||||
Help: "RackCorp Object Storage",
|
||||
@@ -173,6 +185,9 @@ var providerOption = fs.Option{
|
||||
}, {
|
||||
Value: "Selectel",
|
||||
Help: "Selectel Object Storage",
|
||||
}, {
|
||||
Value: "Servercore",
|
||||
Help: "Servercore Object Storage",
|
||||
}, {
|
||||
Value: "SpectraLogic",
|
||||
Help: "Spectra Logic Black Pearl",
|
||||
@@ -350,7 +365,49 @@ func init() {
|
||||
}},
|
||||
}, {
|
||||
Name: "region",
|
||||
Help: "Region to connect to. - the location where your bucket will be created and your data stored. Need bo be same with your endpoint.\n",
|
||||
Help: "Region to connect to.",
|
||||
Provider: "Cubbit",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "eu-west-1",
|
||||
Help: "Europe West",
|
||||
}},
|
||||
}, {
|
||||
Name: "region",
|
||||
Help: "Region to connect to for FileLu S5.",
|
||||
Provider: "FileLu",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "global",
|
||||
Help: "Global",
|
||||
}, {
|
||||
Value: "us-east",
|
||||
Help: "North America (US-East)",
|
||||
}, {
|
||||
Value: "eu-central",
|
||||
Help: "Europe (EU-Central)",
|
||||
}, {
|
||||
Value: "ap-southeast",
|
||||
Help: "Asia Pacific (AP-Southeast)",
|
||||
}, {
|
||||
Value: "me-central",
|
||||
Help: "Middle East (ME-Central)",
|
||||
}},
|
||||
}, {
|
||||
Name: "region",
|
||||
Help: "Region to connect to.",
|
||||
Provider: "Hetzner",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "hel1",
|
||||
Help: "Helsinki",
|
||||
}, {
|
||||
Value: "fsn1",
|
||||
Help: "Falkenstein",
|
||||
}, {
|
||||
Value: "nbg1",
|
||||
Help: "Nuremberg",
|
||||
}},
|
||||
}, {
|
||||
Name: "region",
|
||||
Help: "Region to connect to. - the location where your bucket will be created and your data stored. Need to be same with your endpoint.\n",
|
||||
Provider: "HuaweiOBS",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "af-south-1",
|
||||
@@ -541,6 +598,20 @@ func init() {
|
||||
Value: "ap-northeast-1",
|
||||
Help: "Northeast Asia Region 1.\nNeeds location constraint ap-northeast-1.",
|
||||
}},
|
||||
}, {
|
||||
Name: "region",
|
||||
Help: "Region where your bucket will be created and your data stored.\n",
|
||||
Provider: "Rabata",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "us-east-1",
|
||||
Help: "US East (N. Virginia)",
|
||||
}, {
|
||||
Value: "eu-west-1",
|
||||
Help: "EU (Ireland)",
|
||||
}, {
|
||||
Value: "eu-west-2",
|
||||
Help: "EU (London)",
|
||||
}},
|
||||
}, {
|
||||
Name: "region",
|
||||
Help: "region - the location where your bucket will be created and your data stored.\n",
|
||||
@@ -626,6 +697,26 @@ func init() {
|
||||
Value: "ru-1",
|
||||
Help: "St. Petersburg",
|
||||
}},
|
||||
}, {
|
||||
Name: "region",
|
||||
Help: "Region where your is data stored.\n",
|
||||
Provider: "Servercore",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "ru-1",
|
||||
Help: "St. Petersburg",
|
||||
}, {
|
||||
Value: "gis-1",
|
||||
Help: "Moscow",
|
||||
}, {
|
||||
Value: "ru-7",
|
||||
Help: "Moscow",
|
||||
}, {
|
||||
Value: "uz-2",
|
||||
Help: "Tashkent, Uzbekistan",
|
||||
}, {
|
||||
Value: "kz-1",
|
||||
Help: "Almaty, Kazakhstan",
|
||||
}},
|
||||
}, {
|
||||
Name: "region",
|
||||
Help: "Region where your data stored.\n",
|
||||
@@ -657,7 +748,7 @@ func init() {
|
||||
}, {
|
||||
Name: "region",
|
||||
Help: "Region to connect to.\n\nLeave blank if you are using an S3 clone and you don't have a region.",
|
||||
Provider: "!AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,FlashBlade,HuaweiOBS,IDrive,Intercolo,IONOS,Liara,Linode,Magalu,Mega,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,Selectel,SpectraLogic,Storj,Synology,TencentCOS,Zata",
|
||||
Provider: "!AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,Cubbit,FlashBlade,FileLu,Hetzner,HuaweiOBS,IDrive,Intercolo,IONOS,Liara,Linode,Magalu,Mega,OVHcloud,Petabox,Qiniu,Rabata,RackCorp,Scaleway,Selectel,Servercore,SpectraLogic,Storj,Synology,TencentCOS,Zata",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "",
|
||||
Help: "Use this if unsure.\nWill use v4 signatures and an empty region.",
|
||||
@@ -858,6 +949,22 @@ func init() {
|
||||
Value: "eos-anhui-1.cmecloud.cn",
|
||||
Help: "Anhui China (Huainan)",
|
||||
}},
|
||||
}, {
|
||||
Name: "endpoint",
|
||||
Help: "Endpoint for Cubbit DS3 Object Storage.",
|
||||
Provider: "Cubbit",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "s3.cubbit.eu",
|
||||
Help: "Cubbit DS3 Object Storage endpoint",
|
||||
}},
|
||||
}, {
|
||||
Name: "endpoint",
|
||||
Help: "Endpoint for FileLu S5 Object Storage.\nRequired when using FileLu S5.",
|
||||
Provider: "FileLu",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "s5lu.com",
|
||||
Help: "Global FileLu S5 endpoint",
|
||||
}},
|
||||
}, {
|
||||
Name: "endpoint",
|
||||
Help: "Endpoint for Google Cloud Storage.",
|
||||
@@ -866,6 +973,20 @@ func init() {
|
||||
Value: "https://storage.googleapis.com",
|
||||
Help: "Google Cloud Storage endpoint",
|
||||
}},
|
||||
}, {
|
||||
Name: "endpoint",
|
||||
Help: "Endpoint for Hetzner Object Storage",
|
||||
Provider: "Hetzner",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "hel1.your-objectstorage.com",
|
||||
Help: "Helsinki",
|
||||
}, {
|
||||
Value: "fsn1.your-objectstorage.com",
|
||||
Help: "Falkenstein",
|
||||
}, {
|
||||
Value: "nbg1.your-objectstorage.com",
|
||||
Help: "Nuremberg",
|
||||
}},
|
||||
}, {
|
||||
// obs endpoints: https://developer.huaweicloud.com/intl/en-us/endpoint?OBS
|
||||
Name: "endpoint",
|
||||
@@ -1001,7 +1122,7 @@ func init() {
|
||||
Help: "APAC Cross Regional Tokyo Endpoint",
|
||||
}, {
|
||||
Value: "s3.hkg.ap.cloud-object-storage.appdomain.cloud",
|
||||
Help: "APAC Cross Regional HongKong Endpoint",
|
||||
Help: "APAC Cross Regional Hong Kong Endpoint",
|
||||
}, {
|
||||
Value: "s3.seo.ap.cloud-object-storage.appdomain.cloud",
|
||||
Help: "APAC Cross Regional Seoul Endpoint",
|
||||
@@ -1013,7 +1134,7 @@ func init() {
|
||||
Help: "APAC Cross Regional Tokyo Private Endpoint",
|
||||
}, {
|
||||
Value: "s3.private.hkg.ap.cloud-object-storage.appdomain.cloud",
|
||||
Help: "APAC Cross Regional HongKong Private Endpoint",
|
||||
Help: "APAC Cross Regional Hong Kong Private Endpoint",
|
||||
}, {
|
||||
Value: "s3.private.seo.ap.cloud-object-storage.appdomain.cloud",
|
||||
Help: "APAC Cross Regional Seoul Private Endpoint",
|
||||
@@ -1354,11 +1475,17 @@ func init() {
|
||||
}},
|
||||
}, {
|
||||
Name: "endpoint",
|
||||
Help: "Endpoint for Zata Object Storage.",
|
||||
Provider: "Zata",
|
||||
Help: "Endpoint for Rabata Object Storage.",
|
||||
Provider: "Rabata",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "idr01.zata.ai",
|
||||
Help: "South Asia Endpoint",
|
||||
Value: "s3.us-east-1.rabata.io",
|
||||
Help: "US East (N. Virginia)",
|
||||
}, {
|
||||
Value: "s3.eu-west-1.rabata.io",
|
||||
Help: "EU West (Ireland)",
|
||||
}, {
|
||||
Value: "s3.eu-west-2.rabata.io",
|
||||
Help: "EU West (London)",
|
||||
}},
|
||||
}, {
|
||||
// RackCorp endpoints: https://www.rackcorp.com/storage/s3storage
|
||||
@@ -1432,6 +1559,26 @@ func init() {
|
||||
Value: "s3.ru-1.storage.selcloud.ru",
|
||||
Help: "Saint Petersburg",
|
||||
}},
|
||||
}, {
|
||||
Name: "endpoint",
|
||||
Help: "Endpoint for Servercore Object Storage.",
|
||||
Provider: "Servercore",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "s3.ru-1.storage.selcloud.ru",
|
||||
Help: "Saint Petersburg",
|
||||
}, {
|
||||
Value: "s3.gis-1.storage.selcloud.ru",
|
||||
Help: "Moscow",
|
||||
}, {
|
||||
Value: "s3.ru-7.storage.selcloud.ru",
|
||||
Help: "Moscow",
|
||||
}, {
|
||||
Value: "s3.uz-2.srvstorage.uz",
|
||||
Help: "Tashkent, Uzbekistan",
|
||||
}, {
|
||||
Value: "s3.kz-1.srvstorage.kz",
|
||||
Help: "Almaty, Kazakhstan",
|
||||
}},
|
||||
}, {
|
||||
Name: "endpoint",
|
||||
Help: "Endpoint for Scaleway Object Storage.",
|
||||
@@ -1551,10 +1698,18 @@ func init() {
|
||||
Value: "cos.accelerate.myqcloud.com",
|
||||
Help: "Use Tencent COS Accelerate Endpoint",
|
||||
}},
|
||||
}, {
|
||||
Name: "endpoint",
|
||||
Help: "Endpoint for Zata Object Storage.",
|
||||
Provider: "Zata",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "idr01.zata.ai",
|
||||
Help: "South Asia Endpoint",
|
||||
}},
|
||||
}, {
|
||||
Name: "endpoint",
|
||||
Help: "Endpoint for S3 API.\n\nRequired when using an S3 clone.",
|
||||
Provider: "!AWS,Alibaba,ArvanCloud,ChinaMobile,GCS,HuaweiOBS,IBMCOS,IDrive,Intercolo,IONOS,Liara,Linode,LyveCloud,Magalu,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,Selectel,StackPath,Storj,Synology,TencentCOS,Zata",
|
||||
Provider: "!AWS,Alibaba,ArvanCloud,ChinaMobile,Cubbit,GCS,Hetzner,HuaweiOBS,IBMCOS,IDrive,Intercolo,IONOS,Liara,Linode,LyveCloud,Magalu,OVHcloud,Petabox,Qiniu,Rabata,RackCorp,Scaleway,Selectel,Servercore,StackPath,Storj,Synology,TencentCOS,Zata",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "objects-us-east-1.dream.io",
|
||||
Help: "Dream Objects endpoint",
|
||||
@@ -1856,7 +2011,7 @@ func init() {
|
||||
Help: "Southwest China (Guiyang)",
|
||||
}, {
|
||||
Value: "xian1",
|
||||
Help: "Nouthwest China (Xian)",
|
||||
Help: "Northwest China (Xian)",
|
||||
}, {
|
||||
Value: "yunnan",
|
||||
Help: "Yunnan China (Kunming)",
|
||||
@@ -2024,6 +2179,20 @@ func init() {
|
||||
Value: "ap-northeast-1",
|
||||
Help: "Northeast Asia Region 1",
|
||||
}},
|
||||
}, {
|
||||
Name: "location_constraint",
|
||||
Help: "location where your bucket will be created and your data stored.\n",
|
||||
Provider: "Rabata",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "us-east-1",
|
||||
Help: "US East (N. Virginia)",
|
||||
}, {
|
||||
Value: "eu-west-1",
|
||||
Help: "EU (Ireland)",
|
||||
}, {
|
||||
Value: "eu-west-2",
|
||||
Help: "EU (London)",
|
||||
}},
|
||||
}, {
|
||||
Name: "location_constraint",
|
||||
Help: "Location constraint - the location where your bucket will be located and your data stored.\n",
|
||||
@@ -2081,7 +2250,7 @@ func init() {
|
||||
Help: "New York (USA) Region",
|
||||
}, {
|
||||
Value: "us-west-1",
|
||||
Help: "Freemont (USA) Region",
|
||||
Help: "Fremont (USA) Region",
|
||||
}, {
|
||||
Value: "nz",
|
||||
Help: "Auckland (New Zealand) Region",
|
||||
@@ -2089,7 +2258,7 @@ func init() {
|
||||
}, {
|
||||
Name: "location_constraint",
|
||||
Help: "Location constraint - must be set to match the Region.\n\nLeave blank if not sure. Used when creating buckets only.",
|
||||
Provider: "!AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,FlashBlade,HuaweiOBS,IBMCOS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,Magalu,Mega,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,Selectel,SpectraLogic,StackPath,Storj,TencentCOS",
|
||||
Provider: "!AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,Cubbit,FlashBlade,FileLu,HuaweiOBS,IBMCOS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,Magalu,Mega,Outscale,OVHcloud,Petabox,Qiniu,Rabata,RackCorp,Scaleway,Selectel,Servercore,SpectraLogic,StackPath,Storj,TencentCOS",
|
||||
}, {
|
||||
Name: "acl",
|
||||
Help: `Canned ACL used when creating buckets and storing or copying objects.
|
||||
@@ -2104,7 +2273,7 @@ doesn't copy the ACL from the source but rather writes a fresh one.
|
||||
If the acl is an empty string then no X-Amz-Acl: header is added and
|
||||
the default (private) will be used.
|
||||
`,
|
||||
Provider: "!Cloudflare,FlashBlade,Mega,Selectel,SpectraLogic,Storj,Synology",
|
||||
Provider: "!Cloudflare,FlashBlade,Mega,Rabata,Selectel,Servercore,SpectraLogic,Storj,Synology",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "default",
|
||||
Help: "Owner gets Full_CONTROL.\nNo one else has access rights (default).",
|
||||
@@ -2162,7 +2331,7 @@ isn't set then "acl" is used instead.
|
||||
If the "acl" and "bucket_acl" are empty strings then no X-Amz-Acl:
|
||||
header is added and the default (private) will be used.
|
||||
`,
|
||||
Provider: "!Cloudflare,FlashBlade,Selectel,SpectraLogic,Storj,Synology",
|
||||
Provider: "!Cloudflare,FlashBlade,Rabata,Selectel,SpectraLogic,Storj,Synology",
|
||||
Advanced: true,
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "private",
|
||||
@@ -2291,6 +2460,15 @@ If you leave it blank, this is calculated automatically from the sse_customer_ke
|
||||
Value: "GLACIER_IR",
|
||||
Help: "Glacier Instant Retrieval storage class",
|
||||
}},
|
||||
}, {
|
||||
// Mapping from here: https://www.arvancloud.ir/en/products/cloud-storage
|
||||
Name: "storage_class",
|
||||
Help: "The storage class to use when storing new objects in ArvanCloud.",
|
||||
Provider: "ArvanCloud",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "STANDARD",
|
||||
Help: "Standard storage class",
|
||||
}},
|
||||
}, {
|
||||
// Mapping from here: https://www.alibabacloud.com/help/doc-detail/64919.htm
|
||||
Name: "storage_class",
|
||||
@@ -2336,15 +2514,6 @@ If you leave it blank, this is calculated automatically from the sse_customer_ke
|
||||
Value: "STANDARD",
|
||||
Help: "Standard storage class",
|
||||
}},
|
||||
}, {
|
||||
// Mapping from here: https://www.arvancloud.ir/en/products/cloud-storage
|
||||
Name: "storage_class",
|
||||
Help: "The storage class to use when storing new objects in ArvanCloud.",
|
||||
Provider: "ArvanCloud",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "STANDARD",
|
||||
Help: "Standard storage class",
|
||||
}},
|
||||
}, {
|
||||
// Mapping from here: https://docs.magalu.cloud/docs/storage/object-storage/Classes-de-Armazenamento/standard
|
||||
Name: "storage_class",
|
||||
@@ -2358,22 +2527,22 @@ If you leave it blank, this is calculated automatically from the sse_customer_ke
|
||||
Help: "Glacier Instant Retrieval storage class",
|
||||
}},
|
||||
}, {
|
||||
// Mapping from here: https://intl.cloud.tencent.com/document/product/436/30925
|
||||
// Mapping from here: https://developer.qiniu.com/kodo/5906/storage-type
|
||||
Name: "storage_class",
|
||||
Help: "The storage class to use when storing new objects in Tencent COS.",
|
||||
Provider: "TencentCOS",
|
||||
Help: "The storage class to use when storing new objects in Qiniu.",
|
||||
Provider: "Qiniu",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "",
|
||||
Help: "Default",
|
||||
}, {
|
||||
Value: "STANDARD",
|
||||
Help: "Standard storage class",
|
||||
}, {
|
||||
Value: "ARCHIVE",
|
||||
Value: "LINE",
|
||||
Help: "Infrequent access storage mode",
|
||||
}, {
|
||||
Value: "GLACIER",
|
||||
Help: "Archive storage mode",
|
||||
}, {
|
||||
Value: "STANDARD_IA",
|
||||
Help: "Infrequent access storage mode",
|
||||
Value: "DEEP_ARCHIVE",
|
||||
Help: "Deep archive storage mode",
|
||||
}},
|
||||
}, {
|
||||
// Mapping from here: https://www.scaleway.com/en/docs/storage/object/quickstart/
|
||||
@@ -2394,22 +2563,22 @@ If you leave it blank, this is calculated automatically from the sse_customer_ke
|
||||
Help: "One Zone - Infrequent Access.\nA good choice for storing secondary backup copies or easily re-creatable data.\nAvailable in the FR-PAR region only.",
|
||||
}},
|
||||
}, {
|
||||
// Mapping from here: https://developer.qiniu.com/kodo/5906/storage-type
|
||||
// Mapping from here: https://intl.cloud.tencent.com/document/product/436/30925
|
||||
Name: "storage_class",
|
||||
Help: "The storage class to use when storing new objects in Qiniu.",
|
||||
Provider: "Qiniu",
|
||||
Help: "The storage class to use when storing new objects in Tencent COS.",
|
||||
Provider: "TencentCOS",
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "",
|
||||
Help: "Default",
|
||||
}, {
|
||||
Value: "STANDARD",
|
||||
Help: "Standard storage class",
|
||||
}, {
|
||||
Value: "LINE",
|
||||
Help: "Infrequent access storage mode",
|
||||
}, {
|
||||
Value: "GLACIER",
|
||||
Value: "ARCHIVE",
|
||||
Help: "Archive storage mode",
|
||||
}, {
|
||||
Value: "DEEP_ARCHIVE",
|
||||
Help: "Deep archive storage mode",
|
||||
Value: "STANDARD_IA",
|
||||
Help: "Infrequent access storage mode",
|
||||
}},
|
||||
}, {
|
||||
Name: "upload_cutoff",
|
||||
@@ -3658,6 +3827,8 @@ func setQuirks(opt *Options) {
|
||||
case "Alibaba":
|
||||
useMultipartEtag = false // Alibaba seems to calculate multipart Etags differently from AWS
|
||||
useAlreadyExists = true // returns 200 OK
|
||||
case "Hetzner":
|
||||
useAlreadyExists = false
|
||||
case "HuaweiOBS":
|
||||
// Huawei OBS PFS is not support listObjectV2, and if turn on the urlEncodeListing, marker will not work and keep list same page forever.
|
||||
urlEncodeListings = false
|
||||
@@ -3676,6 +3847,9 @@ func setQuirks(opt *Options) {
|
||||
case "Cloudflare":
|
||||
virtualHostStyle = false
|
||||
useMultipartEtag = false // currently multipart Etags are random
|
||||
case "Cubbit":
|
||||
// no quirks
|
||||
useMultipartEtag = false // Cubbit calculates multipart Etags differently from AWS
|
||||
case "ArvanCloud":
|
||||
listObjectsV2 = false
|
||||
virtualHostStyle = false
|
||||
@@ -3690,6 +3864,11 @@ func setQuirks(opt *Options) {
|
||||
case "FlashBlade":
|
||||
mightGzip = false // Never auto gzips objects
|
||||
virtualHostStyle = false // supports vhost but defaults to paths
|
||||
case "FileLu":
|
||||
listObjectsV2 = false
|
||||
virtualHostStyle = false
|
||||
urlEncodeListings = false
|
||||
useMultipartEtag = false
|
||||
case "IBMCOS":
|
||||
listObjectsV2 = false // untested
|
||||
virtualHostStyle = false
|
||||
@@ -3744,6 +3923,8 @@ func setQuirks(opt *Options) {
|
||||
virtualHostStyle = false
|
||||
case "OVHcloud":
|
||||
// No quirks
|
||||
case "Rabata":
|
||||
// server side copy not supported
|
||||
case "RackCorp":
|
||||
// No quirks
|
||||
useMultipartEtag = false // untested
|
||||
@@ -3768,6 +3949,8 @@ func setQuirks(opt *Options) {
|
||||
useAlreadyExists = true
|
||||
case "Selectel":
|
||||
urlEncodeListings = false
|
||||
case "Servercore":
|
||||
urlEncodeListings = false
|
||||
case "SeaweedFS":
|
||||
listObjectsV2 = false // untested
|
||||
virtualHostStyle = false
|
||||
@@ -4024,6 +4207,12 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
|
||||
if opt.Provider == "AWS" {
|
||||
f.features.DoubleSlash = true
|
||||
}
|
||||
if opt.Provider == "Rabata" {
|
||||
f.features.Copy = nil
|
||||
}
|
||||
if opt.Provider == "Hetzner" {
|
||||
f.features.SetTier = false
|
||||
}
|
||||
if opt.DirectoryMarkers {
|
||||
f.features.CanHaveEmptyDirectories = true
|
||||
}
|
||||
@@ -6159,6 +6348,10 @@ func (o *Object) ModTime(ctx context.Context) time.Time {
|
||||
|
||||
// SetModTime sets the modification time of the local fs object
|
||||
func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error {
|
||||
if o.fs.opt.Provider == "Rabata" {
|
||||
// Rabata does not support copying objects
|
||||
return fs.ErrorCantSetModTime
|
||||
}
|
||||
err := o.readMetaData(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -561,6 +561,21 @@ func (f *Fs) setRoot(root string) {
|
||||
f.rootContainer, f.rootDirectory = bucket.Split(f.root)
|
||||
}
|
||||
|
||||
// Fetch the base container's policy to be used if/when we need to create a
|
||||
// segments container to ensure we use the same policy.
|
||||
func (f *Fs) fetchStoragePolicy(ctx context.Context, container string) (fs.Fs, error) {
|
||||
err := f.pacer.Call(func() (bool, error) {
|
||||
var rxHeaders swift.Headers
|
||||
_, rxHeaders, err := f.c.Container(ctx, container)
|
||||
|
||||
f.opt.StoragePolicy = rxHeaders["X-Storage-Policy"]
|
||||
fs.Debugf(f, "Auto set StoragePolicy to %s", f.opt.StoragePolicy)
|
||||
|
||||
return shouldRetryHeaders(ctx, rxHeaders, err)
|
||||
})
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// NewFsWithConnection constructs an Fs from the path, container:path
|
||||
// and authenticated connection.
|
||||
//
|
||||
@@ -590,6 +605,7 @@ func NewFsWithConnection(ctx context.Context, opt *Options, name, root string, c
|
||||
f.opt.UseSegmentsContainer.Valid = true
|
||||
fs.Debugf(f, "Auto set use_segments_container to %v", f.opt.UseSegmentsContainer.Value)
|
||||
}
|
||||
|
||||
if f.rootContainer != "" && f.rootDirectory != "" {
|
||||
// Check to see if the object exists - ignoring directory markers
|
||||
var info swift.Object
|
||||
@@ -1132,6 +1148,13 @@ func (f *Fs) newSegmentedUpload(ctx context.Context, dstContainer string, dstPat
|
||||
container: dstContainer,
|
||||
}
|
||||
if f.opt.UseSegmentsContainer.Value {
|
||||
if f.opt.StoragePolicy == "" {
|
||||
_, err = f.fetchStoragePolicy(ctx, dstContainer)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
su.container += segmentsContainerSuffix
|
||||
err = f.makeContainer(ctx, su.container)
|
||||
if err != nil {
|
||||
|
||||
@@ -76,6 +76,7 @@ func (f *Fs) testNoChunk(t *testing.T) {
|
||||
|
||||
// Additional tests that aren't in the framework
|
||||
func (f *Fs) InternalTest(t *testing.T) {
|
||||
t.Run("PolicyDiscovery", f.testPolicyDiscovery)
|
||||
t.Run("NoChunk", f.testNoChunk)
|
||||
t.Run("WithChunk", f.testWithChunk)
|
||||
t.Run("WithChunkFail", f.testWithChunkFail)
|
||||
@@ -195,4 +196,50 @@ func (f *Fs) testCopyLargeObject(t *testing.T) {
|
||||
require.Equal(t, obj.Size(), objTarget.Size())
|
||||
}
|
||||
|
||||
func (f *Fs) testPolicyDiscovery(t *testing.T) {
|
||||
ctx := context.TODO()
|
||||
container := "testPolicyDiscovery-1"
|
||||
// Reset the policy so we can test if it is populated.
|
||||
f.opt.StoragePolicy = ""
|
||||
err := f.makeContainer(ctx, container)
|
||||
require.NoError(t, err)
|
||||
_, err = f.fetchStoragePolicy(ctx, container)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Default policy for SAIO image is 1replica.
|
||||
assert.Equal(t, "1replica", f.opt.StoragePolicy)
|
||||
|
||||
// Create a container using a non-default policy, and check to ensure
|
||||
// that the created segments container uses the same non-default policy.
|
||||
policy := "Policy-1"
|
||||
container = "testPolicyDiscovery-2"
|
||||
|
||||
f.opt.StoragePolicy = policy
|
||||
err = f.makeContainer(ctx, container)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Reset the policy so we can test if it is populated, and set to the
|
||||
// non-default policy.
|
||||
f.opt.StoragePolicy = ""
|
||||
_, err = f.fetchStoragePolicy(ctx, container)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, policy, f.opt.StoragePolicy)
|
||||
|
||||
// Test that when a segmented upload container is made, the newly
|
||||
// created container inherits the non-default policy of the base
|
||||
// container.
|
||||
f.opt.StoragePolicy = ""
|
||||
f.opt.UseSegmentsContainer.Value = true
|
||||
su, err := f.newSegmentedUpload(ctx, container, "")
|
||||
require.NoError(t, err)
|
||||
// The container name we expected?
|
||||
segmentsContainer := container + segmentsContainerSuffix
|
||||
assert.Equal(t, segmentsContainer, su.container)
|
||||
// The policy we expected?
|
||||
f.opt.StoragePolicy = ""
|
||||
_, err = f.fetchStoragePolicy(ctx, su.container)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, policy, f.opt.StoragePolicy)
|
||||
}
|
||||
|
||||
var _ fstests.InternalTester = (*Fs)(nil)
|
||||
+1
-1
@@ -14,4 +14,4 @@ if [ -z "$globs" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker run -v $PWD:/workdir --user $(id -u):$(id -g) davidanson/markdownlint-cli2 $globs
|
||||
docker run --rm -v $PWD:/workdir --user $(id -u):$(id -g) davidanson/markdownlint-cli2 $globs
|
||||
+11
-12
@@ -2,6 +2,7 @@ package s3
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/rclone/gofakes3"
|
||||
"github.com/rclone/rclone/fs"
|
||||
@@ -12,25 +13,23 @@ type logger struct{}
|
||||
|
||||
// print log message
|
||||
func (l logger) Print(level gofakes3.LogLevel, v ...any) {
|
||||
var s string
|
||||
if len(v) == 0 {
|
||||
s = ""
|
||||
} else {
|
||||
var ok bool
|
||||
s, ok = v[0].(string)
|
||||
if !ok {
|
||||
s = fmt.Sprint(v[0])
|
||||
var b strings.Builder
|
||||
for i := range v {
|
||||
if i > 0 {
|
||||
fmt.Fprintf(&b, " ")
|
||||
}
|
||||
v = v[1:]
|
||||
fmt.Fprint(&b, v[i])
|
||||
}
|
||||
s := b.String()
|
||||
|
||||
switch level {
|
||||
default:
|
||||
fallthrough
|
||||
case gofakes3.LogErr:
|
||||
fs.Errorf("serve s3", s, v...)
|
||||
fs.Errorf("serve s3", s)
|
||||
case gofakes3.LogWarn:
|
||||
fs.Infof("serve s3", s, v...)
|
||||
fs.Infof("serve s3", s)
|
||||
case gofakes3.LogInfo:
|
||||
fs.Debugf("serve s3", s, v...)
|
||||
fs.Debugf("serve s3", s)
|
||||
}
|
||||
}
|
||||
@@ -117,6 +117,7 @@ WebDAV or S3, that work out of the box.)
|
||||
{{< provider name="Citrix ShareFile" home="http://sharefile.com/" config="/sharefile/" >}}
|
||||
{{< provider name="Cloudflare R2" home="https://blog.cloudflare.com/r2-open-beta/" config="/s3/#cloudflare-r2" >}}
|
||||
{{< provider name="Cloudinary" home="https://cloudinary.com/" config="/cloudinary/" >}}
|
||||
{{< provider name="Cubbit DS3" home="https://cubbit.io/ds3-cloud" config="/s3/#Cubbit" >}}
|
||||
{{< provider name="DigitalOcean Spaces" home="https://www.digitalocean.com/products/object-storage/" config="/s3/#digitalocean-spaces" >}}
|
||||
{{< provider name="Digi Storage" home="https://storage.rcs-rds.ro/" config="/koofr/#digi-storage" >}}
|
||||
{{< provider name="Dreamhost" home="https://www.dreamhost.com/cloud/storage/" config="/s3/#dreamhost" >}}
|
||||
@@ -125,6 +126,7 @@ WebDAV or S3, that work out of the box.)
|
||||
{{< provider name="Exaba" home="https://exaba.com/" config="/s3/#exaba" >}}
|
||||
{{< provider name="Fastmail Files" home="https://www.fastmail.com/" config="/webdav/#fastmail-files" >}}
|
||||
{{< provider name="FileLu Cloud Storage" home="https://filelu.com/" config="/filelu/" >}}
|
||||
{{< provider name="FileLu S5 (S3-Compatible Object Storage)" home="https://s5lu.com/" config="/s3/#filelu-s5" >}}
|
||||
{{< provider name="Files.com" home="https://www.files.com/" config="/filescom/" >}}
|
||||
{{< provider name="FlashBlade" home="https://www.purestorage.com/products/unstructured-data-storage.html" config="/s3/#pure-storage-flashblade" >}}
|
||||
{{< provider name="FTP" home="https://en.wikipedia.org/wiki/File_Transfer_Protocol" config="/ftp/" >}}
|
||||
@@ -133,9 +135,11 @@ WebDAV or S3, that work out of the box.)
|
||||
{{< provider name="Google Drive" home="https://www.google.com/drive/" config="/drive/" >}}
|
||||
{{< provider name="Google Photos" home="https://www.google.com/photos/about/" config="/googlephotos/" >}}
|
||||
{{< provider name="HDFS" home="https://hadoop.apache.org/" config="/hdfs/" >}}
|
||||
{{< provider name="Hetzner Object Storage" home="https://www.hetzner.com/storage/object-storage/" config="/s3/#hetzner" >}}
|
||||
{{< provider name="Hetzner Storage Box" home="https://www.hetzner.com/storage/storage-box" config="/sftp/#hetzner-storage-box" >}}
|
||||
{{< provider name="HiDrive" home="https://www.strato.de/cloud-speicher/" config="/hidrive/" >}}
|
||||
{{< provider name="HTTP" home="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol" config="/http/" >}}
|
||||
{{< provider name="Huawei OBS" home="https://www.huaweicloud.com/intl/en-us/product/obs.html" config="/s3/#huawei-obs" >}}
|
||||
{{< provider name="iCloud Drive" home="https://icloud.com/" config="/iclouddrive/" >}}
|
||||
{{< provider name="ImageKit" home="https://imagekit.io" config="/imagekit/" >}}
|
||||
{{< provider name="Internet Archive" home="https://archive.org/" config="/internetarchive/" >}}
|
||||
@@ -179,13 +183,17 @@ WebDAV or S3, that work out of the box.)
|
||||
{{< provider name="QingStor" home="https://www.qingcloud.com/products/storage" config="/qingstor/" >}}
|
||||
{{< provider name="Qiniu Cloud Object Storage (Kodo)" home="https://www.qiniu.com/en/products/kodo" config="/s3/#qiniu" >}}
|
||||
{{< provider name="Quatrix by Maytech" home="https://www.maytech.net/products/quatrix-business" config="/quatrix/" >}}
|
||||
{{< provider name="Rabata Cloud Storage" home="https://rabata.io" config="/s3/#Rabata" >}}
|
||||
{{< provider name="RackCorp Object Storage" home="https://www.rackcorp.com/" config="/s3/#RackCorp" >}}
|
||||
{{< provider name="Rackspace Cloud Files" home="https://www.rackspace.com/cloud/files" config="/swift/" >}}
|
||||
{{< provider name="Rclone Serve S3" home="/commands/rclone_serve_s3/" config="/s3/#rclone" >}}
|
||||
{{< provider name="rsync.net" home="https://rsync.net/products/rclone.html" config="/sftp/#rsync-net" >}}
|
||||
{{< provider name="Scaleway" home="https://www.scaleway.com/object-storage/" config="/s3/#scaleway" >}}
|
||||
{{< provider name="Seafile" home="https://www.seafile.com/" config="/seafile/" >}}
|
||||
{{< provider name="Seagate Lyve Cloud" home="https://www.seagate.com/gb/en/services/cloud/storage/" config="/s3/#lyve" >}}
|
||||
{{< provider name="SeaweedFS" home="https://github.com/chrislusf/seaweedfs/" config="/s3/#seaweedfs" >}}
|
||||
{{< provider name="Selectel" home="https://selectel.ru/services/cloud/storage/" config="/s3/#selectel" >}}
|
||||
{{< provider name="Servercore Object Storage" home="https://servercore.com/services/object-storage/" config="/s3/#servercore" >}}
|
||||
{{< provider name="SFTP" home="https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol" config="/sftp/" >}}
|
||||
{{< provider name="Sia" home="https://sia.tech/" config="/sia/" >}}
|
||||
{{< provider name="SMB / CIFS" home="https://en.wikipedia.org/wiki/Server_Message_Block" config="/smb/" >}}
|
||||
|
||||
@@ -1016,3 +1016,9 @@ put them back in again.` >}}
|
||||
- Matt LaPaglia <mlapaglia@gmail.com>
|
||||
- Youfu Zhang <1315097+zhangyoufu@users.noreply.github.com>
|
||||
- juejinyuxitu <juejinyuxitu@outlook.com>
|
||||
- iTrooz <hey@itrooz.fr>
|
||||
- Microscotch <github.com@microscotch.net>
|
||||
- Andrew Ruthven <andrew@etc.gen.nz>
|
||||
- spiffytech <git@spiffy.tech>
|
||||
- Dulani Woods <Dulani@gmail.com>
|
||||
- Marco Ferretti <mferretti93@gmail.com>
|
||||
@@ -852,6 +852,32 @@ the binary units, e.g. 1, 2\*\*10, 2\*\*20, 2\*\*30 respectively.
|
||||
|
||||
See also [--human-readable](#human-readable).
|
||||
|
||||
### --assume-listings-sorted
|
||||
|
||||
This flag can be used when the source and destination backends are
|
||||
guaranteed to return the items in the same sorted order and in that
|
||||
case it will speed up the sync.
|
||||
|
||||
Not all backends are guaranteed to return sorted entries (eg local)
|
||||
but s3 should, so an s3 to s3 sync could benefit from this flag.
|
||||
|
||||
If rclone finds an out of order directory entry then it will cancel
|
||||
the sync with the error:
|
||||
|
||||
```console
|
||||
out of order listing in source (remote:dir)
|
||||
```
|
||||
|
||||
In this case you should remove the `--assume-listings-sorted` flag.
|
||||
|
||||
If you are using `--assume-listings-sorted` then rclone will assume
|
||||
`--no-unicode-normalization` and it will compare file names in a case
|
||||
sensitive way.
|
||||
|
||||
Normally sorting directory entries is not a bottleneck, but it can
|
||||
become so with syncs of millions of items in a single directory as the
|
||||
sync will not start until the directory listing is complete.
|
||||
|
||||
## Main options
|
||||
|
||||
### --backup-dir string
|
||||
|
||||
@@ -100,7 +100,9 @@ Choose a number from below, or type in your own value
|
||||
\ "us-east1"
|
||||
13 / Northern Virginia.
|
||||
\ "us-east4"
|
||||
14 / Oregon.
|
||||
14 / Ohio.
|
||||
\ "us-east5"
|
||||
15 / Oregon.
|
||||
\ "us-west1"
|
||||
location> 12
|
||||
The storage class to use when storing objects in Google Cloud Storage.
|
||||
|
||||
+140
-56
@@ -28,76 +28,150 @@ as described [below](#whitelabel-authentication):
|
||||
- Onlime
|
||||
- Onlime (onlime.dk)
|
||||
- MediaMarkt
|
||||
- MediaMarkt Cloud (mediamarkt.jottacloud.com)
|
||||
- Let's Go Cloud (letsgo.jotta.cloud)
|
||||
|
||||
Paths are specified as `remote:path`
|
||||
|
||||
Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
|
||||
|
||||
## Authentication types
|
||||
## Authentication
|
||||
|
||||
Some of the white-label versions uses a different authentication method than the
|
||||
official service, and you have to choose the correct one when setting up the remote.
|
||||
Authentication in Jottacloud is in general based on OAuth and OpenID Connect
|
||||
(OIDC). There are different variants to choose from, depending on which service
|
||||
you are using, e.g. a white-label service may only support one of them. Note
|
||||
that there is no documentation to rely on, so the descriptions provided here
|
||||
are based on observations and may not be accurate.
|
||||
|
||||
### Standard authentication
|
||||
Jottacloud uses two optional OAuth security mechanisms, referred to as "Refresh
|
||||
Token Rotation" and "Automatic Reuse Detection", which has some implications.
|
||||
Access tokens normally have one hour expiry, after which they need to be
|
||||
refreshed (rotated), an operation that requires the refresh token to be
|
||||
supplied. Rclone does this automatically. This is standard OAuth. But in
|
||||
Jottacloud, such a refresh operation not only creates a new access token, but
|
||||
also refresh token, and invalidates the existing refresh token, the one that
|
||||
was supplied. It keeps track of the history of refresh tokens, sometimes
|
||||
referred to as a token family, descending from the original refresh token that
|
||||
was issued after the initial authentication. This is used to detect any
|
||||
attempts at reusing old refresh tokens, and trigger an immedate invalidation of
|
||||
the current refresh token, and effectively the entire refresh token family.
|
||||
|
||||
The standard authentication method used by the official service (jottacloud.com),
|
||||
as well as some of the white-label services, is based on OAuth 2.0 and OpenID
|
||||
Connect (OIDC), and requires you to generate a single-use personal login token
|
||||
from the account security settings in the service's web interface. Log in to your
|
||||
account, go to "Settings" and then "Security", or use the direct link presented
|
||||
to you by rclone when configuring the remote:
|
||||
<https://www.jottacloud.com/web/secure>. Scroll down to the section "Personal login
|
||||
token", and click the "Generate" button. Note that if you are using a white-label
|
||||
service you probably can't use the direct link, you need to find the same page in
|
||||
their dedicated web interface, and also it may be in a different location than
|
||||
described above.
|
||||
|
||||
To access your account from multiple instances of rclone, you need to configure
|
||||
each of them with a separate personal login token. E.g. you create a Jottacloud
|
||||
remote with rclone in one location, and copy the configuration file to a second
|
||||
location where you also want to run rclone and access the same remote. Then you
|
||||
need to replace the token for one of them, using the [config reconnect](https://rclone.org/commands/rclone_config_reconnect/)
|
||||
command, which requires you to generate a new personal login token and supply
|
||||
as input. If you do not do this, the token may easily end up being invalidated,
|
||||
resulting in both instances failing with an error message something along the
|
||||
When the current refresh token has been invalidated, next time rclone tries to
|
||||
perform a token refresh, it will fail with an error message something along the
|
||||
lines of:
|
||||
|
||||
```text
|
||||
oauth2: cannot fetch token: 400 Bad Request
|
||||
Response: {"error":"invalid_grant","error_description":"Stale token"}
|
||||
CRITICAL: Failed to create file system for "remote:": (...): couldn't fetch token: invalid_grant: maybe token expired? - try refreshing with "rclone config reconnect remote:"
|
||||
```
|
||||
|
||||
When this happens, you need to replace the token as described above to be able
|
||||
to use your remote again.
|
||||
If you run rclone with verbosity level 2 (`-vv`), you will see a debug message
|
||||
with an additional error description from the OAuth response:
|
||||
|
||||
All personal login tokens you have taken into use will be listed in the web
|
||||
interface under "My logged in devices", and from the right side of that list
|
||||
you can click the "X" button to revoke individual tokens.
|
||||
```text
|
||||
DEBUG : remote: got fatal oauth error: oauth2: "invalid_grant" "Session doesn't have required client"
|
||||
```
|
||||
|
||||
### Whitelabel authentication
|
||||
(The error description used to be "Stale token" instead of "Session doesn't
|
||||
have required client", so you may see references to that in older descriptions
|
||||
of this situation.)
|
||||
|
||||
Most of the white-label versions uses a slightly different authentication flow,
|
||||
where it doesn't offer the option of creating a CLI token, and the username
|
||||
is generated internally. To setup rclone to use one of these, choose white-label
|
||||
authentication in the setup process, and then select the specific service
|
||||
in the next step.
|
||||
When this happens, you need to re-authenticate to be able to use your remote
|
||||
again, e.g. using the [config reconnect](/commands/rclone_config_reconnect/)
|
||||
command as suggested in the error message. This will create an entirely new
|
||||
refresh token (family).
|
||||
|
||||
Note that when setting this up, you need to be on a machine with an
|
||||
internet-connected web browser. If you need it on a machine where this is not
|
||||
the case, then you will have to create the configuration on a different machine
|
||||
and copy it from there. The jottacloud backend does not support the
|
||||
`rclone authorize` command. See the [remote setup docs](/remote_setup) for
|
||||
details.
|
||||
A typical example of how you may end up in this situation, is if you create
|
||||
a Jottacloud remote with rclone in one location, and then copy the
|
||||
configuration file to a second location where you start using rclone to access
|
||||
the same remote. Eventually there will now be a token refresh attempt with an
|
||||
invalidated token, i.e. refresh token reuse, resulting in both instances
|
||||
starting to fail with the "invalid_grant" error. It is possible to copy remote
|
||||
configurations, but you must then replace the token for one of them using the
|
||||
[config reconnect](https://rclone.org/commands/rclone_config_reconnect/)
|
||||
command.
|
||||
|
||||
### Legacy authentication
|
||||
You can get some overview of your active tokens in your service's web user
|
||||
interface, if you navigate to "Settings" and then "Security" (in which case
|
||||
you end up at <https://www.jottacloud.com/web/secure> or similar). Down on
|
||||
that page you have a section "My logged in devices". This contains a list
|
||||
of entries which seemingly represents currently valid refresh tokens, or
|
||||
refresh token families. From the right side of that list you can click a
|
||||
button ("X") to revoke (invalidate) it, which means you will still have access
|
||||
using an existing access token until that expires, but you will not be able to
|
||||
perform a token refresh. Note that this entire "My logged in devices" feature
|
||||
seem to behave a bit differently with different authentication variants and
|
||||
with use of the different (white-label) services.
|
||||
|
||||
Originally Jottacloud used an older authentication method, not based on OpenID
|
||||
Connect, which required the username and password to be specified. Since
|
||||
Jottacloud migrated to the newer method, handled by the standard authentication,
|
||||
some white-label versions (those from Elkjøp) still used the legacy method for
|
||||
a long time. Currently there are no known uses of this, it is still supported
|
||||
by rclone, but the support will be removed in a future version.
|
||||
### Standard
|
||||
|
||||
This is an OAuth variant designed for command-line applications. It is
|
||||
primarily supported by the official service (jottacloud.com), but may also be
|
||||
supported by some of the white-label services. The information necessary to be
|
||||
able to perform authentication, like domain name and endpoint to connect to,
|
||||
are found automatically (it is encoded into the supplied login token, described
|
||||
next), so you do not need to specify which service to configure.
|
||||
|
||||
When configuring a remote, you are asked to enter a single-use personal login
|
||||
token, which you must manually generate from the account security settings in
|
||||
the service's web interface. You do not need a web browser on the same machine
|
||||
like with traditional OAuth, but need to use a web browser somewhere, and be
|
||||
able to be copy the generated string into your rclone configuration session.
|
||||
Log in to your service's web user interface, navigate to "Settings" and then
|
||||
"Security", or, for the official service, use the direct link presented to you
|
||||
by rclone when configuring the remote: <https://www.jottacloud.com/web/secure>.
|
||||
Scroll down to the section "Personal login token", and click the "Generate"
|
||||
button. Copy the presented string and paste it where rclone asks for it. Rclone
|
||||
will then use this to perform an initial token request, and receive a regular
|
||||
OAuth token which it stores in your remote configuration. There will then also
|
||||
be a new entry in the "My logged in devices" list in the web interface, with
|
||||
device name and application name "Jottacloud CLI".
|
||||
|
||||
Each time a new token is created this way, i.e. a new personal login token is
|
||||
generated and traded in for an OAuth token, you get an entirely new refresh
|
||||
token family, with a new entry in the "My logged in devices". You can create as
|
||||
many remotes as you want, and use multiple instances of rclone on same or
|
||||
different machine, as long as you configure them separately like this, and not
|
||||
get your self into the refresh token reuse issue described above.
|
||||
|
||||
### Traditional
|
||||
|
||||
Jottacloud also supports a more traditional OAuth variant. Most of the
|
||||
white-label services support this, and for many of them this is the only
|
||||
alternative because they do not support personal login tokens. This method
|
||||
relies on pre-defined service-specific domain names and endpoints, and rclone
|
||||
need you to specify which service to configure. This also means that any
|
||||
changes to existing or additions of new white-label services needs an update
|
||||
in the rclone backend implementation.
|
||||
|
||||
When configuring a remote, you must interactively login to an OAuth
|
||||
authorization web site, and a one-time authorization code is sent back to
|
||||
rclone behind the scene, which it uses to request an OAuth token. This means
|
||||
that you need to be on a machine with an internet-connected web browser. If you
|
||||
need it on a machine where this is not the case, then you will have to create
|
||||
the configuration on a different machine and copy it from there. The Jottacloud
|
||||
backend does not support the `rclone authorize` command. See the
|
||||
[remote setup docs](/remote_setup) for details.
|
||||
|
||||
Jottacloud exerts some form of strict session management when authenticating
|
||||
using this method. This leads to some unexpected cases of the "invalid_grant"
|
||||
error described above, and effectively limits you to only use of a single
|
||||
active authentication on the same machine. I.e. you can only create a single
|
||||
rclone remote, and you can't even log in with the service's official desktop
|
||||
client while having a rclone remote configured, or else you will eventually get
|
||||
all sessions invalidated and are forced to re-authenticate.
|
||||
|
||||
When you have successfully authenticated, there will be an entry in the
|
||||
"My logged in devices" list in the web interface representing your session. It
|
||||
will typically be listed with application name "Jottacloud for Desktop" or
|
||||
similar (it depends on the white-label service configuration).
|
||||
|
||||
### Legacy
|
||||
|
||||
Originally Jottacloud used an OAuth variant which required your account's
|
||||
username and password to be specified. When Jottacloud migrated to the newer
|
||||
methods, some white-label versions (those from Elkjøp) still used this legacy
|
||||
method for a long time. Currently there are no known uses of this, it is still
|
||||
supported by rclone, but the support will be removed in a future version.
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -151,19 +225,29 @@ Type of authentication.
|
||||
Choose a number from below, or type in an existing value of type string.
|
||||
Press Enter for the default (standard).
|
||||
/ Standard authentication.
|
||||
1 | Use this if you're a normal Jottacloud user.
|
||||
| This is primarily supported by the official service, but may also be
|
||||
| supported by some white-label services. It is designed for command-line
|
||||
1 | applications, and you will be asked to enter a single-use personal login
|
||||
| token which you must manually generate from the account security settings
|
||||
| in the web interface of your service.
|
||||
\ (standard)
|
||||
/ Whitelabel authentication.
|
||||
2 | Use this if you are using the service offered by a third party such as Telia, Tele2, Onlime, Elkjøp, etc.
|
||||
\ (whitelabel)
|
||||
/ Traditional authentication.
|
||||
| This is supported by the official service and all white-label services
|
||||
| that rclone knows about. You will be asked which service to connect to.
|
||||
2 | It has a limitation of only a single active authentication at a time. You
|
||||
| need to be on, or have access to, a machine with an internet-connected
|
||||
| web browser.
|
||||
\ (traditional)
|
||||
/ Legacy authentication.
|
||||
3 | This is no longer supported by any known services and not recommended for normal users.
|
||||
3 | This is no longer supported by any known services and not recommended
|
||||
| used. You will be asked for your account's username and password.
|
||||
\ (legacy)
|
||||
config_type> 1
|
||||
|
||||
Option config_login_token.
|
||||
Personal login token.
|
||||
Generate here: https://www.jottacloud.com/web/secure
|
||||
Generate it from the account security settings in the web interface of your
|
||||
service, for the official service on https://www.jottacloud.com/web/secure.
|
||||
Enter a value.
|
||||
config_login_token> <your token here>
|
||||
|
||||
|
||||
@@ -131,6 +131,109 @@ section and followed by the privacy policy of Rclone.
|
||||
local configuration file.
|
||||
- Rclone does not share any user data with third parties.
|
||||
|
||||
## User Data Collection and Storage
|
||||
|
||||
This section outlines how rclone accesses, uses, stores, and shares
|
||||
user data obtained from service provider APIs. Our use of information
|
||||
received from provider APIs will adhere to the provider API Services
|
||||
User Data Policy, including the Limited Use requirements.
|
||||
|
||||
Rclone is a client-side command-line program that users run on their
|
||||
own computers to manage their files on cloud storage services. The
|
||||
rclone project does not operate any servers that store or process your
|
||||
personal data. All data access and processing occurs directly on the
|
||||
user's machine and between the user's machine and the provider API
|
||||
servers.
|
||||
|
||||
### Data Accessed
|
||||
|
||||
When you authorize rclone to access your files on your provider, it
|
||||
may access the following types of data, depending on the permissions
|
||||
you grant:
|
||||
|
||||
- Files: Rclone accesses the metadata (filenames, sizes, modification
|
||||
times, etc.) and content of your files and folders on your provider.
|
||||
This is necessary for rclone to perform file management tasks like
|
||||
copying, syncing, moving, and listing files.
|
||||
|
||||
- Authentication Tokens: Rclone requests OAuth 2.0 access tokens from
|
||||
the provider. These tokens are used to authenticate your requests to
|
||||
the provider's APIs and prove that you have granted rclone
|
||||
permission to access your data.
|
||||
|
||||
- Basic Profile Information: As part of the authentication process,
|
||||
rclone may receive your email address to identify the connected
|
||||
account within the rclone configuration.
|
||||
|
||||
### Data Usage
|
||||
|
||||
Rclone uses the user data it accesses solely to provide its core
|
||||
functionality, which is initiated and controlled entirely by you, the
|
||||
user. Specifically:
|
||||
|
||||
- The data is used to perform file transfer and management operations
|
||||
(such as `copy`, `sync`, `move`, `list`, `delete`) between your
|
||||
local machine and your provider account as per your direct commands.
|
||||
|
||||
- Authentication tokens are used exclusively to make authorized API
|
||||
calls to the provider's services on your behalf.
|
||||
|
||||
- Your email address is used locally to help you identify which
|
||||
provider account is configured.
|
||||
|
||||
Rclone does not use your data for any other purpose, such as
|
||||
advertising, marketing, or analysis by the rclone project developers.
|
||||
|
||||
### Data Sharing
|
||||
|
||||
Rclone does not share your user data with any third parties.
|
||||
|
||||
All data transfers initiated by the user occur directly between the
|
||||
machine where rclone is running and the provider's servers. The rclone
|
||||
project and its developers **never** have access to your
|
||||
authentication tokens or your file data.
|
||||
|
||||
### Data Storage & Protection
|
||||
|
||||
- Configuration Data: Rclone stores its configuration, including the
|
||||
OAuth 2.0 tokens required to access your provider account, in a
|
||||
configuration file (`rclone.conf`) located on your local machine.
|
||||
|
||||
- Security: You are responsible for securing this configuration
|
||||
file on your own computer. Rclone provides a built-in option to
|
||||
encrypt the configuration file with a password for an added layer of
|
||||
security. We strongly recommend using this feature.
|
||||
|
||||
- File Data: Your file data is only held in your computer's memory
|
||||
(RAM) temporarily during transfer operations. Rclone does not
|
||||
permanently store your file content on your local disk unless you
|
||||
explicitly command it to do so (e.g., by running a `copy` command
|
||||
from the provider to a local directory).
|
||||
|
||||
### Data Retention & Deletion
|
||||
|
||||
Rclone gives you full control over your data.
|
||||
|
||||
- Data Retention: Rclone retains the configuration data, including
|
||||
authentication tokens, on your local machine for as long as you keep
|
||||
the configuration file. This allows you to use rclone without having
|
||||
to re-authenticate for every session.
|
||||
|
||||
- Data Deletion: You can delete your data and revoke rclone's
|
||||
access at any time through one of the following methods:
|
||||
|
||||
1. Local Deletion: You can delete the specific provider
|
||||
configuration from your `rclone.conf` file or delete the entire
|
||||
file itself. This will permanently remove the authentication
|
||||
tokens from your machine.
|
||||
|
||||
2. Revoking Access via the provider: You can revoke rclone's
|
||||
access to your provider directly from your the providers's
|
||||
security settings page. This will invalidate the authentication
|
||||
tokens, and rclone will no longer be able to access your data.
|
||||
For example, if you are using Google you can manage your permissions
|
||||
[on the Google permissions page](https://myaccount.google.com/permissions).
|
||||
|
||||
## Resources & Further Information
|
||||
|
||||
- [Data Protection Act 1998](http://www.legislation.gov.uk/ukpga/1998/29/contents)
|
||||
|
||||
@@ -18,10 +18,13 @@ The S3 backend can be used with a number of different providers:
|
||||
{{< provider name="China Mobile Ecloud Elastic Object Storage (EOS)" home="https://ecloud.10086.cn/home/product-introduction/eos/" config="/s3/#china-mobile-ecloud-eos" >}}
|
||||
{{< provider name="Cloudflare R2" home="https://blog.cloudflare.com/r2-open-beta/" config="/s3/#cloudflare-r2" >}}
|
||||
{{< provider name="Arvan Cloud Object Storage (AOS)" home="https://www.arvancloud.com/en/products/cloud-storage" config="/s3/#arvan-cloud" >}}
|
||||
{{< provider name="Cubbit DS3" home="https://cubbit.io/ds3-cloud" config="/s3/#Cubbit" >}}
|
||||
{{< provider name="DigitalOcean Spaces" home="https://www.digitalocean.com/products/object-storage/" config="/s3/#digitalocean-spaces" >}}
|
||||
{{< provider name="Dreamhost" home="https://www.dreamhost.com/cloud/storage/" config="/s3/#dreamhost" >}}
|
||||
{{< provider name="Exaba" home="https://exaba.com/" config="/s3/#exaba" >}}
|
||||
{{< provider name="FileLu S5 (S3-Compatible Object Storage)" home="https://s5lu.com/" config="/s3/#filelu-s5" >}}
|
||||
{{< provider name="GCS" home="https://cloud.google.com/storage/docs" config="/s3/#google-cloud-storage" >}}
|
||||
{{< provider name="Hetzner" home="https://www.hetzner.com/storage/object-storage/" config="/s3/#hetzner" >}}
|
||||
{{< provider name="Huawei OBS" home="https://www.huaweicloud.com/intl/en-us/product/obs.html" config="/s3/#huawei-obs" >}}
|
||||
{{< provider name="IBM COS S3" home="http://www.ibm.com/cloud/object-storage" config="/s3/#ibm-cos-s3" >}}
|
||||
{{< provider name="IDrive e2" home="https://www.idrive.com/e2/?refer=rclone" config="/s3/#idrive-e2" >}}
|
||||
@@ -38,12 +41,14 @@ The S3 backend can be used with a number of different providers:
|
||||
{{< provider name="Petabox" home="https://petabox.io/" config="/s3/#petabox" >}}
|
||||
{{< provider name="Pure Storage FlashBlade" home="https://www.purestorage.com/products/unstructured-data-storage.html" config="/s3/#pure-storage-flashblade" >}}
|
||||
{{< provider name="Qiniu Cloud Object Storage (Kodo)" home="https://www.qiniu.com/en/products/kodo" config="/s3/#qiniu" >}}
|
||||
{{< provider name="Rabata Cloud Storage" home="https://rabata.io" config="/s3/#Rabata" >}}
|
||||
{{< provider name="RackCorp Object Storage" home="https://www.rackcorp.com/" config="/s3/#RackCorp" >}}
|
||||
{{< provider name="Rclone Serve S3" home="/commands/rclone_serve_s3/" config="/s3/#rclone" >}}
|
||||
{{< provider name="Scaleway" home="https://www.scaleway.com/en/object-storage/" config="/s3/#scaleway" >}}
|
||||
{{< provider name="Seagate Lyve Cloud" home="https://www.seagate.com/gb/en/services/cloud/storage/" config="/s3/#lyve" >}}
|
||||
{{< provider name="SeaweedFS" home="https://github.com/chrislusf/seaweedfs/" config="/s3/#seaweedfs" >}}
|
||||
{{< provider name="Selectel" home="https://selectel.ru/services/cloud/storage/" config="/s3/#selectel" >}}
|
||||
{{< provider name="Servercore Object Storage" home="https://servercore.com/services/object-storage/" config="/s3/#servercore" >}}
|
||||
{{< provider name="Spectra Logic" home="https://spectralogic.com/blackpearl-nearline-object-gateway" config="/s3/#spectralogic" >}}
|
||||
{{< provider name="StackPath" home="https://www.stackpath.com/products/object-storage/" config="/s3/#stackpath" >}}
|
||||
{{< provider name="Storj" home="https://storj.io/" config="/s3/#storj" >}}
|
||||
@@ -3231,6 +3236,47 @@ does. If this is causing a problem then upload the files with
|
||||
A consequence of this is that `Content-Encoding: gzip` will never
|
||||
appear in the metadata on Cloudflare.
|
||||
|
||||
### Cubbit DS3 {#Cubbit}
|
||||
|
||||
[Cubbit Object Storage](https://www.cubbit.io/ds3-cloud) is a geo-distributed cloud object storage platform.
|
||||
|
||||
To connect to Cubbit DS3 you will need an access key and secret key pair. You can follow this [guide](https://docs.cubbit.io/getting-started/quickstart#api-keys) to retrieve these keys. They will be needed when prompted by `rclone config`.
|
||||
|
||||
Default region will correspond to `eu-west-1` and the endpoint has to be specified as `s3.cubbit.eu`.
|
||||
|
||||
Going through the whole process of creating a new remote by running `rclone config`, each prompt should be answered as shown below:
|
||||
|
||||
```
|
||||
name> cubbit-ds3 (or any name you like)
|
||||
Storage> s3
|
||||
provider> Cubbit
|
||||
env_auth> false
|
||||
access_key_id> YOUR_ACCESS_KEY
|
||||
secret_access_key> YOUR_SECRET_KEY
|
||||
region> eu-west-1 (or leave empty)
|
||||
endpoint> s3.cubbit.eu
|
||||
acl>
|
||||
```
|
||||
|
||||
The resulting configuration file should look like:
|
||||
|
||||
```
|
||||
[cubbit-ds3]
|
||||
type = s3
|
||||
provider = Cubbit
|
||||
access_key_id = ACCESS_KEY
|
||||
secret_access_key = SECRET_KEY
|
||||
region = eu-west-1
|
||||
endpoint = s3.cubbit.eu
|
||||
```
|
||||
|
||||
You can then start using Cubbit DS3 with rclone. For example, to create a new bucket and copy files into it, you can run:
|
||||
|
||||
```
|
||||
rclone mkdir cubbit-ds3:my-bucket
|
||||
rclone copy /path/to/files cubbit-ds3:my-bucket
|
||||
```
|
||||
|
||||
### DigitalOcean Spaces
|
||||
|
||||
[Spaces](https://www.digitalocean.com/products/object-storage/) is an [S3-interoperable](https://developers.digitalocean.com/documentation/spaces/) object storage service from cloud provider DigitalOcean.
|
||||
@@ -3400,6 +3446,150 @@ endpoint = https://storage.googleapis.com
|
||||
|
||||
This is Google bug [#312292516](https://issuetracker.google.com/u/0/issues/312292516).
|
||||
|
||||
### Hetzner Object Storage {#hetzner}
|
||||
|
||||
Here is an example of making a [Hetzner Object Storage](https://www.hetzner.com/storage/object-storage/)
|
||||
configuration. First run:
|
||||
|
||||
rclone config
|
||||
|
||||
This will guide you through an interactive setup process.
|
||||
|
||||
```
|
||||
No remotes found, make a new one?
|
||||
n) New remote
|
||||
s) Set configuration password
|
||||
q) Quit config
|
||||
n/s/q> n
|
||||
|
||||
Enter name for new remote.
|
||||
name> my-hetzner
|
||||
Option Storage.
|
||||
Type of storage to configure.
|
||||
Choose a number from below, or type in your own value.
|
||||
[snip]
|
||||
XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, Hetzner, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Magalu, Minio, Netease, Outscale, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, Selectel, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
|
||||
\ (s3)
|
||||
[snip]
|
||||
Storage> s3
|
||||
Option provider.
|
||||
Choose your S3 provider.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
[snip]
|
||||
XX / Hetzner Object Storage
|
||||
\ (Hetzner)
|
||||
[snip]
|
||||
provider> Hetzner
|
||||
Option env_auth.
|
||||
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
|
||||
Only applies if access_key_id and secret_access_key is blank.
|
||||
Choose a number from below, or type in your own boolean value (true or false).
|
||||
Press Enter for the default (false).
|
||||
1 / Enter AWS credentials in the next step.
|
||||
\ (false)
|
||||
2 / Get AWS credentials from the environment (env vars or IAM).
|
||||
\ (true)
|
||||
env_auth>
|
||||
Option access_key_id.
|
||||
AWS Access Key ID.
|
||||
Leave blank for anonymous access or runtime credentials.
|
||||
Enter a value. Press Enter to leave empty.
|
||||
access_key_id> ACCESS_KEY
|
||||
Option secret_access_key.
|
||||
AWS Secret Access Key (password).
|
||||
Leave blank for anonymous access or runtime credentials.
|
||||
Enter a value. Press Enter to leave empty.
|
||||
secret_access_key> SECRET_KEY
|
||||
Option region.
|
||||
Region to connect to.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
1 / Helsinki
|
||||
\ (hel1)
|
||||
2 / Falkenstein
|
||||
\ (fsn1)
|
||||
3 / Nuremberg
|
||||
\ (nbg1)
|
||||
region>
|
||||
Option endpoint.
|
||||
Endpoint for Hetzner Object Storage
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
1 / Helsinki
|
||||
\ (hel1.your-objectstorage.com)
|
||||
2 / Falkenstein
|
||||
\ (fsn1.your-objectstorage.com)
|
||||
3 / Nuremberg
|
||||
\ (nbg1.your-objectstorage.com)
|
||||
endpoint>
|
||||
Option location_constraint.
|
||||
Location constraint - must be set to match the Region.
|
||||
Leave blank if not sure. Used when creating buckets only.
|
||||
Enter a value. Press Enter to leave empty.
|
||||
location_constraint>
|
||||
Option acl.
|
||||
Canned ACL used when creating buckets and storing or copying objects.
|
||||
This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
|
||||
For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
|
||||
Note that this ACL is applied when server-side copying objects as S3
|
||||
doesn't copy the ACL from the source but rather writes a fresh one.
|
||||
If the acl is an empty string then no X-Amz-Acl: header is added and
|
||||
the default (private) will be used.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
/ Owner gets FULL_CONTROL.
|
||||
1 | No one else has access rights (default).
|
||||
\ (private)
|
||||
/ Owner gets FULL_CONTROL.
|
||||
2 | The AllUsers group gets READ access.
|
||||
\ (public-read)
|
||||
acl>
|
||||
Edit advanced config?
|
||||
y) Yes
|
||||
n) No (default)
|
||||
y/n>
|
||||
Configuration complete.
|
||||
Options:
|
||||
- type: s3
|
||||
- provider: Hetzner
|
||||
- access_key_id: ACCESS_KEY
|
||||
- secret_access_key: SECRET_KEY
|
||||
Keep this "my-hetzner" remote?
|
||||
y) Yes this is OK (default)
|
||||
e) Edit this remote
|
||||
d) Delete this remote
|
||||
y/e/d>
|
||||
Current remotes:
|
||||
|
||||
Name Type
|
||||
==== ====
|
||||
my-hetzner s3
|
||||
|
||||
e) Edit existing remote
|
||||
n) New remote
|
||||
d) Delete remote
|
||||
r) Rename remote
|
||||
c) Copy remote
|
||||
s) Set configuration password
|
||||
q) Quit config
|
||||
e/n/d/r/c/s/q>
|
||||
```
|
||||
|
||||
This will leave the config file looking like this.
|
||||
|
||||
```
|
||||
[my-hetzner]
|
||||
type = s3
|
||||
provider = Hetzner
|
||||
access_key_id = ACCESS_KEY
|
||||
secret_access_key = SECRET_KEY
|
||||
region = hel1
|
||||
endpoint = hel1.your-objectstorage.com
|
||||
acl = private
|
||||
```
|
||||
|
||||
|
||||
### Huawei OBS {#huawei-obs}
|
||||
|
||||
Object Storage Service (OBS) provides stable, secure, efficient, and easy-to-use cloud storage that lets you store virtually any volume of unstructured data in any format and access it from anywhere.
|
||||
@@ -5635,6 +5825,244 @@ Name Type
|
||||
qiniu s3
|
||||
```
|
||||
|
||||
### FileLu S5 {#filelu-s5}
|
||||
|
||||
[FileLu S5 Object Storage](https://s5lu.com) is an S3-compatible object storage system.
|
||||
It provides multiple region options (Global, US-East, EU-Central, AP-Southeast, and ME-Central) while using a single endpoint (`s5lu.com`).
|
||||
FileLu S5 is designed for scalability, security, and simplicity, with predictable pricing and no hidden charges for data transfers or API requests.
|
||||
|
||||
Here is an example of making a configuration. First run:
|
||||
|
||||
```sh
|
||||
rclone config
|
||||
```
|
||||
|
||||
This will guide you through an interactive setup process.
|
||||
|
||||
```text
|
||||
No remotes found, make a new one\?
|
||||
n) New remote
|
||||
s) Set configuration password
|
||||
q) Quit config
|
||||
n/s/q> n
|
||||
|
||||
Enter name for new remote.
|
||||
name> s5lu
|
||||
|
||||
Option Storage.
|
||||
Type of storage to configure.
|
||||
Choose a number from below, or type in your own value.
|
||||
[snip]
|
||||
XX / Amazon S3 Compliant Storage Providers including AWS,... FileLu, ...
|
||||
\ (s3)
|
||||
[snip]
|
||||
Storage> s3
|
||||
|
||||
Option provider.
|
||||
Choose your S3 provider.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
[snip]
|
||||
XX / FileLu S5 Object Storage
|
||||
\ (FileLu)
|
||||
[snip]
|
||||
provider> FileLu
|
||||
|
||||
Option env_auth.
|
||||
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
|
||||
Only applies if access_key_id and secret_access_key is blank.
|
||||
Choose a number from below, or type in your own boolean value (true or false).
|
||||
Press Enter for the default (false).
|
||||
1 / Enter AWS credentials in the next step.
|
||||
\ (false)
|
||||
2 / Get AWS credentials from the environment (env vars or IAM).
|
||||
\ (true)
|
||||
env_auth>
|
||||
|
||||
Option access_key_id.
|
||||
AWS Access Key ID.
|
||||
Leave blank for anonymous access or runtime credentials.
|
||||
Enter a value. Press Enter to leave empty.
|
||||
access_key_id> XXX
|
||||
|
||||
Option secret_access_key.
|
||||
AWS Secret Access Key (password).
|
||||
Leave blank for anonymous access or runtime credentials.
|
||||
Enter a value. Press Enter to leave empty.
|
||||
secret_access_key> XXX
|
||||
|
||||
Option endpoint.
|
||||
Endpoint for S3 API.
|
||||
Required when using an S3 clone.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
1 / Global
|
||||
\ (global)
|
||||
2 / North America (US-East)
|
||||
\ (us-east)
|
||||
3 / Europe (EU-Central)
|
||||
\ (eu-central)
|
||||
4 / Asia Pacific (AP-Southeast)
|
||||
\ (ap-southeast)
|
||||
5 / Middle East (ME-Central)
|
||||
\ (me-central)
|
||||
region> 1
|
||||
|
||||
Edit advanced config?
|
||||
y) Yes
|
||||
n) No (default)
|
||||
y/n> n
|
||||
|
||||
Configuration complete.
|
||||
Options:
|
||||
- type: s3
|
||||
- provider: FileLu
|
||||
- access_key_id: XXX
|
||||
- secret_access_key: XXX
|
||||
- endpoint: s5lu.com
|
||||
Keep this "s5lu" remote?
|
||||
y) Yes this is OK (default)
|
||||
e) Edit this remote
|
||||
d) Delete this remote
|
||||
y/e/d> y
|
||||
```
|
||||
|
||||
This will leave the config file looking like this.
|
||||
|
||||
```
|
||||
[s5lu]
|
||||
type = s3
|
||||
provider = FileLu
|
||||
access_key_id = XXX
|
||||
secret_access_key = XXX
|
||||
endpoint = s5lu.com
|
||||
```
|
||||
|
||||
### Rabata {#Rabata}
|
||||
|
||||
[Rabata](https://rabata.io) is an S3-compatible secure cloud storage service that offers flat, transparent pricing (no API request fees)
|
||||
while supporting standard S3 APIs. It is suitable for backup, application storage,media workflows, and archive use cases.
|
||||
|
||||
Server side copy is not implemented with Rabata, also meaning modification time of objects cannot be updated.
|
||||
|
||||
Rclone config:
|
||||
|
||||
```
|
||||
rclone config
|
||||
No remotes found, make a new one?
|
||||
n) New remote
|
||||
s) Set configuration password
|
||||
q) Quit config
|
||||
n/s/q> n
|
||||
|
||||
Enter name for new remote.
|
||||
name> Rabata
|
||||
|
||||
Option Storage.
|
||||
Type of storage to configure.
|
||||
Choose a number from below, or type in your own value.
|
||||
[snip]
|
||||
XX / Amazon S3 Compliant Storage Providers including AWS, ...
|
||||
\ (s3)
|
||||
[snip]
|
||||
Storage> s3
|
||||
|
||||
Option provider.
|
||||
Choose your S3 provider.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
[snip]
|
||||
XX / Rabata Cloud Storage
|
||||
\ (Rabata)
|
||||
[snip]
|
||||
provider> Rabata
|
||||
|
||||
Option env_auth.
|
||||
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
|
||||
Only applies if access_key_id and secret_access_key is blank.
|
||||
Choose a number from below, or type in your own boolean value (true or false).
|
||||
Press Enter for the default (false).
|
||||
1 / Enter AWS credentials in the next step.
|
||||
\ (false)
|
||||
2 / Get AWS credentials from the environment (env vars or IAM).
|
||||
\ (true)
|
||||
env_auth>
|
||||
|
||||
Option access_key_id.
|
||||
AWS Access Key ID.
|
||||
Leave blank for anonymous access or runtime credentials.
|
||||
Enter a value. Press Enter to leave empty.
|
||||
access_key_id> ACCESS_KEY_ID
|
||||
|
||||
Option secret_access_key.
|
||||
AWS Secret Access Key (password).
|
||||
Leave blank for anonymous access or runtime credentials.
|
||||
Enter a value. Press Enter to leave empty.
|
||||
secret_access_key> SECRET_ACCESS_KEY
|
||||
|
||||
Option region.
|
||||
Region where your bucket will be created and your data stored.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
1 / US East (N. Virginia)
|
||||
\ (us-east-1)
|
||||
2 / EU (Ireland)
|
||||
\ (eu-west-1)
|
||||
3 / EU (London)
|
||||
\ (eu-west-2)
|
||||
region> 3
|
||||
|
||||
Option endpoint.
|
||||
Endpoint for Rabata Object Storage.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
1 / US East (N. Virginia)
|
||||
\ (s3.us-east-1.rabata.io)
|
||||
2 / EU West (Ireland)
|
||||
\ (s3.eu-west-1.rabata.io)
|
||||
3 / EU West (London)
|
||||
\ (s3.eu-west-2.rabata.io)
|
||||
endpoint> 3
|
||||
|
||||
Option location_constraint.
|
||||
location where your bucket will be created and your data stored.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
1 / US East (N. Virginia)
|
||||
\ (us-east-1)
|
||||
2 / EU (Ireland)
|
||||
\ (eu-west-1)
|
||||
3 / EU (London)
|
||||
\ (eu-west-2)
|
||||
location_constraint> 3
|
||||
|
||||
Edit advanced config?
|
||||
y) Yes
|
||||
n) No (default)
|
||||
y/n> n
|
||||
|
||||
Configuration complete.
|
||||
Options:
|
||||
- type: s3
|
||||
- provider: Rabata
|
||||
- access_key_id: ACCESS_KEY_ID
|
||||
- secret_access_key: SECRET_ACCESS_KEY
|
||||
- region: eu-west-2
|
||||
- endpoint: s3.eu-west-2.rabata.io
|
||||
- location_constraint: eu-west-2
|
||||
Keep this "rabata" remote?
|
||||
y) Yes this is OK (default)
|
||||
e) Edit this remote
|
||||
d) Delete this remote
|
||||
y/e/d> y
|
||||
|
||||
Current remotes:
|
||||
|
||||
Name Type
|
||||
==== ====
|
||||
rabata s3
|
||||
```
|
||||
|
||||
### RackCorp {#RackCorp}
|
||||
|
||||
[RackCorp Object Storage](https://www.rackcorp.com/storage/s3storage) is an S3 compatible object storage platform from your friendly cloud provider RackCorp.
|
||||
@@ -6019,6 +6447,117 @@ region = ru-1
|
||||
endpoint = s3.ru-1.storage.selcloud.ru
|
||||
```
|
||||
|
||||
### Servercore {#servercore}
|
||||
[Servercore Object Storage](https://servercore.io/object-storage/) is an S3
|
||||
compatible object storage system that provides scalable and secure storage
|
||||
solutions for businesses of all sizes.
|
||||
|
||||
rclone config example:
|
||||
|
||||
```
|
||||
No remotes found, make a new one\?
|
||||
n) New remote
|
||||
s) Set configuration password
|
||||
q) Quit config
|
||||
n/s/q> n
|
||||
|
||||
Enter name for new remote.
|
||||
name> servercore
|
||||
|
||||
Option Storage.
|
||||
Type of storage to configure.
|
||||
Choose a number from below, or type in your own value.
|
||||
[snip]
|
||||
XX / Amazon S3 Compliant Storage Providers including ..., Servercore, ...
|
||||
\ (s3)
|
||||
[snip]
|
||||
Storage> s3
|
||||
|
||||
Option provider.
|
||||
Choose your S3 provider.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
[snip]
|
||||
XX / Servercore Object Storage
|
||||
\ (Servercore)
|
||||
[snip]
|
||||
provider> Servercore
|
||||
|
||||
Option env_auth.
|
||||
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
|
||||
Only applies if access_key_id and secret_access_key is blank.
|
||||
Choose a number from below, or type in your own boolean value (true or false).
|
||||
Press Enter for the default (false).
|
||||
1 / Enter AWS credentials in the next step.
|
||||
\ (false)
|
||||
2 / Get AWS credentials from the environment (env vars or IAM).
|
||||
\ (true)
|
||||
env_auth> 1
|
||||
|
||||
Option access_key_id.
|
||||
AWS Access Key ID.
|
||||
Leave blank for anonymous access or runtime credentials.
|
||||
Enter a value. Press Enter to leave empty.
|
||||
access_key_id> ACCESS_KEY
|
||||
|
||||
Option secret_access_key.
|
||||
AWS Secret Access Key (password).
|
||||
Leave blank for anonymous access or runtime credentials.
|
||||
Enter a value. Press Enter to leave empty.
|
||||
secret_access_key> SECRET_ACCESS_KEY
|
||||
|
||||
Option region.
|
||||
Region where your is data stored.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
1 / St. Petersburg
|
||||
\ (ru-1)
|
||||
2 / Moscow
|
||||
\ (gis-1)
|
||||
3 / Moscow
|
||||
\ (ru-7)
|
||||
4 / Tashkent, Uzbekistan
|
||||
\ (uz-2)
|
||||
5 / Almaty, Kazakhstan
|
||||
\ (kz-1)
|
||||
region> 1
|
||||
|
||||
Option endpoint.
|
||||
Endpoint for Servercore Object Storage.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
1 / Saint Petersburg
|
||||
\ (s3.ru-1.storage.selcloud.ru)
|
||||
2 / Moscow
|
||||
\ (s3.gis-1.storage.selcloud.ru)
|
||||
3 / Moscow
|
||||
\ (s3.ru-7.storage.selcloud.ru)
|
||||
4 / Tashkent, Uzbekistan
|
||||
\ (s3.uz-2.srvstorage.uz)
|
||||
5 / Almaty, Kazakhstan
|
||||
\ (s3.kz-1.srvstorage.kz)
|
||||
endpoint> 1
|
||||
|
||||
Edit advanced config?
|
||||
y) Yes
|
||||
n) No (default)
|
||||
y/n> n
|
||||
|
||||
Configuration complete.
|
||||
Options:
|
||||
- type: s3
|
||||
- provider: Servercore
|
||||
- access_key_id: ACCESS_KEY
|
||||
- secret_access_key: SECRET_ACCESS_KEY
|
||||
- region: ru-1
|
||||
- endpoint: s3.ru-1.storage.selcloud.ru
|
||||
Keep this "servercore" remote?
|
||||
y) Yes this is OK (default)
|
||||
e) Edit this remote
|
||||
d) Delete this remote
|
||||
y/e/d> y
|
||||
```
|
||||
|
||||
### Spectra Logic {#spectralogic}
|
||||
|
||||
[Spectra Logic](https://www.spectralogic.com/blackpearl-nearline-object-gateway)
|
||||
|
||||
@@ -59,14 +59,14 @@ Thank you very much to our sponsors:
|
||||
<!-- markdownlint-capture -->
|
||||
<!-- markdownlint-disable line-length no-bare-urls -->
|
||||
|
||||
{{< sponsor src="/img/logos/backblaze.svg" width="300" height="200" title="Visit our sponsor Backblaze" link="https://www.backblaze.com/cloud-storage-rclonead?utm_source=rclone&utm_medium=paid&utm_campaign=rclone-website-20250715">}}
|
||||
{{< sponsor src="/img/logos/idrive_e2.svg" width="300" height="200" title="Visit our sponsor IDrive e2" link="https://www.idrive.com/e2/?refer=rclone">}}
|
||||
{{< sponsor src="/img/logos/filescom-enterprise-grade-workflows.png" width="300" height="200" title="Start Your Free Trial Today" link="https://files.com/?utm_source=rclone&utm_medium=referral&utm_campaign=banner&utm_term=rclone">}}
|
||||
{{< sponsor src="/img/logos/mega-s4.svg" width="300" height="200" title="MEGA S4: New S3 compatible object storage. High scale. Low cost. Free egress." link="https://mega.io/objectstorage?utm_source=rclone&utm_medium=referral&utm_campaign=rclone-mega-s4&mct=rclonepromo">}}
|
||||
{{< sponsor src="/img/logos/sia.svg" width="200" height="200" title="Visit our sponsor sia" link="https://sia.tech">}}
|
||||
{{< sponsor src="/img/logos/route4me.svg" width="400" height="200" title="Visit our sponsor Route4Me" link="https://route4me.com/">}}
|
||||
{{< sponsor src="/img/logos/rcloneview.svg" width="300" height="200" title="Visit our sponsor RcloneView" link="https://rcloneview.com/">}}
|
||||
{{< sponsor src="/img/logos/rcloneui.svg" width="300" height="200" title="Visit our sponsor RcloneUI" link="https://github.com/rclone-ui/rclone-ui">}}
|
||||
{{< sponsor src="/img/logos/filelu-rclone.svg" width="330" height="200" title="Visit our sponsor FileLu" link="https://filelu.com/">}}
|
||||
{{< sponsor src="/img/logos/filelu-rclone.svg" width="300" height="200" title="Visit our sponsor FileLu" link="https://filelu.com/">}}
|
||||
{{< sponsor src="/img/logos/torbox.png" width="200" height="200" title="Visit our sponsor TORBOX" link="https://www.torbox.app/">}}
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
@@ -9,15 +9,6 @@
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Platinum Sponsor
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<a href="https://www.backblaze.com/cloud-storage-rclonead?utm_source=rclone&utm_medium=paid&utm_campaign=rclone-website-20250715" target="_blank" rel="noopener" title="Visit rclone's sponsor Backblaze"><img src="/img/logos/backblaze.svg"></a><br />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Gold Sponsor
|
||||
|
||||
@@ -566,6 +566,12 @@ var ConfigOptionsInfo = Options{{
|
||||
Default: "",
|
||||
Help: "HTTP proxy URL.",
|
||||
Groups: "Networking",
|
||||
}, {
|
||||
Name: "assume_listings_sorted",
|
||||
Default: false,
|
||||
Advanced: true,
|
||||
Help: "If set will not sort listings. If listings aren't sorted the sync may go wrong.",
|
||||
Groups: "Copy",
|
||||
}}
|
||||
|
||||
// ConfigInfo is filesystem config options
|
||||
@@ -680,6 +686,7 @@ type ConfigInfo struct {
|
||||
MaxConnections int `config:"max_connections"`
|
||||
NameTransform []string `config:"name_transform"`
|
||||
HTTPProxy string `config:"http_proxy"`
|
||||
AssumeListingsSorted bool `config:"assume_listings_sorted"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -45,6 +45,7 @@ type Sorter struct {
|
||||
keyFn KeyFn // transform an entry into a sort key
|
||||
cutoff int // number of entries above which we start extsort
|
||||
extSort bool // true if we are ext sorting
|
||||
noSort bool // true if we aren't sorting
|
||||
inputChan chan string // for sending data to the ext sort
|
||||
outputChan <-chan string // for receiving data from the ext sort
|
||||
errChan <-chan error // for getting errors from the ext sort
|
||||
@@ -78,6 +79,7 @@ func NewSorter(ctx context.Context, f NewObjecter, callback fs.ListRCallback, ke
|
||||
keyFn: keyFn,
|
||||
cutoff: ci.ListCutoff,
|
||||
errs: errcount.New(),
|
||||
noSort: ci.AssumeListingsSorted,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -172,6 +174,9 @@ func (ls *Sorter) startExtSort() (err error) {
|
||||
//
|
||||
// Safe to call from concurrent go routines
|
||||
func (ls *Sorter) Add(entries fs.DirEntries) error {
|
||||
if ls.noSort {
|
||||
return ls.callback(entries)
|
||||
}
|
||||
ls.mu.Lock()
|
||||
defer ls.mu.Unlock()
|
||||
if ls.extSort {
|
||||
@@ -267,6 +272,9 @@ func (lh *listHelper) Flush() error {
|
||||
|
||||
// Send the sorted entries to the callback.
|
||||
func (ls *Sorter) Send() (err error) {
|
||||
if ls.noSort {
|
||||
return nil
|
||||
}
|
||||
ls.mu.Lock()
|
||||
defer ls.mu.Unlock()
|
||||
|
||||
|
||||
@@ -46,6 +46,46 @@ func TestSorter(t *testing.T) {
|
||||
assert.Equal(t, fs.DirEntries(nil), ls.entries)
|
||||
}
|
||||
|
||||
func TestSorterAssumeSorted(t *testing.T) {
|
||||
ctx, ci := fs.AddConfig(context.Background())
|
||||
ci.AssumeListingsSorted = true
|
||||
|
||||
gotEntry := 0
|
||||
wantEntries := fs.DirEntries{
|
||||
mockdir.New("c"),
|
||||
mockobject.Object("C"),
|
||||
mockdir.New("b"),
|
||||
mockobject.Object("B"),
|
||||
mockdir.New("a"),
|
||||
mockobject.Object("A"),
|
||||
}
|
||||
callback := func(entries fs.DirEntries) error {
|
||||
for _, entry := range entries {
|
||||
require.Equal(t, wantEntries[gotEntry], entry)
|
||||
gotEntry++
|
||||
}
|
||||
return nil
|
||||
}
|
||||
ls, err := NewSorter(ctx, nil, callback, nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Test Add
|
||||
require.NoError(t, ls.Add(wantEntries[0:2]))
|
||||
require.NoError(t, ls.Add(wantEntries[2:6]))
|
||||
assert.Equal(t, 6, gotEntry)
|
||||
assert.Equal(t, fs.DirEntries(nil), ls.entries)
|
||||
|
||||
// Test Send
|
||||
err = ls.Send()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 6, gotEntry)
|
||||
|
||||
// Test Cleanup
|
||||
ls.CleanUp()
|
||||
assert.Equal(t, 6, gotEntry)
|
||||
assert.Equal(t, fs.DirEntries(nil), ls.entries)
|
||||
}
|
||||
|
||||
func TestSorterIdentity(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
cmpFn := func(a, b fs.DirEntry) int {
|
||||
|
||||
+5
-2
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/dirtree"
|
||||
"github.com/rclone/rclone/fs/filter"
|
||||
"github.com/rclone/rclone/fs/fserrors"
|
||||
"github.com/rclone/rclone/fs/list"
|
||||
"github.com/rclone/rclone/fs/walk"
|
||||
"github.com/rclone/rclone/lib/transform"
|
||||
@@ -330,7 +331,8 @@ func (m *March) matchListings(srcChan, dstChan <-chan fs.DirEntry, srcOnly, dstO
|
||||
continue
|
||||
} else if srcName < srcPrevName {
|
||||
// this should never happen since we sort the listings
|
||||
panic("Out of order listing in source")
|
||||
// however the user may be using the --assume-listings-sorted flag
|
||||
return fserrors.FatalError(fmt.Errorf("out of order listing in source (%v)", src.Fs()))
|
||||
}
|
||||
}
|
||||
if dst != nil && dstPrev != nil {
|
||||
@@ -340,7 +342,8 @@ func (m *March) matchListings(srcChan, dstChan <-chan fs.DirEntry, srcOnly, dstO
|
||||
continue
|
||||
} else if dstName < dstPrevName {
|
||||
// this should never happen since we sort the listings
|
||||
panic("Out of order listing in destination")
|
||||
// however the user may be using the --assume-listings-sorted flag
|
||||
return fserrors.FatalError(fmt.Errorf("out of order listing in destination (%v)", dst.Fs()))
|
||||
}
|
||||
}
|
||||
switch {
|
||||
|
||||
@@ -8,10 +8,12 @@ PORT=28628
|
||||
. $(dirname "$0")/docker.bash
|
||||
|
||||
start() {
|
||||
# We need to replace the remakerings in the container to create Policy-1.
|
||||
docker run --rm -d --name ${NAME} \
|
||||
-p 127.0.0.1:${PORT}:8080 \
|
||||
bouncestorage/swift-aio
|
||||
|
||||
-v $(dirname "$0")/TestSwiftAIO.d/remakerings:/etc/swift/remakerings:ro \
|
||||
openstackswift/saio
|
||||
|
||||
echo type=swift
|
||||
echo env_auth=false
|
||||
echo user=test:tester
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! grep -q "^\[storage-policy:1\]" swift.conf; then
|
||||
cat <<EOF >> swift.conf
|
||||
|
||||
[storage-policy:1]
|
||||
name = Policy-1
|
||||
EOF
|
||||
fi
|
||||
|
||||
rm -f *.builder *.ring.gz backups/*.builder backups/*.ring.gz
|
||||
|
||||
swift-ring-builder object.builder create 10 1 1
|
||||
swift-ring-builder object.builder add r1z1-127.0.0.1:6200/swift-d0 1
|
||||
swift-ring-builder object.builder add r1z1-127.0.0.1:6200/swift-d1 1
|
||||
swift-ring-builder object.builder add r1z1-127.0.0.1:6200/swift-d2 1
|
||||
swift-ring-builder object.builder add r1z1-127.0.0.1:6200/swift-d3 1
|
||||
swift-ring-builder object.builder add r1z1-127.0.0.1:6200/swift-d4 1
|
||||
swift-ring-builder object.builder add r1z1-127.0.0.1:6200/swift-d5 1
|
||||
swift-ring-builder object.builder rebalance
|
||||
swift-ring-builder container.builder create 10 1 1
|
||||
swift-ring-builder container.builder add r1z1-127.0.0.1:6201/swift-d0 1
|
||||
swift-ring-builder container.builder add r1z1-127.0.0.1:6201/swift-d1 1
|
||||
swift-ring-builder container.builder add r1z1-127.0.0.1:6201/swift-d2 1
|
||||
swift-ring-builder container.builder add r1z1-127.0.0.1:6201/swift-d3 1
|
||||
swift-ring-builder container.builder add r1z1-127.0.0.1:6201/swift-d4 1
|
||||
swift-ring-builder container.builder add r1z1-127.0.0.1:6201/swift-d5 1
|
||||
swift-ring-builder container.builder rebalance
|
||||
swift-ring-builder account.builder create 10 1 1
|
||||
swift-ring-builder account.builder add r1z1-127.0.0.1:6202/swift-d0 1
|
||||
swift-ring-builder account.builder add r1z1-127.0.0.1:6202/swift-d1 1
|
||||
swift-ring-builder account.builder add r1z1-127.0.0.1:6202/swift-d2 1
|
||||
swift-ring-builder account.builder add r1z1-127.0.0.1:6202/swift-d3 1
|
||||
swift-ring-builder account.builder add r1z1-127.0.0.1:6202/swift-d4 1
|
||||
swift-ring-builder account.builder add r1z1-127.0.0.1:6202/swift-d5 1
|
||||
swift-ring-builder account.builder rebalance
|
||||
|
||||
# For Policy-1:
|
||||
swift-ring-builder object-1.builder create 10 1 1
|
||||
swift-ring-builder object-1.builder add r1z1-127.0.0.1:6200/swift-d0 1
|
||||
swift-ring-builder object-1.builder add r1z1-127.0.0.1:6200/swift-d1 1
|
||||
swift-ring-builder object-1.builder add r1z1-127.0.0.1:6200/swift-d2 1
|
||||
swift-ring-builder object-1.builder add r1z1-127.0.0.1:6200/swift-d3 1
|
||||
swift-ring-builder object-1.builder add r1z1-127.0.0.1:6200/swift-d4 1
|
||||
swift-ring-builder object-1.builder add r1z1-127.0.0.1:6200/swift-d5 1
|
||||
swift-ring-builder object-1.builder rebalance
|
||||
@@ -8,9 +8,11 @@ PORT=28632
|
||||
. $(dirname "$0")/docker.bash
|
||||
|
||||
start() {
|
||||
# We need to replace the remakerings in the container to create Policy-1.
|
||||
docker run --rm -d --name ${NAME} \
|
||||
-p 127.0.0.1:${PORT}:8080 \
|
||||
bouncestorage/swift-aio
|
||||
-v $(dirname "$0")/TestSwiftAIO.d/remakerings:/etc/swift/remakerings:ro \
|
||||
openstackswift/saio
|
||||
|
||||
echo type=swift
|
||||
echo env_auth=false
|
||||
|
||||
@@ -110,7 +110,7 @@ func start(name string) error {
|
||||
return nil
|
||||
}
|
||||
// If we got a _connect value then try to connect to it
|
||||
const maxTries = 30
|
||||
const maxTries = 100
|
||||
var rdBuf = make([]byte, 1)
|
||||
for i := 1; i <= maxTries; i++ {
|
||||
if i != 0 {
|
||||
@@ -175,7 +175,16 @@ func Start(remoteName string) (fn func(), err error) {
|
||||
if running[name] <= 0 {
|
||||
// if server isn't running check to see if this server has
|
||||
// been started already but not by us and stop it if so
|
||||
if os.Getenv(envKey(name, "type")) == "" && isRunning(name) {
|
||||
const maxTries = 10
|
||||
for i := 1; i <= maxTries; i++ {
|
||||
if os.Getenv(envKey(name, "type")) == "" && !isRunning(name) {
|
||||
fs.Logf(name, "Stopped server")
|
||||
break
|
||||
}
|
||||
if i != 1 {
|
||||
time.Sleep(time.Second)
|
||||
fs.Logf(name, "Attempting to stop %s try %d/%d", name, i, maxTries)
|
||||
}
|
||||
stop(name)
|
||||
}
|
||||
if !isRunning(name) {
|
||||
@@ -211,6 +220,6 @@ func stop(name string) {
|
||||
fs.Errorf(name, "Failed to stop server: %v", err)
|
||||
}
|
||||
running[name] = 0
|
||||
fs.Logf(name, "Stopped server")
|
||||
fs.Logf(name, "Stopping server")
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ require (
|
||||
github.com/spf13/cobra v1.10.1
|
||||
github.com/spf13/pflag v1.0.10
|
||||
github.com/stretchr/testify v1.11.1
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20241213151442-a19cff0ec7b5
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20250926104142-ccb8d3498e6c
|
||||
github.com/unknwon/goconfig v1.0.0
|
||||
github.com/willscott/go-nfs v0.0.3
|
||||
github.com/winfsp/cgofuse v1.6.1-0.20250813110601-7d90b0992471
|
||||
@@ -127,6 +127,7 @@ require (
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.38.5 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
|
||||
github.com/bradenaw/juniper v0.15.3 // indirect
|
||||
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect
|
||||
github.com/calebcase/tmpfile v1.0.3 // indirect
|
||||
@@ -246,6 +247,7 @@ require (
|
||||
github.com/ProtonMail/go-crypto v1.3.0
|
||||
github.com/golang-jwt/jwt/v4 v4.5.2
|
||||
github.com/pkg/xattr v0.4.12
|
||||
github.com/pquerna/otp v1.5.0
|
||||
golang.org/x/mobile v0.0.0-20250911085028-6912353760cf
|
||||
golang.org/x/term v0.35.0
|
||||
)
|
||||
@@ -150,6 +150,8 @@ github.com/aws/smithy-go v1.23.0 h1:8n6I3gXzWJB2DxBDnfxgBaSX6oe0d/t10qGz7OKqMCE=
|
||||
github.com/aws/smithy-go v1.23.0/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI=
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8WK8raXaxBx6fRVTlJILwEwQGL1I/ByEI=
|
||||
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||
github.com/bradenaw/juniper v0.15.3 h1:RHIAMEDTpvmzV1wg1jMAHGOoI2oJUSPx3lxRldXnFGo=
|
||||
github.com/bradenaw/juniper v0.15.3/go.mod h1:UX4FX57kVSaDp4TPqvSjkAAewmRFAfXf27BOs5z9dq8=
|
||||
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 h1:GKTyiRCL6zVf5wWaqKnf+7Qs6GbEPfd4iMOitWzXJx8=
|
||||
@@ -512,6 +514,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU=
|
||||
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
|
||||
github.com/pquerna/otp v1.5.0 h1:NMMR+WrmaqXU4EzdGJEE1aUUI0AMRzsp96fFFWNPwxs=
|
||||
github.com/pquerna/otp v1.5.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
|
||||
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
|
||||
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
@@ -596,6 +600,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20241213151442-a19cff0ec7b5 h1:Sa+sR8aaAMFwxhXWENEnE6ZpqhZ9d7u1RT2722Rw6hc=
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20241213151442-a19cff0ec7b5/go.mod h1:UdZiFUFu6e2WjjtjxivwXWcwc1N/8zgbkBR9QNucUOY=
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20250926104142-ccb8d3498e6c h1:BLopNCyqewbE8+BtlIp/Juzu8AJGxz0gHdGADnsblVc=
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20250926104142-ccb8d3498e6c/go.mod h1:ykucQyiE9Q2qx1wLlEtZkkNn1IURib/2O+Mvd25i1Fo=
|
||||
github.com/tailscale/depaware v0.0.0-20210622194025-720c4b409502/go.mod h1:p9lPsd+cx33L3H9nNoecRRxPssFKUwwI50I3pZ0yT+8=
|
||||
github.com/tinylib/msgp v1.4.0 h1:SYOeDRiydzOw9kSiwdYp9UcBgPFtLU2WDHaJXyHruf8=
|
||||
github.com/tinylib/msgp v1.4.0/go.mod h1:cvjFkb4RiC8qSBOPMGPSzSAx47nAsfhLVTCZZNuHv5o=
|
||||
|
||||
@@ -250,9 +250,7 @@ func (ts *TokenSource) reReadToken() (changed bool) {
|
||||
return false
|
||||
}
|
||||
|
||||
if !newToken.Valid() {
|
||||
fs.Debugf(ts.name, "Loaded invalid token from config file - ignoring")
|
||||
} else {
|
||||
if newToken.Valid() {
|
||||
fs.Debugf(ts.name, "Loaded fresh token from config file")
|
||||
changed = true
|
||||
}
|
||||
@@ -264,6 +262,8 @@ func (ts *TokenSource) reReadToken() (changed bool) {
|
||||
if changed {
|
||||
ts.token = newToken
|
||||
ts.tokenSource = nil // invalidate since we changed the token
|
||||
} else {
|
||||
fs.Debugf(ts.name, "No updated token found in the config file")
|
||||
}
|
||||
return changed
|
||||
}
|
||||
@@ -319,6 +319,8 @@ func (ts *TokenSource) Token() (*oauth2.Token, error) {
|
||||
return ts.token, nil
|
||||
}
|
||||
|
||||
fs.Debug(ts.name, "Token expired")
|
||||
|
||||
// Try getting the token a few times
|
||||
for i := 1; i <= maxTries; i++ {
|
||||
// Try reading the token from the config file in case it has
|
||||
@@ -344,6 +346,7 @@ func (ts *TokenSource) Token() (*oauth2.Token, error) {
|
||||
|
||||
token, err = ts.tokenSource.Token()
|
||||
if err == nil {
|
||||
fs.Debug(ts.name, "Token refresh successful")
|
||||
break
|
||||
}
|
||||
if newErr := maybeWrapOAuthError(err, ts.name); newErr != err {
|
||||
|
||||
@@ -47,16 +47,14 @@ func (r *Renew) renewOnExpiry() {
|
||||
}
|
||||
uploads := r.uploads.Load()
|
||||
if uploads != 0 {
|
||||
fs.Debugf(r.name, "Token expired - %d uploads in progress - refreshing", uploads)
|
||||
fs.Debugf(r.name, "Background refresher detected expired token - %d uploads in progress - refreshing", uploads)
|
||||
// Do a transaction
|
||||
err := r.run()
|
||||
if err == nil {
|
||||
fs.Debugf(r.name, "Token refresh successful")
|
||||
} else {
|
||||
fs.Errorf(r.name, "Token refresh failed: %v", err)
|
||||
if err != nil {
|
||||
fs.Errorf(r.name, "Background token refresher failed: %v", err)
|
||||
}
|
||||
} else {
|
||||
fs.Debugf(r.name, "Token expired but no uploads in progress - doing nothing")
|
||||
fs.Debugf(r.name, "Background refresher detected expired token but no uploads in progress - doing nothing")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user