pybackup-engine 0.1.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.
- pybackup_engine-0.1.0/LICENSE +9 -0
- pybackup_engine-0.1.0/PKG-INFO +190 -0
- pybackup_engine-0.1.0/README.md +156 -0
- pybackup_engine-0.1.0/pybackup_engine.egg-info/PKG-INFO +190 -0
- pybackup_engine-0.1.0/pybackup_engine.egg-info/SOURCES.txt +10 -0
- pybackup_engine-0.1.0/pybackup_engine.egg-info/dependency_links.txt +1 -0
- pybackup_engine-0.1.0/pybackup_engine.egg-info/entry_points.txt +2 -0
- pybackup_engine-0.1.0/pybackup_engine.egg-info/requires.txt +9 -0
- pybackup_engine-0.1.0/pybackup_engine.egg-info/top_level.txt +1 -0
- pybackup_engine-0.1.0/pyproject.toml +61 -0
- pybackup_engine-0.1.0/setup.cfg +4 -0
- pybackup_engine-0.1.0/tests/test_all.py +1400 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Selvaraj Iyyappan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pybackup-engine
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Production-grade backup engine for files and databases with a web UI
|
|
5
|
+
Author: pybackup-engine Contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/selvaraj2003/pybackup
|
|
8
|
+
Project-URL: Documentation, https://github.com/selvaraj2003/pybackup
|
|
9
|
+
Project-URL: Repository, https://github.com/selvaraj2003/pybackup
|
|
10
|
+
Project-URL: Issues, https://github.com/selvaraj2003/pybackup
|
|
11
|
+
Keywords: backup,database,mongodb,postgres,mysql,mssql,files
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: System Administrators
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Information Technology
|
|
16
|
+
Classifier: Topic :: System :: Archiving :: Backup
|
|
17
|
+
Classifier: Topic :: System :: Systems Administration
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: click
|
|
26
|
+
Requires-Dist: PyYAML
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
30
|
+
Requires-Dist: black; extra == "dev"
|
|
31
|
+
Requires-Dist: ruff; extra == "dev"
|
|
32
|
+
Requires-Dist: mypy; extra == "dev"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# PyBackup Engine
|
|
36
|
+
|
|
37
|
+
> Production-grade backup engine for files and databases — with a built-in web dashboard.
|
|
38
|
+
|
|
39
|
+
[](https://pypi.org/project/pybackup)
|
|
40
|
+
[](https://python.org)
|
|
41
|
+
[](LICENSE)
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
| Feature | Detail |
|
|
48
|
+
|---|---|
|
|
49
|
+
| **Engines** | Files, MongoDB, PostgreSQL, MySQL, MS SQL Server |
|
|
50
|
+
| **Web Dashboard** | Pure Python stdlib — no Flask/FastAPI/Django |
|
|
51
|
+
| **Database** | SQLite by default (WAL mode, zero config) |
|
|
52
|
+
| **CLI** | `run`, `verify`, `checksum`, `config-check`, `serve` |
|
|
53
|
+
| **Security** | Secrets resolved from env vars, never hard-coded |
|
|
54
|
+
| **Fonts** | Space Grotesk headings · Inter body |
|
|
55
|
+
| **Theme** | Dark / Light toggle |
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Install
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install pybackup
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
### 1. Write a config
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
# pybackup.yaml
|
|
73
|
+
version: 1
|
|
74
|
+
|
|
75
|
+
global:
|
|
76
|
+
backup_root: /backups
|
|
77
|
+
retention_days: 7
|
|
78
|
+
compress: true
|
|
79
|
+
log_level: INFO
|
|
80
|
+
|
|
81
|
+
postgresql:
|
|
82
|
+
enabled: true
|
|
83
|
+
name: prod-db
|
|
84
|
+
host: localhost
|
|
85
|
+
port: 5432
|
|
86
|
+
database: myapp
|
|
87
|
+
username: backup_user
|
|
88
|
+
password: ${PGPASSWORD} # resolved from env
|
|
89
|
+
|
|
90
|
+
files:
|
|
91
|
+
enabled: true
|
|
92
|
+
name: app-configs
|
|
93
|
+
source: /etc/myapp
|
|
94
|
+
exclude: ["*.log", "*.tmp"]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 2. Run backups
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pybackup run --config pybackup.yaml
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 3. Start the dashboard
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
pybackup serve --port 8741
|
|
107
|
+
# → http://localhost:8741
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## CLI Reference
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
pybackup run -c config.yaml [--dry-run]
|
|
116
|
+
pybackup verify FILE -s CHECKSUM [-a sha256]
|
|
117
|
+
pybackup checksum FILE [-a sha256]
|
|
118
|
+
pybackup config-check -c config.yaml
|
|
119
|
+
pybackup serve [--host 0.0.0.0] [--port 8741] [--db /path/to.db]
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Dashboard
|
|
125
|
+
|
|
126
|
+
The built-in web server serves a single-page dashboard with:
|
|
127
|
+
|
|
128
|
+
- **Stats cards** — total runs, success, failed, success rate
|
|
129
|
+
- **Activity chart** — 30-day bar chart (Chart.js)
|
|
130
|
+
- **Engine doughnut** — breakdown by engine
|
|
131
|
+
- **Run history** — filterable, paginated table with delete support
|
|
132
|
+
- **Run detail modal** — full metadata including error messages
|
|
133
|
+
- **Settings** — theme, retention, log level persisted to SQLite
|
|
134
|
+
- **Dark / Light** theme toggle (Space Grotesk + Inter fonts)
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## REST API
|
|
139
|
+
|
|
140
|
+
All served under `/api/`:
|
|
141
|
+
|
|
142
|
+
| Method | Path | Description |
|
|
143
|
+
|---|---|---|
|
|
144
|
+
| GET | `/api/stats` | Dashboard statistics |
|
|
145
|
+
| GET | `/api/runs` | Paginated run list (`?limit=&offset=&job=&status=`) |
|
|
146
|
+
| POST | `/api/runs` | Create a run entry |
|
|
147
|
+
| GET | `/api/runs/:id` | Single run detail + files |
|
|
148
|
+
| DELETE | `/api/runs/:id` | Delete a run |
|
|
149
|
+
| GET | `/api/settings` | All settings |
|
|
150
|
+
| POST | `/api/settings` | Update settings |
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Project Structure
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
pybackup/
|
|
158
|
+
├── cli.py # Click CLI entry point
|
|
159
|
+
├── constants.py # Global defaults
|
|
160
|
+
├── config/
|
|
161
|
+
│ └── loader.py # YAML loader + validation
|
|
162
|
+
├── engine/
|
|
163
|
+
│ ├── base.py # Abstract BaseBackupEngine
|
|
164
|
+
│ ├── files.py # File/dir backup
|
|
165
|
+
│ ├── mongo.py # MongoDB (mongodump)
|
|
166
|
+
│ ├── postgres.py # PostgreSQL (pg_dump)
|
|
167
|
+
│ ├── mysql.py # MySQL (mysqldump)
|
|
168
|
+
│ ├── mssql.py # MSSQL (sqlcmd)
|
|
169
|
+
│ ├── verify.py # Checksum verification
|
|
170
|
+
│ └── manifest.py # JSON manifests
|
|
171
|
+
├── db/
|
|
172
|
+
│ └── database.py # SQLite persistence layer
|
|
173
|
+
├── server/
|
|
174
|
+
│ ├── httpserver.py # Pure stdlib HTTP server + Router
|
|
175
|
+
│ └── handlers.py # REST API handlers
|
|
176
|
+
├── static/
|
|
177
|
+
│ ├── index.html # SPA dashboard
|
|
178
|
+
│ ├── css/app.css # Styles (Space Grotesk + Inter)
|
|
179
|
+
│ └── js/app.js # Vanilla JS SPA
|
|
180
|
+
└── utils/
|
|
181
|
+
├── exceptions.py # Exception hierarchy
|
|
182
|
+
├── logger.py # Logging setup
|
|
183
|
+
└── security.py # Secret resolution + masking
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## License
|
|
189
|
+
|
|
190
|
+
MIT
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# PyBackup Engine
|
|
2
|
+
|
|
3
|
+
> Production-grade backup engine for files and databases — with a built-in web dashboard.
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/pybackup)
|
|
6
|
+
[](https://python.org)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
| Feature | Detail |
|
|
14
|
+
|---|---|
|
|
15
|
+
| **Engines** | Files, MongoDB, PostgreSQL, MySQL, MS SQL Server |
|
|
16
|
+
| **Web Dashboard** | Pure Python stdlib — no Flask/FastAPI/Django |
|
|
17
|
+
| **Database** | SQLite by default (WAL mode, zero config) |
|
|
18
|
+
| **CLI** | `run`, `verify`, `checksum`, `config-check`, `serve` |
|
|
19
|
+
| **Security** | Secrets resolved from env vars, never hard-coded |
|
|
20
|
+
| **Fonts** | Space Grotesk headings · Inter body |
|
|
21
|
+
| **Theme** | Dark / Light toggle |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install pybackup
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
### 1. Write a config
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
# pybackup.yaml
|
|
39
|
+
version: 1
|
|
40
|
+
|
|
41
|
+
global:
|
|
42
|
+
backup_root: /backups
|
|
43
|
+
retention_days: 7
|
|
44
|
+
compress: true
|
|
45
|
+
log_level: INFO
|
|
46
|
+
|
|
47
|
+
postgresql:
|
|
48
|
+
enabled: true
|
|
49
|
+
name: prod-db
|
|
50
|
+
host: localhost
|
|
51
|
+
port: 5432
|
|
52
|
+
database: myapp
|
|
53
|
+
username: backup_user
|
|
54
|
+
password: ${PGPASSWORD} # resolved from env
|
|
55
|
+
|
|
56
|
+
files:
|
|
57
|
+
enabled: true
|
|
58
|
+
name: app-configs
|
|
59
|
+
source: /etc/myapp
|
|
60
|
+
exclude: ["*.log", "*.tmp"]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 2. Run backups
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pybackup run --config pybackup.yaml
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 3. Start the dashboard
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pybackup serve --port 8741
|
|
73
|
+
# → http://localhost:8741
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## CLI Reference
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
pybackup run -c config.yaml [--dry-run]
|
|
82
|
+
pybackup verify FILE -s CHECKSUM [-a sha256]
|
|
83
|
+
pybackup checksum FILE [-a sha256]
|
|
84
|
+
pybackup config-check -c config.yaml
|
|
85
|
+
pybackup serve [--host 0.0.0.0] [--port 8741] [--db /path/to.db]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Dashboard
|
|
91
|
+
|
|
92
|
+
The built-in web server serves a single-page dashboard with:
|
|
93
|
+
|
|
94
|
+
- **Stats cards** — total runs, success, failed, success rate
|
|
95
|
+
- **Activity chart** — 30-day bar chart (Chart.js)
|
|
96
|
+
- **Engine doughnut** — breakdown by engine
|
|
97
|
+
- **Run history** — filterable, paginated table with delete support
|
|
98
|
+
- **Run detail modal** — full metadata including error messages
|
|
99
|
+
- **Settings** — theme, retention, log level persisted to SQLite
|
|
100
|
+
- **Dark / Light** theme toggle (Space Grotesk + Inter fonts)
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## REST API
|
|
105
|
+
|
|
106
|
+
All served under `/api/`:
|
|
107
|
+
|
|
108
|
+
| Method | Path | Description |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| GET | `/api/stats` | Dashboard statistics |
|
|
111
|
+
| GET | `/api/runs` | Paginated run list (`?limit=&offset=&job=&status=`) |
|
|
112
|
+
| POST | `/api/runs` | Create a run entry |
|
|
113
|
+
| GET | `/api/runs/:id` | Single run detail + files |
|
|
114
|
+
| DELETE | `/api/runs/:id` | Delete a run |
|
|
115
|
+
| GET | `/api/settings` | All settings |
|
|
116
|
+
| POST | `/api/settings` | Update settings |
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Project Structure
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
pybackup/
|
|
124
|
+
├── cli.py # Click CLI entry point
|
|
125
|
+
├── constants.py # Global defaults
|
|
126
|
+
├── config/
|
|
127
|
+
│ └── loader.py # YAML loader + validation
|
|
128
|
+
├── engine/
|
|
129
|
+
│ ├── base.py # Abstract BaseBackupEngine
|
|
130
|
+
│ ├── files.py # File/dir backup
|
|
131
|
+
│ ├── mongo.py # MongoDB (mongodump)
|
|
132
|
+
│ ├── postgres.py # PostgreSQL (pg_dump)
|
|
133
|
+
│ ├── mysql.py # MySQL (mysqldump)
|
|
134
|
+
│ ├── mssql.py # MSSQL (sqlcmd)
|
|
135
|
+
│ ├── verify.py # Checksum verification
|
|
136
|
+
│ └── manifest.py # JSON manifests
|
|
137
|
+
├── db/
|
|
138
|
+
│ └── database.py # SQLite persistence layer
|
|
139
|
+
├── server/
|
|
140
|
+
│ ├── httpserver.py # Pure stdlib HTTP server + Router
|
|
141
|
+
│ └── handlers.py # REST API handlers
|
|
142
|
+
├── static/
|
|
143
|
+
│ ├── index.html # SPA dashboard
|
|
144
|
+
│ ├── css/app.css # Styles (Space Grotesk + Inter)
|
|
145
|
+
│ └── js/app.js # Vanilla JS SPA
|
|
146
|
+
└── utils/
|
|
147
|
+
├── exceptions.py # Exception hierarchy
|
|
148
|
+
├── logger.py # Logging setup
|
|
149
|
+
└── security.py # Secret resolution + masking
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## License
|
|
155
|
+
|
|
156
|
+
MIT
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pybackup-engine
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Production-grade backup engine for files and databases with a web UI
|
|
5
|
+
Author: pybackup-engine Contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/selvaraj2003/pybackup
|
|
8
|
+
Project-URL: Documentation, https://github.com/selvaraj2003/pybackup
|
|
9
|
+
Project-URL: Repository, https://github.com/selvaraj2003/pybackup
|
|
10
|
+
Project-URL: Issues, https://github.com/selvaraj2003/pybackup
|
|
11
|
+
Keywords: backup,database,mongodb,postgres,mysql,mssql,files
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: System Administrators
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Information Technology
|
|
16
|
+
Classifier: Topic :: System :: Archiving :: Backup
|
|
17
|
+
Classifier: Topic :: System :: Systems Administration
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: click
|
|
26
|
+
Requires-Dist: PyYAML
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
30
|
+
Requires-Dist: black; extra == "dev"
|
|
31
|
+
Requires-Dist: ruff; extra == "dev"
|
|
32
|
+
Requires-Dist: mypy; extra == "dev"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# PyBackup Engine
|
|
36
|
+
|
|
37
|
+
> Production-grade backup engine for files and databases — with a built-in web dashboard.
|
|
38
|
+
|
|
39
|
+
[](https://pypi.org/project/pybackup)
|
|
40
|
+
[](https://python.org)
|
|
41
|
+
[](LICENSE)
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
| Feature | Detail |
|
|
48
|
+
|---|---|
|
|
49
|
+
| **Engines** | Files, MongoDB, PostgreSQL, MySQL, MS SQL Server |
|
|
50
|
+
| **Web Dashboard** | Pure Python stdlib — no Flask/FastAPI/Django |
|
|
51
|
+
| **Database** | SQLite by default (WAL mode, zero config) |
|
|
52
|
+
| **CLI** | `run`, `verify`, `checksum`, `config-check`, `serve` |
|
|
53
|
+
| **Security** | Secrets resolved from env vars, never hard-coded |
|
|
54
|
+
| **Fonts** | Space Grotesk headings · Inter body |
|
|
55
|
+
| **Theme** | Dark / Light toggle |
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Install
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install pybackup
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
### 1. Write a config
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
# pybackup.yaml
|
|
73
|
+
version: 1
|
|
74
|
+
|
|
75
|
+
global:
|
|
76
|
+
backup_root: /backups
|
|
77
|
+
retention_days: 7
|
|
78
|
+
compress: true
|
|
79
|
+
log_level: INFO
|
|
80
|
+
|
|
81
|
+
postgresql:
|
|
82
|
+
enabled: true
|
|
83
|
+
name: prod-db
|
|
84
|
+
host: localhost
|
|
85
|
+
port: 5432
|
|
86
|
+
database: myapp
|
|
87
|
+
username: backup_user
|
|
88
|
+
password: ${PGPASSWORD} # resolved from env
|
|
89
|
+
|
|
90
|
+
files:
|
|
91
|
+
enabled: true
|
|
92
|
+
name: app-configs
|
|
93
|
+
source: /etc/myapp
|
|
94
|
+
exclude: ["*.log", "*.tmp"]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 2. Run backups
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pybackup run --config pybackup.yaml
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 3. Start the dashboard
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
pybackup serve --port 8741
|
|
107
|
+
# → http://localhost:8741
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## CLI Reference
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
pybackup run -c config.yaml [--dry-run]
|
|
116
|
+
pybackup verify FILE -s CHECKSUM [-a sha256]
|
|
117
|
+
pybackup checksum FILE [-a sha256]
|
|
118
|
+
pybackup config-check -c config.yaml
|
|
119
|
+
pybackup serve [--host 0.0.0.0] [--port 8741] [--db /path/to.db]
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Dashboard
|
|
125
|
+
|
|
126
|
+
The built-in web server serves a single-page dashboard with:
|
|
127
|
+
|
|
128
|
+
- **Stats cards** — total runs, success, failed, success rate
|
|
129
|
+
- **Activity chart** — 30-day bar chart (Chart.js)
|
|
130
|
+
- **Engine doughnut** — breakdown by engine
|
|
131
|
+
- **Run history** — filterable, paginated table with delete support
|
|
132
|
+
- **Run detail modal** — full metadata including error messages
|
|
133
|
+
- **Settings** — theme, retention, log level persisted to SQLite
|
|
134
|
+
- **Dark / Light** theme toggle (Space Grotesk + Inter fonts)
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## REST API
|
|
139
|
+
|
|
140
|
+
All served under `/api/`:
|
|
141
|
+
|
|
142
|
+
| Method | Path | Description |
|
|
143
|
+
|---|---|---|
|
|
144
|
+
| GET | `/api/stats` | Dashboard statistics |
|
|
145
|
+
| GET | `/api/runs` | Paginated run list (`?limit=&offset=&job=&status=`) |
|
|
146
|
+
| POST | `/api/runs` | Create a run entry |
|
|
147
|
+
| GET | `/api/runs/:id` | Single run detail + files |
|
|
148
|
+
| DELETE | `/api/runs/:id` | Delete a run |
|
|
149
|
+
| GET | `/api/settings` | All settings |
|
|
150
|
+
| POST | `/api/settings` | Update settings |
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Project Structure
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
pybackup/
|
|
158
|
+
├── cli.py # Click CLI entry point
|
|
159
|
+
├── constants.py # Global defaults
|
|
160
|
+
├── config/
|
|
161
|
+
│ └── loader.py # YAML loader + validation
|
|
162
|
+
├── engine/
|
|
163
|
+
│ ├── base.py # Abstract BaseBackupEngine
|
|
164
|
+
│ ├── files.py # File/dir backup
|
|
165
|
+
│ ├── mongo.py # MongoDB (mongodump)
|
|
166
|
+
│ ├── postgres.py # PostgreSQL (pg_dump)
|
|
167
|
+
│ ├── mysql.py # MySQL (mysqldump)
|
|
168
|
+
│ ├── mssql.py # MSSQL (sqlcmd)
|
|
169
|
+
│ ├── verify.py # Checksum verification
|
|
170
|
+
│ └── manifest.py # JSON manifests
|
|
171
|
+
├── db/
|
|
172
|
+
│ └── database.py # SQLite persistence layer
|
|
173
|
+
├── server/
|
|
174
|
+
│ ├── httpserver.py # Pure stdlib HTTP server + Router
|
|
175
|
+
│ └── handlers.py # REST API handlers
|
|
176
|
+
├── static/
|
|
177
|
+
│ ├── index.html # SPA dashboard
|
|
178
|
+
│ ├── css/app.css # Styles (Space Grotesk + Inter)
|
|
179
|
+
│ └── js/app.js # Vanilla JS SPA
|
|
180
|
+
└── utils/
|
|
181
|
+
├── exceptions.py # Exception hierarchy
|
|
182
|
+
├── logger.py # Logging setup
|
|
183
|
+
└── security.py # Secret resolution + masking
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## License
|
|
189
|
+
|
|
190
|
+
MIT
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
pybackup_engine.egg-info/PKG-INFO
|
|
5
|
+
pybackup_engine.egg-info/SOURCES.txt
|
|
6
|
+
pybackup_engine.egg-info/dependency_links.txt
|
|
7
|
+
pybackup_engine.egg-info/entry_points.txt
|
|
8
|
+
pybackup_engine.egg-info/requires.txt
|
|
9
|
+
pybackup_engine.egg-info/top_level.txt
|
|
10
|
+
tests/test_all.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pybackup-engine"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Production-grade backup engine for files and databases with a web UI"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [{ name = "pybackup-engine Contributors" }]
|
|
13
|
+
keywords = ["backup", "database", "mongodb", "postgres", "mysql", "mssql", "files"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: System Administrators",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Intended Audience :: Information Technology",
|
|
19
|
+
"Topic :: System :: Archiving :: Backup",
|
|
20
|
+
"Topic :: System :: Systems Administration",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Operating System :: POSIX :: Linux"
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
dependencies = [
|
|
28
|
+
"click",
|
|
29
|
+
"PyYAML",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
dev = ["pytest>=7.0", "pytest-cov", "black", "ruff", "mypy"]
|
|
34
|
+
|
|
35
|
+
[project.scripts]
|
|
36
|
+
pybackup = "pybackup.cli:main"
|
|
37
|
+
|
|
38
|
+
[project.urls]
|
|
39
|
+
Homepage = "https://github.com/selvaraj2003/pybackup"
|
|
40
|
+
Documentation = "https://github.com/selvaraj2003/pybackup"
|
|
41
|
+
Repository = "https://github.com/selvaraj2003/pybackup"
|
|
42
|
+
Issues = "https://github.com/selvaraj2003/pybackup"
|
|
43
|
+
|
|
44
|
+
[tool.setuptools.packages.find]
|
|
45
|
+
where = ["."]
|
|
46
|
+
include = ["pybackup-engine*"]
|
|
47
|
+
|
|
48
|
+
[tool.setuptools.package-data]
|
|
49
|
+
"pybackup.static" = ["**/*"]
|
|
50
|
+
|
|
51
|
+
[tool.black]
|
|
52
|
+
line-length = 100
|
|
53
|
+
target-version = ["py311"]
|
|
54
|
+
|
|
55
|
+
[tool.ruff]
|
|
56
|
+
line-length = 100
|
|
57
|
+
select = ["E", "F", "W", "I", "UP"]
|
|
58
|
+
|
|
59
|
+
[tool.mypy]
|
|
60
|
+
python_version = "3.11"
|
|
61
|
+
strict = true
|