Building
mesgd uses beamer to build its Erlang dependencies and install the compiled application. From the source directory, build the application, generate its key identities, and start the local node:
make
make keys
make start
make and make install both compile. beamer also builds pki, topt, and qr, and installs the beams and mesgd.app into ~/.beamer. make copies the account UI to ~/.beamer/mesgd-user-ui. A node that loads beams from ~/.beamer serves that UI at /account.
make keys creates keys/mesgd.json and keys/admin.json. Both files contain signing and encryption key material: one identifies the service, and the other is an administrator PKI identity. Account administration is controlled separately by the usernames in configuration.
make start starts epmd when it is not already running, then runs ./mesgd start. The local start sets the distribution cookie from MESGD_COOKIE_FILE or from {cookie, Atom} in mesgd.config.
Erlang/OTP 25 or newer is required. qrencode is optional: if PNG generation fails, enrollment still returns the manual authenticator key and an otpauth URI, allowing the person to complete setup.
Tests
Choose the suite for the behavior you changed, or run make test for the combined server suite:
| Target | What you learn |
|---|---|
make test-auth | Signup, login, reset, sessions, and keys work |
make test-oauth | Provider login, PKCE, and linking work |
make test-admin | Administrator actions and the recovery handoff work |
make test-grant | Path patterns, roles, and routing tokens work |
make test-samples | Sample messages and role suggestion work |
make test-stats | Counters work |
make test-history | History queries work |
make test-acme | ACME certificate automation tests |
make test | All of the above, plus path and client tests |
The account, OAuth, and admin suites use a temporary database and temporary keys. They do not talk to a mesgd you already started.
mesgd-sdk has its own targets. make test-auth there checks the account client with no network. make test-auth-live starts a short-lived mesgd on loopback. make test-mesgd runs the protocol tests for the languages that implement them. See SDK.
Where a running node loads code
make compiles mesgd_client and mesgd_user_cli into ebin/ and copies beams to ~/.beamer. The mesgd command recompiles those two modules when the source is newer than the beam. Set MESGD_EBIN when you want the command to load beams from somewhere else.
A node that is already running keeps the code it loaded at start. After you copy updated mesgd_user and mesgd_http_auth beams into ~/.beamer, load them with code:load_file/1 on that node, or restart.