organum-backup 0.4.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.
- organum_backup-0.4.0/LICENSE +21 -0
- organum_backup-0.4.0/PKG-INFO +165 -0
- organum_backup-0.4.0/README.md +146 -0
- organum_backup-0.4.0/pyproject.toml +35 -0
- organum_backup-0.4.0/setup.cfg +4 -0
- organum_backup-0.4.0/src/organum_backup/PROFILE_EXAMPLE.json +44 -0
- organum_backup-0.4.0/src/organum_backup/__init__.py +3 -0
- organum_backup-0.4.0/src/organum_backup/backup_bridge.py +480 -0
- organum_backup-0.4.0/src/organum_backup/backup_desk.html +703 -0
- organum_backup-0.4.0/src/organum_backup/backup_operator.py +1018 -0
- organum_backup-0.4.0/src/organum_backup/profile_contract.py +196 -0
- organum_backup-0.4.0/src/organum_backup/receipt_reader.py +284 -0
- organum_backup-0.4.0/src/organum_backup/rollback_check.py +266 -0
- organum_backup-0.4.0/src/organum_backup/schedule_plan.py +324 -0
- organum_backup-0.4.0/src/organum_backup/schedule_state.py +125 -0
- organum_backup-0.4.0/src/organum_backup/source_capture.py +248 -0
- organum_backup-0.4.0/src/organum_backup.egg-info/PKG-INFO +165 -0
- organum_backup-0.4.0/src/organum_backup.egg-info/SOURCES.txt +37 -0
- organum_backup-0.4.0/src/organum_backup.egg-info/dependency_links.txt +1 -0
- organum_backup-0.4.0/src/organum_backup.egg-info/entry_points.txt +3 -0
- organum_backup-0.4.0/src/organum_backup.egg-info/top_level.txt +1 -0
- organum_backup-0.4.0/tests/test_backup.py +349 -0
- organum_backup-0.4.0/tests/test_bridge.py +384 -0
- organum_backup-0.4.0/tests/test_candidate.py +52 -0
- organum_backup-0.4.0/tests/test_capture_guard.py +198 -0
- organum_backup-0.4.0/tests/test_delivery.py +84 -0
- organum_backup-0.4.0/tests/test_desk_receipts.py +128 -0
- organum_backup-0.4.0/tests/test_halt.py +93 -0
- organum_backup-0.4.0/tests/test_identifiers.py +163 -0
- organum_backup-0.4.0/tests/test_lock.py +158 -0
- organum_backup-0.4.0/tests/test_migration.py +225 -0
- organum_backup-0.4.0/tests/test_real_restic.py +68 -0
- organum_backup-0.4.0/tests/test_receipt_reader.py +255 -0
- organum_backup-0.4.0/tests/test_receipts.py +418 -0
- organum_backup-0.4.0/tests/test_rollback_check.py +436 -0
- organum_backup-0.4.0/tests/test_same_place.py +85 -0
- organum_backup-0.4.0/tests/test_schedule_plan.py +351 -0
- organum_backup-0.4.0/tests/test_select.py +116 -0
- organum_backup-0.4.0/tests/test_source_capture.py +250 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jihoon Jeong
|
|
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.
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: organum-backup
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: Encrypted, restorable snapshots of the places agent state lives - a careful wrapper around restic and your own rclone remote.
|
|
5
|
+
Author: Jihoon Jeong
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://ludex-lab.github.io/organum/
|
|
8
|
+
Project-URL: Repository, https://github.com/ludex-lab/organum-backup
|
|
9
|
+
Keywords: backup,restic,rclone,agent,organism-engineering
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# organum-backup
|
|
21
|
+
|
|
22
|
+
Encrypted, restorable snapshots of the places agent state lives — a careful wrapper around
|
|
23
|
+
[restic](https://restic.net) and **your own** [rclone](https://rclone.org) remote.
|
|
24
|
+
|
|
25
|
+
> **Status: 0.4.0 (macOS on Apple Silicon).**
|
|
26
|
+
> Install via `pip install organum-backup` or `pip install "organum[backup]"`.
|
|
27
|
+
|
|
28
|
+
Part of the [organum](https://github.com/ludex-lab/organum) family, shipped as its own package:
|
|
29
|
+
organum's core stays standard-library-only and read-only; this tool downloads nothing by itself
|
|
30
|
+
but drives restic and rclone, reads one Keychain item, and writes when you restore.
|
|
31
|
+
|
|
32
|
+
## Why it exists
|
|
33
|
+
|
|
34
|
+
Agents keep their memory, session stores and working state in places git does not protect —
|
|
35
|
+
ignored folders, SQLite files, app data. On 2026-11-21 one mistaken `git sparse-checkout` in a
|
|
36
|
+
working repository deleted some fifty ignored folders of agent state. Nothing on the machine had a copy
|
|
37
|
+
newer than two months. That morning's snapshot from this tool restored them into a separate
|
|
38
|
+
folder, and the workspace reopened the same evening.
|
|
39
|
+
|
|
40
|
+
## Bring your own remote (no bundled OAuth client)
|
|
41
|
+
|
|
42
|
+
`organum-backup` ships **no OAuth client, no cloud credentials, and no bundled binaries**.
|
|
43
|
+
Install `restic` (v0.19+) and `rclone` yourself (e.g. `brew install restic rclone`), then point your
|
|
44
|
+
profile's `repository` at either:
|
|
45
|
+
|
|
46
|
+
1. **A local path** (`"kind": "local"`, `"location": "/Volumes/BackupDrive/organum-backup"`), or
|
|
47
|
+
2. **Any `rclone` remote you configure** (`"kind": "rclone"`, `"location": "my-remote:PersonalBackup"`):
|
|
48
|
+
S3, Backblaze B2, Cloudflare R2, SFTP, Google Drive (with your own OAuth client in `rclone config`),
|
|
49
|
+
or any other backend `rclone` supports.
|
|
50
|
+
|
|
51
|
+
Store a **printable ASCII** repository password in macOS Keychain (non-ASCII items are rejected because
|
|
52
|
+
macOS `security -w` hex-encodes them, breaking standalone `restic` compatibility):
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
PASS="$(python3 -c 'import secrets; print(secrets.token_urlsafe(32))')"
|
|
56
|
+
security add-generic-password -s organum.backup -a personal-files -w "$PASS"
|
|
57
|
+
# Write $PASS down in your offline password manager / recovery kit before clearing your shell!
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Initialize and run your first backup:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
organum-backup doctor --profile /abs/path/to/profile.json --rclone-config /abs/path/to/rclone.conf
|
|
64
|
+
organum-backup init --profile /abs/path/to/profile.json --rclone-config /abs/path/to/rclone.conf --execute
|
|
65
|
+
organum-backup backup --profile /abs/path/to/profile.json --rclone-config /abs/path/to/rclone.conf --execute
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## What it does
|
|
69
|
+
|
|
70
|
+
- `backup` — a restic snapshot of the folders you list, to a restic repository on a local path
|
|
71
|
+
or on any rclone remote you configured.
|
|
72
|
+
- `source_capture` (optional) — before each backup, a private stable copy of live files that
|
|
73
|
+
cannot be read safely in place: SQLite databases through the online-backup API (committed WAL
|
|
74
|
+
content included, `quick_check` verified, companion `-wal`/`-shm`/`-journal` races tolerated),
|
|
75
|
+
ordinary files as bounded stable copies.
|
|
76
|
+
- `snapshots`, `ls`, `restore` — list snapshots; look inside one (`ls --snapshot ID --path /a/folder`
|
|
77
|
+
lists that folder's own entries); restore a whole snapshot, or one folder of it with
|
|
78
|
+
`--path`, into a **new** folder.
|
|
79
|
+
On a new machine, where the profile's capture plan is not present, `restore --recovery`
|
|
80
|
+
takes no target: it restores into a new folder under `<profile folder>/recovery/` (private,
|
|
81
|
+
made by the tool) and the receipt names that folder.
|
|
82
|
+
- `rollback-check` — read-only: one sheet of what an older version (v0.3.1) would not know if you went
|
|
83
|
+
back to it — both state files, whether the last success is bound to a saved receipt, how far the old
|
|
84
|
+
state is behind, lock files, the capture marker, the two LaunchAgent files. Exit 0 means no line asks
|
|
85
|
+
for a look, 2 that one does (`attention`) or that the sheet could not be made (`blocked`).
|
|
86
|
+
- `launchd-template` — prints the LaunchAgent plist (`organum.backup.<profile>.<device>`,
|
|
87
|
+
`Disabled=true`, installed `organum-backup` absolute entry point, private log paths) without writing anything.
|
|
88
|
+
- `schedule-plan` — read-only: inspects LaunchAgent files (plus `launchctl print` with `--ask-launchd`
|
|
89
|
+
and `ps` with `--ask-processes`) and prints the exact ordered commands to install or switch cleanly.
|
|
90
|
+
- `run-if-due` — a schedule decision for launchd: daily time, defer on battery, catch up.
|
|
91
|
+
After three failed backups the schedule halts (`status: halted`, exit 2) until you run `resume --execute`.
|
|
92
|
+
- `organum-backup-desk` — a loopback-only bilingual (English / Korean) web desk for the same actions.
|
|
93
|
+
`GET /` contains **no session secret**; startup prints a single-use terminal code (valid 120s, max 5 tries)
|
|
94
|
+
exchanged via `POST /bootstrap` for an in-memory session secret. Exits automatically after 15 minutes idle
|
|
95
|
+
(held while a job runs). Real execution is **off by default** (pass `--allow-execute` to enable).
|
|
96
|
+
|
|
97
|
+
## Threat model
|
|
98
|
+
|
|
99
|
+
- **What `organum-backup` protects against:**
|
|
100
|
+
- Accidental local deletion, repo corruption, or silent SQLite WAL loss (including `git sparse-checkout`
|
|
101
|
+
or tool bugs wiping ignored folders).
|
|
102
|
+
- Browser-side cross-site attacks against `organum-backup-desk` (loopback-only bind, strict `Host`/`Origin`/
|
|
103
|
+
`Sec-Fetch-Site`, CSP `default-src 'none'`, zero `innerHTML`, no secret in `GET /`, single-use terminal
|
|
104
|
+
bootstrap code, memory-only session, 15-minute idle exit).
|
|
105
|
+
- Other user accounts on the same Mac (private `0700` state/staging/log/recovery folders; terminal code
|
|
106
|
+
is never written to disk or logs; Keychain password passes only via subprocess environment, never argv
|
|
107
|
+
or receipts).
|
|
108
|
+
- Overwriting live files during restore (`--overwrite never`, target must not exist and must not overlap
|
|
109
|
+
sources, profile, state, or Keychain).
|
|
110
|
+
- **What it does NOT protect against:**
|
|
111
|
+
- A process running under the **same macOS user account** that can read your terminal, memory, or login
|
|
112
|
+
Keychain — such a process can already read the backup password and modify your files directly, and the
|
|
113
|
+
desk does not claim otherwise.
|
|
114
|
+
- Loss of the encryption password (there is no backdoor or key escrow).
|
|
115
|
+
- Host-wide atomic snapshots across unrelated apps (each SQLite DB is a verified online backup; ordinary
|
|
116
|
+
files are bounded stable copies captured sequentially).
|
|
117
|
+
|
|
118
|
+
## Restore with restic alone (no vendor lock-in)
|
|
119
|
+
|
|
120
|
+
Your snapshots are standard `restic` repositories. Even without `organum-backup` installed, you can
|
|
121
|
+
restore directly on any machine with `restic` (and `rclone` if remote):
|
|
122
|
+
|
|
123
|
+
```sh
|
|
124
|
+
export RESTIC_PASSWORD="$(security find-generic-password -s organum.backup -a personal-files -w)"
|
|
125
|
+
# Local repository:
|
|
126
|
+
restic -r /path/to/repo/personal-files/mac-primary snapshots
|
|
127
|
+
restic -r /path/to/repo/personal-files/mac-primary restore latest --target /path/to/new-empty-folder
|
|
128
|
+
# Or rclone remote:
|
|
129
|
+
restic -o rclone.args="serve restic --stdio --config /path/to/rclone.conf" \
|
|
130
|
+
-r rclone:my-remote:PersonalBackup/personal-files/mac-primary restore latest --target /path/to/new-empty-folder
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Design choices worth knowing
|
|
134
|
+
|
|
135
|
+
- The repository password goes from the macOS Keychain to the engine's environment only —
|
|
136
|
+
never to argv, logs, receipts or the browser.
|
|
137
|
+
- Engines run without a shell, in a fixed minimal environment, against a strictly validated
|
|
138
|
+
profile (exact keys, duplicate keys refused, symlinked paths refused).
|
|
139
|
+
- Nothing is deleted automatically. Retention is recorded, not enforced.
|
|
140
|
+
- One run at a time, by a `flock` on a file that is never removed; the engine inherits it.
|
|
141
|
+
- Success is evidence, not an exit code: one final JSON summary and a full snapshot id.
|
|
142
|
+
- Every real `backup`, `init`, `restore`, `resume`, and halt (once) leaves an immutable receipt in
|
|
143
|
+
`<profile folder>/.organum-backup-state/receipts/<repository key>/`.
|
|
144
|
+
|
|
145
|
+
## Develop
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
PYTHONPATH=src python3 -m unittest discover -s tests # Python >= 3.11
|
|
149
|
+
node tests/test_ui.cjs && node tests/test_bridge_ui.cjs # Node, synthetic DOM
|
|
150
|
+
PYTHONPATH=src python3 tools/reproduce_wal.py # 442 WAL databases at a file limit of 256
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
One opt-in test drives a real restic binary against a throwaway local repository (no Keychain,
|
|
154
|
+
no rclone, no network):
|
|
155
|
+
|
|
156
|
+
```sh
|
|
157
|
+
ORGANUM_BACKUP_RESTIC=/path/to/restic PYTHONPATH=src python3 -m unittest discover -s tests -p 'test_real_restic.py'
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Origin and credits
|
|
161
|
+
|
|
162
|
+
Built in the Yeoul village as "personal backup" (v0.1.1 – v0.3.1); this repository starts from
|
|
163
|
+
v0.3.1 as received. See [CREDITS.md](CREDITS.md) and [records/](records/).
|
|
164
|
+
|
|
165
|
+
MIT License.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# organum-backup
|
|
2
|
+
|
|
3
|
+
Encrypted, restorable snapshots of the places agent state lives — a careful wrapper around
|
|
4
|
+
[restic](https://restic.net) and **your own** [rclone](https://rclone.org) remote.
|
|
5
|
+
|
|
6
|
+
> **Status: 0.4.0 (macOS on Apple Silicon).**
|
|
7
|
+
> Install via `pip install organum-backup` or `pip install "organum[backup]"`.
|
|
8
|
+
|
|
9
|
+
Part of the [organum](https://github.com/ludex-lab/organum) family, shipped as its own package:
|
|
10
|
+
organum's core stays standard-library-only and read-only; this tool downloads nothing by itself
|
|
11
|
+
but drives restic and rclone, reads one Keychain item, and writes when you restore.
|
|
12
|
+
|
|
13
|
+
## Why it exists
|
|
14
|
+
|
|
15
|
+
Agents keep their memory, session stores and working state in places git does not protect —
|
|
16
|
+
ignored folders, SQLite files, app data. On 2026-11-21 one mistaken `git sparse-checkout` in a
|
|
17
|
+
working repository deleted some fifty ignored folders of agent state. Nothing on the machine had a copy
|
|
18
|
+
newer than two months. That morning's snapshot from this tool restored them into a separate
|
|
19
|
+
folder, and the workspace reopened the same evening.
|
|
20
|
+
|
|
21
|
+
## Bring your own remote (no bundled OAuth client)
|
|
22
|
+
|
|
23
|
+
`organum-backup` ships **no OAuth client, no cloud credentials, and no bundled binaries**.
|
|
24
|
+
Install `restic` (v0.19+) and `rclone` yourself (e.g. `brew install restic rclone`), then point your
|
|
25
|
+
profile's `repository` at either:
|
|
26
|
+
|
|
27
|
+
1. **A local path** (`"kind": "local"`, `"location": "/Volumes/BackupDrive/organum-backup"`), or
|
|
28
|
+
2. **Any `rclone` remote you configure** (`"kind": "rclone"`, `"location": "my-remote:PersonalBackup"`):
|
|
29
|
+
S3, Backblaze B2, Cloudflare R2, SFTP, Google Drive (with your own OAuth client in `rclone config`),
|
|
30
|
+
or any other backend `rclone` supports.
|
|
31
|
+
|
|
32
|
+
Store a **printable ASCII** repository password in macOS Keychain (non-ASCII items are rejected because
|
|
33
|
+
macOS `security -w` hex-encodes them, breaking standalone `restic` compatibility):
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
PASS="$(python3 -c 'import secrets; print(secrets.token_urlsafe(32))')"
|
|
37
|
+
security add-generic-password -s organum.backup -a personal-files -w "$PASS"
|
|
38
|
+
# Write $PASS down in your offline password manager / recovery kit before clearing your shell!
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Initialize and run your first backup:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
organum-backup doctor --profile /abs/path/to/profile.json --rclone-config /abs/path/to/rclone.conf
|
|
45
|
+
organum-backup init --profile /abs/path/to/profile.json --rclone-config /abs/path/to/rclone.conf --execute
|
|
46
|
+
organum-backup backup --profile /abs/path/to/profile.json --rclone-config /abs/path/to/rclone.conf --execute
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## What it does
|
|
50
|
+
|
|
51
|
+
- `backup` — a restic snapshot of the folders you list, to a restic repository on a local path
|
|
52
|
+
or on any rclone remote you configured.
|
|
53
|
+
- `source_capture` (optional) — before each backup, a private stable copy of live files that
|
|
54
|
+
cannot be read safely in place: SQLite databases through the online-backup API (committed WAL
|
|
55
|
+
content included, `quick_check` verified, companion `-wal`/`-shm`/`-journal` races tolerated),
|
|
56
|
+
ordinary files as bounded stable copies.
|
|
57
|
+
- `snapshots`, `ls`, `restore` — list snapshots; look inside one (`ls --snapshot ID --path /a/folder`
|
|
58
|
+
lists that folder's own entries); restore a whole snapshot, or one folder of it with
|
|
59
|
+
`--path`, into a **new** folder.
|
|
60
|
+
On a new machine, where the profile's capture plan is not present, `restore --recovery`
|
|
61
|
+
takes no target: it restores into a new folder under `<profile folder>/recovery/` (private,
|
|
62
|
+
made by the tool) and the receipt names that folder.
|
|
63
|
+
- `rollback-check` — read-only: one sheet of what an older version (v0.3.1) would not know if you went
|
|
64
|
+
back to it — both state files, whether the last success is bound to a saved receipt, how far the old
|
|
65
|
+
state is behind, lock files, the capture marker, the two LaunchAgent files. Exit 0 means no line asks
|
|
66
|
+
for a look, 2 that one does (`attention`) or that the sheet could not be made (`blocked`).
|
|
67
|
+
- `launchd-template` — prints the LaunchAgent plist (`organum.backup.<profile>.<device>`,
|
|
68
|
+
`Disabled=true`, installed `organum-backup` absolute entry point, private log paths) without writing anything.
|
|
69
|
+
- `schedule-plan` — read-only: inspects LaunchAgent files (plus `launchctl print` with `--ask-launchd`
|
|
70
|
+
and `ps` with `--ask-processes`) and prints the exact ordered commands to install or switch cleanly.
|
|
71
|
+
- `run-if-due` — a schedule decision for launchd: daily time, defer on battery, catch up.
|
|
72
|
+
After three failed backups the schedule halts (`status: halted`, exit 2) until you run `resume --execute`.
|
|
73
|
+
- `organum-backup-desk` — a loopback-only bilingual (English / Korean) web desk for the same actions.
|
|
74
|
+
`GET /` contains **no session secret**; startup prints a single-use terminal code (valid 120s, max 5 tries)
|
|
75
|
+
exchanged via `POST /bootstrap` for an in-memory session secret. Exits automatically after 15 minutes idle
|
|
76
|
+
(held while a job runs). Real execution is **off by default** (pass `--allow-execute` to enable).
|
|
77
|
+
|
|
78
|
+
## Threat model
|
|
79
|
+
|
|
80
|
+
- **What `organum-backup` protects against:**
|
|
81
|
+
- Accidental local deletion, repo corruption, or silent SQLite WAL loss (including `git sparse-checkout`
|
|
82
|
+
or tool bugs wiping ignored folders).
|
|
83
|
+
- Browser-side cross-site attacks against `organum-backup-desk` (loopback-only bind, strict `Host`/`Origin`/
|
|
84
|
+
`Sec-Fetch-Site`, CSP `default-src 'none'`, zero `innerHTML`, no secret in `GET /`, single-use terminal
|
|
85
|
+
bootstrap code, memory-only session, 15-minute idle exit).
|
|
86
|
+
- Other user accounts on the same Mac (private `0700` state/staging/log/recovery folders; terminal code
|
|
87
|
+
is never written to disk or logs; Keychain password passes only via subprocess environment, never argv
|
|
88
|
+
or receipts).
|
|
89
|
+
- Overwriting live files during restore (`--overwrite never`, target must not exist and must not overlap
|
|
90
|
+
sources, profile, state, or Keychain).
|
|
91
|
+
- **What it does NOT protect against:**
|
|
92
|
+
- A process running under the **same macOS user account** that can read your terminal, memory, or login
|
|
93
|
+
Keychain — such a process can already read the backup password and modify your files directly, and the
|
|
94
|
+
desk does not claim otherwise.
|
|
95
|
+
- Loss of the encryption password (there is no backdoor or key escrow).
|
|
96
|
+
- Host-wide atomic snapshots across unrelated apps (each SQLite DB is a verified online backup; ordinary
|
|
97
|
+
files are bounded stable copies captured sequentially).
|
|
98
|
+
|
|
99
|
+
## Restore with restic alone (no vendor lock-in)
|
|
100
|
+
|
|
101
|
+
Your snapshots are standard `restic` repositories. Even without `organum-backup` installed, you can
|
|
102
|
+
restore directly on any machine with `restic` (and `rclone` if remote):
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
export RESTIC_PASSWORD="$(security find-generic-password -s organum.backup -a personal-files -w)"
|
|
106
|
+
# Local repository:
|
|
107
|
+
restic -r /path/to/repo/personal-files/mac-primary snapshots
|
|
108
|
+
restic -r /path/to/repo/personal-files/mac-primary restore latest --target /path/to/new-empty-folder
|
|
109
|
+
# Or rclone remote:
|
|
110
|
+
restic -o rclone.args="serve restic --stdio --config /path/to/rclone.conf" \
|
|
111
|
+
-r rclone:my-remote:PersonalBackup/personal-files/mac-primary restore latest --target /path/to/new-empty-folder
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Design choices worth knowing
|
|
115
|
+
|
|
116
|
+
- The repository password goes from the macOS Keychain to the engine's environment only —
|
|
117
|
+
never to argv, logs, receipts or the browser.
|
|
118
|
+
- Engines run without a shell, in a fixed minimal environment, against a strictly validated
|
|
119
|
+
profile (exact keys, duplicate keys refused, symlinked paths refused).
|
|
120
|
+
- Nothing is deleted automatically. Retention is recorded, not enforced.
|
|
121
|
+
- One run at a time, by a `flock` on a file that is never removed; the engine inherits it.
|
|
122
|
+
- Success is evidence, not an exit code: one final JSON summary and a full snapshot id.
|
|
123
|
+
- Every real `backup`, `init`, `restore`, `resume`, and halt (once) leaves an immutable receipt in
|
|
124
|
+
`<profile folder>/.organum-backup-state/receipts/<repository key>/`.
|
|
125
|
+
|
|
126
|
+
## Develop
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
PYTHONPATH=src python3 -m unittest discover -s tests # Python >= 3.11
|
|
130
|
+
node tests/test_ui.cjs && node tests/test_bridge_ui.cjs # Node, synthetic DOM
|
|
131
|
+
PYTHONPATH=src python3 tools/reproduce_wal.py # 442 WAL databases at a file limit of 256
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
One opt-in test drives a real restic binary against a throwaway local repository (no Keychain,
|
|
135
|
+
no rclone, no network):
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
ORGANUM_BACKUP_RESTIC=/path/to/restic PYTHONPATH=src python3 -m unittest discover -s tests -p 'test_real_restic.py'
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Origin and credits
|
|
142
|
+
|
|
143
|
+
Built in the Yeoul village as "personal backup" (v0.1.1 – v0.3.1); this repository starts from
|
|
144
|
+
v0.3.1 as received. See [CREDITS.md](CREDITS.md) and [records/](records/).
|
|
145
|
+
|
|
146
|
+
MIT License.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "organum-backup"
|
|
7
|
+
version = "0.4.0"
|
|
8
|
+
description = "Encrypted, restorable snapshots of the places agent state lives - a careful wrapper around restic and your own rclone remote."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "Jihoon Jeong" }]
|
|
14
|
+
keywords = ["backup", "restic", "rclone", "agent", "organism-engineering"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Operating System :: MacOS :: MacOS X",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
24
|
+
Homepage = "https://ludex-lab.github.io/organum/"
|
|
25
|
+
Repository = "https://github.com/ludex-lab/organum-backup"
|
|
26
|
+
|
|
27
|
+
[project.scripts]
|
|
28
|
+
organum-backup = "organum_backup.backup_operator:main"
|
|
29
|
+
organum-backup-desk = "organum_backup.backup_bridge:main"
|
|
30
|
+
|
|
31
|
+
[tool.setuptools.packages.find]
|
|
32
|
+
where = ["src"]
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.package-data]
|
|
35
|
+
organum_backup = ["backup_desk.html", "PROFILE_EXAMPLE.json"]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "organum.backup.profile/v1",
|
|
3
|
+
"profile_id": "personal-files",
|
|
4
|
+
"device_id": "mac-primary",
|
|
5
|
+
"source_roots": [
|
|
6
|
+
"/Users/example/Documents"
|
|
7
|
+
],
|
|
8
|
+
"exclude_patterns": [
|
|
9
|
+
"**/node_modules/**",
|
|
10
|
+
"**/.venv/**",
|
|
11
|
+
"**/__pycache__/**",
|
|
12
|
+
"**/.DS_Store"
|
|
13
|
+
],
|
|
14
|
+
"downloaded_model_roots": [],
|
|
15
|
+
"repository": {
|
|
16
|
+
"kind": "local",
|
|
17
|
+
"location": "/Users/example/BackupTestRepository"
|
|
18
|
+
},
|
|
19
|
+
"schedule": {
|
|
20
|
+
"enabled": false,
|
|
21
|
+
"interval_hours": 24,
|
|
22
|
+
"local_time": "03:00",
|
|
23
|
+
"on_battery": "defer",
|
|
24
|
+
"catch_up": true
|
|
25
|
+
},
|
|
26
|
+
"transfer": {
|
|
27
|
+
"upload_kib_per_second": 10240
|
|
28
|
+
},
|
|
29
|
+
"retention": {
|
|
30
|
+
"automatic_delete": false,
|
|
31
|
+
"keep_daily": 30,
|
|
32
|
+
"keep_weekly": 12,
|
|
33
|
+
"keep_monthly": 12
|
|
34
|
+
},
|
|
35
|
+
"credentials": {
|
|
36
|
+
"password_provider": "macos-keychain",
|
|
37
|
+
"keychain_service": "jj.personal-backup",
|
|
38
|
+
"keychain_account": "personal-files"
|
|
39
|
+
},
|
|
40
|
+
"engine": {
|
|
41
|
+
"restic_binary": null,
|
|
42
|
+
"rclone_binary": null
|
|
43
|
+
}
|
|
44
|
+
}
|