bard-backup 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CLAUDE.md +2 -2
- data/README.md +1 -3
- data/lib/bard/backup/database.rb +1 -1
- data/lib/bard/backup/file_tree.rb +1 -1
- data/lib/bard/backup/version.rb +1 -1
- data/lib/bard/backup.rb +3 -1
- data/lib/bard/plugins/encrypt.rb +13 -11
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c66bfeccaabd27a54df1d8b24e333a07d2ae06280e42b1ed9f66f0b8efe52b5e
|
|
4
|
+
data.tar.gz: 0af92ab20c579f1cc42b35a7452c8719ab24372228384f3752f7f7a92f8aa0c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f75e352e04b247fe34165d316538a87e596edd09f26627b514ae52fc74f28881e1f34d3c8d5101570ab77f41fb6764dc6c55407d81c21e6de71422a3dd534531
|
|
7
|
+
data.tar.gz: 23b16bc9572158fb2968eafbd72bb9559815796ea618c542fe69c6dce6be8632c556dd83441748f43a0c72c21b23b92b3cb9c139d31be3f4cf606599563a2881
|
data/CLAUDE.md
CHANGED
|
@@ -50,12 +50,12 @@ Tests require AWS credentials at `spec/support/credentials.json`. In CI, this is
|
|
|
50
50
|
- `S3Destination` — dumps DB locally via backhoe, uploads to S3, runs `Deleter` for retention, verifies previous hour's backup
|
|
51
51
|
- `UploadDestination` — dumps DB and uploads to presigned URLs (multi-threaded)
|
|
52
52
|
|
|
53
|
-
**Config DSL** (loaded via `bard/plugins/backup` and `bard/plugins/encrypt
|
|
53
|
+
**Config DSL** (loaded via `bard/plugins/backup` and `bard/plugins/encrypt`; `backup` extends `Bard::Config`, `encrypt` extends `Bard::BackupConfig`):
|
|
54
54
|
```ruby
|
|
55
55
|
backup do
|
|
56
56
|
s3 "primary", path: "bucket/subfolder", region: "us-west-2"
|
|
57
|
+
encrypt true # reads key from config/master.key
|
|
57
58
|
end
|
|
58
|
-
encrypt true # reads key from config/master.key
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
**Key classes**:
|
data/README.md
CHANGED
|
@@ -22,10 +22,8 @@ In a Rails app, configure destinations in `config/bard.rb` using the `Bard::Conf
|
|
|
22
22
|
```ruby
|
|
23
23
|
backup do
|
|
24
24
|
s3 "primary", path: "my-bucket/my-project", region: "us-west-2"
|
|
25
|
+
encrypt true # optional: encrypt payloads at rest. Reads key from config/master.key.
|
|
25
26
|
end
|
|
26
|
-
|
|
27
|
-
# Optional: encrypt payloads at rest. Reads the key from config/master.key.
|
|
28
|
-
encrypt true
|
|
29
27
|
```
|
|
30
28
|
|
|
31
29
|
Credentials live in Rails encrypted credentials under `bard_backup` (matched by `name:`):
|
data/lib/bard/backup/database.rb
CHANGED
|
@@ -17,7 +17,7 @@ module Bard
|
|
|
17
17
|
Array(destination_hashes)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
encryption_key = bard_config&.
|
|
20
|
+
encryption_key = bard_config&.backup&.encryption_key
|
|
21
21
|
if encryption_key
|
|
22
22
|
destinations = destinations.map { |h| { encryption_key: encryption_key, **h } }
|
|
23
23
|
end
|
|
@@ -15,7 +15,7 @@ module Bard
|
|
|
15
15
|
return if data_paths.empty?
|
|
16
16
|
|
|
17
17
|
encryption_key = s3_config.delete(:encryption_key)
|
|
18
|
-
encryption_key ||= bard_config&.
|
|
18
|
+
encryption_key ||= bard_config&.backup&.encryption_key
|
|
19
19
|
|
|
20
20
|
s3_tree = S3Tree.new(path: "#{bucket}/#{project_name}", encryption_key: encryption_key, **s3_config)
|
|
21
21
|
new(s3_tree, data_paths).call
|
data/lib/bard/backup/version.rb
CHANGED
data/lib/bard/backup.rb
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
require "bard"
|
|
2
|
+
require "bard/plugins/backup"
|
|
3
|
+
require "bard/plugins/encrypt"
|
|
1
4
|
require "bard/backup/database"
|
|
2
5
|
require "bard/backup/file_tree"
|
|
3
6
|
require "bard/backup/latest_finder"
|
|
4
|
-
require "bard"
|
|
5
7
|
require "bard/backup/railtie" if defined?(Rails)
|
|
6
8
|
|
|
7
9
|
module Bard
|
data/lib/bard/plugins/encrypt.rb
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
require "bard/
|
|
1
|
+
require "bard/plugins/backup"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
module Bard
|
|
4
|
+
class BackupConfig
|
|
5
|
+
def encrypt(value = nil)
|
|
6
|
+
if value.nil?
|
|
7
|
+
@encrypt
|
|
8
|
+
else
|
|
9
|
+
@encrypt = value
|
|
10
|
+
end
|
|
9
11
|
end
|
|
10
|
-
end
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
def encryption_key
|
|
14
|
+
return nil unless encrypt
|
|
15
|
+
File.read("config/master.key").strip
|
|
16
|
+
end
|
|
15
17
|
end
|
|
16
18
|
end
|