devdoor 0.1.0__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.
- devdoor/__init__.py +6 -0
- devdoor/__main__.py +8 -0
- devdoor/cli/__init__.py +1 -0
- devdoor/cli/app.py +99 -0
- devdoor/cli/auth.py +178 -0
- devdoor/cli/domains.py +214 -0
- devdoor/cli/inspector.py +209 -0
- devdoor/cli/local.py +790 -0
- devdoor/cli/share.py +443 -0
- devdoor/cli/validators.py +40 -0
- devdoor/core/__init__.py +1 -0
- devdoor/core/config.py +482 -0
- devdoor/core/engine.py +495 -0
- devdoor/core/events.py +287 -0
- devdoor/core/protocol.py +462 -0
- devdoor/core/router.py +163 -0
- devdoor/inspector/__init__.py +14 -0
- devdoor/inspector/curl.py +68 -0
- devdoor/inspector/daemon_hook.py +147 -0
- devdoor/inspector/replay.py +122 -0
- devdoor/inspector/store.py +291 -0
- devdoor/platform/__init__.py +36 -0
- devdoor/platform/base.py +209 -0
- devdoor/platform/darwin.py +194 -0
- devdoor/platform/linux.py +185 -0
- devdoor/platform/windows.py +143 -0
- devdoor/proxy/__init__.py +7 -0
- devdoor/proxy/certs.py +311 -0
- devdoor/proxy/forwarder.py +457 -0
- devdoor/proxy/https_server.py +122 -0
- devdoor/tui/__init__.py +17 -0
- devdoor/tui/inspector_app.py +667 -0
- devdoor/tunnel/__init__.py +1 -0
- devdoor/tunnel/auth_client.py +287 -0
- devdoor/tunnel/client.py +309 -0
- devdoor/tunnel/httperr.py +168 -0
- devdoor/tunnel/mux.py +566 -0
- devdoor/tunnel/relay_api.py +245 -0
- devdoor-0.1.0.dist-info/METADATA +227 -0
- devdoor-0.1.0.dist-info/RECORD +43 -0
- devdoor-0.1.0.dist-info/WHEEL +4 -0
- devdoor-0.1.0.dist-info/entry_points.txt +3 -0
- devdoor-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"""Client-side subdomain validation and typed REST client for devdoor-relay."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
from typing import cast
|
|
7
|
+
|
|
8
|
+
import aiohttp
|
|
9
|
+
from pydantic import BaseModel, ConfigDict
|
|
10
|
+
|
|
11
|
+
from devdoor.tunnel.auth_client import normalize_relay_url
|
|
12
|
+
from devdoor.tunnel.httperr import (
|
|
13
|
+
ManagedHttpClient,
|
|
14
|
+
RelayRequestError,
|
|
15
|
+
decode_json_response,
|
|
16
|
+
format_network_error,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
_SUBDOMAIN_RE = re.compile(r"^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$")
|
|
20
|
+
|
|
21
|
+
RESERVED_SYSTEM_SUBDOMAINS: frozenset[str] = frozenset(
|
|
22
|
+
{
|
|
23
|
+
"admin",
|
|
24
|
+
"api",
|
|
25
|
+
"app",
|
|
26
|
+
"auth",
|
|
27
|
+
"billing",
|
|
28
|
+
"cdn",
|
|
29
|
+
"dashboard",
|
|
30
|
+
"devdoor",
|
|
31
|
+
"docs",
|
|
32
|
+
"localhost",
|
|
33
|
+
"login",
|
|
34
|
+
"mail",
|
|
35
|
+
"oauth",
|
|
36
|
+
"relay",
|
|
37
|
+
"root",
|
|
38
|
+
"status",
|
|
39
|
+
"support",
|
|
40
|
+
"ws",
|
|
41
|
+
"www",
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
PROTECTED_BRAND_KEYWORDS: tuple[str, ...] = (
|
|
46
|
+
"amazon",
|
|
47
|
+
"anthropic",
|
|
48
|
+
"apple",
|
|
49
|
+
"auth0",
|
|
50
|
+
"aws",
|
|
51
|
+
"bankofamerica",
|
|
52
|
+
"binance",
|
|
53
|
+
"chase",
|
|
54
|
+
"cloudflare",
|
|
55
|
+
"coinbase",
|
|
56
|
+
"discord",
|
|
57
|
+
"dropbox",
|
|
58
|
+
"facebook",
|
|
59
|
+
"github",
|
|
60
|
+
"google",
|
|
61
|
+
"meta",
|
|
62
|
+
"microsoft",
|
|
63
|
+
"netflix",
|
|
64
|
+
"okta",
|
|
65
|
+
"openai",
|
|
66
|
+
"paypal",
|
|
67
|
+
"slack",
|
|
68
|
+
"stripe",
|
|
69
|
+
"vercel",
|
|
70
|
+
"wellsfargo",
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class SubdomainValidationError(ValueError):
|
|
75
|
+
"""Raised when a requested subdomain fails syntax or brand-protection checks."""
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def validate_subdomain(raw: str) -> str:
|
|
79
|
+
"""Normalize and validate a requested tunnel subdomain before contacting the relay."""
|
|
80
|
+
candidate = raw.strip().lower()
|
|
81
|
+
if len(candidate) < 3 or len(candidate) > 63:
|
|
82
|
+
raise SubdomainValidationError(f"Subdomain {raw!r} must be between 3 and 63 characters.")
|
|
83
|
+
if candidate.startswith("xn--"):
|
|
84
|
+
raise SubdomainValidationError("Punycode 'xn--' subdomains are not permitted.")
|
|
85
|
+
if not _SUBDOMAIN_RE.fullmatch(candidate):
|
|
86
|
+
raise SubdomainValidationError(
|
|
87
|
+
f"Subdomain {raw!r} may only contain lowercase letters, digits, and hyphens."
|
|
88
|
+
)
|
|
89
|
+
if candidate in RESERVED_SYSTEM_SUBDOMAINS:
|
|
90
|
+
raise SubdomainValidationError(f"Subdomain {candidate!r} is reserved by the relay.")
|
|
91
|
+
|
|
92
|
+
compact = candidate.replace("-", "")
|
|
93
|
+
for brand in PROTECTED_BRAND_KEYWORDS:
|
|
94
|
+
if brand in compact:
|
|
95
|
+
raise SubdomainValidationError(
|
|
96
|
+
f"Subdomain {candidate!r} resembles protected brand {brand!r}."
|
|
97
|
+
)
|
|
98
|
+
return candidate
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class DomainRecord(BaseModel):
|
|
102
|
+
"""Relay custom-domain ownership and DNS verification status."""
|
|
103
|
+
|
|
104
|
+
model_config = ConfigDict(extra="ignore")
|
|
105
|
+
|
|
106
|
+
id: str
|
|
107
|
+
domain: str
|
|
108
|
+
verified: bool = False
|
|
109
|
+
txt_name: str | None = None
|
|
110
|
+
txt_value: str | None = None
|
|
111
|
+
cname_target: str | None = None
|
|
112
|
+
a_target: str | None = None
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
class SubdomainRecord(BaseModel):
|
|
116
|
+
"""Account-reserved vanity subdomain returned by ``GET /api/subdomains``."""
|
|
117
|
+
|
|
118
|
+
model_config = ConfigDict(extra="ignore")
|
|
119
|
+
|
|
120
|
+
name: str
|
|
121
|
+
url: str = ""
|
|
122
|
+
created_at: str | None = None
|
|
123
|
+
active: bool = False
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
class ActiveTunnelRecord(BaseModel):
|
|
127
|
+
"""Active tunnel summary returned by ``GET /api/tunnels/active``."""
|
|
128
|
+
|
|
129
|
+
model_config = ConfigDict(extra="ignore")
|
|
130
|
+
|
|
131
|
+
subdomain: str
|
|
132
|
+
url: str
|
|
133
|
+
domain: str | None = None
|
|
134
|
+
started_at: str | None = None
|
|
135
|
+
ttl_seconds: int | None = None
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
class RelayApiClient(ManagedHttpClient):
|
|
139
|
+
"""Typed async client for relay domain, subdomain, and active tunnel endpoints."""
|
|
140
|
+
|
|
141
|
+
def __init__(
|
|
142
|
+
self,
|
|
143
|
+
*,
|
|
144
|
+
relay_url: str,
|
|
145
|
+
token: str,
|
|
146
|
+
session: aiohttp.ClientSession | None = None,
|
|
147
|
+
timeout_seconds: float = 15.0,
|
|
148
|
+
) -> None:
|
|
149
|
+
super().__init__(session=session, timeout_seconds=timeout_seconds)
|
|
150
|
+
self._relay_url = normalize_relay_url(relay_url)
|
|
151
|
+
cleaned_token = token.strip()
|
|
152
|
+
if not cleaned_token:
|
|
153
|
+
raise RelayRequestError("Not authenticated. Run 'devdoor login' first.")
|
|
154
|
+
self._token = cleaned_token
|
|
155
|
+
|
|
156
|
+
async def _request_json(
|
|
157
|
+
self,
|
|
158
|
+
method: str,
|
|
159
|
+
path: str,
|
|
160
|
+
*,
|
|
161
|
+
json_body: dict[str, object] | None = None,
|
|
162
|
+
params: dict[str, str] | None = None,
|
|
163
|
+
) -> dict[str, object]:
|
|
164
|
+
headers = {"Authorization": f"Bearer {self._token}"}
|
|
165
|
+
try:
|
|
166
|
+
async with self._session().request(
|
|
167
|
+
method,
|
|
168
|
+
f"{self._relay_url}{path}",
|
|
169
|
+
headers=headers,
|
|
170
|
+
json=json_body,
|
|
171
|
+
params=params,
|
|
172
|
+
) as resp:
|
|
173
|
+
return await decode_json_response(resp)
|
|
174
|
+
except (aiohttp.ClientError, TimeoutError, OSError) as exc:
|
|
175
|
+
raise format_network_error(exc, self._relay_url) from exc
|
|
176
|
+
|
|
177
|
+
async def list_domains(self) -> list[DomainRecord]:
|
|
178
|
+
"""List custom domains registered for the current account."""
|
|
179
|
+
payload = await self._request_json("GET", "/api/domains")
|
|
180
|
+
raw_items = payload.get("domains", [])
|
|
181
|
+
if not isinstance(raw_items, list):
|
|
182
|
+
return []
|
|
183
|
+
return [
|
|
184
|
+
DomainRecord.model_validate(item)
|
|
185
|
+
for item in cast(list[object], raw_items)
|
|
186
|
+
if isinstance(item, dict)
|
|
187
|
+
]
|
|
188
|
+
|
|
189
|
+
async def add_domain(self, domain: str) -> DomainRecord:
|
|
190
|
+
"""Register a custom domain via ``POST /api/domains``."""
|
|
191
|
+
normalized = domain.strip().lower().rstrip(".")
|
|
192
|
+
if not normalized or "." not in normalized:
|
|
193
|
+
raise ValueError(f"Expected a fully qualified domain name, got {domain!r}")
|
|
194
|
+
payload = await self._request_json("POST", "/api/domains", json_body={"domain": normalized})
|
|
195
|
+
return DomainRecord.model_validate(payload)
|
|
196
|
+
|
|
197
|
+
async def _resolve_domain_id(self, domain_or_id: str) -> str:
|
|
198
|
+
target = domain_or_id.strip().lower().rstrip(".")
|
|
199
|
+
for item in await self.list_domains():
|
|
200
|
+
if item.id == domain_or_id or item.domain.lower() == target:
|
|
201
|
+
return item.id
|
|
202
|
+
if "." not in domain_or_id:
|
|
203
|
+
return domain_or_id
|
|
204
|
+
raise RelayRequestError(f"Custom domain {target!r} was not found on your account.")
|
|
205
|
+
|
|
206
|
+
async def verify_domain(self, domain_or_id: str) -> DomainRecord:
|
|
207
|
+
"""Trigger DNS TXT/CNAME verification via ``POST /api/domains/{id}/verify``."""
|
|
208
|
+
domain_id = await self._resolve_domain_id(domain_or_id)
|
|
209
|
+
payload = await self._request_json("POST", f"/api/domains/{domain_id}/verify")
|
|
210
|
+
return DomainRecord.model_validate(payload)
|
|
211
|
+
|
|
212
|
+
async def remove_domain(self, domain_or_id: str, *, force: bool = False) -> None:
|
|
213
|
+
"""Delete a registered custom domain via ``DELETE /api/domains/{id}``."""
|
|
214
|
+
domain_id = await self._resolve_domain_id(domain_or_id)
|
|
215
|
+
params = {"force": "true"} if force else None
|
|
216
|
+
await self._request_json("DELETE", f"/api/domains/{domain_id}", params=params)
|
|
217
|
+
|
|
218
|
+
async def list_subdomains(self) -> list[SubdomainRecord]:
|
|
219
|
+
"""List reserved subdomains from ``GET /api/subdomains``."""
|
|
220
|
+
payload = await self._request_json("GET", "/api/subdomains")
|
|
221
|
+
raw_items = payload.get("subdomains", [])
|
|
222
|
+
if not isinstance(raw_items, list):
|
|
223
|
+
return []
|
|
224
|
+
return [
|
|
225
|
+
SubdomainRecord.model_validate(item)
|
|
226
|
+
for item in cast(list[object], raw_items)
|
|
227
|
+
if isinstance(item, dict)
|
|
228
|
+
]
|
|
229
|
+
|
|
230
|
+
async def release_subdomain(self, name: str) -> None:
|
|
231
|
+
"""Release a reserved subdomain via ``DELETE /api/subdomains/{name}``."""
|
|
232
|
+
cleaned = name.strip().lower()
|
|
233
|
+
await self._request_json("DELETE", f"/api/subdomains/{cleaned}")
|
|
234
|
+
|
|
235
|
+
async def list_active_tunnels(self) -> list[ActiveTunnelRecord]:
|
|
236
|
+
"""List active public tunnels from ``GET /api/tunnels/active``."""
|
|
237
|
+
payload = await self._request_json("GET", "/api/tunnels/active")
|
|
238
|
+
raw_items = payload.get("tunnels", [])
|
|
239
|
+
if not isinstance(raw_items, list):
|
|
240
|
+
return []
|
|
241
|
+
return [
|
|
242
|
+
ActiveTunnelRecord.model_validate(item)
|
|
243
|
+
for item in cast(list[object], raw_items)
|
|
244
|
+
if isinstance(item, dict)
|
|
245
|
+
]
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: devdoor
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Open-source local HTTPS domain proxy, streaming tunnel client, and TUI inspector
|
|
5
|
+
Keywords: https,local-development,reverse-proxy,tunnel,websocket,tui
|
|
6
|
+
Author: Dipak Rathod
|
|
7
|
+
Author-email: Dipak Rathod <dipakrathod.tech@gmail.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: MacOS
|
|
14
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
18
|
+
Classifier: Topic :: Internet :: Proxy Servers
|
|
19
|
+
Classifier: Topic :: Software Development :: Testing
|
|
20
|
+
Requires-Dist: aiohttp>=3.14.5
|
|
21
|
+
Requires-Dist: aiosqlite>=0.22.1
|
|
22
|
+
Requires-Dist: cryptography>=50.0.2
|
|
23
|
+
Requires-Dist: psutil>=7.2.2
|
|
24
|
+
Requires-Dist: pydantic>=2.14.4
|
|
25
|
+
Requires-Dist: pyyaml>=6.0.4
|
|
26
|
+
Requires-Dist: rich>=15.0.0
|
|
27
|
+
Requires-Dist: textual>=8.2.8
|
|
28
|
+
Requires-Dist: typer>=0.29.3
|
|
29
|
+
Requires-Python: >=3.15
|
|
30
|
+
Project-URL: Homepage, https://github.com/dipakrathod-tech/DevDoor
|
|
31
|
+
Project-URL: Repository, https://github.com/dipakrathod-tech/DevDoor
|
|
32
|
+
Project-URL: Issues, https://github.com/dipakrathod-tech/DevDoor/issues
|
|
33
|
+
Project-URL: Security, https://github.com/dipakrathod-tech/DevDoor/security/advisories
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
<h1 align="center">DevDoor</h1>
|
|
37
|
+
|
|
38
|
+
<p align="center">
|
|
39
|
+
Local HTTPS domains, streaming tunnels, and built-in TUI request replay—100% open-source in Python.
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<a href="https://github.com/dipakrathod-tech/DevDoor/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/dipakrathod-tech/DevDoor/ci.yml?branch=main&style=flat-square&label=CI" alt="CI"></a>
|
|
44
|
+
<img src="https://img.shields.io/badge/python-3.15%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.15+">
|
|
45
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT License"></a>
|
|
46
|
+
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-111827?style=flat-square" alt="Platform">
|
|
47
|
+
<a href="https://github.com/dipakrathod-tech/devdoor-relay"><img src="https://img.shields.io/badge/relay-open%20source-16a34a?style=flat-square" alt="Open Source Relay"></a>
|
|
48
|
+
</p>
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
myapp.test → localhost:3000
|
|
52
|
+
myapp.test/api → localhost:8080
|
|
53
|
+
dashboard.test → localhost:5173
|
|
54
|
+
share --port 3000 → https://brisk-otter.devdoor.dev (streaming SSE + WebSockets + replay)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Why DevDoor?
|
|
58
|
+
|
|
59
|
+
- **Both sides open-source:** Pair the CLI with the self-hostable [`devdoor-relay`](https://github.com/dipakrathod-tech/devdoor-relay) server—no closed relay or paywalled vanity subdomains, custom domains, passwords, or TTLs.
|
|
60
|
+
- **True streaming & WebSockets:** Multiplexes HTTP body chunks, SSE/LLM streams, and WebSockets (Vite/Next.js HMR) over a single backpressure-controlled connection instead of buffering entire payloads in memory.
|
|
61
|
+
- **Built-in TUI Inspector & Replay:** Inspect live headers and bodies, copy as `cURL`, and replay captured webhooks locally even after closing a tunnel (`devdoor inspect`).
|
|
62
|
+
- **Cross-platform:** Trusted local `.test` HTTPS on macOS and Linux, plus zero-admin `*.localhost` mode (and optional elevated `.test`) on Windows.
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
65
|
+
|
|
66
|
+
> **Note:** Not yet published on PyPI—install directly from GitHub or a local source clone.
|
|
67
|
+
|
|
68
|
+
Requires **Python 3.15+** and [`uv`](https://docs.astral.sh/uv/) (or `pipx`):
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
uv tool install git+https://github.com/dipakrathod-tech/DevDoor.git
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Or run from a source checkout:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
git clone https://github.com/dipakrathod-tech/DevDoor.git
|
|
78
|
+
cd DevDoor
|
|
79
|
+
uv sync
|
|
80
|
+
uv run devdoor --help
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Quick Start
|
|
84
|
+
|
|
85
|
+
Map a local app to a trusted HTTPS domain:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
devdoor start myapp --port 3000
|
|
89
|
+
# https://myapp.test → localhost:3000
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Expose a local server (or multi-route project) to the internet:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
devdoor share --port 3000
|
|
96
|
+
# https://brisk-otter.devdoor.dev → localhost:3000
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Local HTTPS Domains
|
|
100
|
+
|
|
101
|
+
Start and stop local domains with automatic Root CA trust and per-domain SNI TLS certificates:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
devdoor start myapp --port 3000
|
|
105
|
+
devdoor start api --port 8080
|
|
106
|
+
devdoor start myapp --port 3000 --wait --timeout 15s # wait until upstream listens
|
|
107
|
+
devdoor stop myapp # stop one domain
|
|
108
|
+
devdoor stop # stop all domains
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Bare names default to `.test` on macOS/Linux (or `.localhost` in zero-admin Windows mode). You can specify any custom TLD explicitly:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
devdoor start app.loc --port 3000 # https://app.loc → localhost:3000
|
|
115
|
+
devdoor start my.demo --port 4000 # https://my.demo → localhost:4000
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
> **Note:** Avoid `.local`—it is reserved for mDNS and can cause slow DNS lookups on macOS and Linux.
|
|
119
|
+
|
|
120
|
+
Route multiple URL paths under one domain:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
devdoor start myapp --port 3000 --route /api=8080 --route /ws=9000 --cors
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Or declare services in `devdoor.yaml` (or `.devdoor.yaml`) at your project root:
|
|
127
|
+
|
|
128
|
+
```yaml
|
|
129
|
+
services:
|
|
130
|
+
- domain: myapp
|
|
131
|
+
port: 3000
|
|
132
|
+
routes:
|
|
133
|
+
- path: /api
|
|
134
|
+
port: 8080
|
|
135
|
+
- domain: dashboard
|
|
136
|
+
port: 5173
|
|
137
|
+
log_mode: full # full | minimal | off
|
|
138
|
+
cors: true # inject dev CORS headers on proxied responses
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
devdoor up # start all project services
|
|
143
|
+
devdoor up --config /path/to/devdoor.yaml
|
|
144
|
+
devdoor down # stop project services only
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Internet Sharing & Self-Hosting
|
|
148
|
+
|
|
149
|
+
Authenticate via browser OAuth (`GitHub` / `OIDC`) or an API token, then share a local port or a `devdoor.yaml` multi-route service:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
devdoor login # browser OAuth device flow
|
|
153
|
+
devdoor login --token dd_your_api_token # headless / CI / self-hosted token
|
|
154
|
+
devdoor logout # clear stored local credentials
|
|
155
|
+
devdoor config set relay https://tunnel.example.com # point to your own devdoor-relay
|
|
156
|
+
devdoor config show # inspect current config
|
|
157
|
+
|
|
158
|
+
devdoor share --port 3000 # random subdomain
|
|
159
|
+
devdoor share myapp # share multi-route devdoor.yaml service
|
|
160
|
+
devdoor share --port 3000 --subdomain demo # reserved vanity subdomain
|
|
161
|
+
devdoor share --port 3000 --password secret # password-protected tunnel (HTTP Basic Auth)
|
|
162
|
+
devdoor share --port 3000 --ttl 30m # auto-expire after 30 minutes
|
|
163
|
+
devdoor share --port 3000 --domain api.example.com # verified custom domain
|
|
164
|
+
devdoor share --port 3000 --preserve-host # preserve incoming public Host header
|
|
165
|
+
devdoor share --port 3000 --cors # inject dev CORS headers
|
|
166
|
+
devdoor share --port 3000 --tui # live Textual inspector during share
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Manage verified custom domains and reserved vanity subdomains:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
devdoor domain add api.example.com
|
|
173
|
+
devdoor domain verify api.example.com
|
|
174
|
+
devdoor domain list
|
|
175
|
+
devdoor domain remove api.example.com
|
|
176
|
+
|
|
177
|
+
devdoor subdomain list
|
|
178
|
+
devdoor subdomain release demo
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Browser Warning Gate
|
|
182
|
+
|
|
183
|
+
Random-subdomain tunnels display a one-time interstitial notice on browser page loads to protect shared relay domains. It is skipped automatically for vanity subdomains, custom domains, password-protected tunnels, and programmatic HTTP clients (`curl`, webhooks, `fetch`/XHR, CORS preflights, WebSockets). Browser-like scripts can also bypass it explicitly:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
curl -H "DevDoor-Skip-Browser-Warning: 1" https://brisk-otter.devdoor.dev/
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Request Inspector, Logs & Diagnostics
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
devdoor inspect # launch Textual TUI inspector & local replay
|
|
193
|
+
devdoor inspect --domain myapp.test # filter exchanges to one domain
|
|
194
|
+
devdoor list # list local domains + active tunnels (alias: ls)
|
|
195
|
+
devdoor list --json
|
|
196
|
+
|
|
197
|
+
devdoor logs # view captured access logs
|
|
198
|
+
devdoor logs --follow myapp # tail logs for one domain (-f)
|
|
199
|
+
devdoor logs --flush # clear stored logs from inspector.db
|
|
200
|
+
|
|
201
|
+
devdoor doctor # verify CA, trust store, port forwarding, hosts, certs
|
|
202
|
+
devdoor upgrade # upgrade devdoor via uv/pipx/pip (alias: update)
|
|
203
|
+
devdoor version # print version and Python runtime
|
|
204
|
+
devdoor uninstall # remove CA, trust, hosts entries, firewall rules, ~/.devdoor
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Contributing
|
|
208
|
+
|
|
209
|
+
Contributions are welcome! Please read the [Contributing Guide](CONTRIBUTING.md), follow the [Code of Conduct](CODE_OF_CONDUCT.md), and adhere to [CONSTRAINTS.md](CONSTRAINTS.md).
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
git clone https://github.com/dipakrathod-tech/DevDoor.git
|
|
213
|
+
cd DevDoor
|
|
214
|
+
uv sync
|
|
215
|
+
|
|
216
|
+
./scripts/check.sh fast # pyright strict, ruff, import-linter, floor guard
|
|
217
|
+
./scripts/check.sh task # fast checks + pytest coverage (>= 80% changed lines) + bandit
|
|
218
|
+
./scripts/check.sh full # task checks + pip-audit (+ gitleaks if installed)
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Security
|
|
222
|
+
|
|
223
|
+
Please report security vulnerabilities privately as described in [SECURITY.md](SECURITY.md) rather than opening a public issue.
|
|
224
|
+
|
|
225
|
+
## License
|
|
226
|
+
|
|
227
|
+
Released under the [MIT License](LICENSE). Copyright (c) 2026 Dipak Rathod.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
devdoor/__init__.py,sha256=R9w4TfZMJd-rskAbkwsAuD6PqRaF2u-PGPk7gfGFZDs,167
|
|
2
|
+
devdoor/__main__.py,sha256=YHk2_zL7xcTCIh4D-EXL5D9xmV23cYmjkNg_A25Alfg,165
|
|
3
|
+
devdoor/cli/__init__.py,sha256=tdQTfbjOsXjZQ4yR9tzRst_RFU-YLSPhdboPP-Mme60,60
|
|
4
|
+
devdoor/cli/app.py,sha256=VXDQeFe_bqdNovCz0k_Kz79pttsVWUVlYWodJAUztNQ,2914
|
|
5
|
+
devdoor/cli/auth.py,sha256=_8DZhZaDtllQU3VVADb47oWmn79xES7TXyq70Qym42I,6080
|
|
6
|
+
devdoor/cli/domains.py,sha256=tKG3TRSAXPfZqkfn1AL4Mjeklzn0gcUxA_TzVXwS9VY,8320
|
|
7
|
+
devdoor/cli/inspector.py,sha256=j6K-ZxZfQwkxVlymKy0Grmo_WJfLIqbV-Q502noBPAA,7511
|
|
8
|
+
devdoor/cli/local.py,sha256=E7Nl_kCKJByNn4EOTFY5w-o2haf4rhlqPdXMsfCFCDQ,28880
|
|
9
|
+
devdoor/cli/share.py,sha256=n11YUFVqGz5-SyCft_mRfynPLKscUysIw_Jq5gJRBjI,15202
|
|
10
|
+
devdoor/cli/validators.py,sha256=ZGwczptPHrEsWrptfh9B4vmlCzdOeuSahFBkVBCahuY,1429
|
|
11
|
+
devdoor/core/__init__.py,sha256=AaMdMPs59MmjDHGSb45gL0gigW_Y5igX3_v1fg9P4Zk,40
|
|
12
|
+
devdoor/core/config.py,sha256=JW23O_qjPhQOHja6Y7Chivy5GXMq3fqscHhAtSxKCdo,15803
|
|
13
|
+
devdoor/core/engine.py,sha256=qxNOf7ESMH3PWA9B2_6EVQnqWpNO9RC4Q3F8N921kMQ,18116
|
|
14
|
+
devdoor/core/events.py,sha256=Kzv-yTlsDd8PYrUruSdYdA18HUHRv67GWcVYiXk9crc,10014
|
|
15
|
+
devdoor/core/protocol.py,sha256=gt_LrfTXJa6p19V_eo0ic7FPRLru32IrjHMCuGbtnOA,16182
|
|
16
|
+
devdoor/core/router.py,sha256=557eaWW9_rzMiMu_osg-J7CvUJvpKmiRS5b62ravC4k,5408
|
|
17
|
+
devdoor/inspector/__init__.py,sha256=GvOF8TKda0bAYaxHIVh3lAnwuTGqLJSDUhSV3xUndIw,419
|
|
18
|
+
devdoor/inspector/curl.py,sha256=iwyqhdiT4XT5voD4AybvYjuXcM-ILx8z9fsvMiX6ojo,2084
|
|
19
|
+
devdoor/inspector/daemon_hook.py,sha256=dBb9kB1mhg2OY5ElitLkH1MvLOlhUs11RicHKT3oo3M,5967
|
|
20
|
+
devdoor/inspector/replay.py,sha256=DjZRVBeSmYVEnFDAYACdwNpJ9Mi-91FFyF4Xwc9OV80,4450
|
|
21
|
+
devdoor/inspector/store.py,sha256=qOJdkvhE_6N3hsMYd-EuXsibl3x6G30uz_NV5E72f3A,10632
|
|
22
|
+
devdoor/platform/__init__.py,sha256=KhXqTuuOLd6hjRLIAaDdHWTwYmNTEvL2Emdb47jSjqo,1034
|
|
23
|
+
devdoor/platform/base.py,sha256=Io9MiP0Q-gctUiAupYUTv5p5ZUxOfrtV2ybOVEZGpoE,6665
|
|
24
|
+
devdoor/platform/darwin.py,sha256=TiVBcN8c7nCWKoAX6vUAR-rVfNlL1T_LJ4t2dFwEvV0,7222
|
|
25
|
+
devdoor/platform/linux.py,sha256=8jJqS6pHuUS3DtitPNS0PP9eYCsatLTkPdyZ5dUiN5U,7076
|
|
26
|
+
devdoor/platform/windows.py,sha256=FmRIUWnAEGGA_87mmCR72CKYWdy-qbESqDJ5MflzqOQ,4546
|
|
27
|
+
devdoor/proxy/__init__.py,sha256=wiM3P2xZTmv2rayXWFjRO9jPoBoeIb3QizOXkANL7H0,222
|
|
28
|
+
devdoor/proxy/certs.py,sha256=UdxuGsuvIITnwCwsoUH2wdj3XSaWmJmANALM4-YlCJs,12506
|
|
29
|
+
devdoor/proxy/forwarder.py,sha256=HRTlQgxBxuCaQbWaetir0aQVLw848woBFMwt9sjO_7E,15728
|
|
30
|
+
devdoor/proxy/https_server.py,sha256=0CqM7oc_2w97rLtL-ifX3558xTZPlpa3Vrq__Tq-oQE,4640
|
|
31
|
+
devdoor/tui/__init__.py,sha256=LCjz3iaO_z-DKQV4ca8ttudbmiSDTa7KsTIR9yd7eM4,342
|
|
32
|
+
devdoor/tui/inspector_app.py,sha256=l3LAVYZznVJyLUkH62SxKfl72SYEkqicuRPtSq2Ryfw,23478
|
|
33
|
+
devdoor/tunnel/__init__.py,sha256=iDMpiB-731zZXpAhf29RkOg20ZNiD_IgAT15jgRsyy8,85
|
|
34
|
+
devdoor/tunnel/auth_client.py,sha256=Ua7ni8EZ0t0UvmzX7uv7-Av0sMl7t1yJU6AdJFZpqB0,10575
|
|
35
|
+
devdoor/tunnel/client.py,sha256=HXpOopFvbDvm5iQCbN6StU59v-oUhIFemiyAo0kEACs,12132
|
|
36
|
+
devdoor/tunnel/httperr.py,sha256=R_lA5acpFrysVCQAyE9NFR3GVlsWGNY9sXSfuaxad8s,5838
|
|
37
|
+
devdoor/tunnel/mux.py,sha256=LwAfRKpBTH6wTXCmxQyuc3b-otmgDNj_bGEi6zwacpk,21343
|
|
38
|
+
devdoor/tunnel/relay_api.py,sha256=WCYWSe-Xe0yZLvLGgGU1Vkd8i8yEUR70Ys3VKUG50aQ,8075
|
|
39
|
+
devdoor-0.1.0.dist-info/licenses/LICENSE,sha256=95tkAzd4PRhd-BG4JHLBhwDYM8i7xo2-CEoBPjs9NDM,1069
|
|
40
|
+
devdoor-0.1.0.dist-info/WHEEL,sha256=-gI5GRFdiNNn2CFz-ptlExISMINC-k8bFxeojAlHbrM,81
|
|
41
|
+
devdoor-0.1.0.dist-info/entry_points.txt,sha256=YVDlhIOc-QZKlzGr5fMnUb3QwJGzL5ml7_vR2ockiqk,50
|
|
42
|
+
devdoor-0.1.0.dist-info/METADATA,sha256=ZNO1MV7wZKgFyCiM3qFcj77lsKE7jT8qPiFHso12_-U,9400
|
|
43
|
+
devdoor-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dipak Rathod
|
|
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.
|