devs-webadmin 2.0.12__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.
@@ -0,0 +1,165 @@
1
+ Metadata-Version: 2.4
2
+ Name: devs-webadmin
3
+ Version: 2.0.12
4
+ Summary: Web admin UI for managing devcontainers on a server
5
+ Author: Dan Lester
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/ideonate/devs
8
+ Project-URL: Repository, https://github.com/ideonate/devs
9
+ Project-URL: Issues, https://github.com/ideonate/devs/issues
10
+ Project-URL: Documentation, https://github.com/ideonate/devs/tree/main/packages/webadmin
11
+ Keywords: devcontainer,docker,webadmin,management
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Web Environment
14
+ Classifier: Framework :: FastAPI
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Topic :: System :: Systems Administration
25
+ Requires-Python: >=3.8
26
+ Description-Content-Type: text/markdown
27
+ Requires-Dist: fastapi>=0.68.0
28
+ Requires-Dist: uvicorn[standard]>=0.15.0
29
+ Requires-Dist: click>=8.0.0
30
+ Requires-Dist: devs-common>=0.1.0
31
+ Requires-Dist: structlog>=21.1.0
32
+ Provides-Extra: dev
33
+ Requires-Dist: pytest>=6.0; extra == "dev"
34
+ Requires-Dist: pytest-cov; extra == "dev"
35
+ Requires-Dist: pytest-asyncio; extra == "dev"
36
+ Requires-Dist: black; extra == "dev"
37
+ Requires-Dist: mypy; extra == "dev"
38
+ Requires-Dist: flake8; extra == "dev"
39
+ Requires-Dist: httpx; extra == "dev"
40
+ Requires-Dist: build>=0.10.0; extra == "dev"
41
+ Requires-Dist: twine>=4.0.0; extra == "dev"
42
+
43
+ # devs-webadmin - Web Admin UI
44
+
45
+ A web-based admin interface for managing devcontainers on a server. Provides the same core functionality as the `devs` CLI but accessible from a browser -- useful for headless servers, remote machines, or when you want a visual overview of running containers.
46
+
47
+ ## Features
48
+
49
+ - **Container Management**: Start, stop, and clean up devcontainers from a web UI
50
+ - **Repository-Based**: Enter any GitHub `org/repo` to start containers (uses RepoCache, no local checkout needed)
51
+ - **All Containers View**: See all devs-managed containers across all projects at a glance
52
+ - **VS Code Tunnels**: Start, stop, and authenticate tunnels directly from the browser
53
+ - **Tunnel Auth via Device Flow**: GitHub device code flow for tunnel authentication without needing a terminal
54
+
55
+ ## Installation
56
+
57
+ ```bash
58
+ # From the monorepo root
59
+ pip install -e packages/webadmin/
60
+
61
+ # Or when published
62
+ pip install devs-webadmin
63
+ ```
64
+
65
+ ## Quick Start
66
+
67
+ ```bash
68
+ # Start the web admin server
69
+ devs-webadmin serve
70
+
71
+ # Open http://localhost:8080 in your browser
72
+ ```
73
+
74
+ ## Usage
75
+
76
+ ### Starting the Server
77
+
78
+ ```bash
79
+ # Default: 0.0.0.0:8080
80
+ devs-webadmin serve
81
+
82
+ # Custom host/port
83
+ devs-webadmin serve --host 127.0.0.1 --port 3000
84
+
85
+ # Development mode with auto-reload
86
+ devs-webadmin serve --reload
87
+ ```
88
+
89
+ ### Web UI
90
+
91
+ The UI has two main sections:
92
+
93
+ **Start Container Form** -- Enter a GitHub repository (e.g. `ideonate/devs`) and a dev name (e.g. `sally`), then click Start. The repo is cloned/updated via the shared repo cache at `~/.devs/repocache/`.
94
+
95
+ **Container List** -- Shows all devs-managed containers with:
96
+ - Status (running/exited) with color indicators
97
+ - Project name, mode (copy/live), creation time
98
+ - Stop (preserves container state) and Clean (removes container + workspace) buttons
99
+ - Tunnel controls for running containers
100
+
101
+ ### Tunnel Controls
102
+
103
+ Each running container shows a tunnel panel:
104
+
105
+ - **Start tunnel** -- Launches a VS Code tunnel in the container. Once running, shows an "Open in browser" link to `vscode.dev`.
106
+ - **Kill tunnel** -- Stops a running tunnel.
107
+ - **Auth** -- Opens a modal with the GitHub device flow. A device code is displayed along with a link to `github.com/login/device`. Complete the login in your browser and the modal updates automatically when authentication succeeds. Auth persists across container stop/restart cycles.
108
+
109
+ ## Configuration
110
+
111
+ ### Environment Variables
112
+
113
+ | Variable | Default | Description |
114
+ |---|---|---|
115
+ | `WEBADMIN_HOST` | `0.0.0.0` | Server bind address |
116
+ | `WEBADMIN_PORT` | `8080` | Server port |
117
+ | `DEVS_WORKSPACES_DIR` | `~/.devs/workspaces` | Workspace directory |
118
+ | `DEVS_REPO_CACHE_DIR` | `~/.devs/repocache` | Repository cache directory |
119
+ | `DEVS_CLAUDE_CONFIG_DIR` | `~/.devs/claudeconfig` | Claude config directory |
120
+ | `DEVS_CODEX_CONFIG_DIR` | `~/.devs/codexconfig` | Codex config directory |
121
+ | `GH_TOKEN` / `GITHUB_TOKEN` | (none) | GitHub token for private repos |
122
+
123
+ ### Shared Directories
124
+
125
+ The webadmin shares the same directories as the CLI and webhook:
126
+
127
+ - `~/.devs/repocache/` -- Cached repository clones
128
+ - `~/.devs/workspaces/` -- Workspace copies for containers
129
+ - `~/.devs/claudeconfig/` -- Claude authentication
130
+
131
+ ## Architecture
132
+
133
+ ### Backend
134
+
135
+ - **FastAPI** + **Uvicorn** (same stack as the webhook package)
136
+ - Uses `devs-common` for all container/workspace/repo operations
137
+ - Synchronous common library calls wrapped with `asyncio.to_thread`
138
+ - Stop/clean operations work by Docker container name (no repo cloning needed)
139
+
140
+ ### Frontend
141
+
142
+ - **Vue 3** loaded from CDN (no build step, no npm required)
143
+ - Single `index.html` served as a static file from the Python package
144
+ - Self-contained -- ships inside the pip package with no external build process
145
+
146
+ ### API Endpoints
147
+
148
+ | Method | Path | Description |
149
+ |---|---|---|
150
+ | `GET` | `/api/containers` | List all containers (optional `?repo=org/repo` filter) |
151
+ | `POST` | `/api/start` | Start container `{ repo, dev_name }` |
152
+ | `POST` | `/api/stop` | Stop container `{ container_name }` |
153
+ | `POST` | `/api/clean` | Remove container + workspace `{ container_name }` |
154
+ | `GET` | `/api/tunnel/status` | Tunnel status `?container_name=X` |
155
+ | `POST` | `/api/tunnel/start` | Start tunnel `{ container_name }` |
156
+ | `POST` | `/api/tunnel/kill` | Kill tunnel `{ container_name }` |
157
+ | `POST` | `/api/tunnel/auth` | Start device flow auth `{ container_name }` |
158
+ | `GET` | `/api/tunnel/auth/status` | Poll auth completion `?container_name=X` |
159
+
160
+ ## Requirements
161
+
162
+ - **Python 3.8+**
163
+ - **Docker** running and accessible
164
+ - **DevContainer CLI**: `npm install -g @devcontainers/cli`
165
+ - **devs-common** package (installed automatically as a dependency)
@@ -0,0 +1,123 @@
1
+ # devs-webadmin - Web Admin UI
2
+
3
+ A web-based admin interface for managing devcontainers on a server. Provides the same core functionality as the `devs` CLI but accessible from a browser -- useful for headless servers, remote machines, or when you want a visual overview of running containers.
4
+
5
+ ## Features
6
+
7
+ - **Container Management**: Start, stop, and clean up devcontainers from a web UI
8
+ - **Repository-Based**: Enter any GitHub `org/repo` to start containers (uses RepoCache, no local checkout needed)
9
+ - **All Containers View**: See all devs-managed containers across all projects at a glance
10
+ - **VS Code Tunnels**: Start, stop, and authenticate tunnels directly from the browser
11
+ - **Tunnel Auth via Device Flow**: GitHub device code flow for tunnel authentication without needing a terminal
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ # From the monorepo root
17
+ pip install -e packages/webadmin/
18
+
19
+ # Or when published
20
+ pip install devs-webadmin
21
+ ```
22
+
23
+ ## Quick Start
24
+
25
+ ```bash
26
+ # Start the web admin server
27
+ devs-webadmin serve
28
+
29
+ # Open http://localhost:8080 in your browser
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ### Starting the Server
35
+
36
+ ```bash
37
+ # Default: 0.0.0.0:8080
38
+ devs-webadmin serve
39
+
40
+ # Custom host/port
41
+ devs-webadmin serve --host 127.0.0.1 --port 3000
42
+
43
+ # Development mode with auto-reload
44
+ devs-webadmin serve --reload
45
+ ```
46
+
47
+ ### Web UI
48
+
49
+ The UI has two main sections:
50
+
51
+ **Start Container Form** -- Enter a GitHub repository (e.g. `ideonate/devs`) and a dev name (e.g. `sally`), then click Start. The repo is cloned/updated via the shared repo cache at `~/.devs/repocache/`.
52
+
53
+ **Container List** -- Shows all devs-managed containers with:
54
+ - Status (running/exited) with color indicators
55
+ - Project name, mode (copy/live), creation time
56
+ - Stop (preserves container state) and Clean (removes container + workspace) buttons
57
+ - Tunnel controls for running containers
58
+
59
+ ### Tunnel Controls
60
+
61
+ Each running container shows a tunnel panel:
62
+
63
+ - **Start tunnel** -- Launches a VS Code tunnel in the container. Once running, shows an "Open in browser" link to `vscode.dev`.
64
+ - **Kill tunnel** -- Stops a running tunnel.
65
+ - **Auth** -- Opens a modal with the GitHub device flow. A device code is displayed along with a link to `github.com/login/device`. Complete the login in your browser and the modal updates automatically when authentication succeeds. Auth persists across container stop/restart cycles.
66
+
67
+ ## Configuration
68
+
69
+ ### Environment Variables
70
+
71
+ | Variable | Default | Description |
72
+ |---|---|---|
73
+ | `WEBADMIN_HOST` | `0.0.0.0` | Server bind address |
74
+ | `WEBADMIN_PORT` | `8080` | Server port |
75
+ | `DEVS_WORKSPACES_DIR` | `~/.devs/workspaces` | Workspace directory |
76
+ | `DEVS_REPO_CACHE_DIR` | `~/.devs/repocache` | Repository cache directory |
77
+ | `DEVS_CLAUDE_CONFIG_DIR` | `~/.devs/claudeconfig` | Claude config directory |
78
+ | `DEVS_CODEX_CONFIG_DIR` | `~/.devs/codexconfig` | Codex config directory |
79
+ | `GH_TOKEN` / `GITHUB_TOKEN` | (none) | GitHub token for private repos |
80
+
81
+ ### Shared Directories
82
+
83
+ The webadmin shares the same directories as the CLI and webhook:
84
+
85
+ - `~/.devs/repocache/` -- Cached repository clones
86
+ - `~/.devs/workspaces/` -- Workspace copies for containers
87
+ - `~/.devs/claudeconfig/` -- Claude authentication
88
+
89
+ ## Architecture
90
+
91
+ ### Backend
92
+
93
+ - **FastAPI** + **Uvicorn** (same stack as the webhook package)
94
+ - Uses `devs-common` for all container/workspace/repo operations
95
+ - Synchronous common library calls wrapped with `asyncio.to_thread`
96
+ - Stop/clean operations work by Docker container name (no repo cloning needed)
97
+
98
+ ### Frontend
99
+
100
+ - **Vue 3** loaded from CDN (no build step, no npm required)
101
+ - Single `index.html` served as a static file from the Python package
102
+ - Self-contained -- ships inside the pip package with no external build process
103
+
104
+ ### API Endpoints
105
+
106
+ | Method | Path | Description |
107
+ |---|---|---|
108
+ | `GET` | `/api/containers` | List all containers (optional `?repo=org/repo` filter) |
109
+ | `POST` | `/api/start` | Start container `{ repo, dev_name }` |
110
+ | `POST` | `/api/stop` | Stop container `{ container_name }` |
111
+ | `POST` | `/api/clean` | Remove container + workspace `{ container_name }` |
112
+ | `GET` | `/api/tunnel/status` | Tunnel status `?container_name=X` |
113
+ | `POST` | `/api/tunnel/start` | Start tunnel `{ container_name }` |
114
+ | `POST` | `/api/tunnel/kill` | Kill tunnel `{ container_name }` |
115
+ | `POST` | `/api/tunnel/auth` | Start device flow auth `{ container_name }` |
116
+ | `GET` | `/api/tunnel/auth/status` | Poll auth completion `?container_name=X` |
117
+
118
+ ## Requirements
119
+
120
+ - **Python 3.8+**
121
+ - **Docker** running and accessible
122
+ - **DevContainer CLI**: `npm install -g @devcontainers/cli`
123
+ - **devs-common** package (installed automatically as a dependency)
@@ -0,0 +1,10 @@
1
+ """Web Admin UI for DevContainer Management."""
2
+
3
+ from importlib.metadata import version, PackageNotFoundError
4
+
5
+ try:
6
+ __version__ = version("devs-webadmin")
7
+ except PackageNotFoundError:
8
+ __version__ = "0.0.0"
9
+ __author__ = "Dan Lester"
10
+ __email__ = "dan@ideonate.com"
File without changes