ghostdock 0.0.17 → 0.0.18
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.
- package/dist/cli-reference.md +18 -0
- package/dist/cli.md +58 -1
- package/dist/index.js +2034 -1454
- package/package.json +1 -1
package/dist/cli-reference.md
CHANGED
|
@@ -28,6 +28,24 @@ ghostdock apps list [flags]
|
|
|
28
28
|
|
|
29
29
|
MCP tool: `apps_list`.
|
|
30
30
|
|
|
31
|
+
## `ghostdock docker`
|
|
32
|
+
|
|
33
|
+
Docker over the private network: a sandbox's Docker engine from this machine.
|
|
34
|
+
|
|
35
|
+
### `ghostdock docker context`
|
|
36
|
+
|
|
37
|
+
Point Docker at a sandbox's Docker engine over the private network: plain `docker` and `docker compose` then run there. Creates (or updates) the Docker context ghostdock-<org>-<sandbox> for tcp://<sandbox>.<org>.ghostdock.internal:2376 with a client certificate of this machine's device, and makes it the current context. Needs `ghostdock network connect` first, and Docker's CLI. The certificate lives 30 days; `network connect` and this command renew it with 10 days left. An expired certificate fails Docker's TLS handshake with Docker's own error: run this command again. Docker's `no such host` on a ghostdock.internal address means this machine is not connected: run `ghostdock network connect`. After an organization rename the old name stops resolving: run it again to update the host.
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
ghostdock docker context <sandbox> [flags]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| Argument | Description |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `<sandbox>` | Sandbox name, from `network ls`. Required. |
|
|
46
|
+
| `--org <value>` | Organization id or slug, from `ghostdock organizations list` (default: GHOSTDOCK_ORG, then `ghostdock organizations use`). |
|
|
47
|
+
| `--use` | Make it the current Docker context (`docker context use`). `--no-use` only creates or updates it. Default: `true`. |
|
|
48
|
+
|
|
31
49
|
## `ghostdock env`
|
|
32
50
|
|
|
33
51
|
Manage organization environment variables and secrets.
|
package/dist/cli.md
CHANGED
|
@@ -97,6 +97,7 @@ Commands are grouped by resource, like `gh` or `kubectl`: `ghostdock <resource>
|
|
|
97
97
|
<!-- generated:command-groups:start (bun run sync:cli-reference; do not edit) -->
|
|
98
98
|
```
|
|
99
99
|
ghostdock apps Published apps of an organization.
|
|
100
|
+
ghostdock docker Docker over the private network: a sandbox's Docker engine from this machine.
|
|
100
101
|
ghostdock env Manage organization environment variables and secrets.
|
|
101
102
|
ghostdock images Organization image catalog: OCI bookmarks, Dockerfiles and Compose files.
|
|
102
103
|
ghostdock login Sign in and store a device access token for this machine…
|
|
@@ -632,6 +633,56 @@ ghostdock network disconnect
|
|
|
632
633
|
Without that, names of the private network hang while you are disconnected. `network status`
|
|
633
634
|
says when such a file is still there.
|
|
634
635
|
|
|
636
|
+
### `ghostdock docker context`
|
|
637
|
+
|
|
638
|
+
Point your own `docker` and `docker compose` at a sandbox's Docker engine, over the private
|
|
639
|
+
network with mutual TLS ([ADR 0032](../../docs/adr/0032-docker-api-over-gdo-net.md)). Connect
|
|
640
|
+
first: the context uses this machine's device.
|
|
641
|
+
|
|
642
|
+
```bash
|
|
643
|
+
ghostdock network connect
|
|
644
|
+
ghostdock docker context quiet-harbor --org acme
|
|
645
|
+
# ✓ Docker context ghostdock-acme-quiet-harbor (in use)
|
|
646
|
+
# tcp://quiet-harbor.acme.ghostdock.internal:2376
|
|
647
|
+
# Certificate for this device, valid until 2026-11-20.
|
|
648
|
+
# → docker ps
|
|
649
|
+
docker ps
|
|
650
|
+
docker compose up -d
|
|
651
|
+
ghostdock docker context north-pier --no-use # create only: docker --context ghostdock-acme-north-pier ps
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
- **One Docker context per sandbox**, `ghostdock-<org>-<sandbox>`, for
|
|
655
|
+
`tcp://<sandbox>.<org>.ghostdock.internal:2376`. Running the command again updates it;
|
|
656
|
+
without `--no-use` it also becomes Docker's current context (`docker context use`). A
|
|
657
|
+
`DOCKER_HOST` or `DOCKER_CONTEXT` in your shell wins over that: the command says so.
|
|
658
|
+
- **One client certificate per organization and machine**, in
|
|
659
|
+
`~/.config/ghostdock/docker/<organizationId>/`: `key.pem` (ECDSA P-256, made on this machine,
|
|
660
|
+
0600; only a certificate request is sent), `cert.pem` and `ca.pem`. The certificate names your
|
|
661
|
+
user, this machine's device and the organization, and lives 30 days. A new one replaces the
|
|
662
|
+
earlier one of this device for that organization: the old one stops working at once.
|
|
663
|
+
- **Renewal:** `ghostdock network connect` and `ghostdock docker context` renew every
|
|
664
|
+
certificate of this machine with less than 10 days left, and update the contexts they wrote
|
|
665
|
+
(`~/.config/ghostdock/docker/contexts.json`). An expired certificate fails Docker's TLS
|
|
666
|
+
handshake with Docker's own error: run `ghostdock docker context <sandbox>` again.
|
|
667
|
+
- **`no such host`** on a `ghostdock.internal` address means this machine is not connected:
|
|
668
|
+
run `ghostdock network connect`. The context's description in `docker context ls` says so
|
|
669
|
+
too.
|
|
670
|
+
- **Renamed organization:** the context's host keeps the old name, which stops resolving. Run
|
|
671
|
+
`ghostdock docker context <sandbox>` again to update the host.
|
|
672
|
+
- **Only from this device:** the sandbox checks every request with the app (membership, device,
|
|
673
|
+
the network pause). A copied key and certificate do not work from another machine; a refusal
|
|
674
|
+
comes back as Docker's `Error response from daemon: Ghostdock: …` with what to run.
|
|
675
|
+
- **Warnings:** a sandbox on another provider than this machine's connection (with the
|
|
676
|
+
`network connect` command that reaches it), and a sandbox whose base image is too old for
|
|
677
|
+
Docker over the network (restart it to update). A sandbox that cannot have a Docker engine
|
|
678
|
+
over the network (its provider has no private network, it has no address there yet, or a
|
|
679
|
+
name that is not a DNS label) gets no context, and the command says why.
|
|
680
|
+
- **A stopped sandbox** gets its context too: the first connection to it starts it (wake on
|
|
681
|
+
SYN), and its Docker engine answers once it runs. A start that takes longer than Docker's
|
|
682
|
+
32 s dial timeout fails that one command with Docker's `i/o timeout`; the next one works.
|
|
683
|
+
- **Needs Docker's CLI** (`docker` on `PATH`: Docker Desktop, OrbStack, or the CLI alone). The
|
|
684
|
+
Docker engine itself runs in the sandbox.
|
|
685
|
+
|
|
635
686
|
## Command index
|
|
636
687
|
|
|
637
688
|
Every command with its arguments and what it does. Run `ghostdock <command> --help` for its flags,
|
|
@@ -644,6 +695,12 @@ or read [`cli-reference.md`](cli-reference.md) for every command's full descript
|
|
|
644
695
|
| --- | --- |
|
|
645
696
|
| `ghostdock apps list [flags]` | List the live published apps (sites) of an organization, with their URLs. |
|
|
646
697
|
|
|
698
|
+
#### docker
|
|
699
|
+
|
|
700
|
+
| Command | What it does |
|
|
701
|
+
| --- | --- |
|
|
702
|
+
| `ghostdock docker context <sandbox> [flags]` | Point Docker at a sandbox's Docker engine over the private network: plain… |
|
|
703
|
+
|
|
647
704
|
#### env
|
|
648
705
|
|
|
649
706
|
| Command | What it does |
|
|
@@ -828,7 +885,7 @@ and secrets, see [`ghostdock env`](#ghostdock-env).
|
|
|
828
885
|
| ------------------------------- | ------------------------------------------------------------- | --------------------------------- |
|
|
829
886
|
| `GHOSTDOCK_BASE_URL` | API origin the CLI talks to. Override for local dev / self-hosted instances. | Local/dev builds default to `http://localhost:3000`. npm-published builds default to the production API origin baked at publish time. Override with `--base-url` or this env var. |
|
|
830
887
|
| `GHOSTDOCK_ORG` | Organization (id or slug) for commands run without `--org`. Takes precedence over the default from `organizations use`. | unset |
|
|
831
|
-
| `XDG_CONFIG_HOME` | Base directory for the CLI's per-machine state (`ghostdock/credentials.json`, `ghostdock/settings.json`, `ghostdock/network/`). | `~/.config` (native Windows: `%APPDATA%`) |
|
|
888
|
+
| `XDG_CONFIG_HOME` | Base directory for the CLI's per-machine state (`ghostdock/credentials.json`, `ghostdock/settings.json`, `ghostdock/network/`, `ghostdock/docker/`). | `~/.config` (native Windows: `%APPDATA%`) |
|
|
832
889
|
| `GHOSTDOCK_CREDENTIALS_PATH` | Absolute path to the credentials file, overriding the default. `settings.json` (the default organization) sits in the same directory, so each credentials file keeps its own default — handy for a second account. | `~/.config/ghostdock/credentials.json` |
|
|
833
890
|
|
|
834
891
|
Example for local development against a Nuxt dev server:
|