@@ -8,36 +8,51 @@ This guide explains how to deploy the Cryptic client and or the
88
99** Run the latest client image:**
1010
11- [ Demo] ( https://youtu.be/acNHqzHia3o?si=_4mQuE4KQooxb1UM )
11+ [ Video Demo] ( https://youtu.be/acNHqzHia3o?si=_4mQuE4KQooxb1UM )
1212
1313``` bash
1414# Get the latest Client docker image
1515docker pull ghcr.io/etnt/cryptic-tui:latest
1616
17+ # Create a separate GPG directory for Docker (avoids conflicts with host's keyboxd)
18+ mkdir -p ~ /.cryptic-gpg
19+
1720# Run the Cryptic Onboarding script
18- # 1. Generate a GPG key pair (or use existing one from ~/.gnupg )
21+ # 1. Generate a GPG key pair (stored in ~/.cryptic-gpg on host )
1922# 2. Export the generated key
2023# 3. Send the key and fingerprint to the admin
21- # 4. WAIT! - Do not exit the onboard script (the container will be gone)
24+ # 4. WAIT! - Do not exit the onboard script until certificate is received
2225# 5. When admin has registered your key: Request a TLS certificate from server
2326# If your server is running on localhost on your Host machine, specify:
2427# cryptic-server as your server address (see the: `--add-host` below)
2528# 6. Exit the onboard script
2629# You should now see your certificates at ~/.cryptic/<user>/cryptic-server_<port>
2730#
28- # NOTE: ~/.gnupg is mounted so your GPG keyring is shared with the container.
29- # This is required for automatic certificate renewal.
31+ # NOTE: We use ~/.cryptic-gpg instead of ~/.gnupg because modern macOS/Linux
32+ # GPG uses keyboxd daemon which doesn't work across container boundaries.
33+ # The container manages its own GPG keyring that persists on the host.
3034docker run -it --rm --name cryptic-client \
3135 -v ~ /.cryptic:/home/cryptic/.cryptic \
32- -v ~ /.gnupg :/home/cryptic/.gnupg \
36+ -v ~ /.cryptic-gpg :/home/cryptic/.gnupg \
3337 --add-host=cryptic-server:host-gateway \
3438 ghcr.io/etnt/cryptic-tui:latest sh -c ' cryptic --onboard'
3539
3640# Start the Cryptic client with your username (e.g `franz`)
3741# You'll be prompted for a Passphrase which is used to encrypt your local DB
42+
43+ # Method 1: Using environment variables
44+ docker run -it --rm --name cryptic-client \
45+ -v ~ /.cryptic:/home/cryptic/.cryptic \
46+ -v ~ /.cryptic-gpg:/home/cryptic/.gnupg \
47+ --add-host=cryptic-server:host-gateway \
48+ -e CRYPTIC_USERNAME=franz \
49+ -e CRYPTIC_ENABLE_DB=true \
50+ ghcr.io/etnt/cryptic-tui:latest
51+
52+ # Method 2: Using command-line flags
3853docker run -it --rm --name cryptic-client \
3954 -v ~ /.cryptic:/home/cryptic/.cryptic \
40- -v ~ /.gnupg :/home/cryptic/.gnupg \
55+ -v ~ /.cryptic-gpg :/home/cryptic/.gnupg \
4156 --add-host=cryptic-server:host-gateway \
4257 ghcr.io/etnt/cryptic-tui:latest sh -c ' cryptic -u franz --enable-db --tui'
4358```
@@ -48,6 +63,10 @@ docker run -it --rm --name cryptic-client \
4863# Get the latest Server docker image
4964docker pull ghcr.io/etnt/cryptic:latest
5065
66+ # Create a directory for storing the Cryptic server data
67+ mkdir ~ /.cryptic_server
68+ cd ~ /.cryptic_server
69+
5170# Setup the server certificates (one-time step)
5271# Creates ca.crt, ca.key, server.crt, server.key in ./priv/ssl/
5372mkdir -p priv/ssl priv/ca/bootstrap
@@ -65,6 +84,7 @@ gpg --armor --export alice@cryptic.local > priv/ca/bootstrap/alice.gpg
6584
6685# Run the server (requires certificates in ./priv/ssl/)
6786# Here we show how to expose port 9898 instead of the default (8443)
87+ # For debug log output, add: -e CRYPTIC_DEBUG=true
6888mkdir -p logs data/ca/bootstrap
6989docker run -d \
7090 --name cryptic-server \
@@ -84,61 +104,10 @@ docker run -d \
84104# Check server logs
85105docker logs -f cryptic-server
86106
87- # Stop the server
107+ # Stop the server and remove the container
88108docker stop cryptic-server && docker rm cryptic-server
89109```
90110
91- ### First Admin Bootstrap
92-
93- The admin bootstrap happens ** before** starting the server:
94-
95- 1 . ** Generate a GPG key** on your host machine (if you don't have one):
96- ``` bash
97- gpg --quick-generate-key ' alice <alice@cryptic.local>' rsa4096
98- ```
99-
100- 2 . ** Export the public key** to the bootstrap directory:
101- ``` bash
102- gpg --armor --export alice@cryptic.local > priv/ca/bootstrap/alice.gpg
103- ```
104-
105- 3 . ** Start the server** - it will read the bootstrap directory and register the admin.
106-
107- ** Now the admin can onboard** from their client machine:
108-
109- ``` bash
110- docker run -it --rm --name cryptic-client \
111- -v ~ /.cryptic:/home/cryptic/.cryptic \
112- -v ~ /.gnupg:/home/cryptic/.gnupg \
113- --add-host=cryptic-server:host-gateway \
114- ghcr.io/etnt/cryptic-tui:latest sh -c ' cryptic --onboard'
115- ```
116-
117- During onboarding:
118- 1 . Use your existing GPG key (the one you just created)
119- 2 . The fingerprint is already registered (from the bootstrap step)
120- 3 . Request your TLS certificate
121- 4 . Start using Cryptic!
122-
123- Once the first admin has a certificate, they can register other users' GPG keys
124- through the admin interface, allowing those users to complete onboarding.
125-
126- ** Note** : If you need to bootstrap multiple admin users before starting the server,
127- each admin generates their GPG key and exports it:
128-
129- ``` bash
130- # Each admin generates their key on their machine (no passphrase needed)
131- gpg --quick-generate-key ' alice <alice@cryptic.local>' rsa4096
132- gpg --quick-generate-key ' bob <bob@cryptic.local>' rsa4096
133-
134- # Export each public key to the bootstrap directory
135- gpg --armor --export alice@cryptic.local > priv/ca/bootstrap/alice.gpg
136- gpg --armor --export bob@cryptic.local > priv/ca/bootstrap/bob.gpg
137-
138- # Then start the server (it will read all GPG keys from priv/ca/bootstrap/)
139- docker run -d --name cryptic-server ...
140- ```
141-
142111## The Client
143112
144113The Cryptic TUI (Terminal User Interface) client can run in Docker to
@@ -336,8 +305,18 @@ The entrypoint script (`docker-tui-entrypoint.sh`) handles:
336305
337306# ### Building the Image
338307
308+ **Important**: The Dockerfile expects to be run from the **parent directory** containing both `cryptic/` and `cryptic-tui/` as subdirectories.
309+
339310Build the Docker image :
340311` ` ` bash
312+ # From the parent directory (containing both cryptic/ and cryptic-tui/)
313+ cd /path/to/parent-directory
314+ docker build -t cryptic-tui:latest -f cryptic/Dockerfile.tui .
315+ ` ` `
316+
317+ Or using Docker Compose (handles build context automatically) :
318+ ` ` ` bash
319+ # From the cryptic directory
341320docker compose build cryptic-tui
342321` ` `
343322
@@ -346,6 +325,16 @@ Build without cache (fresh build):
346325docker compose build --no-cache cryptic-tui
347326` ` `
348327
328+ **Common Error**: If you get `COPY failed: file not found` errors, ensure you're building from the parent directory, not from within `cryptic/`:
329+ ` ` ` bash
330+ # Wrong (from inside cryptic/)
331+ docker build -t cryptic-tui:latest -f Dockerfile.tui . # ❌ Will fail
332+
333+ # Correct (from parent directory)
334+ cd ..
335+ docker build -t cryptic-tui:latest -f cryptic/Dockerfile.tui . # ✅ Works
336+ ` ` `
337+
349338# ### Running the Client
350339
351340Run interactively (recommended) :
0 commit comments