Fixed token issue, added OAuth2 including recipe and docs.

This commit is contained in:
MaxJa4
2023-08-21 16:48:17 +02:00
parent ddca5c4853
commit 70275eac86
4 changed files with 94 additions and 7 deletions

View File

@@ -70,7 +70,9 @@ type Config struct {
AzureStorageContainerName string `split_words:"true"`
AzureStoragePath string `split_words:"true"`
AzureStorageEndpoint string `split_words:"true" default:"https://{{ .AccountName }}.blob.core.windows.net/"`
DropboxToken string `split_words:"true"`
DropboxRefreshToken string `split_words:"true"`
DropboxAppKey string `split_words:"true"`
DropboxAppSecret string `split_words:"true"`
DropboxRemotePath string `split_words:"true"`
DropboxConcurrencyLevel int `split_words:"true" default:"6"`
}

View File

@@ -220,9 +220,11 @@ func newScript() (*script, error) {
s.storages = append(s.storages, azureBackend)
}
if s.c.DropboxToken != "" {
if s.c.DropboxRefreshToken != "" && s.c.DropboxAppKey != "" && s.c.DropboxAppSecret != "" {
dropboxConfig := dropbox.Config{
Token: s.c.DropboxToken,
RefreshToken: s.c.DropboxRefreshToken,
AppKey: s.c.DropboxAppKey,
AppSecret: s.c.DropboxAppSecret,
RemotePath: s.c.DropboxRemotePath,
ConcurrencyLevel: s.c.DropboxConcurrencyLevel,
}