Skip to content

FR: include config from files/dirs #464

@edekeijzer

Description

@edekeijzer

With every addition to my config it gets a little less clear to understand. My suggestion would be to create something like Home Assistant does in its yaml, an !include <file|dir> directive that would allow splitting backends and locations into separate files. Considering that both backends and locations should have unique items underneath them, I'd suggest taking their names from from the filenames.

Example:

autorestic.yml

version: 2

global:
  forget:
    keep-last: 10
    keep-daily: 7
    keep-weekly: 4
    keep-monthly: 12

backends: !include backends/

locations: !include locations/

backends/remote.yml

type: rest
path: http://remote.example.com:8086/myserver
key: <redacted>
requirekey: true
rest:
  user: myuser
  password: <redacted>

locations/important-stuff.yml

from:
  - /data/important
to:
  - remote

Unfortunately I am not skilled in Go but I'd be more than willing to help testing if this gets implemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions