-
Notifications
You must be signed in to change notification settings - Fork 14
/
config.toml.example
185 lines (170 loc) · 5.54 KB
/
config.toml.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
####################################################
# You can store the credentials for the archive in your config file.
#
# This makes it easy to script and schedule backup jobs, and 0s will
# force you to make the permissions on the file restricted to your
# user.
#
# Make sure you run `chmod 600 config.toml` after creating your config!
#
[stash.local_with_password]
key = { source = "plaintext", user = "123", password = "123" }
backend = { type = "fs", path = "/path/to/stash" }
####################################################
# macOS Keychain support
#
# Zerostash can save your password in macOS keychain.
#
# By doing this, you use the hardware-backed key store on supported
# systems, and still get a convenient experience.
#
# Do note that changing the *alias* (or `example_keychain` below) will
# invalidate the existing entry, and you will have to re-enter your
# password.
#
# This configuration item is only available on macOS, and the
# configuration file will fail to load on other systems.
#
[stash.example_keychain]
key = { source = "plaintext", user = "[email protected]", keychain = true }
backend = { type = "fs", path = "/path/to/stash" }
####################################################
# Interactive passwords
#
# If you don't want to store credentials in the config, you can still
# alias the object store paths for convenience.
#
[stash.local_interactive_password]
key = { source = "ask" }
backend = { type = "fs", path = "/path/to/stash" }
####################################################
# Key file
#
# Storing your credentials in a separate toml file is useful for
# automated provisioning.
#
[stash.local_keyfile]
key = { source = "file", path = "keyfile.toml.example" }
backend = { type = "fs", path = "/path/to/stash" }
####################################################
# Split keyfile
#
# To create an archive that's only written by one machine and read by
# another, you can create split keys.
#
# Use the following command line to generate the keys:
#
# 0s keys gen test_stash_name \
# split_key \
# --user test \
# --read-keyfile rw.toml \
# --write-keyfile w.toml
#
# The directory listings and metadata are encrypted with a
# symmetric key in `w.toml`, however the file contents can
# only be decrypted with `rw.toml`'s secret asymmetric key.
#
# Set up the machine that's making backups with the following config:
[stash.test_stash_writer]
key = { source = "file", path = "w.toml" }
backend = { type = "s3", bucket = "test_bucket", region = { name = "us-east-1" } }
#
# Then set up your backup reader with the following, very similar
# config:
#
[stash.test_stash_reader]
key = { source = "file", path = "rw.toml" }
backend = { type = "s3", bucket = "test_bucket", region = { name = "us-east-1" } }
####################################################
# S3 Remote backups
#
# Remote backups work similarly to the previous examples. You can also
# store the S3 keys directly in your Zerostash config, and copy the
# same config to multiple machines or use it in templates of your
# deployment system.
#
# Zerostash recognizes the following regions for AWS:
#
# * "us-east-1"
# * "us-east-2"
# * "us-west-1"
# * "us-west-2"
# * "ca-central-1"
# * "af-south-1"
# * "ap-east-1"
# * "ap-south-1"
# * "ap-northeast-1"
# * "ap-northeast-2"
# * "ap-northeast-3"
# * "ap-southeast-1"
# * "ap-southeast-2"
# * "cn-north-1"
# * "cn-northwest-1"
# * "eu-north-1"
# * "eu-central-1"
# * "eu-west-1"
# * "eu-west-2"
# * "eu-west-3"
# * "sa-east-1"
# * "me-south-1"
#
# For DigitalOcean:
#
# * "nyc3"
# * "ams3"
# * "sgp1"
# * "fra1"
#
[stash.s3_aws_with_keys]
key = { source = "ask" }
backend = { type = "s3", bucket = "test_bucket", region = { name = "us-east-1" }, keys = ["access_key_id", "secret_key"] }
####################################################
# S3 Remote backups using the environment
#
# Zerostash can also lift your S3 configuration from the environment.
# The following variables need to be set with your access and secret keys:
#
# export AWS_ACCESS_KEY_ID=xxxx
# export AWS_SECRET_ACCESS_KEY=xxxx
#
[stash.s3_aws_env_key]
key = { source = "ask" }
backend = { type = "s3", bucket = "test_bucket", region = { name = "us-east-1" } }
####################################################
# S3-compatible remotes
#
# A custom server can also be used instead of the usual S3 regions.
# If an endpoint is specified, you may still need to set the
# appropriate region for your server. On most minio default
# installations, this will be `us-east-1`
#
[stash.s3_custom_address]
key = { source = "ask" }
[stash.s3_custom_address.backend]
type = "s3"
bucket = "test_bucket"
region = { name = "custom", details = { endpoint = "https://127.0.0.1:8080/", "region" = "" }}
####################################################
# Cache files locally
#
# A custom server can also be used instead of the usual S3 regions.
# If an endpoint is specified, you may still need to set the
# appropriate region for your server. On most Minio default
# installations, this will be `us-east-1`
#
# The `max_size_mb` will make sure that locally stored content will
# never be more than the given amount of mebibytes (2^20 bytes).
#
# When opening a cached repository, the root is always queried from
# the `upstream` for freshness.
#
[stash.remote_cached]
key = { source = "ask" }
[stash.remote_cached.backend]
type = "fs_cache"
path = "/Users/user/Code/repo"
max_size_mb = 1000
[stash.remote_cached.backend.upstream]
type = "s3"
bucket = "test_bucket"
region = { name = "custom", details = { endpoint = "https://127.0.0.1:8080/", "region" = "" }}