Setting up Marchat #80
Replies: 55 comments
-
|
Thanks for the detailed report and for running the test suite. The error:
is coming from AES-GCM when trying to decrypt your existing keystore file. That usually means either:
Recently I changed the keystore key derivation from a simple SHA256-based scheme to PBKDF2. The JSON format is backward-compatible, but the encryption key is not, so older If you don’t need to keep the existing keystore contents, the simplest fix is to remove only the keystore file and let marchat create a new one. You can keep your profiles and use the same passphrase:
If you’re sure this is a brand‑new install and there was no older keystore, then it’s likely a passphrase mismatch (e.g. admin key vs keystore passphrase, or a typo). Removing I’ll look at adding a clearer error message and a migration path for old keystores so this is less confusing. Thanks for surfacing it. Quick question to help confirm: did this start happening after updating marchat from an older version, or is this a fresh install on this machine? |
Beta Was this translation helpful? Give feedback.
-
|
I just started setting up marchat yesterday, and I didn't update as it was already the latest update. I would also like help setting up access to the chatroom without having to use ssh |
Beta Was this translation helpful? Give feedback.
-
|
Got it, thanks for clarifying. You don’t need SSH access for clients to join a marchat server. SSH is only required if you’re managing the machine the server is running on. If your intention is to run everything locally (for example on a home network), you just need:
As long as the server is reachable over the network and the client is configured with the correct server URL, that’s all that’s required for clients to connect. To connect remotely (outside your local network), you’ll also need:
Typical setups are:
|
Beta Was this translation helpful? Give feedback.
-
|
how would i set up TLS, the readme is vague on that, but incredibly extensive on everything else |
Beta Was this translation helpful? Give feedback.
-
|
well, actually, what does TLS give you? all im aware is that is secure, but that's all i know |
Beta Was this translation helpful? Give feedback.
-
|
What TLS gives you
So: no TLS = fine for localhost or a trusted LAN. TLS = what you want if the server is on the internet or any network you don’t fully trust. How to set up TLS with marchat
If you run marchat behind nginx/traefik/Cloudflare, you can terminate TLS there and keep marchat on |
Beta Was this translation helpful? Give feedback.
-
|
okay. thank you, are there any recommended clients like termux to use on apple? termux only has paid offbrands on apple because apple bad. |
Beta Was this translation helpful? Give feedback.
-
|
also, where would the environment variables be? |
Beta Was this translation helpful? Give feedback.
-
|
Apple / clients
Where to put the environment variables You can do either of these:
|
Beta Was this translation helpful? Give feedback.
-
|
whats the admin key |
Beta Was this translation helpful? Give feedback.
-
|
The admin key is a secret you choose when you set up the server. Marchat doesn’t generate or assign it.
So it’s one shared secret: whatever you put in |
Beta Was this translation helpful? Give feedback.
-
|
thank you, i wrote .env to the marchat root folder but it doesnt seem to accept my config as the port and TLS hasn't changed |
Beta Was this translation helpful? Give feedback.
-
|
nvm while looking for config to point to i i found it was somewhere else xD |
Beta Was this translation helpful? Give feedback.
-
|
Why your The server only loads a
So: move (or copy) your |
Beta Was this translation helpful? Give feedback.
-
|
No worries, glad you found the config directory. If anything else comes up, just ask. |
Beta Was this translation helpful? Give feedback.
-
|
wierd, idk why it's not acceping my phone |
Beta Was this translation helpful? Give feedback.
-
|
A couple of things that often cause this: 1. Same username in two places 2. Network What exactly happens on the phone when it fails (error text, or it just hangs/disconnects)? That will narrow it down. |
Beta Was this translation helpful? Give feedback.
-
|
here i'll record |
Beta Was this translation helpful? Give feedback.
-
Screencast_20260219_174324.webm |
Beta Was this translation helpful? Give feedback.
-
|
here is localhost ig Screencast_20260219_174827.webm |
Beta Was this translation helpful? Give feedback.
-
|
TLS (wss://)
If the cert is self-signed, the client on the phone needs to be run with So: same idea as before (use the PC’s IP, not localhost), but with wss and the right port when TLS is on, and --skip-tls-verify for a self-signed cert. |
Beta Was this translation helpful? Give feedback.
-
|
any ideas |
Beta Was this translation helpful? Give feedback.
-
|
One thing that helps: connect a client from the same machine that’s running the server (e.g. a second terminal with |
Beta Was this translation helpful? Give feedback.
-
|
localhost wont work |
Beta Was this translation helpful? Give feedback.
-
|
i'll check the config |
Beta Was this translation helpful? Give feedback.
-
|
nothing's abnormal |
Beta Was this translation helpful? Give feedback.
-
|
idk how to fix it, i'd down for you to remote control if you wanna |
Beta Was this translation helpful? Give feedback.
-
|
One more thing to try: if you're on a self-signed cert, use |
Beta Was this translation helpful? Give feedback.
-
|
okay, sleep well! |
Beta Was this translation helpful? Give feedback.
-
|
I need to see actual error output to help further. Videos of the UI don't show what's failing. Required diagnostic output: Server side: # Show startup output (note the port in the banner)
./marchat-server 2>&1 | tee server-log.txt
# Verify it's listening (use your configured port, default is 8080)
ss -tlnp | grep 8080Client side (same machine as server): # Test local connection (use the port shown in the server banner)
./marchat-client --server ws://localhost:8080/ws --username TestUser 2>&1 | tee client-log.txtPaste the text output from both. Without actual error messages and server logs, I can't debug this. Also: Make sure you deleted your old keystore file as mentioned earlier - this is still the likely cause of the rm ~/.config/marchat/keystore.datThen try connecting again with the same passphrase. A new keystore will be created automatically. If you're new to self-hosting, I'd recommend starting with the Docker image (simpler deployment): docker run -d -p 8080:8080 \
-e MARCHAT_ADMIN_KEY=$(openssl rand -hex 32) \
-e MARCHAT_USERS=BlueAzure \
codecodesxyz/marchat:v0.9.0-beta.5Get localhost working first before attempting remote/phone access. Use GitHub Discussions (here) for setup questions - Issues are for bugs. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Create New Profile
Selected: Default
Authentication Required
Admin Key: ••••••••
Keystore passphrase: ••••••
Connecting to ws://localhost:5555/ws as BlueAzure...
Error initializing keystore: failed to decrypt keystore: cipher: message authentication failed
blueazure@Azura ~/D/M/marchat (main) [1]> marchat-client
📝 Select a connection profile or create a new one...
Select a connection profile:
▶ Default (BlueAzure@ws://localhost:5555/ws) [Admin] [E2E] [Recent]
Profile-2 (Azura@ws://localhost:5555/ws) [Admin] [E2E]
Create New Profile
Selected: Default
Authentication Required
Admin Key: ••••••••
Keystore passphrase: ••••••
Connecting to ws://localhost:5555/ws as BlueAzure...
Error initializing keystore: failed to decrypt keystore: cipher: message authentication failed
blueazure@Azura ~/D/M/marchat (main) [1]> marchat-client
📝 Select a connection profile or create a new one...
Select a connection profile:
▶ Default (BlueAzure@ws://localhost:5555/ws) [Admin] [E2E] [Recent]
Profile-2 (Azura@ws://localhost:5555/ws) [Admin] [E2E]
Create New Profile
Selected: Default
Authentication Required
Admin Key: ••••••••
Keystore passphrase: ••••••
Connecting to ws://localhost:5555/ws as BlueAzure...
Error initializing keystore: failed to decrypt keystore: cipher: message authentication failed
blueazure@Azura ~/D/M/marchat (main) [1]> marchat-client
📝 Select a connection profile or create a new one...
Select a connection profile:
▶ Default (BlueAzure@ws://localhost:5555/ws) [Admin] [E2E] [Recent]
Profile-2 (Azura@ws://localhost:5555/ws) [Admin] [E2E]
Create New Profile
Selected: Default
Authentication Required
Admin Key: ••••••
Keystore passphrase: ••••••
Connecting to ws://localhost:5555/ws as BlueAzure...
Error initializing keystore: failed to decrypt keystore: cipher: message authentication failed
blueazure@Azura ~/D/M/marchat (main) [1]> marchat-client
📝 Select a connection profile or create a new one...
Select a connection profile:
Default (BlueAzure@ws://localhost:5555/ws) [Admin] [E2E] [Recent]
Profile-2 (Azura@ws://localhost:5555/ws) [Admin] [E2E]
▶ Create New Profile
Creating a new connection profile...
🚀 marchat Configuration
Server URL: ws://localhost:5555/ws
Username: Az
Admin user? n
Enable E2E encryption? y
Keystore passphrase: ••••••
Theme: retro
[ Connect ]
✅ Configuration saved as 'Profile-3'! You can use --auto or --quick-start for faster connections.
Connecting to ws://localhost:5555/ws as Az...
Error initializing keystore: failed to decrypt keystore: cipher: message authentication failed
blueazure@Azura ~/D/M/marchat (main) [1]> marchat-client
📝 Select a connection profile or create a new one...
Select a connection profile:
Profile-3 (Az@ws://localhost:5555/ws) [E2E] [Recent]
▶ Default (BlueAzure@ws://localhost:5555/ws) [Admin] [E2E]
Profile-2 (Azura@ws://localhost:5555/ws) [Admin] [E2E]
Create New Profile
Selected: Default
Authentication Required
Admin Key: ••••••••
Keystore passphrase: ••••••
Connecting to ws://localhost:5555/ws as BlueAzure...
Error initializing keystore: failed to decrypt keystore: cipher: message authentication failed
blueazure@Azura ~/D/M/marchat (main) [1]> marchat-client
📝 Select a connection profile or create a new one...
Select a connection profile:
Default (BlueAzure@ws://localhost:5555/ws) [Admin] [E2E] [Recent]
Profile-4 (aua@ws://localhost:5555/ws)
Profile-3 (Az@ws://localhost:5555/ws) [E2E]
▶ Profile-2 (Azura@ws://localhost:5555/ws) [Admin] [E2E]
Create New Profile
Selected: Profile-2
Authentication Required
Admin Key: ••••••••
Keystore passphrase: ••••••
Connecting to ws://localhost:5555/ws as Azura...
Error initializing keystore: failed to decrypt keystore: cipher: message authentication failed
blueazure@Azura ~/D/M/marchat (main) [1]> bash test.sh
Running Marchat Test Suite
Using Go: go version go1.25.7 X:nodwarf5 linux/amd64
Running tests...
ok github.com/Cod-e-Codes/marchat/client (cached)
ok github.com/Cod-e-Codes/marchat/client/config (cached)
ok github.com/Cod-e-Codes/marchat/client/crypto (cached)
ok github.com/Cod-e-Codes/marchat/cmd/license (cached)
ok github.com/Cod-e-Codes/marchat/cmd/server (cached)
ok github.com/Cod-e-Codes/marchat/config (cached)
ok github.com/Cod-e-Codes/marchat/plugin (cached)
ok github.com/Cod-e-Codes/marchat/plugin/host (cached)
ok github.com/Cod-e-Codes/marchat/plugin/license (cached)
ok github.com/Cod-e-Codes/marchat/plugin/manager (cached)
ok github.com/Cod-e-Codes/marchat/plugin/store (cached)
ok github.com/Cod-e-Codes/marchat/server (cached)
ok github.com/Cod-e-Codes/marchat/shared (cached)
All tests passed!
Generating test coverage report...
ok github.com/Cod-e-Codes/marchat/client (cached) coverage: 25.3% of statements
ok github.com/Cod-e-Codes/marchat/client/config (cached) coverage: 54.5% of statements
ok github.com/Cod-e-Codes/marchat/client/crypto (cached) coverage: 76.9% of statements
ok github.com/Cod-e-Codes/marchat/cmd/license (cached) coverage: 42.2% of statements
ok github.com/Cod-e-Codes/marchat/cmd/server (cached) coverage: 5.3% of statements
ok github.com/Cod-e-Codes/marchat/config (cached) coverage: 74.2% of statements
ok github.com/Cod-e-Codes/marchat/plugin (cached) coverage: [no statements]
ok github.com/Cod-e-Codes/marchat/plugin/host (cached) coverage: 22.4% of statements
ok github.com/Cod-e-Codes/marchat/plugin/license (cached) coverage: 83.1% of statements
ok github.com/Cod-e-Codes/marchat/plugin/manager (cached) coverage: 22.5% of statements
ok github.com/Cod-e-Codes/marchat/plugin/store (cached) coverage: 46.8% of statements
ok github.com/Cod-e-Codes/marchat/server (cached) coverage: 33.2% of statements
ok github.com/Cod-e-Codes/marchat/shared (cached) coverage: 82.4% of statements
Coverage report generated: coverage.html
Coverage Summary:
total: (statements) 34.7%
Test suite completed successfully!
blueazure@Azura ~/D/M/marchat (main)> marchat-client
📝 Select a connection profile or create a new one...
Select a connection profile:
▶ Profile-2 (Azura@ws://localhost:5555/ws) [Admin] [E2E] [Recent]
Default (BlueAzure@ws://localhost:5555/ws) [Admin] [E2E]
Profile-4 (aua@ws://localhost:5555/ws)
Profile-3 (Az@ws://localhost:5555/ws) [E2E]
Create New Profile
Selected: Profile-2
Authentication Required
Admin Key: ••••••••
Keystore passphrase: ••••••
Connecting to ws://localhost:5555/ws as Azura...
Error initializing keystore: failed to decrypt keystore: cipher: message authentication failed
blueazure@Azura ~/D/M/marchat (main) [1]> openssl rand -hex 32
61014f45e194e5b585a18336b0bf3d795a911f533903c45adc3c3506bc441436
blueazure@Azura ~/D/M/marchat (main)> marchat-client --interactive
flag provided but not defined: -interactive
Usage of marchat-client:
-admin
Connect as admin (requires --admin-key)
-admin-key string
Admin key for privileged commands
-auto
Automatically connect using most recent profile
-config string
Path to config file (optional)
-e2e
Enable end-to-end encryption
-keystore-passphrase string
Passphrase for keystore (required for E2E)
-non-interactive
Skip interactive prompts (require all flags)
-quick-start
Use last connection or select from saved profiles
-server string
Server URL
-skip-tls-verify
Skip TLS certificate verification
-theme string
Theme
-username string
Username
blueazure@Azura ~/D/M/marchat (main) [2]> marchat-client --keystore-passphrase
flag needs an argument: -keystore-passphrase
Usage of marchat-client:
-admin
Connect as admin (requires --admin-key)
-admin-key string
Admin key for privileged commands
-auto
Automatically connect using most recent profile
-config string
Path to config file (optional)
-e2e
Enable end-to-end encryption
-keystore-passphrase string
Passphrase for keystore (required for E2E)
-non-interactive
Skip interactive prompts (require all flags)
-quick-start
Use last connection or select from saved profiles
-server string
Server URL
-skip-tls-verify
Skip TLS certificate verification
-theme string
Theme
-username string
Username
blueazure@Azura ~/D/M/marchat (main) [2]> marchat-client --keystore-passphrase 641366
📝 Select a connection profile or create a new one...
Select a connection profile:
Profile-2 (Azura@ws://localhost:5555/ws) [Admin] [E2E] [Recent]
▶ Default (BlueAzure@ws://localhost:5555/ws) [Admin] [E2E]
Profile-4 (aua@ws://localhost:5555/ws)
Profile-3 (Az@ws://localhost:5555/ws) [E2E]
Create New Profile
Selected: Default
Authentication Required
Admin Key: ••••••••
Keystore passphrase: ••••••
Connecting to ws://localhost:5555/ws as BlueAzure...
Error initializing keystore: failed to decrypt keystore: cipher: message authentication failed
blueazure@Azura ~/D/M/marchat (main) [1]> openssl rand -hex 32
Beta Was this translation helpful? Give feedback.
All reactions