mirror of
https://github.com/rclone/rclone.git
synced 2025-01-24 12:56:36 +02:00
Merge branch 'rclone:master' into user-from-header
This commit is contained in:
commit
ffeee9511b
@ -393,8 +393,10 @@ func newFsFromOptions(ctx context.Context, name, root string, opt *Options) (fs.
|
||||
policyClientOptions := policy.ClientOptions{
|
||||
Transport: newTransporter(ctx),
|
||||
}
|
||||
backup := service.ShareTokenIntentBackup
|
||||
clientOpt := service.ClientOptions{
|
||||
ClientOptions: policyClientOptions,
|
||||
ClientOptions: policyClientOptions,
|
||||
FileRequestIntent: &backup,
|
||||
}
|
||||
|
||||
// Here we auth by setting one of cred, sharedKeyCred or f.client
|
||||
|
@ -42,9 +42,10 @@ type Bucket struct {
|
||||
|
||||
// LifecycleRule is a single lifecycle rule
|
||||
type LifecycleRule struct {
|
||||
DaysFromHidingToDeleting *int `json:"daysFromHidingToDeleting"`
|
||||
DaysFromUploadingToHiding *int `json:"daysFromUploadingToHiding"`
|
||||
FileNamePrefix string `json:"fileNamePrefix"`
|
||||
DaysFromHidingToDeleting *int `json:"daysFromHidingToDeleting"`
|
||||
DaysFromUploadingToHiding *int `json:"daysFromUploadingToHiding"`
|
||||
DaysFromStartingToCancelingUnfinishedLargeFiles *int `json:"daysFromStartingToCancelingUnfinishedLargeFiles"`
|
||||
FileNamePrefix string `json:"fileNamePrefix"`
|
||||
}
|
||||
|
||||
// Timestamp is a UTC time when this file was uploaded. It is a base
|
||||
|
@ -2231,6 +2231,7 @@ This will dump something like this showing the lifecycle rules.
|
||||
{
|
||||
"daysFromHidingToDeleting": 1,
|
||||
"daysFromUploadingToHiding": null,
|
||||
"daysFromStartingToCancelingUnfinishedLargeFiles": null,
|
||||
"fileNamePrefix": ""
|
||||
}
|
||||
]
|
||||
@ -2257,8 +2258,9 @@ overwrites will still cause versions to be made.
|
||||
See: https://www.backblaze.com/docs/cloud-storage-lifecycle-rules
|
||||
`,
|
||||
Opts: map[string]string{
|
||||
"daysFromHidingToDeleting": "After a file has been hidden for this many days it is deleted. 0 is off.",
|
||||
"daysFromUploadingToHiding": "This many days after uploading a file is hidden",
|
||||
"daysFromHidingToDeleting": "After a file has been hidden for this many days it is deleted. 0 is off.",
|
||||
"daysFromUploadingToHiding": "This many days after uploading a file is hidden",
|
||||
"daysFromStartingToCancelingUnfinishedLargeFiles": "Cancels any unfinished large file versions after this many days",
|
||||
},
|
||||
}
|
||||
|
||||
@ -2278,6 +2280,13 @@ func (f *Fs) lifecycleCommand(ctx context.Context, name string, arg []string, op
|
||||
}
|
||||
newRule.DaysFromUploadingToHiding = &days
|
||||
}
|
||||
if daysStr := opt["daysFromStartingToCancelingUnfinishedLargeFiles"]; daysStr != "" {
|
||||
days, err := strconv.Atoi(daysStr)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("bad daysFromStartingToCancelingUnfinishedLargeFiles: %w", err)
|
||||
}
|
||||
newRule.DaysFromStartingToCancelingUnfinishedLargeFiles = &days
|
||||
}
|
||||
bucketName, _ := f.split("")
|
||||
if bucketName == "" {
|
||||
return nil, errors.New("bucket required")
|
||||
@ -2285,7 +2294,7 @@ func (f *Fs) lifecycleCommand(ctx context.Context, name string, arg []string, op
|
||||
}
|
||||
|
||||
var bucket *api.Bucket
|
||||
if newRule.DaysFromHidingToDeleting != nil || newRule.DaysFromUploadingToHiding != nil {
|
||||
if newRule.DaysFromHidingToDeleting != nil || newRule.DaysFromUploadingToHiding != nil || newRule.DaysFromStartingToCancelingUnfinishedLargeFiles != nil {
|
||||
bucketID, err := f.getBucketID(ctx, bucketName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -2056,7 +2056,7 @@ If you leave it blank, this is calculated automatically from the sse_customer_ke
|
||||
Help: "One Zone Infrequent Access storage class",
|
||||
}, {
|
||||
Value: "GLACIER",
|
||||
Help: "Glacier storage class",
|
||||
Help: "Glacier Flexible Retrieval storage class",
|
||||
}, {
|
||||
Value: "DEEP_ARCHIVE",
|
||||
Help: "Glacier Deep Archive storage class",
|
||||
|
@ -919,3 +919,4 @@ put them back in again.` >}}
|
||||
* Filipe Azevedo <pasnox@gmail.com>
|
||||
* hayden.pan <hayden.pan@outlook.com>
|
||||
* Yxxx <45665172+marsjane@users.noreply.github.com>
|
||||
* Thomas ten Cate <ttencate@gmail.com>
|
||||
|
@ -465,10 +465,10 @@ flags with `--exclude`, `--exclude-from`, `--filter` or `--filter-from`,
|
||||
you must use include rules for all the files you want in the include
|
||||
statement. For more flexibility use the `--filter-from` flag.
|
||||
|
||||
`--exclude-from` has no effect when combined with `--files-from` or
|
||||
`--include-from` has no effect when combined with `--files-from` or
|
||||
`--files-from-raw` flags.
|
||||
|
||||
`--exclude-from` followed by `-` reads filter rules from standard input.
|
||||
`--include-from` followed by `-` reads filter rules from standard input.
|
||||
|
||||
### `--filter` - Add a file-filtering rule
|
||||
|
||||
@ -562,6 +562,8 @@ Other filter flags (`--include`, `--include-from`, `--exclude`,
|
||||
trailing whitespace is stripped from the input lines. Lines starting
|
||||
with `#` or `;` are ignored.
|
||||
|
||||
`--files-from` followed by `-` reads the list of files from standard input.
|
||||
|
||||
Rclone commands with a `--files-from` flag traverse the remote,
|
||||
treating the names in `--files-from` as a set of filters.
|
||||
|
||||
|
@ -180,7 +180,7 @@ User-specified template.
|
||||
Rclone itself implements the remote control protocol in its `rclone
|
||||
rc` command.
|
||||
|
||||
You can use it like this
|
||||
You can use it like this:
|
||||
|
||||
```
|
||||
$ rclone rc rc/noop param1=one param2=two
|
||||
@ -190,8 +190,23 @@ $ rclone rc rc/noop param1=one param2=two
|
||||
}
|
||||
```
|
||||
|
||||
Run `rclone rc` on its own to see the help for the installed remote
|
||||
control commands.
|
||||
If the remote is running on a different URL than the default
|
||||
`http://localhost:5572/`, use the `--url` option to specify it:
|
||||
|
||||
```
|
||||
$ rclone rc --url http://some.remote:1234/ rc/noop
|
||||
```
|
||||
|
||||
Or, if the remote is listening on a Unix socket, use the `--unix-socket` option
|
||||
instead:
|
||||
|
||||
```
|
||||
$ rclone rc --unix-socket /tmp/rclone.sock rc/noop
|
||||
```
|
||||
|
||||
Run `rclone rc` on its own, without any commands, to see the help for the
|
||||
installed remote control commands. Note that this also needs to connect to the
|
||||
remote server.
|
||||
|
||||
## JSON input
|
||||
|
||||
|
@ -244,7 +244,7 @@ Choose a number from below, or type in your own value
|
||||
\ "STANDARD_IA"
|
||||
5 / One Zone Infrequent Access storage class
|
||||
\ "ONEZONE_IA"
|
||||
6 / Glacier storage class
|
||||
6 / Glacier Flexible Retrieval storage class
|
||||
\ "GLACIER"
|
||||
7 / Glacier Deep Archive storage class
|
||||
\ "DEEP_ARCHIVE"
|
||||
|
2
go.mod
2
go.mod
@ -79,7 +79,7 @@ require (
|
||||
go.etcd.io/bbolt v1.3.10
|
||||
goftp.io/server/v2 v2.0.1
|
||||
golang.org/x/crypto v0.31.0
|
||||
golang.org/x/net v0.32.0
|
||||
golang.org/x/net v0.33.0
|
||||
golang.org/x/oauth2 v0.24.0
|
||||
golang.org/x/sync v0.10.0
|
||||
golang.org/x/sys v0.28.0
|
||||
|
4
go.sum
4
go.sum
@ -758,8 +758,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
|
||||
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
|
||||
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
|
||||
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
|
Loading…
x
Reference in New Issue
Block a user