feat: per-project Matrix room — load MATRIX_ROOM_ID from project TOML
Each project can specify its own Matrix room for notifications. - harb → #harb-dev:matrix.allf.in - disinto → #disinto-dev:matrix.allf.in
This commit is contained in:
parent
211ccb0445
commit
ed57eff704
3 changed files with 25 additions and 0 deletions
|
|
@ -54,6 +54,15 @@ svc = cfg.get('services', {})
|
|||
if 'containers' in svc:
|
||||
emit('PROJECT_CONTAINERS', svc['containers'])
|
||||
|
||||
# [matrix] section
|
||||
mx = cfg.get('matrix', {})
|
||||
if 'room_id' in mx:
|
||||
emit('MATRIX_ROOM_ID', mx['room_id'])
|
||||
if 'bot_user' in mx:
|
||||
emit('MATRIX_BOT_USER', mx['bot_user'])
|
||||
if 'token_env' in mx:
|
||||
emit('MATRIX_TOKEN_ENV', mx['token_env'])
|
||||
|
||||
# [monitoring] section
|
||||
mon = cfg.get('monitoring', {})
|
||||
for key in ['check_prs', 'check_dev_agent', 'check_pipeline_stall']:
|
||||
|
|
@ -80,4 +89,10 @@ if [ -z "${PROJECT_REPO_ROOT:-}" ] && [ -n "${PROJECT_NAME:-}" ]; then
|
|||
export PROJECT_REPO_ROOT="/home/${USER}/${PROJECT_NAME}"
|
||||
fi
|
||||
|
||||
# Resolve MATRIX_TOKEN from env var name (token_env points to an env var, not the token itself)
|
||||
if [ -n "${MATRIX_TOKEN_ENV:-}" ]; then
|
||||
export MATRIX_TOKEN="${!MATRIX_TOKEN_ENV:-}"
|
||||
unset MATRIX_TOKEN_ENV
|
||||
fi
|
||||
|
||||
unset _PROJECT_TOML _PROJECT_VARS _key _val
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@ stale_minutes = 60
|
|||
[services]
|
||||
containers = []
|
||||
|
||||
[matrix]
|
||||
room_id = "!ynKSMyWU7OSkbNjR:matrix.allf.in"
|
||||
bot_user = "@disinto-factory:matrix.allf.in"
|
||||
token_env = "DISINTO_MATRIX_TOKEN"
|
||||
|
||||
[monitoring]
|
||||
check_prs = true
|
||||
check_dev_agent = true
|
||||
|
|
|
|||
|
|
@ -14,6 +14,11 @@ stale_minutes = 60
|
|||
[services]
|
||||
containers = ["ponder"]
|
||||
|
||||
[matrix]
|
||||
room_id = "!LvLgiDVUbZKcRYga:matrix.allf.in"
|
||||
bot_user = "@harb-factory:matrix.allf.in"
|
||||
token_env = "MATRIX_TOKEN"
|
||||
|
||||
[monitoring]
|
||||
check_prs = true
|
||||
check_dev_agent = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue