ossnap 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.
- ossnap-0.1.0/PKG-INFO +161 -0
- ossnap-0.1.0/README.md +140 -0
- ossnap-0.1.0/pyproject.toml +39 -0
- ossnap-0.1.0/setup.cfg +4 -0
- ossnap-0.1.0/src/ossnap/__init__.py +1 -0
- ossnap-0.1.0/src/ossnap/cli.py +541 -0
- ossnap-0.1.0/src/ossnap/config.py +47 -0
- ossnap-0.1.0/src/ossnap/crypto.py +85 -0
- ossnap-0.1.0/src/ossnap/exceptions.py +20 -0
- ossnap-0.1.0/src/ossnap/git.py +115 -0
- ossnap-0.1.0/src/ossnap/github.py +85 -0
- ossnap-0.1.0/src/ossnap/install.py +58 -0
- ossnap-0.1.0/src/ossnap/repos.py +127 -0
- ossnap-0.1.0/src/ossnap/ssh.py +147 -0
- ossnap-0.1.0/src/ossnap/ui.py +94 -0
- ossnap-0.1.0/src/ossnap.egg-info/PKG-INFO +161 -0
- ossnap-0.1.0/src/ossnap.egg-info/SOURCES.txt +19 -0
- ossnap-0.1.0/src/ossnap.egg-info/dependency_links.txt +1 -0
- ossnap-0.1.0/src/ossnap.egg-info/entry_points.txt +2 -0
- ossnap-0.1.0/src/ossnap.egg-info/requires.txt +5 -0
- ossnap-0.1.0/src/ossnap.egg-info/top_level.txt +1 -0
ossnap-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ossnap
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Snapshot and restore your macOS dev environment
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/nvt1904/ossnap
|
|
7
|
+
Project-URL: Issues, https://github.com/nvt1904/ossnap/issues
|
|
8
|
+
Keywords: macos,backup,snapshot,developer,ssh,dotenv
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Operating System :: MacOS
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Requires-Dist: click>=8.1
|
|
17
|
+
Requires-Dist: cryptography>=42.0
|
|
18
|
+
Requires-Dist: keyring>=25.0
|
|
19
|
+
Requires-Dist: rich>=13.0
|
|
20
|
+
Requires-Dist: questionary>=2.0
|
|
21
|
+
|
|
22
|
+
# ossnap
|
|
23
|
+
|
|
24
|
+
> Snapshot and restore your macOS dev environment in minutes.
|
|
25
|
+
|
|
26
|
+
ossnap backs up your SSH keys, `.env` files, and git repo list to a **private GitHub repository** — encrypted — and restores everything on a new machine with a single command.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## What it does
|
|
31
|
+
|
|
32
|
+
- **SSH keys** — encrypted and stored securely
|
|
33
|
+
- **.env files** — discovered recursively across all your repos (including monorepos)
|
|
34
|
+
- **Repo list** — re-clones all your git repos on restore
|
|
35
|
+
- **Versioned snapshots** — full history, restore any point in time
|
|
36
|
+
|
|
37
|
+
Everything sensitive is encrypted with AES before leaving your machine. The password lives in your macOS Keychain.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Requirements
|
|
42
|
+
|
|
43
|
+
- macOS
|
|
44
|
+
- Python 3.11+
|
|
45
|
+
- [GitHub CLI](https://cli.github.com) (`gh`) — installed automatically if missing
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Install
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
curl -fsSL https://raw.githubusercontent.com/nvt1904/ossnap/main/install.sh | bash
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Or manually with pipx:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pipx install ossnap
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Quick start
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
ossnap init # one-time setup wizard
|
|
67
|
+
ossnap snapshot # save current state
|
|
68
|
+
ossnap list # view snapshot history
|
|
69
|
+
ossnap pull # restore to this or a new machine
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Aliases: `i`, `s`, `l`, `p`
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
ossnap s -n "before reinstall" # named snapshot
|
|
76
|
+
ossnap p --repos-dir ~/code # restore repos to custom dir
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Commands
|
|
82
|
+
|
|
83
|
+
| Command | Alias | Description |
|
|
84
|
+
|---------|-------|-------------|
|
|
85
|
+
| `init` | `i` | Interactive setup wizard |
|
|
86
|
+
| `snapshot` | `s` | Save a snapshot to GitHub |
|
|
87
|
+
| `list` | `l` | List all snapshots |
|
|
88
|
+
| `pull` | `p` | Restore from a snapshot |
|
|
89
|
+
|
|
90
|
+
### `ossnap snapshot`
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
-n, --name TEXT Custom snapshot name (default: timestamp)
|
|
94
|
+
-h, --help
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### `ossnap pull`
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
--ssh-dir DIR Restore SSH keys to a custom directory
|
|
101
|
+
--repos-dir DIR Clone repos into a custom base directory
|
|
102
|
+
-h, --help
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## How it works
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
ossnap snapshot
|
|
111
|
+
└── Clones your private GitHub repo
|
|
112
|
+
├── ssh/
|
|
113
|
+
│ ├── config (encrypted)
|
|
114
|
+
│ ├── authorized_keys (encrypted)
|
|
115
|
+
│ └── keys/
|
|
116
|
+
│ └── id_ed25519 (encrypted)
|
|
117
|
+
└── repos/
|
|
118
|
+
├── repos.json (list of all your git repos)
|
|
119
|
+
└── envs/
|
|
120
|
+
└── Documents/my-project/
|
|
121
|
+
└── .env (encrypted)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Each snapshot is a git commit. History is preserved — roll back to any point.
|
|
125
|
+
|
|
126
|
+
**Encryption**: AES-256 via [Fernet](https://cryptography.io/en/latest/fernet/), key derived from your password using PBKDF2-HMAC-SHA256 (600,000 iterations). Password stored in macOS Keychain.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Configuration
|
|
131
|
+
|
|
132
|
+
Config file: `~/.ossnap/config.json`
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"github_repo_url": "https://github.com/you/your-private-repo",
|
|
137
|
+
"ssh_dir": "~/.ssh",
|
|
138
|
+
"scan_dirs": ["~/Documents", "~/Projects"],
|
|
139
|
+
"env_patterns": [".env", ".env.local", ".env.development", ".env.production"],
|
|
140
|
+
"exclude_dirs": ["node_modules", ".git", "venv", "__pycache__", ".venv"]
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Edit directly or re-run `ossnap init` to reconfigure (existing values are pre-filled).
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Uninstall
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
pipx uninstall ossnap
|
|
152
|
+
rm -rf ~/.ossnap
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Your snapshot repo on GitHub is unaffected — delete it manually if you want.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
MIT
|
ossnap-0.1.0/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# ossnap
|
|
2
|
+
|
|
3
|
+
> Snapshot and restore your macOS dev environment in minutes.
|
|
4
|
+
|
|
5
|
+
ossnap backs up your SSH keys, `.env` files, and git repo list to a **private GitHub repository** — encrypted — and restores everything on a new machine with a single command.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What it does
|
|
10
|
+
|
|
11
|
+
- **SSH keys** — encrypted and stored securely
|
|
12
|
+
- **.env files** — discovered recursively across all your repos (including monorepos)
|
|
13
|
+
- **Repo list** — re-clones all your git repos on restore
|
|
14
|
+
- **Versioned snapshots** — full history, restore any point in time
|
|
15
|
+
|
|
16
|
+
Everything sensitive is encrypted with AES before leaving your machine. The password lives in your macOS Keychain.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Requirements
|
|
21
|
+
|
|
22
|
+
- macOS
|
|
23
|
+
- Python 3.11+
|
|
24
|
+
- [GitHub CLI](https://cli.github.com) (`gh`) — installed automatically if missing
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
curl -fsSL https://raw.githubusercontent.com/nvt1904/ossnap/main/install.sh | bash
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Or manually with pipx:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pipx install ossnap
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Quick start
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
ossnap init # one-time setup wizard
|
|
46
|
+
ossnap snapshot # save current state
|
|
47
|
+
ossnap list # view snapshot history
|
|
48
|
+
ossnap pull # restore to this or a new machine
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Aliases: `i`, `s`, `l`, `p`
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
ossnap s -n "before reinstall" # named snapshot
|
|
55
|
+
ossnap p --repos-dir ~/code # restore repos to custom dir
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Commands
|
|
61
|
+
|
|
62
|
+
| Command | Alias | Description |
|
|
63
|
+
|---------|-------|-------------|
|
|
64
|
+
| `init` | `i` | Interactive setup wizard |
|
|
65
|
+
| `snapshot` | `s` | Save a snapshot to GitHub |
|
|
66
|
+
| `list` | `l` | List all snapshots |
|
|
67
|
+
| `pull` | `p` | Restore from a snapshot |
|
|
68
|
+
|
|
69
|
+
### `ossnap snapshot`
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
-n, --name TEXT Custom snapshot name (default: timestamp)
|
|
73
|
+
-h, --help
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `ossnap pull`
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
--ssh-dir DIR Restore SSH keys to a custom directory
|
|
80
|
+
--repos-dir DIR Clone repos into a custom base directory
|
|
81
|
+
-h, --help
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## How it works
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
ossnap snapshot
|
|
90
|
+
└── Clones your private GitHub repo
|
|
91
|
+
├── ssh/
|
|
92
|
+
│ ├── config (encrypted)
|
|
93
|
+
│ ├── authorized_keys (encrypted)
|
|
94
|
+
│ └── keys/
|
|
95
|
+
│ └── id_ed25519 (encrypted)
|
|
96
|
+
└── repos/
|
|
97
|
+
├── repos.json (list of all your git repos)
|
|
98
|
+
└── envs/
|
|
99
|
+
└── Documents/my-project/
|
|
100
|
+
└── .env (encrypted)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Each snapshot is a git commit. History is preserved — roll back to any point.
|
|
104
|
+
|
|
105
|
+
**Encryption**: AES-256 via [Fernet](https://cryptography.io/en/latest/fernet/), key derived from your password using PBKDF2-HMAC-SHA256 (600,000 iterations). Password stored in macOS Keychain.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Configuration
|
|
110
|
+
|
|
111
|
+
Config file: `~/.ossnap/config.json`
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"github_repo_url": "https://github.com/you/your-private-repo",
|
|
116
|
+
"ssh_dir": "~/.ssh",
|
|
117
|
+
"scan_dirs": ["~/Documents", "~/Projects"],
|
|
118
|
+
"env_patterns": [".env", ".env.local", ".env.development", ".env.production"],
|
|
119
|
+
"exclude_dirs": ["node_modules", ".git", "venv", "__pycache__", ".venv"]
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Edit directly or re-run `ossnap init` to reconfigure (existing values are pre-filled).
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Uninstall
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
pipx uninstall ossnap
|
|
131
|
+
rm -rf ~/.ossnap
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Your snapshot repo on GitHub is unaffected — delete it manually if you want.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
MIT
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ossnap"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Snapshot and restore your macOS dev environment"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
keywords = ["macos", "backup", "snapshot", "developer", "ssh", "dotenv"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Environment :: Console",
|
|
16
|
+
"Operating System :: MacOS",
|
|
17
|
+
"Programming Language :: Python :: 3.11",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
]
|
|
20
|
+
dependencies = [
|
|
21
|
+
"click>=8.1",
|
|
22
|
+
"cryptography>=42.0",
|
|
23
|
+
"keyring>=25.0",
|
|
24
|
+
"rich>=13.0",
|
|
25
|
+
"questionary>=2.0",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Homepage = "https://github.com/nvt1904/ossnap"
|
|
30
|
+
Issues = "https://github.com/nvt1904/ossnap/issues"
|
|
31
|
+
|
|
32
|
+
[project.scripts]
|
|
33
|
+
ossnap = "ossnap.cli:main"
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.packages.find]
|
|
36
|
+
where = ["src"]
|
|
37
|
+
|
|
38
|
+
[tool.setuptools.package-dir]
|
|
39
|
+
ossnap = "src/ossnap"
|
ossnap-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|