mirror of
https://github.com/filebrowser/filebrowser.git
synced 2026-01-23 02:35:10 +00:00
feat: integrate tus.io for resumable and chunked uploads (#2145)
This commit is contained in:
parent
2744f7d5b9
commit
7b35815754
24 changed files with 694 additions and 66 deletions
|
|
@ -21,6 +21,7 @@ type Settings struct {
|
|||
Defaults UserDefaults `json:"defaults"`
|
||||
AuthMethod AuthMethod `json:"authMethod"`
|
||||
Branding Branding `json:"branding"`
|
||||
Tus Tus `json:"tus"`
|
||||
Commands map[string][]string `json:"commands"`
|
||||
Shell []string `json:"shell"`
|
||||
Rules []rules.Rule `json:"rules"`
|
||||
|
|
|
|||
|
|
@ -33,6 +33,12 @@ func (s *Storage) Get() (*Settings, error) {
|
|||
if set.UserHomeBasePath == "" {
|
||||
set.UserHomeBasePath = DefaultUsersHomeBasePath
|
||||
}
|
||||
if set.Tus == (Tus{}) {
|
||||
set.Tus = Tus{
|
||||
ChunkSize: DefaultTusChunkSize,
|
||||
RetryCount: DefaultTusRetryCount,
|
||||
}
|
||||
}
|
||||
return set, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
10
settings/tus.go
Normal file
10
settings/tus.go
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package settings
|
||||
|
||||
const DefaultTusChunkSize = 10 * 1024 * 1024 // 10MB
|
||||
const DefaultTusRetryCount = 5
|
||||
|
||||
// Tus contains the tus.io settings of the app.
|
||||
type Tus struct {
|
||||
ChunkSize uint64 `json:"chunkSize"`
|
||||
RetryCount uint16 `json:"retryCount"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue