dnsctl-app 1.0.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.
Files changed (45) hide show
  1. dnsctl_app-1.0.0/LICENSE +21 -0
  2. dnsctl_app-1.0.0/PKG-INFO +264 -0
  3. dnsctl_app-1.0.0/README.md +229 -0
  4. dnsctl_app-1.0.0/dnsctl/__init__.py +3 -0
  5. dnsctl_app-1.0.0/dnsctl/cli/__init__.py +0 -0
  6. dnsctl_app-1.0.0/dnsctl/cli/main.py +675 -0
  7. dnsctl_app-1.0.0/dnsctl/config.py +46 -0
  8. dnsctl_app-1.0.0/dnsctl/core/__init__.py +0 -0
  9. dnsctl_app-1.0.0/dnsctl/core/cloudflare_client.py +282 -0
  10. dnsctl_app-1.0.0/dnsctl/core/diff_engine.py +175 -0
  11. dnsctl_app-1.0.0/dnsctl/core/git_manager.py +134 -0
  12. dnsctl_app-1.0.0/dnsctl/core/security.py +163 -0
  13. dnsctl_app-1.0.0/dnsctl/core/state_manager.py +215 -0
  14. dnsctl_app-1.0.0/dnsctl/core/sync_engine.py +231 -0
  15. dnsctl_app-1.0.0/dnsctl/gui/__init__.py +0 -0
  16. dnsctl_app-1.0.0/dnsctl/gui/app.py +244 -0
  17. dnsctl_app-1.0.0/dnsctl/gui/controllers/__init__.py +0 -0
  18. dnsctl_app-1.0.0/dnsctl/gui/controllers/history_controller.py +202 -0
  19. dnsctl_app-1.0.0/dnsctl/gui/controllers/main_controller.py +501 -0
  20. dnsctl_app-1.0.0/dnsctl/gui/controllers/plan_controller.py +268 -0
  21. dnsctl_app-1.0.0/dnsctl/gui/controllers/record_controller.py +223 -0
  22. dnsctl_app-1.0.0/dnsctl/gui/controllers/record_editor_controller.py +199 -0
  23. dnsctl_app-1.0.0/dnsctl/gui/ui/history_dialog.ui +131 -0
  24. dnsctl_app-1.0.0/dnsctl/gui/ui/login_dialog.ui +153 -0
  25. dnsctl_app-1.0.0/dnsctl/gui/ui/main_window.ui +304 -0
  26. dnsctl_app-1.0.0/dnsctl/gui/ui/plan_dialog.ui +105 -0
  27. dnsctl_app-1.0.0/dnsctl/gui/ui/record_editor.ui +225 -0
  28. dnsctl_app-1.0.0/dnsctl/gui/ui/unlock_dialog.ui +109 -0
  29. dnsctl_app-1.0.0/dnsctl/icon.png +0 -0
  30. dnsctl_app-1.0.0/dnsctl_app.egg-info/PKG-INFO +264 -0
  31. dnsctl_app-1.0.0/dnsctl_app.egg-info/SOURCES.txt +43 -0
  32. dnsctl_app-1.0.0/dnsctl_app.egg-info/dependency_links.txt +1 -0
  33. dnsctl_app-1.0.0/dnsctl_app.egg-info/entry_points.txt +5 -0
  34. dnsctl_app-1.0.0/dnsctl_app.egg-info/requires.txt +10 -0
  35. dnsctl_app-1.0.0/dnsctl_app.egg-info/top_level.txt +1 -0
  36. dnsctl_app-1.0.0/pyproject.toml +62 -0
  37. dnsctl_app-1.0.0/setup.cfg +4 -0
  38. dnsctl_app-1.0.0/tests/test_cloudflare_client.py +102 -0
  39. dnsctl_app-1.0.0/tests/test_diff_engine.py +201 -0
  40. dnsctl_app-1.0.0/tests/test_phase4.py +227 -0
  41. dnsctl_app-1.0.0/tests/test_phase5.py +136 -0
  42. dnsctl_app-1.0.0/tests/test_record_editor.py +61 -0
  43. dnsctl_app-1.0.0/tests/test_security.py +73 -0
  44. dnsctl_app-1.0.0/tests/test_state_manager.py +88 -0
  45. dnsctl_app-1.0.0/tests/test_sync_engine.py +227 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dhivijit Koppuravuri
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,264 @@
1
+ Metadata-Version: 2.4
2
+ Name: dnsctl-app
3
+ Version: 1.0.0
4
+ Summary: Secure, version-controlled DNS management tool with CLI and GUI
5
+ Author-email: Dhivijit Koppuravuri <me@dhivijit.dev>
6
+ License-Expression: MIT
7
+ Project-URL: Source, https://github.com/dhivijit/dnsctl
8
+ Project-URL: Issue Tracker, https://github.com/dhivijit/dnsctl/issues
9
+ Keywords: dns,devops,infrastructure,git,cli,security
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Environment :: Console
12
+ Classifier: Environment :: X11 Applications :: Qt
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: System Administrators
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Internet :: Name Service (DNS)
20
+ Classifier: Topic :: System :: Systems Administration
21
+ Classifier: Topic :: Utilities
22
+ Requires-Python: >=3.11
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: requests>=2.31
26
+ Requires-Dist: cryptography>=41.0
27
+ Requires-Dist: keyring>=24.0
28
+ Requires-Dist: click>=8.1
29
+ Requires-Dist: PyQt6>=6.6
30
+ Requires-Dist: GitPython>=3.1
31
+ Provides-Extra: dev
32
+ Requires-Dist: pytest>=7.4; extra == "dev"
33
+ Requires-Dist: pyinstaller>=6.0; extra == "dev"
34
+ Dynamic: license-file
35
+
36
+ <div align="center">
37
+
38
+ <img src="dnsctl/icon.png" alt="DNSCTL Icon" width="128" height="128">
39
+
40
+ # DNSCTL
41
+
42
+ **Secure, version-controlled DNS management for Cloudflare (CLI + GUI)**
43
+
44
+ </div>
45
+
46
+ DNSCTL is a local infrastructure tool for safely managing Cloudflare DNS records using a Git-backed state model, drift detection, and a plan/apply workflow.
47
+
48
+ It combines:
49
+
50
+ - A powerful CLI for automation
51
+ - A PyQt GUI for visualization
52
+ - Secure secret handling
53
+ - Version-controlled state
54
+ - Protected record enforcement
55
+
56
+ Think of it as a lightweight, DNS-focused reconciliation engine for Cloudflare.
57
+
58
+ ---
59
+
60
+ ## ✨ Key Features
61
+
62
+ - **State Sync** — Pull DNS records into local JSON state
63
+ - **Local Editing** — Add / edit / delete records safely
64
+ - **Drift Detection** — Detect out-of-band dashboard changes
65
+ - **Plan / Apply Workflow** — Preview before pushing
66
+ - **Protected Records** — System + user-defined protection
67
+ - **Git-Backed History** — Every state change auto-committed
68
+ - **Secure Token Storage** — AES-GCM encrypted + OS keyring
69
+ - **Session Locking** — Auto-expires after inactivity
70
+ - **CLI + GUI Parity** — Same core engine
71
+
72
+ ---
73
+
74
+ ## 📦 Installation
75
+
76
+ ### Windows
77
+
78
+ **Download the installer from the [Releases](https://github.com/dhivijit/dnsctl/releases) page.**
79
+
80
+ The installer includes both CLI and GUI applications with all dependencies bundled.
81
+
82
+ ### macOS / Linux
83
+
84
+ ```bash
85
+ git clone https://github.com/dhivijit/dnsctl.git
86
+ cd dnsctl
87
+ pip install .
88
+ ```
89
+
90
+ **Requirements:**
91
+ - Python 3.11+
92
+ - Git
93
+ - OS keyring support (macOS Keychain / Linux Secret Service)
94
+
95
+ **Note:** For development mode, use `pip install -e .`
96
+
97
+ ---
98
+
99
+ ## 🚀 Quick Start
100
+
101
+ ### 1. Initialize local state
102
+
103
+ ```bash
104
+ dnsctl init
105
+ ```
106
+
107
+ ### 2. Store your Cloudflare API token (encrypted)
108
+
109
+ ```bash
110
+ dnsctl login
111
+ ```
112
+
113
+ The token is:
114
+ - Encrypted with AES-256-GCM
115
+ - Key derived via PBKDF2 (200k iterations)
116
+ - Stored securely in OS keyring
117
+
118
+ ### 3. Unlock session
119
+
120
+ ```bash
121
+ dnsctl unlock
122
+ ```
123
+
124
+ ### 4. Sync zones
125
+
126
+ ```bash
127
+ dnsctl sync
128
+ ```
129
+
130
+ ---
131
+
132
+ ## 🧰 CLI Overview
133
+
134
+ ### Authentication
135
+
136
+ ```bash
137
+ dnsctl init
138
+ dnsctl login
139
+ dnsctl unlock
140
+ dnsctl lock
141
+ dnsctl logout
142
+ ```
143
+
144
+ ### Sync & Status
145
+
146
+ ```bash
147
+ dnsctl sync [-z ZONE]
148
+ dnsctl status
149
+ dnsctl diff
150
+ dnsctl plan
151
+ dnsctl apply
152
+ ```
153
+
154
+ ### Record Management (Local State)
155
+
156
+ ```bash
157
+ dnsctl add --type A --name sub.example.com --content 1.2.3.4
158
+ dnsctl edit --type A --name sub.example.com --content 5.6.7.8
159
+ dnsctl rm --type A --name sub.example.com
160
+ ```
161
+
162
+ ### Protected Records
163
+
164
+ ```bash
165
+ dnsctl protect --type A --name example.com --reason "Critical root record"
166
+ dnsctl unprotect --type A --name example.com
167
+ dnsctl protected
168
+ ```
169
+
170
+ ### History & Rollback
171
+
172
+ ```bash
173
+ dnsctl log
174
+ dnsctl rollback <commit_sha>
175
+ ```
176
+
177
+ ### Import / Export
178
+
179
+ ```bash
180
+ dnsctl export
181
+ dnsctl import zone.json
182
+ ```
183
+
184
+ ---
185
+
186
+ ## 🖥 GUI
187
+
188
+ Launch:
189
+
190
+ ```bash
191
+ dnsctl-g
192
+ ```
193
+
194
+ Features:
195
+
196
+ - Zone selector
197
+ - Record type tabs (A, CNAME, MX, TXT, etc.)
198
+ - Drift status indicator
199
+ - Sync / Plan / Apply controls
200
+ - Record add/edit/delete dialogs
201
+ - History & rollback viewer
202
+ - Session unlock modal
203
+
204
+ The GUI uses the same reconciliation engine as the CLI.
205
+
206
+ ---
207
+
208
+ ## 🔐 Security Model
209
+
210
+ DNSCTL is designed for secure local infrastructure management.
211
+
212
+ ### Token Handling
213
+
214
+ - API token is never stored in plaintext
215
+ - Encrypted with AES-GCM
216
+ - Derived from master password using PBKDF2-HMAC-SHA256
217
+ - Encrypted blob stored in OS keyring
218
+ - Session auto-expires (default: 15 minutes)
219
+
220
+ ### Protected Records
221
+
222
+ Two layers of protection:
223
+
224
+ 1. System-level (e.g., NS records)
225
+ 2. User-defined protection flags
226
+
227
+ Protected records require explicit force to modify or delete.
228
+
229
+ ---
230
+
231
+ ## 🧠 Design Philosophy
232
+
233
+ DNSCTL is built around:
234
+
235
+ - Explicit change control
236
+ - Safe reconciliation
237
+ - Drift awareness
238
+ - Secure secret handling
239
+ - Recoverable state
240
+
241
+ It is intended for developers and security engineers who want more control than a web dashboard provides.
242
+
243
+ ---
244
+
245
+ ## ⚠️ Scope
246
+
247
+ DNSCTL is:
248
+
249
+ - A local DNS management tool
250
+ - Designed for single-user environments
251
+ - Focused on Cloudflare DNS
252
+
253
+ It is not:
254
+
255
+ - A multi-user SaaS system
256
+ - A remote secret manager
257
+ - A full Terraform replacement
258
+
259
+ ---
260
+
261
+ ## 📜 License
262
+
263
+ MIT License
264
+ © Dhivijit
@@ -0,0 +1,229 @@
1
+ <div align="center">
2
+
3
+ <img src="dnsctl/icon.png" alt="DNSCTL Icon" width="128" height="128">
4
+
5
+ # DNSCTL
6
+
7
+ **Secure, version-controlled DNS management for Cloudflare (CLI + GUI)**
8
+
9
+ </div>
10
+
11
+ DNSCTL is a local infrastructure tool for safely managing Cloudflare DNS records using a Git-backed state model, drift detection, and a plan/apply workflow.
12
+
13
+ It combines:
14
+
15
+ - A powerful CLI for automation
16
+ - A PyQt GUI for visualization
17
+ - Secure secret handling
18
+ - Version-controlled state
19
+ - Protected record enforcement
20
+
21
+ Think of it as a lightweight, DNS-focused reconciliation engine for Cloudflare.
22
+
23
+ ---
24
+
25
+ ## ✨ Key Features
26
+
27
+ - **State Sync** — Pull DNS records into local JSON state
28
+ - **Local Editing** — Add / edit / delete records safely
29
+ - **Drift Detection** — Detect out-of-band dashboard changes
30
+ - **Plan / Apply Workflow** — Preview before pushing
31
+ - **Protected Records** — System + user-defined protection
32
+ - **Git-Backed History** — Every state change auto-committed
33
+ - **Secure Token Storage** — AES-GCM encrypted + OS keyring
34
+ - **Session Locking** — Auto-expires after inactivity
35
+ - **CLI + GUI Parity** — Same core engine
36
+
37
+ ---
38
+
39
+ ## 📦 Installation
40
+
41
+ ### Windows
42
+
43
+ **Download the installer from the [Releases](https://github.com/dhivijit/dnsctl/releases) page.**
44
+
45
+ The installer includes both CLI and GUI applications with all dependencies bundled.
46
+
47
+ ### macOS / Linux
48
+
49
+ ```bash
50
+ git clone https://github.com/dhivijit/dnsctl.git
51
+ cd dnsctl
52
+ pip install .
53
+ ```
54
+
55
+ **Requirements:**
56
+ - Python 3.11+
57
+ - Git
58
+ - OS keyring support (macOS Keychain / Linux Secret Service)
59
+
60
+ **Note:** For development mode, use `pip install -e .`
61
+
62
+ ---
63
+
64
+ ## 🚀 Quick Start
65
+
66
+ ### 1. Initialize local state
67
+
68
+ ```bash
69
+ dnsctl init
70
+ ```
71
+
72
+ ### 2. Store your Cloudflare API token (encrypted)
73
+
74
+ ```bash
75
+ dnsctl login
76
+ ```
77
+
78
+ The token is:
79
+ - Encrypted with AES-256-GCM
80
+ - Key derived via PBKDF2 (200k iterations)
81
+ - Stored securely in OS keyring
82
+
83
+ ### 3. Unlock session
84
+
85
+ ```bash
86
+ dnsctl unlock
87
+ ```
88
+
89
+ ### 4. Sync zones
90
+
91
+ ```bash
92
+ dnsctl sync
93
+ ```
94
+
95
+ ---
96
+
97
+ ## 🧰 CLI Overview
98
+
99
+ ### Authentication
100
+
101
+ ```bash
102
+ dnsctl init
103
+ dnsctl login
104
+ dnsctl unlock
105
+ dnsctl lock
106
+ dnsctl logout
107
+ ```
108
+
109
+ ### Sync & Status
110
+
111
+ ```bash
112
+ dnsctl sync [-z ZONE]
113
+ dnsctl status
114
+ dnsctl diff
115
+ dnsctl plan
116
+ dnsctl apply
117
+ ```
118
+
119
+ ### Record Management (Local State)
120
+
121
+ ```bash
122
+ dnsctl add --type A --name sub.example.com --content 1.2.3.4
123
+ dnsctl edit --type A --name sub.example.com --content 5.6.7.8
124
+ dnsctl rm --type A --name sub.example.com
125
+ ```
126
+
127
+ ### Protected Records
128
+
129
+ ```bash
130
+ dnsctl protect --type A --name example.com --reason "Critical root record"
131
+ dnsctl unprotect --type A --name example.com
132
+ dnsctl protected
133
+ ```
134
+
135
+ ### History & Rollback
136
+
137
+ ```bash
138
+ dnsctl log
139
+ dnsctl rollback <commit_sha>
140
+ ```
141
+
142
+ ### Import / Export
143
+
144
+ ```bash
145
+ dnsctl export
146
+ dnsctl import zone.json
147
+ ```
148
+
149
+ ---
150
+
151
+ ## 🖥 GUI
152
+
153
+ Launch:
154
+
155
+ ```bash
156
+ dnsctl-g
157
+ ```
158
+
159
+ Features:
160
+
161
+ - Zone selector
162
+ - Record type tabs (A, CNAME, MX, TXT, etc.)
163
+ - Drift status indicator
164
+ - Sync / Plan / Apply controls
165
+ - Record add/edit/delete dialogs
166
+ - History & rollback viewer
167
+ - Session unlock modal
168
+
169
+ The GUI uses the same reconciliation engine as the CLI.
170
+
171
+ ---
172
+
173
+ ## 🔐 Security Model
174
+
175
+ DNSCTL is designed for secure local infrastructure management.
176
+
177
+ ### Token Handling
178
+
179
+ - API token is never stored in plaintext
180
+ - Encrypted with AES-GCM
181
+ - Derived from master password using PBKDF2-HMAC-SHA256
182
+ - Encrypted blob stored in OS keyring
183
+ - Session auto-expires (default: 15 minutes)
184
+
185
+ ### Protected Records
186
+
187
+ Two layers of protection:
188
+
189
+ 1. System-level (e.g., NS records)
190
+ 2. User-defined protection flags
191
+
192
+ Protected records require explicit force to modify or delete.
193
+
194
+ ---
195
+
196
+ ## 🧠 Design Philosophy
197
+
198
+ DNSCTL is built around:
199
+
200
+ - Explicit change control
201
+ - Safe reconciliation
202
+ - Drift awareness
203
+ - Secure secret handling
204
+ - Recoverable state
205
+
206
+ It is intended for developers and security engineers who want more control than a web dashboard provides.
207
+
208
+ ---
209
+
210
+ ## ⚠️ Scope
211
+
212
+ DNSCTL is:
213
+
214
+ - A local DNS management tool
215
+ - Designed for single-user environments
216
+ - Focused on Cloudflare DNS
217
+
218
+ It is not:
219
+
220
+ - A multi-user SaaS system
221
+ - A remote secret manager
222
+ - A full Terraform replacement
223
+
224
+ ---
225
+
226
+ ## 📜 License
227
+
228
+ MIT License
229
+ © Dhivijit
@@ -0,0 +1,3 @@
1
+ """dnsctl — Secure, version-controlled DNS management for Cloudflare."""
2
+
3
+ __version__ = "1.0.0"
File without changes