backfort 1.3.0__tar.gz
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.
- backfort-1.3.0/.gitignore +103 -0
- backfort-1.3.0/LICENSE +21 -0
- backfort-1.3.0/PKG-INFO +140 -0
- backfort-1.3.0/README.md +1548 -0
- backfort-1.3.0/backfort.sh +7712 -0
- backfort-1.3.0/config.example.yaml +157 -0
- backfort-1.3.0/docs/pypi.md +107 -0
- backfort-1.3.0/pyproject.toml +91 -0
- backfort-1.3.0/run_backfort.py +17 -0
- backfort-1.3.0/src/backfort/__init__.py +1 -0
- backfort-1.3.0/src/backfort/__main__.py +6 -0
- backfort-1.3.0/src/backfort/cli.py +60 -0
- backfort-1.3.0/tests/python_package.py +273 -0
- backfort-1.3.0/tests/test_python_launcher.py +208 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Local configuration and secrets
|
|
2
|
+
config.yaml
|
|
3
|
+
config.local.yaml
|
|
4
|
+
config.*.local.yaml
|
|
5
|
+
config.secret.yaml
|
|
6
|
+
config.*.secret.yaml
|
|
7
|
+
.env
|
|
8
|
+
.env.*
|
|
9
|
+
!.env.example
|
|
10
|
+
environment
|
|
11
|
+
*.key
|
|
12
|
+
*.pem
|
|
13
|
+
*.p12
|
|
14
|
+
*.pfx
|
|
15
|
+
*.crt
|
|
16
|
+
*.credentials
|
|
17
|
+
*.secret
|
|
18
|
+
|
|
19
|
+
# Runtime data
|
|
20
|
+
*.log
|
|
21
|
+
*.log.*
|
|
22
|
+
*.pid
|
|
23
|
+
*.lock
|
|
24
|
+
*.state
|
|
25
|
+
*.last-action
|
|
26
|
+
logs/
|
|
27
|
+
state/
|
|
28
|
+
run/
|
|
29
|
+
|
|
30
|
+
# Temporary files and test artifacts
|
|
31
|
+
.test-bin/
|
|
32
|
+
.tmp/
|
|
33
|
+
tmp/
|
|
34
|
+
temp/
|
|
35
|
+
coverage/
|
|
36
|
+
test-results/
|
|
37
|
+
*.tmp
|
|
38
|
+
*.temp
|
|
39
|
+
*.bak
|
|
40
|
+
*.old
|
|
41
|
+
*.orig
|
|
42
|
+
*.rej
|
|
43
|
+
*~
|
|
44
|
+
|
|
45
|
+
# IDEs and editors
|
|
46
|
+
.idea/
|
|
47
|
+
*.iml
|
|
48
|
+
*.ipr
|
|
49
|
+
*.iws
|
|
50
|
+
.vscode/
|
|
51
|
+
!.vscode/extensions.json
|
|
52
|
+
!.vscode/settings.example.json
|
|
53
|
+
.fleet/
|
|
54
|
+
.zed/
|
|
55
|
+
*.swp
|
|
56
|
+
*.swo
|
|
57
|
+
*.swn
|
|
58
|
+
|
|
59
|
+
# Operating-system metadata
|
|
60
|
+
.DS_Store
|
|
61
|
+
.AppleDouble
|
|
62
|
+
.LSOverride
|
|
63
|
+
._*
|
|
64
|
+
Thumbs.db
|
|
65
|
+
Thumbs.db:encryptable
|
|
66
|
+
ehthumbs.db
|
|
67
|
+
Desktop.ini
|
|
68
|
+
$RECYCLE.BIN/
|
|
69
|
+
.Spotlight-V100/
|
|
70
|
+
.Trashes/
|
|
71
|
+
|
|
72
|
+
# Tool caches and reports
|
|
73
|
+
.cache/
|
|
74
|
+
.pytest_cache/
|
|
75
|
+
__pycache__/
|
|
76
|
+
*.py[cod]
|
|
77
|
+
.mypy_cache/
|
|
78
|
+
.ruff_cache/
|
|
79
|
+
.shellcheckrc.local
|
|
80
|
+
*.lcov
|
|
81
|
+
|
|
82
|
+
# Archives and release artifacts
|
|
83
|
+
dist/
|
|
84
|
+
build/
|
|
85
|
+
release/
|
|
86
|
+
*.tar
|
|
87
|
+
*.tar.gz
|
|
88
|
+
*.tgz
|
|
89
|
+
*.zip
|
|
90
|
+
|
|
91
|
+
*.partial.*
|
|
92
|
+
.backfort-test/
|
|
93
|
+
|
|
94
|
+
.ai/
|
|
95
|
+
.codex/
|
|
96
|
+
.cursor/
|
|
97
|
+
.windsurfrules
|
|
98
|
+
AGENTS.md
|
|
99
|
+
AI_CONTEXT.md
|
|
100
|
+
CLAUDE.md
|
|
101
|
+
GEMINI.md
|
|
102
|
+
KIMI.md
|
|
103
|
+
MANUS.md
|
backfort-1.3.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Igor Sazonov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
backfort-1.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: backfort
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: Recovery-first Linux backups for files, Docker Compose and databases
|
|
5
|
+
Project-URL: Homepage, https://github.com/shellharbor/backfort
|
|
6
|
+
Project-URL: Documentation, https://github.com/shellharbor/backfort/tree/main/wiki
|
|
7
|
+
Project-URL: Repository, https://github.com/shellharbor/backfort
|
|
8
|
+
Project-URL: Issues, https://github.com/shellharbor/backfort/issues
|
|
9
|
+
Author: Igor Sazonov
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: backup,docker-compose,encryption,restore,s3
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Programming Language :: Unix Shell
|
|
24
|
+
Classifier: Topic :: System :: Archiving :: Backup
|
|
25
|
+
Requires-Python: >=3.11
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: build<2,>=1.2.2; extra == 'dev'
|
|
28
|
+
Requires-Dist: coverage[toml]<8,>=7.6; extra == 'dev'
|
|
29
|
+
Requires-Dist: hatchling<2,>=1.27; extra == 'dev'
|
|
30
|
+
Requires-Dist: ruff<1,>=0.12; extra == 'dev'
|
|
31
|
+
Requires-Dist: twine<7,>=6; extra == 'dev'
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# Backfort for Python
|
|
35
|
+
|
|
36
|
+
Recovery-first Linux backups for files, Docker Compose applications and databases.
|
|
37
|
+
This distribution bundles Backfort's canonical Bash engine and example YAML;
|
|
38
|
+
it is a Python launcher, **not a Python rewrite** or a new backup format.
|
|
39
|
+
|
|
40
|
+
## Requirements
|
|
41
|
+
|
|
42
|
+
- Python 3.11+ and Linux. Use WSL or the existing Docker image on Windows.
|
|
43
|
+
- Bash 4.3+, GNU tar, coreutils, findutils, util-linux and gzip.
|
|
44
|
+
- Mike Farah `yq` v4. The Python package named `yq` is not compatible.
|
|
45
|
+
- Feature-specific tools such as rclone, age, GPG, Minisign or Docker Compose
|
|
46
|
+
when the job enables them. Python installation does not install system tools.
|
|
47
|
+
|
|
48
|
+
## Install and run
|
|
49
|
+
|
|
50
|
+
Install Backfort 1.3.0 with pipx, keeping the launcher isolated:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pipx install 'backfort==1.3.0'
|
|
54
|
+
backfort --version
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Or install inside a virtual environment:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
python3 -m venv .venv
|
|
61
|
+
.venv/bin/python -m pip install 'backfort==1.3.0'
|
|
62
|
+
.venv/bin/backfort --version
|
|
63
|
+
.venv/bin/python -m backfort --help
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
From a trusted source checkout, replace the install target with `.`.
|
|
67
|
+
Do not install into a system-managed Python. For privileged backups, use a
|
|
68
|
+
protected installation, never a user-writable environment executed as root.
|
|
69
|
+
No package is downloaded, published or installed system-wide by the Backfort
|
|
70
|
+
launcher itself.
|
|
71
|
+
|
|
72
|
+
The installed `backfort` command and `python -m backfort` accept the same
|
|
73
|
+
arguments as `backfort.sh`. From a checkout, `python3 run_backfort.py` works
|
|
74
|
+
without installing the package, including from another working directory.
|
|
75
|
+
The launcher replaces itself with Bash, preserving arguments, environment,
|
|
76
|
+
terminal I/O, signals and the engine's exit status. It does not invoke a shell
|
|
77
|
+
command string, download a script, install dependencies or elevate privileges.
|
|
78
|
+
|
|
79
|
+
## First configuration
|
|
80
|
+
|
|
81
|
+
Print the bundled reference config to stdout. Choose a new filename: shell
|
|
82
|
+
redirection overwrites an existing file.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
.venv/bin/backfort --print-example-config > backfort.example.yaml
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Edit its host ID, source paths, destination paths, encryption and retention
|
|
89
|
+
before use. Paths are absolute, and backup/state/work directories must stay
|
|
90
|
+
outside the source tree. Then validate the plan:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
.venv/bin/backfort -c "$PWD/backfort.example.yaml" doctor
|
|
94
|
+
.venv/bin/backfort -c "$PWD/backfort.example.yaml" --dry-run run
|
|
95
|
+
.venv/bin/backfort -c "$PWD/backfort.example.yaml" run
|
|
96
|
+
.venv/bin/backfort -c "$PWD/backfort.example.yaml" list
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The sole launcher-specific flag is `--print-example-config`, used alone. All
|
|
100
|
+
other argument parsing and validation belong to the existing Bash CLI.
|
|
101
|
+
|
|
102
|
+
## Quick backup
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
.venv/bin/backfort quick /srv/application \
|
|
106
|
+
--name before-upgrade \
|
|
107
|
+
--to /srv/backups/backfort \
|
|
108
|
+
--state-directory /var/lib/backfort \
|
|
109
|
+
--exclude '*.log'
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The execution account needs access to those paths. Quick mode saves a
|
|
113
|
+
non-secret recovery config in the chosen state directory. Use a saved YAML
|
|
114
|
+
job for encryption, signing, lifecycle hooks and Prometheus textfile metrics.
|
|
115
|
+
|
|
116
|
+
## Verify and recover
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
.venv/bin/backfort -c /etc/backfort/config.yaml \
|
|
120
|
+
verify latest --job application --full
|
|
121
|
+
.venv/bin/backfort -c /etc/backfort/config.yaml \
|
|
122
|
+
restore latest --job application --to /srv/empty-recovery
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Adapt the job name. Recovery requires a new or empty target and the necessary
|
|
126
|
+
keys. Preserve the original `host_id` for automatic `latest` discovery, or
|
|
127
|
+
deliberately select a full backup ID. Full ownership/ACL/xattr recovery needs
|
|
128
|
+
the same privileges and filesystem support as the native Bash installation.
|
|
129
|
+
|
|
130
|
+
Exit codes remain `0` success, `1` partial copies, `2` invalid input or
|
|
131
|
+
prerequisites, and `3` an operational/copy-policy failure. Launcher errors also
|
|
132
|
+
return `2`. Pruning is a separate command; backup creation does not prune.
|
|
133
|
+
|
|
134
|
+
## Learn more
|
|
135
|
+
|
|
136
|
+
- [Repository and full documentation](https://github.com/shellharbor/backfort)
|
|
137
|
+
- [Python installation and publishing](https://github.com/shellharbor/backfort/blob/main/wiki/Python-and-PyPI.md)
|
|
138
|
+
- [Examples](https://github.com/shellharbor/backfort/tree/main/examples)
|
|
139
|
+
- [Security policy](https://github.com/shellharbor/backfort/blob/main/SECURITY.md)
|
|
140
|
+
- [MIT License](https://github.com/shellharbor/backfort/blob/main/LICENSE)
|