feat(mattermost): standalone Docker stack + split provisioner pattern (misp-style)#193
Open
t0kubetsu wants to merge 2 commits into
Open
feat(mattermost): standalone Docker stack + split provisioner pattern (misp-style)#193t0kubetsu wants to merge 2 commits into
t0kubetsu wants to merge 2 commits into
Conversation
…attern
Drop the two-stage Dockerfile (golang:alpine builder + mattermost runtime)
and static users.yml in favour of the misp-standalone provisioner pattern:
- Alpine single-stage image (bash/curl/jq/openssl); scripts volume-mounted
at runtime rather than baked in; mattermost CLI no longer required
- provision.sh: thin orchestrator (provision-users → provision-tokens)
- provision-users.sh: REST API user creation driven by MM_TEAMS /
MM_INSTRUCTOR_COUNT env vars; first user auto-promoted to system_admin
by Mattermost (EnableOpenServer + EnableAPICreateAccount); auto-generated
passwords; creates team and adds all members; writes
/tokens/mm-credentials.json + idempotency stamp
- provision-tokens.sh: reads mm-credentials.json; generates a personal
access token per user via /api/v4/users/{id}/tokens; writes tokens.txt
- .env.example: adds MM_TEAMS, MM_INSTRUCTOR_ORG, MM_INSTRUCTOR_COUNT,
MM_USERS_PER_TEAM, MM_USER_DOMAIN; removes users.yml reference
- compose.yml: provisioner now uses env_file + three :ro script mounts;
removes mattermost-config volume (CLI no longer needed)
- Makefile: adds keys target (mm-credentials.json)
- README: documents new env-driven user model and credential retrieval
Closes #143
3 tasks
Contributor
Author
|
Deployment prerequisite — Before running the scenario, the stack directory on the deployer's catalog copy must have a Workaround (until resolved at the catalog level): cd /path/to/range42-catalog/03_container_layer/docker/admin/mattermost
cp .env.example .envAll defaults in |
hyde-repo
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
users.ymlwith the misp-standalone provisioner pattern: Alpine single-stage image; bash/curl/jq/openssl toolchain; provisioning scripts volume-mounted at runtime (not baked in); mattermost CLI no longer requiredprovision.sh(orchestrator) →provision-users.sh(REST API user + team creation) →provision-tokens.sh(personal access token generation)MM_TEAMS,MM_INSTRUCTOR_COUNT,MM_USERS_PER_TEAM) — no YAML file to maintainsystem_adminby Mattermost (EnableOpenServer+EnableAPICreateAccount)/tokens/mm-credentials.json; idempotency stamp at/tokens/.provisionedprevents re-run on restartmake keystarget added to surface the full credentials JSON alongside the existingmake tokensCloses #143
Scope:
03_container_layer/docker/admin/mattermost/only.Changed files
Dockerfilecompose.ymlenv_file+ three:roscript mounts; removesmattermost-configvolume.env.exampleMM_TEAMS,MM_INSTRUCTOR_ORG,MM_INSTRUCTOR_COUNT,MM_USERS_PER_TEAM,MM_USER_DOMAINMakefilekeystargetREADME.mdprovisioning/provision.shprovisioning/provision-users.shprovisioning/provision-tokens.shprovisioning/init.shprovisioning/users.ymlTest plan
make build-upbuilds provisioner image without errorsmake logs-provisionershows admin + users created, tokens writtenmake tokensprintsusername:tokenlinesmake keysprintsmm-credentials.jsonwith all usersmake reprovisiontriggers a fresh provisioning runsystem_adminrole in Mattermost UI