Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.3.0 #113

Merged
merged 2 commits into from Oct 22, 2021
Merged

1.3.0 #113

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 18 additions & 4 deletions cmd/root.go
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"os"
"path/filepath"

"github.com/cupcakearmy/autorestic/internal"
"github.com/cupcakearmy/autorestic/internal/colors"
Expand Down Expand Up @@ -50,11 +51,24 @@ func initConfig() {
if cfgFile != "" {
viper.SetConfigFile(cfgFile)
} else {
home, err := homedir.Dir()
CheckErr(err)

viper.AddConfigPath(".")
viper.AddConfigPath(home)

// Home
if home, err := homedir.Dir(); err != nil {
viper.AddConfigPath(home)
}

// XDG_CONFIG_HOME
{
prefix, found := os.LookupEnv("XDG_CONFIG_HOME")
if !found {
if home, err := homedir.Dir(); err != nil {
prefix = filepath.Join(home, ".config")
}
}
viper.AddConfigPath(filepath.Join(prefix, "autorestic"))
}

viper.SetConfigName(".autorestic")
}
viper.AutomaticEnv()
Expand Down
6 changes: 3 additions & 3 deletions docs/markdown/backend/available.md
Expand Up @@ -19,17 +19,17 @@ backends:
backends:
name-of-backend:
type: b2
path: 'backblaze_bucketID'
path: 'bucket_name'
# Or With a path
# path: 'backblaze_bucketID:/some/path'
# path: 'bucket_name:/some/path'
env:
B2_ACCOUNT_ID: 'backblaze_keyID'
B2_ACCOUNT_KEY: 'backblaze_applicationKey'
```

#### API Keys gotcha

If you use a _File name prefix_ when making the application key, do not include a leading slash. Make sure to include this prefix in the path (e.g. `path: 'backblaze_bucketID:my/path'`).
If you use a _File name prefix_ when making the application key, do not include a leading slash. Make sure to include this prefix in the path (e.g. `path: 'bucket_name:my/path'`).

## S3 / Minio

Expand Down