Skip to content

Commit

Permalink
fix: OS separator
Browse files Browse the repository at this point in the history
doc: add documentation
  • Loading branch information
dive-deeper authored and MichaelEischer committed Jul 5, 2024
1 parent 8f382a2 commit 6ca368f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The app will create a file in the execution folder called `auth-storage.yaml`. I

# Configuration

The CalendarSync config file consists of `four` building blocks:
The CalendarSync config file consists of several building blocks:

- `sync` - Controls the timeframe to be synced
- `source` - Controls the source calendar to be synced from
Expand All @@ -65,6 +65,7 @@ The CalendarSync config file consists of `four` building blocks:
- `transformations` - Controls the transformers applied to the events before
syncing
- `filters` - Controls filters, which allow events to be excluded from syncing
- `auth` - Controls settings regarding the encrypted auth storage file

## Sync

Expand Down Expand Up @@ -179,6 +180,19 @@ filters:
ExcludeRegexp: ".*test"
```

## Auth

In this section you can configure settings regarding the encrypted local auth storage

```yaml
auth:
storage_mode: yaml # Currently, only yaml is supported
config:
# Here you can use the standard unix abbreviation for home directory (~).
# This works also for Windows systems e.g. ~\calendar-sync\auth-storage.yaml
path: "./auth-storage.yaml"
```

# Cleaning Up

You just synced a lot of events in your calendar and decide you want to use a
Expand Down
4 changes: 3 additions & 1 deletion example.sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ sync:
offset: +1 # MonthEnd +1 month (end of next month)

auth:
storage_mode: yaml
storage_mode: yaml # Currently, only yaml is supported
config:
# Here you can use the standard unix abbreviation for home directory (~).
# This works also for Windows systems e.g. ~\calendar-sync\auth-storage.yaml
path: "./auth-storage.yaml"

# Unfortunately, at this point, we only support one source adapter.
Expand Down
2 changes: 1 addition & 1 deletion internal/auth/yaml_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type YamlStorage struct {
func (y *YamlStorage) Setup(config config.AuthStorage, encryptionPassphrase string) error {
y.StorageEncryptionKey = encryptionPassphrase
y.StoragePath = config.Config["path"].(string)
if strings.HasPrefix(y.StoragePath, "~/") {
if strings.HasPrefix(y.StoragePath, "~" + string(filepath.Separator)) {
homeDir, err := os.UserHomeDir()
if err != nil {
return err
Expand Down

0 comments on commit 6ca368f

Please sign in to comment.