@@ -6,26 +6,39 @@ This guide explains how to deploy the Cryptic client and or the
66
77## Quick Deployment
88
9- ** Run the latest client image:**
9+ Video demos:
10+ - [ Client Setup] ( https://youtu.be/Wq_1-shCmso?si=3cDmipt-EKDGqacV )
11+ - [ Server Setup] ( https://youtu.be/prfl27pbZds?si=2By0Rt2VFpaWarWR )
1012
11- [ Video Demo ] ( https://youtu.be/acNHqzHia3o?si=_4mQuE4KQooxb1UM )
13+ ### Fetch the Docker images
1214
15+ ** Start by fetching the Docker images:**
1316``` bash
14- # Get the latest Client docker image
17+ # Get the latest Client Docker image
1518docker pull ghcr.io/etnt/cryptic-tui:latest
1619
17- # Create a separate GPG directory for Docker (avoids conflicts with host's keyboxd)
20+ # Get the latest Server Docker image
21+ # (only necessary of you want to run the Cryptic server)
22+ docker pull ghcr.io/etnt/cryptic:latest
23+ ```
24+
25+ ### Run the Client container
26+
27+ ** Run the latest client image:**
28+ ``` bash
29+ # STEP 1: Create a separate GPG directory for Docker
1830mkdir -p ~ /.cryptic-gpg
1931
20- # Run the Cryptic Onboarding script
21- # 1. Generate a GPG key pair (stored in ~/.cryptic-gpg on host )
32+ # STEP 2: Run the Cryptic Onboarding script
33+ # 1. Generate a GPG key pair (stored in ~/.cryptic-gpg on Host )
2234# 2. Export the generated key
23- # 3. Send the key and fingerprint to the admin
24- # 4. WAIT! - Do not exit the onboard script until certificate is received
25- # 5. When admin has registered your key: Request a TLS certificate from server
26- # If your server is running on localhost on your Host machine, specify:
27- # cryptic-server as your server address (see the: `--add-host` below)
28- # 6. Exit the onboard script
35+ # 3. Send the key (and fingerprint) to the admin
36+ # 4. When admin has registered your key:
37+ # - Request a TLS certificate from server
38+ # - If your server is running on localhost on your Host machine, specify:
39+ # cryptic-server as your server address (see the: `--add-host` below)
40+ # 5. Exit the onboard script
41+ #
2942# You should now see your certificates at ~/.cryptic/<user>/cryptic-server_<port>
3043#
3144# NOTE: We use ~/.cryptic-gpg instead of ~/.gnupg because modern macOS/Linux
@@ -38,58 +51,61 @@ docker run -it --rm --name cryptic-client \
3851 ghcr.io/etnt/cryptic-tui:latest sh -c ' cryptic --onboard'
3952
4053# Start the Cryptic client with your username (e.g `bob`)
41- # 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=bob \
49- -e CRYPTIC_ENABLE_DB=true \
50- ghcr.io/etnt/cryptic-tui:latest
51-
52- # Method 2: Using command-line flags
53- # (but here also increase log output details)
54+ # - You'll be prompted for a Passphrase which is used to encrypt your local DB
55+ # - Here we also increase the log output details
56+ # - The incoming sender's username will be written to the file: sender.msg
5457docker run -it --rm --name cryptic-client \
5558 -v ~ /.cryptic:/home/cryptic/.cryptic \
5659 -v ~ /.cryptic-gpg:/home/cryptic/.gnupg \
5760 --add-host=cryptic-server:host-gateway \
5861 -e CRYPTIC_DEBUG=true \
59- ghcr.io/etnt/cryptic-tui:latest sh -c ' cryptic -u bob --enable-db --tui'
62+ ghcr.io/etnt/cryptic-tui:latest \
63+ sh -c ' cryptic -u bob --enable-db --file-notify sender.msg --tui'
64+
65+ # To get notified of incoming messages, run (on MAC):
66+ # - brew install fswatch terminal-notifier
67+ fswatch -0 ~ /.cryptic/bob/cryptic-server_8443/sender.msg | xargs -0 -n1 -I{} $HOME /.cryptic/notify_script.sh {}
68+
69+ # Content of notification script
70+ > cat $HOME /.cryptic/notify_script.sh
71+ #! /bin/bash
72+ terminal-notifier -title " Cryptic" -message " Cryptic message from: $1 " -sound Pong
6073```
6174
62- ** Run the latest server image:**
6375
64- ``` bash
65- # Get the latest Server docker image
66- docker pull ghcr.io/etnt/cryptic:latest
76+ ### Run the Server container
6777
68- # Create a directory for storing all Cryptic server data
78+ ** Run the latest server image:**
79+ ``` bash
80+ # STEP 1: Create a directory for storing all Cryptic server data
6981mkdir -p ~ /.cryptic_server
7082cd ~ /.cryptic_server
7183
72- # Step 1 : Generate CA and server certificates (one-time setup)
84+ # STEP 2 : Generate CA and server certificates (one-time setup)
7385# This will prompt for optional DNS Subject Alternative Names (SANs)
7486docker run -it --rm \
75- --entrypoint ' ' \
76- -v $( pwd) :/opt/cryptic/server_data \
77- -e CRYPTIC_SERVER_DIR=/opt/cryptic/server_data \
78- ghcr.io/etnt/cryptic:latest \
79- sh -c ' DIR="${CRYPTIC_SERVER_DIR}/priv/ssl" generate-mtls-certs.sh'
87+ --entrypoint ' ' \
88+ -v $( pwd) :/opt/cryptic/server_data \
89+ -e CRYPTIC_SERVER_DIR=/opt/cryptic/server_data \
90+ ghcr.io/etnt/cryptic:latest \
91+ sh -c ' DIR="${CRYPTIC_SERVER_DIR}/priv/ssl" generate-mtls-certs.sh'
92+
8093
81- # Step 2: Bootstrap the first admin user
82- # Generate a GPG key on your host (if you don't have one)
83- # No passphrase needed - it's only used for signing CSRs
84- gpg --quick-generate-key ' alice <alice@cryptic.local>' rsa4096
94+ # STEP 3: Bootstrap the first admin user (one-time setup)
95+ # Generate and Export a GPG key for the admin user
96+ # Take note of the name of the exported filename
97+ mkdir -p ~ /.cryptic ~ /.cryptic-gpg
98+ docker run -it --rm --name cryptic-client \
99+ -v ~ /.cryptic:/home/cryptic/.cryptic \
100+ -v ~ /.cryptic-gpg:/home/cryptic/.gnupg \
101+ --add-host=cryptic-server:host-gateway \
102+ ghcr.io/etnt/cryptic-tui:latest sh -c ' cryptic --onboard'
85103
86- # Export your GPG public key to the bootstrap directory
87- mkdir -p priv/ca/bootstrap
88- gpg --armor -- export alice@cryptic.local > priv/ca/bootstrap/alice .gpg
104+ # STEP 4: Copy the exported GPG key where Cryptic will find it
105+ mkdir -p ~ /.cryptic_server/ priv/ca/bootstrap
106+ cp ~ /.cryptic/gpg- export/ < filename > ~ /.cryptic_server/ priv/ca/bootstrap/admin .gpg
89107
90- # Step 3: Run the server
91- # All server data (priv/, logs/, data/) will be in ~/.cryptic_server/
92- # Note: Mount to /opt/cryptic/server_data (not /opt/cryptic which contains the Erlang release)
108+ # STEP 5: Run the server
93109# For debug log output, add: -e CRYPTIC_DEBUG=true
94110docker run -d \
95111 --name cryptic-server \
@@ -99,11 +115,25 @@ docker run -d \
99115 -e CRYPTIC_SERVER_DIR=/opt/cryptic/server_data \
100116 ghcr.io/etnt/cryptic:latest
101117
102- # Check server logs (you'll see certificate information on first start)
103- docker logs -f cryptic-server
118+ # STEP 6: Connect (login) the admin user
119+ # See `Run the Client container` above
120+
121+ # Check the server logs
122+ docker logs cryptic-server
123+ tail -f ./logs/server.log
104124
105125# Stop the server and remove the container
106- docker stop cryptic-server && docker rm cryptic-server
126+ docker stop cryptic-server
127+ docker rm cryptic-server
128+
129+ # Remove all server data
130+ rm -rf ~ /.cryptic_server
131+
132+ # Remove all GPG keys
133+ rm -rf ~ /.cryptic-gpg
134+
135+ # Remove all user data
136+ rm -rf ~ /.cryptic
107137```
108138
109139### Manual Certificate Generation (Optional)
0 commit comments