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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79b2f29911f73ce6b73f1adce60d4595854edac99e4d0664a39c1b01c5680076
4
- data.tar.gz: 7f17e3ce3ed4c71555039b6b384759d5e5ddd3d3c17085014c3fccc2b41e593e
3
+ metadata.gz: c66bfeccaabd27a54df1d8b24e333a07d2ae06280e42b1ed9f66f0b8efe52b5e
4
+ data.tar.gz: 0af92ab20c579f1cc42b35a7452c8719ab24372228384f3752f7f7a92f8aa0c0
5
5
  SHA512:
6
- metadata.gz: ad7eb50c8781bed4f6ec83359afd2f7d029087e52574678bbed7578dbb64b01e0e9636e65cb98794bae2214a1fea3db956894d803a8af3a29b626cce52d1f692
7
- data.tar.gz: 3e0a8974d131887b9da4d5f82a71608f56d28af077a88abd2d03bd267c74769dbeadbe974bb653ec1d433c6fe1956e6367706e6fe53484b93dc3f7cf43a6f39f
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`, which extend `Bard::Config`):
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:`):
@@ -17,7 +17,7 @@ module Bard
17
17
  Array(destination_hashes)
18
18
  end
19
19
 
20
- encryption_key = bard_config&.respond_to?(:encryption_key) ? bard_config.encryption_key : nil
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&.respond_to?(:encryption_key) ? bard_config.encryption_key : nil
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
@@ -1,6 +1,6 @@
1
1
  module Bard
2
2
  class Backup
3
- VERSION = "0.10.0"
3
+ VERSION = "0.11.0"
4
4
  end
5
5
  end
6
6
 
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
@@ -1,16 +1,18 @@
1
- require "bard/config"
1
+ require "bard/plugins/backup"
2
2
 
3
- class Bard::Config
4
- def encrypt(value = nil)
5
- if value.nil?
6
- @encrypt
7
- else
8
- @encrypt = value
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
- def encryption_key
13
- return nil unless encrypt
14
- File.read("config/master.key").strip
13
+ def encryption_key
14
+ return nil unless encrypt
15
+ File.read("config/master.key").strip
16
+ end
15
17
  end
16
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel