bard-backup 0.16.0 → 0.16.2

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: b04f7c45bf80b1e66501cde66ca37f02def6a887368710c18ebbb6b12e8dd906
4
- data.tar.gz: 2ae3f5a68b9fd1d3166475917b3c0abfdecad4d4e9fdcdba6ebf0f8397f38659
3
+ metadata.gz: 334fe0c69997da7ca4ea68bcfe33b23868b863c9ca5fd355d8713cec9184d9e6
4
+ data.tar.gz: 883b6e3b202f9e57de6c414a282c4d2983b61b50791f7e1a3c10e3bd4f14f02f
5
5
  SHA512:
6
- metadata.gz: 3647ba74dbeaad6cc519d8cb6a6e8a00166c53a8f885891435d3fd4e800d0a5388395176bdc5ca9b76af3d607de6138fadc845df6a946f32fd7591042c6fa1f1
7
- data.tar.gz: d58dc757b0738f1f0dc1547fe15cf236e95d51f0843a204c1d5e2df8d671c560f4bf237ec27217991d26f241b6f03c036c6a8b8ef889466a55ceb127efb59874
6
+ metadata.gz: f73eddb5fc415a04bfae9e25953fc07a8c9b2d04280f341490b6c4f73601618c9ae5120e4cb9c5305deeb239f820cf4842d3b783ba7f2b4d20f170fc6efbe8eb
7
+ data.tar.gz: 1c68e20bb32a956c3385211ac166fa278eee80df2a3b4e3c537e00dd81136ff4849ccaf621562a8e14c06b2f7cfd9817e5749c497ce0787eb421413e3c6b0b13
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Bard::Backup handles backups for a bard project:
4
4
  1. Takes a database dump and uploads it to S3 (or PUTs it to presigned URLs)
5
- 2. Syncs configured data directories to S3 with a local manifest cache
5
+ 2. Syncs configured data directories to S3 with a local manifest cache, skipping the Solid Queue, Cache and Cable SQLite databases Rails keeps in `storage/`
6
6
  3. Deletes old database backups using a backoff heuristic: 48 hours, 30 days, 26 weeks, 24 months, then yearly
7
7
  4. Raises an error if we don't have a database backup from the previous hour
8
8
  5. Optionally encrypts uploaded payloads at rest with AES-256-GCM
@@ -92,6 +92,8 @@ module Bard
92
92
  data_paths.each do |data_path|
93
93
  Dir.glob("#{data_path}/**/*").each do |file|
94
94
  next unless File.file?(file)
95
+ # Rails keeps Solid Queue/Cache/Cable's SQLite databases in storage/: runtime state, not data
96
+ next if File.basename(file).match?(/(\A|_)(queue|cache|cable)\.sqlite3(-wal|-shm|-journal)?\z/)
95
97
  stat = File.stat(file)
96
98
  result[file] = { mtime: stat.mtime.to_f, size: stat.size }
97
99
  end
@@ -10,9 +10,15 @@ module Bard
10
10
  end
11
11
 
12
12
  def call
13
- result = { path: tree_config[:path], encrypted: [], skipped: [] }
13
+ result = { path: tree_config[:path], encrypted: [], skipped: [], gone: [] }
14
14
  stored_tree.files.each do |file|
15
- stored = stored_tree.get(file).b
15
+ stored = begin
16
+ stored_tree.get(file).b
17
+ rescue Aws::S3::Errors::NoSuchKey
18
+ # the hourly backup pruned it after we listed it
19
+ result[:gone] << file
20
+ next
21
+ end
16
22
  if under_target_key?(stored)
17
23
  result[:skipped] << file
18
24
  else
@@ -29,7 +29,8 @@ namespace :bard do
29
29
  end
30
30
 
31
31
  Bard::Backup.encrypt_existing!(destinations, **Bard::Backup::RailsCredentials.find).each do |result|
32
- puts "#{result[:path]}: encrypted #{result[:encrypted].size}, already encrypted #{result[:skipped].size}"
32
+ gone = Array(result[:gone])
33
+ puts "#{result[:path]}: encrypted #{result[:encrypted].size}, already encrypted #{result[:skipped].size}#{", gone before it could be read #{gone.size}" if gone.any?}"
33
34
  end
34
35
  end
35
36
 
@@ -1,6 +1,6 @@
1
1
  module Bard
2
2
  class Backup
3
- VERSION = "0.16.0"
3
+ VERSION = "0.16.2"
4
4
  end
5
5
  end
6
6
 
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.16.0
4
+ version: 0.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel