sshcnfgr 0.1.0b1__py3-none-any.whl

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.
sshcnfgr/tui.tcss ADDED
@@ -0,0 +1,105 @@
1
+ #body {
2
+ height: 1fr;
3
+ }
4
+
5
+ #left {
6
+ width: 45%;
7
+ padding: 1;
8
+ border: round $primary;
9
+ }
10
+
11
+ #right {
12
+ width: 55%;
13
+ padding: 1;
14
+ border: round $accent;
15
+ }
16
+
17
+ #list_actions,
18
+ #identity_actions,
19
+ #group_identity_actions,
20
+ #detail_actions {
21
+ height: auto;
22
+ margin-top: 1;
23
+ }
24
+
25
+ #hosts_table,
26
+ #identities_table {
27
+ height: 1fr;
28
+ }
29
+
30
+ Input {
31
+ margin-top: 1;
32
+ }
33
+
34
+ #status {
35
+ margin-top: 1;
36
+ padding: 1;
37
+ border: round $success;
38
+ color: $text;
39
+ }
40
+
41
+ #dedup_toolbar {
42
+ height: auto;
43
+ padding: 0 1;
44
+ align-vertical: middle;
45
+ }
46
+
47
+ #dedup_title {
48
+ width: 1fr;
49
+ text-style: bold;
50
+ }
51
+
52
+ #dedup_body {
53
+ height: 1fr;
54
+ }
55
+
56
+ #dedup_left {
57
+ width: 40%;
58
+ padding: 1;
59
+ border: round $primary;
60
+ }
61
+
62
+ #dedup_right {
63
+ width: 60%;
64
+ padding: 1;
65
+ border: round $accent;
66
+ }
67
+
68
+ #dedup_groups_table {
69
+ height: 1fr;
70
+ }
71
+
72
+ #dedup_members_table {
73
+ height: 8;
74
+ margin-bottom: 1;
75
+ }
76
+
77
+ #dedup_conflicts_container {
78
+ height: auto;
79
+ margin-bottom: 1;
80
+ }
81
+
82
+ .dedup-hint {
83
+ color: $text-muted;
84
+ margin: 1 0;
85
+ }
86
+
87
+ #dedup_preview {
88
+ margin-top: 1;
89
+ padding: 1;
90
+ border: round $primary;
91
+ color: $text;
92
+ }
93
+
94
+ #dedup_left_actions,
95
+ #dedup_merge_actions {
96
+ height: auto;
97
+ margin-top: 1;
98
+ }
99
+
100
+ #dedup_status {
101
+ margin-top: 1;
102
+ padding: 1;
103
+ border: round $success;
104
+ color: $text;
105
+ }
@@ -0,0 +1,205 @@
1
+ Metadata-Version: 2.5
2
+ Name: sshcnfgr
3
+ Version: 0.1.0b1
4
+ Summary: TUI, optional Qt6 GUI, and CLI to manage OpenSSH host configs from a single TOML file
5
+ Project-URL: Homepage, https://github.com/thomsbe/SSHCnfgr
6
+ Project-URL: Repository, https://github.com/thomsbe/SSHCnfgr
7
+ Project-URL: Issues, https://github.com/thomsbe/SSHCnfgr/issues
8
+ Project-URL: Changelog, https://github.com/thomsbe/SSHCnfgr/blob/main/CHANGELOG.md
9
+ Author-email: Thomas Baer <thomas.baer@tbaer.de>
10
+ Maintainer-email: Thomas Baer <thomas.baer@tbaer.de>
11
+ License-Expression: MIT
12
+ License-File: LICENSE
13
+ Keywords: cli,config,devops,openssh,pyside6,qt,ssh,textual,tui
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Environment :: X11 Applications :: Qt
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Intended Audience :: System Administrators
19
+ Classifier: Operating System :: MacOS
20
+ Classifier: Operating System :: Microsoft :: Windows
21
+ Classifier: Operating System :: POSIX :: Linux
22
+ Classifier: Programming Language :: Python :: 3
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Programming Language :: Python :: 3.14
26
+ Classifier: Topic :: Software Development :: User Interfaces
27
+ Classifier: Topic :: System :: Systems Administration
28
+ Classifier: Topic :: Utilities
29
+ Requires-Python: >=3.12
30
+ Requires-Dist: click>=8.1.7
31
+ Requires-Dist: loguru>=0.7.3
32
+ Requires-Dist: textual>=6.0.0
33
+ Requires-Dist: tomli-w>=1.0.0
34
+ Provides-Extra: dev
35
+ Requires-Dist: build>=1.2.2; extra == 'dev'
36
+ Requires-Dist: pytest>=8.3.0; extra == 'dev'
37
+ Requires-Dist: ruff>=0.6.0; extra == 'dev'
38
+ Requires-Dist: twine>=5.1.1; extra == 'dev'
39
+ Provides-Extra: qt
40
+ Requires-Dist: pyside6-essentials>=6.8.0; extra == 'qt'
41
+ Description-Content-Type: text/markdown
42
+
43
+ # SSHCnfgr
44
+
45
+ > **English speaker?** Jump to the [English Summary](#english-summary) at the bottom.
46
+
47
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/thomsbe/SSHCnfgr/blob/main/LICENSE)
48
+ [![Python 3.12+](https://img.shields.io/badge/Python-3.12%2B-3776AB.svg)](https://www.python.org/)
49
+ [![Status: Beta](https://img.shields.io/badge/Status-0.1.0b1%20Beta-orange.svg)](https://pypi.org/project/sshcnfgr/)
50
+
51
+ **SSHCnfgr** verwaltet deine OpenSSH-Hosts, Gruppen und Identities über eine einzige, saubere TOML-Datei (`~/.ssh/sshcnfgr.toml`) — per **Textual-TUI**, optionaler **Qt6-Desktop-GUI** (Wayland/X11/macOS/Windows) oder **Click-CLI**.
52
+
53
+ ## Highlights
54
+
55
+ - **Eine einzige Datei neben `~/.ssh/config`:** Alles liegt in `~/.ssh/sshcnfgr.toml` (auf Linux/macOS automatisch mit `0600`-Rechten, unter Windows in `%USERPROFILE%\.ssh\sshcnfgr.toml`) — ideal für den direkten Start per `uvx`.
56
+ - **TOML als Source of Truth:** Deaktivierte Hosts bleiben in der Datenbank erhalten, landen aber nicht in der generierten OpenSSH-Config (`~/.ssh/config.generated`, ebenfalls `0600`).
57
+ - **Dubletten finden & zusammenführen:** Erkennt Hosts mit gleichem Ziel (`HostName` + effektiver `Port` + effektiver `User`), zeigt Feld-Konflikte übersichtlich an und führt Einträge interaktiv zusammen (übrige Dubletten wahlweise deaktivieren oder löschen).
58
+ - **TUI, Qt6-GUI & CLI:** Im Terminal mit Textual, auf dem Desktop optional mit PySide6/Qt6 (Live-Suche, Gruppen-/Identity-Tabs, `extra_options`-Editor, Config-Vorschau) oder skriptbar über die CLI.
59
+ - **Sicherheitsnetz:** Keine Speicherung privater Schlüssel-Inhalte (nur Pfade & `.pub`-Metadaten), atomares Schreiben und automatische Zeitstempel-Backups (`*.bak.YYYYMMDD-HHMMSS`) vor jedem Überschreiben.
60
+
61
+ ---
62
+
63
+ ## Schnellstart mit `uv` / `uvx`
64
+
65
+ > **Hinweis zur Beta-Version (`0.1.0b1`):** Da es sich um eine Vorabversion handelt, benötigt `uvx` / `uv tool install` aktuell das Flag `--prerelease=allow`. Ab dem regulären `0.1.0`-Release entfällt dieses Flag.
66
+
67
+ ### Ohne Installation direkt ausführen (`uvx`)
68
+
69
+ ```bash
70
+ # Textual-TUI direkt starten (legt ~/.ssh/sshcnfgr.toml bei Bedarf an)
71
+ uvx --prerelease=allow sshcnfgr
72
+
73
+ # Optionale Qt6 Desktop-GUI starten (Wayland / X11 / macOS / Windows)
74
+ uvx --prerelease=allow --from "sshcnfgr[qt]" sshcnfgr gui
75
+
76
+ # Bestehende ~/.ssh/config importieren
77
+ uvx --prerelease=allow sshcnfgr import --source ~/.ssh/config
78
+ ```
79
+
80
+ ### Dauerhaft als CLI-Tool installieren (`uv tool install`)
81
+
82
+ ```bash
83
+ # Terminal-Version (TUI + CLI)
84
+ uv tool install --prerelease=allow sshcnfgr
85
+
86
+ # Inklusive Qt6 Desktop-GUI
87
+ uv tool install --prerelease=allow "sshcnfgr[qt]"
88
+
89
+ # Danach direkt nutzbar:
90
+ sshcnfgr # startet die TUI
91
+ sshcnfgr gui # startet die Qt6-GUI
92
+ sshcnfgr --help # zeigt alle Kommandos
93
+ ```
94
+
95
+ *(Falls `uv` noch nicht installiert ist: `curl -LsSf https://astral.sh/uv/install.sh | sh` auf Linux/macOS bzw. `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"` unter Windows.)*
96
+
97
+ ---
98
+
99
+ ## Typischer Ablauf
100
+
101
+ 1. **Vorhandene SSH-Config importieren** (deine `~/.ssh/config` wird nur gelesen):
102
+ ```bash
103
+ sshcnfgr import --source ~/.ssh/config
104
+ ```
105
+ 2. **Lokale SSH-Keys erfassen** (nur Pfade & `.pub`-Vorschau, keine Private Keys):
106
+ ```bash
107
+ sshcnfgr identities scan
108
+ ```
109
+ 3. **Hosts pflegen & Dubletten aufräumen:**
110
+ - In der TUI (`sshcnfgr`) mit **`Ctrl+U`** oder Button **„Dubletten“**
111
+ - Oder in der Qt6-GUI (`sshcnfgr gui`) über **„Dubletten…“** (`Ctrl+U`)
112
+ 4. **OpenSSH-Config erzeugen:**
113
+ ```bash
114
+ sshcnfgr generate
115
+ ```
116
+ Standard-Ausgabe ist `~/.ssh/config.generated` (`0600`). Du kannst sie direkt per `Include` in deiner `~/.ssh/config` einbinden:
117
+ ```sshconfig
118
+ Include config.generated
119
+ ```
120
+
121
+ ---
122
+
123
+ ## CLI-Übersicht
124
+
125
+ ```bash
126
+ sshcnfgr # TUI direkt starten
127
+ sshcnfgr tui # TUI starten
128
+ sshcnfgr gui # Qt6 Desktop-GUI starten ([qt]-Extra)
129
+ sshcnfgr import --source ~/.ssh/config # OpenSSH-Config importieren
130
+ sshcnfgr generate --output ~/.ssh/config.generated # OpenSSH-Config generieren
131
+ sshcnfgr identities scan # Keys aus ~/.ssh erfassen
132
+ sshcnfgr identities list # Bekannte Identities anzeigen
133
+ sshcnfgr groups set-identity prod id_ed25519 # Gruppen-Default-Identity setzen
134
+ sshcnfgr --version # Version anzeigen
135
+ ```
136
+
137
+ Optionales File-Logging (Standard: keine Logdatei):
138
+ ```bash
139
+ sshcnfgr --verbose --log-file /tmp/sshcnfgr.log generate
140
+ ```
141
+
142
+ ---
143
+
144
+ ## Dateien & Migration
145
+
146
+ | Datei | Zweck |
147
+ | --- | --- |
148
+ | `~/.ssh/sshcnfgr.toml` | Zentrale Source of Truth (Hosts, Gruppen, Identities, `global_options`, `[ui]`), `0600` auf POSIX |
149
+ | `~/.ssh/config.generated` | Generierte OpenSSH-Config (nur aktive Hosts, `Host *` am Ende), `0600` auf POSIX |
150
+ | `*.bak.YYYYMMDD-HHMMSS` | Automatisches Zeitstempel-Backup vor jedem Überschreiben |
151
+
152
+ > **Migration aus `0.1.0a1`:** Falls `~/.ssh/sshcnfgr.toml` noch nicht existiert, aber noch eine ältere `~/.config/sshcnfgr/hosts.toml` vorhanden ist, lädt SSHCnfgr diese automatisch und schreibt beim nächsten Speichern nach `~/.ssh/sshcnfgr.toml`.
153
+
154
+ ---
155
+
156
+ ## Entwicklung & Release
157
+
158
+ ```bash
159
+ git clone https://github.com/thomsbe/SSHCnfgr.git
160
+ cd SSHCnfgr
161
+ uv sync --extra dev --extra qt
162
+
163
+ # Linting & Tests (inkl. Textual Pilot & Qt6 Offscreen)
164
+ uv run ruff check .
165
+ QT_QPA_PLATFORM=offscreen uv run pytest -v
166
+ ```
167
+
168
+ ### Paket bauen & auf PyPI veröffentlichen
169
+
170
+ ```bash
171
+ uv build
172
+ uv run twine check dist/*
173
+ uv publish
174
+ ```
175
+
176
+ Weitere Dokumente: [CHANGELOG.md](CHANGELOG.md), [SECURITY.md](SECURITY.md), [CONTRIBUTING.md](CONTRIBUTING.md), [LICENSE](LICENSE) (MIT).
177
+
178
+ ---
179
+
180
+ ## English Summary
181
+
182
+ **SSHCnfgr** is a cross-platform (Linux, macOS, Windows) manager for OpenSSH host configurations backed by a **single TOML file** (`~/.ssh/sshcnfgr.toml`, `0600` permissions on POSIX) located right next to `~/.ssh/config`.
183
+
184
+ ### Key Features
185
+ - **Single source of truth:** Manage hosts, groups, identity profiles, and global defaults in `~/.ssh/sshcnfgr.toml` and generate clean OpenSSH configs (`~/.ssh/config.generated`) containing only enabled hosts.
186
+ - **Duplicate detection & interactive merge:** Finds hosts pointing to the same effective `(HostName, Port, User)` target, highlights field conflicts, merges non-conflicting attributes, and lets you disable or delete duplicates safely.
187
+ - **Three interfaces:** Interactive **Textual TUI** (default), optional **Qt6 desktop GUI** (`PySide6-Essentials`, Wayland/X11/macOS/Windows), and **Click CLI**.
188
+ - **Safe by design:** Never reads or stores private SSH key contents; writes atomically with `0600` permissions and creates timestamped backups before overwriting.
189
+
190
+ ### Quickstart
191
+ ```bash
192
+ # Run directly with uvx (during 0.1.0b1 beta, pass --prerelease=allow)
193
+ uvx --prerelease=allow sshcnfgr
194
+ uvx --prerelease=allow --from "sshcnfgr[qt]" sshcnfgr gui
195
+
196
+ # Or install globally as a tool
197
+ uv tool install --prerelease=allow sshcnfgr
198
+ uv tool install --prerelease=allow "sshcnfgr[qt]"
199
+
200
+ # Import existing OpenSSH config & generate
201
+ sshcnfgr import --source ~/.ssh/config
202
+ sshcnfgr generate
203
+ ```
204
+
205
+ Licensed under the [MIT License](LICENSE). See [SECURITY.md](SECURITY.md) for security reporting and [CONTRIBUTING.md](CONTRIBUTING.md) for development details.
@@ -0,0 +1,22 @@
1
+ sshcnfgr/__init__.py,sha256=LmieYhhe4ido1LkZ_itH6Ady-CVtf68eXd3WX5yiJ0I,76
2
+ sshcnfgr/cli.py,sha256=RTVO0CcK9k4fbMGNy5inSet_vJ1DcAUGe3muJ6CgQYg,5727
3
+ sshcnfgr/dedup.py,sha256=STV1mo7HDNcL0Ht4qVBbTOECMPTzHV6V2ruWF7NXHSY,12017
4
+ sshcnfgr/dedup_screen.py,sha256=PQcnBplh_LSDl6jjgv5dv9InQArBJblm6ZFPzhALz20,17706
5
+ sshcnfgr/generator.py,sha256=jEmYp1g-_swG2NgtRwq4B2LQJP6W-qEY38i0e6L1cXY,3012
6
+ sshcnfgr/identities.py,sha256=iMNFqXDwVP3FeocahLA0vyl-_y7gm576OHZpR95jFgA,2891
7
+ sshcnfgr/importer.py,sha256=dYM2slWxDeIucac_pPfJeneb8U-5YF7qtoeR89L9F08,5136
8
+ sshcnfgr/logging_conf.py,sha256=BZmdH0FdXxibbkmzI9W0p8OgB3PUb9Qf9Sb2pivyY9Y,1225
9
+ sshcnfgr/model.py,sha256=-Q-LnSf9JHq13-qd_VokGXjqF2WofUAH6KJ_YgxNAYo,8513
10
+ sshcnfgr/paths.py,sha256=7r-tspyEpRdCb3oC_dFUmZkHDNc2T9LgfXDYbK4GRzY,1175
11
+ sshcnfgr/settings.py,sha256=Um0Zm0rTZfubpD_wfHKjpg5jWcJqNs7pusYnb1I_28w,2699
12
+ sshcnfgr/store.py,sha256=oi7WU7yaxuPC5pS8pUb2w-cJ-uFcec91T7H9QEe6p-c,7529
13
+ sshcnfgr/tui.py,sha256=dFs2IrRhr5UROLlCPsGvV6W-Ze9m9hAFX7jNSsGDtvw,19192
14
+ sshcnfgr/tui.tcss,sha256=U3ObCzs_bORAusxQZqjtJ3DRVnoZNIYgBZIlheEzeD0,1224
15
+ sshcnfgr/gui/__init__.py,sha256=irezPyFiSaQVHi3ykm5b-mGb4vCv7M3FnJu7hiGMGcE,674
16
+ sshcnfgr/gui/dedup_dialog.py,sha256=fAhnKUJCqTqj2mG36Wp5QoZVzZrLvuXELgu406bkCkM,18511
17
+ sshcnfgr/gui/main_window.py,sha256=tsFhuWP7FsqlXlUxU0Fk8X8zk4xaAvMauZbcyemrpKI,48562
18
+ sshcnfgr-0.1.0b1.dist-info/METADATA,sha256=dSpIIVDOvRGto_dH2HgACbKoYB-_ud1chaWUy6dqSB8,9230
19
+ sshcnfgr-0.1.0b1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
20
+ sshcnfgr-0.1.0b1.dist-info/entry_points.txt,sha256=sWQfCKwcH8ap34Bl3odP3SZPPXjY-XjS5HfoIY2UlHI,46
21
+ sshcnfgr-0.1.0b1.dist-info/licenses/LICENSE,sha256=dZBs4qwqRmC1Wcgzxg47bOrGs0Dd1z-_DM1aPubso8I,1068
22
+ sshcnfgr-0.1.0b1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ sshcnfgr = sshcnfgr.cli:cli
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Thomas Baer
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.