daef7ea190
Helper functions (matrix-mas capability group): - mas_client_register_bash_infra: register/sync OAuth clients via mas-cli - mas_syn2mas_migration_bash_infra: dry-run + apply user migration to MAS - synapse_msc3861_enable_go_infra: edit homeserver.yaml MSC3861 block (with diff) - wellknown_oidc_patch_go_infra: patch well-known JSON with msc2965.authentication - synapse_login_flows_check_go_infra: health-check post-migration login flows Flows + issues for custom Matrix clients (PC + Android): - 0010 matrix-client-pc: Wails + React+Mantine (issues 0147-0153) - 0011 matrix-client-android: Kotlin + Compose (issues 0154-0161) - 0162 enable MAS as auth provider (Synapse delegate) — EXECUTED on VPS - 0163 custom admin panel propio (sustituye synapse-admin) Production state (organic-machine.com): - Synapse migrated SQLite -> Postgres - MSC3861 active, password_config disabled - 21 users + 41 access_tokens migrated via syn2mas - 4 MAS clients registered (element, matrix_pc, matrix_android, admin_panel) - synapse-admin container removed + Coolify route deleted - well-known patched with org.matrix.msc2965.authentication Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.9 KiB
2.9 KiB
id, title, status, priority, created, related_flows, related_issues, dependencies, tags
| id | title | status | priority | created | related_flows | related_issues | dependencies | tags | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0147 | matrix-client-pc scaffold: Wails + React+Mantine + login MAS | pending | high | 2026-05-24 |
|
|
|
|
Objetivo
Crear el esqueleto de la app projects/element_agents/apps/matrix_client_pc/ con Wails v2 (Go) + React+Vite+Mantine+@fn_library y dejar funcionando el login MAS OIDC contra mas-...organic-machine.com. Resultado: arrancar binario -> redirect navegador a MAS -> volver con token -> mostrar perfil del usuario.
Tareas
wails init -n matrix_client_pc -t react-tsdentro deprojects/element_agents/apps/.- Sub-repo Gitea:
git init -b master+ crear repodataforge/matrix_client_pc+ push inicial. app.mdcon frontmatter (lang=go, framework=wails, tags incluyenmatrix+service? — NO, es app cliente, sin tag service).go.modcon deps:wails/v2,mautrix-go,keyring.- Reemplazar template frontend por React+Mantine+
@fn_library. Symlinkfrontend/src/fn_library->../../../../../frontend/functions/ui/(o copia si symlink no funciona en build). - Backend Go (
backend/):wails.jsonconbindingsparaMatrixService.MatrixService.Login() -> URL(devuelve URL MAS OIDC).MatrixService.HandleCallback(code) -> User.MatrixService.GetSession() -> *Session(lee de keyring).MatrixService.Logout().
- Frontend React: layout
AppShellMantine, paginaLogin.tsxcon boton "Sign in with Matrix" -> abre URL MAS en navegador del SO. - Persistencia tokens en keyring SO (
github.com/zalando/go-keyring). - Loopback HTTP local (
127.0.0.1:0, puerto libre aleatorio) para recibir callback OIDC. - Test e2e basico: arrancar app, login con
@dev-pc:matrix-af2f3d.organic-machine.com, ver perfil.
Funciones del registry a crear (delegar a fn-constructor)
matrix_client_init_go_infra—mautrix.NewClient(homeserver, userID, accessToken) -> *Client, error. Wrapper que configura SQLite store + crypto store.mas_oidc_flow_go_infra—StartFlow(masURL) -> authURL, codeVerifier, state.ExchangeCode(code, codeVerifier) -> *Token.keyring_save_token_go_infra/keyring_load_token_go_infra— wrappersgo-keyring.
Acceptance
- Binario Wails compila para linux/amd64 + windows/amd64.
wails devarranca con hot-reload.- Login MAS OIDC end-to-end: boton -> navegador -> consent -> callback -> perfil visible.
- Token persistido entre re-arranques (no re-login si token vigente).
app.mdconuses_functionsque apunta a las 3 funciones nuevas.- Sub-repo
dataforge/matrix_client_pccreado con commit inicial.
Notas
- MAS URL: leerla de
.well-known/matrix/clientdel homeserver para no hardcodear. - Refresh token: MAS usa OAuth 2.0 estandar — implementar refresh proactivo (~5min antes de expiry).
- Gotcha: en Windows,
wails devrequiere WebView2 instalado.