ruborg 0.3.1 → 0.4.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/.rubocop.yml +175 -0
- data/CHANGELOG.md +26 -0
- data/CLAUDE.md +67 -1
- data/README.md +337 -80
- data/Rakefile +1 -1
- data/SECURITY.md +41 -2
- data/exe/ruborg +1 -1
- data/lib/ruborg/backup.rb +97 -12
- data/lib/ruborg/cli.rb +257 -78
- data/lib/ruborg/config.rb +18 -61
- data/lib/ruborg/logger.rb +4 -5
- data/lib/ruborg/passbolt.rb +5 -5
- data/lib/ruborg/repository.rb +275 -7
- data/lib/ruborg/version.rb +2 -2
- data/lib/ruborg.rb +1 -1
- data/ruborg.yml.example +136 -22
- metadata +41 -12
data/ruborg.yml.example
CHANGED
|
@@ -1,28 +1,142 @@
|
|
|
1
|
-
# Ruborg
|
|
1
|
+
# Ruborg Example Configuration
|
|
2
|
+
#
|
|
3
|
+
# To use this configuration:
|
|
4
|
+
# cp ruborg.yml.example ruborg.yml
|
|
5
|
+
# chmod 600 ruborg.yml
|
|
6
|
+
# # Edit ruborg.yml with your settings
|
|
2
7
|
|
|
3
|
-
#
|
|
4
|
-
|
|
8
|
+
# Global settings (applied to all repositories unless overridden)
|
|
9
|
+
compression: lz4 # Options: lz4 (fast), zstd (balanced), lzma (high compression), none
|
|
10
|
+
encryption: repokey # Options: repokey, keyfile, none (NOT recommended)
|
|
11
|
+
auto_init: true # Automatically initialize repositories on first use
|
|
12
|
+
auto_prune: true # Automatically prune old backups after each backup
|
|
13
|
+
log_file: ~/.ruborg/logs/ruborg.log # Log file path (optional)
|
|
5
14
|
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- /home/user/projects
|
|
10
|
-
- /etc
|
|
15
|
+
# Custom Borg executable path (optional)
|
|
16
|
+
# Use this if borg is not in PATH or you want to use a specific version
|
|
17
|
+
# borg_path: /usr/local/bin/borg
|
|
11
18
|
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- "*/.cache/*"
|
|
17
|
-
- "*/node_modules/*"
|
|
18
|
-
- "*/.git/*"
|
|
19
|
+
# Global Passbolt integration (optional)
|
|
20
|
+
# Store passphrases securely in Passbolt instead of config files
|
|
21
|
+
passbolt:
|
|
22
|
+
resource_id: "your-global-passbolt-resource-id"
|
|
19
23
|
|
|
20
|
-
#
|
|
21
|
-
|
|
24
|
+
# Borg environment options (optional)
|
|
25
|
+
# Configure security settings for Borg operations
|
|
26
|
+
borg_options:
|
|
27
|
+
allow_relocated_repo: false # Reject repos that have been moved (recommended: false)
|
|
28
|
+
allow_unencrypted_repo: false # Reject unencrypted repos (recommended: false)
|
|
22
29
|
|
|
23
|
-
#
|
|
24
|
-
|
|
30
|
+
# Global retention policy (can be overridden per repository)
|
|
31
|
+
# Specify how many backups to keep
|
|
32
|
+
retention:
|
|
33
|
+
keep_hourly: 24 # Keep 24 hourly backups
|
|
34
|
+
keep_daily: 7 # Keep 7 daily backups
|
|
35
|
+
keep_weekly: 4 # Keep 4 weekly backups
|
|
36
|
+
keep_monthly: 6 # Keep 6 monthly backups
|
|
37
|
+
keep_yearly: 1 # Keep 1 yearly backup
|
|
38
|
+
# Alternative time-based retention:
|
|
39
|
+
# keep_within: "7d" # Keep all backups within 7 days
|
|
40
|
+
# keep_last: 30 # Keep last 30 backups
|
|
25
41
|
|
|
26
|
-
#
|
|
27
|
-
|
|
28
|
-
|
|
42
|
+
# Multiple repositories
|
|
43
|
+
repositories:
|
|
44
|
+
# Repository 1: Documents backup
|
|
45
|
+
- name: documents
|
|
46
|
+
description: "Personal and work documents backup"
|
|
47
|
+
path: /mnt/backup/borg-documents
|
|
48
|
+
sources:
|
|
49
|
+
- name: home-docs
|
|
50
|
+
paths:
|
|
51
|
+
- /home/user/Documents
|
|
52
|
+
- /home/user/Desktop
|
|
53
|
+
exclude:
|
|
54
|
+
- "*.tmp"
|
|
55
|
+
- "*.cache"
|
|
56
|
+
- ".git"
|
|
57
|
+
- name: work-docs
|
|
58
|
+
paths:
|
|
59
|
+
- /home/user/Work
|
|
60
|
+
exclude:
|
|
61
|
+
- "*.log"
|
|
62
|
+
- "node_modules"
|
|
63
|
+
|
|
64
|
+
# Repository 2: Database backups with per-file mode
|
|
65
|
+
- name: databases
|
|
66
|
+
description: "MySQL and PostgreSQL database dumps"
|
|
67
|
+
path: /mnt/backup/borg-databases
|
|
68
|
+
retention_mode: per_file # Each file gets its own archive
|
|
69
|
+
# Repository-specific passbolt (overrides global)
|
|
70
|
+
passbolt:
|
|
71
|
+
resource_id: "database-backup-passbolt-id"
|
|
72
|
+
# Repository-specific retention policy
|
|
73
|
+
retention:
|
|
74
|
+
keep_files_modified_within: "30d" # For per-file mode: keep files modified in last 30 days
|
|
75
|
+
keep_daily: 14
|
|
76
|
+
sources:
|
|
77
|
+
- name: mysql-dumps
|
|
78
|
+
paths:
|
|
79
|
+
- /var/backups/mysql
|
|
80
|
+
- name: postgres-dumps
|
|
81
|
+
paths:
|
|
82
|
+
- /var/backups/postgresql
|
|
83
|
+
|
|
84
|
+
# Repository 3: System configuration backups
|
|
85
|
+
- name: system-config
|
|
86
|
+
description: "System and application configuration files"
|
|
87
|
+
path: /mnt/backup/borg-config
|
|
88
|
+
compression: zstd # Repository-specific compression (overrides global)
|
|
89
|
+
encryption: keyfile # Repository-specific encryption (overrides global)
|
|
90
|
+
auto_prune: false # Disable auto-pruning for this repo
|
|
91
|
+
sources:
|
|
92
|
+
- name: etc-configs
|
|
93
|
+
paths:
|
|
94
|
+
- /etc/nginx
|
|
95
|
+
- /etc/systemd/system
|
|
96
|
+
- /etc/fstab
|
|
97
|
+
- name: app-configs
|
|
98
|
+
paths:
|
|
99
|
+
- /home/user/.ssh/config
|
|
100
|
+
- /home/user/.gitconfig
|
|
101
|
+
exclude:
|
|
102
|
+
- "*.key" # Don't backup private keys
|
|
103
|
+
- "*.pem"
|
|
104
|
+
|
|
105
|
+
# Repository 4: Media files (minimal compression, longer retention)
|
|
106
|
+
- name: media
|
|
107
|
+
description: "Photos and videos"
|
|
108
|
+
path: /mnt/backup/borg-media
|
|
109
|
+
compression: none # Media files are already compressed
|
|
110
|
+
retention:
|
|
111
|
+
keep_monthly: 12 # Keep 12 monthly backups
|
|
112
|
+
keep_yearly: 5 # Keep 5 yearly backups
|
|
113
|
+
sources:
|
|
114
|
+
- name: photos
|
|
115
|
+
paths:
|
|
116
|
+
- /home/user/Pictures
|
|
117
|
+
exclude:
|
|
118
|
+
- "*.thumbs"
|
|
119
|
+
- "Thumbs.db"
|
|
120
|
+
|
|
121
|
+
# Usage Examples:
|
|
122
|
+
#
|
|
123
|
+
# Backup all repositories:
|
|
124
|
+
# ruborg backup --all
|
|
125
|
+
#
|
|
126
|
+
# Backup specific repository:
|
|
127
|
+
# ruborg backup --repository documents
|
|
128
|
+
#
|
|
129
|
+
# List archives in a repository:
|
|
130
|
+
# ruborg list --repository documents
|
|
131
|
+
#
|
|
132
|
+
# Restore an archive:
|
|
133
|
+
# ruborg restore archive-name --repository documents --destination /restore/path
|
|
134
|
+
#
|
|
135
|
+
# Check repository integrity:
|
|
136
|
+
# ruborg check --repository documents --verify-data
|
|
137
|
+
#
|
|
138
|
+
# Initialize a new repository manually:
|
|
139
|
+
# ruborg init /path/to/repository --passbolt-id "your-passbolt-id"
|
|
140
|
+
#
|
|
141
|
+
# Get repository information:
|
|
142
|
+
# ruborg info --repository documents
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruborg
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michail Pantelelis
|
|
@@ -10,33 +10,33 @@ cert_chain: []
|
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
|
-
name:
|
|
13
|
+
name: psych
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '
|
|
18
|
+
version: '5.0'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '
|
|
25
|
+
version: '5.0'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
|
-
name:
|
|
27
|
+
name: thor
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
32
|
+
version: '1.3'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '
|
|
39
|
+
version: '1.3'
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: bundler
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -51,6 +51,20 @@ dependencies:
|
|
|
51
51
|
- - "~>"
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
53
|
version: '2.0'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: bundler-audit
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - "~>"
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0.9'
|
|
61
|
+
type: :development
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - "~>"
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '0.9'
|
|
54
68
|
- !ruby/object:Gem::Dependency
|
|
55
69
|
name: rake
|
|
56
70
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -93,10 +107,23 @@ dependencies:
|
|
|
93
107
|
- - "~>"
|
|
94
108
|
- !ruby/object:Gem::Version
|
|
95
109
|
version: '1.0'
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: rubocop-rspec
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - "~>"
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '3.0'
|
|
117
|
+
type: :development
|
|
118
|
+
prerelease: false
|
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - "~>"
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '3.0'
|
|
124
|
+
description: Ruborg provides a user-friendly interface to Borg backup. It reads YAML
|
|
125
|
+
configuration files and orchestrates backup operations, supporting repository creation,
|
|
126
|
+
backup management, and Passbolt integration.
|
|
100
127
|
email:
|
|
101
128
|
- mpantel@aegean.gr
|
|
102
129
|
executables:
|
|
@@ -105,6 +132,7 @@ extensions: []
|
|
|
105
132
|
extra_rdoc_files: []
|
|
106
133
|
files:
|
|
107
134
|
- ".rspec"
|
|
135
|
+
- ".rubocop.yml"
|
|
108
136
|
- CHANGELOG.md
|
|
109
137
|
- CLAUDE.md
|
|
110
138
|
- LICENSE
|
|
@@ -128,6 +156,7 @@ metadata:
|
|
|
128
156
|
homepage_uri: https://github.com/mpantel/ruborg
|
|
129
157
|
source_code_uri: https://github.com/mpantel/ruborg.git
|
|
130
158
|
changelog_uri: https://github.com/mpantel/ruborg/blob/main/CHANGELOG.md
|
|
159
|
+
rubygems_mfa_required: 'true'
|
|
131
160
|
rdoc_options: []
|
|
132
161
|
require_paths:
|
|
133
162
|
- lib
|
|
@@ -142,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
142
171
|
- !ruby/object:Gem::Version
|
|
143
172
|
version: '0'
|
|
144
173
|
requirements: []
|
|
145
|
-
rubygems_version: 3.
|
|
174
|
+
rubygems_version: 3.6.9
|
|
146
175
|
specification_version: 4
|
|
147
176
|
summary: A friendly Ruby frontend for Borg backup
|
|
148
177
|
test_files: []
|