From 2078be8b479931332ced3d99c45005d15a33f89b Mon Sep 17 00:00:00 2001 From: Buck Doyle Date: Wed, 3 Jun 2026 15:10:24 -0500 Subject: [PATCH 1/5] ci: Remove Matrix as factory workflow dependency --- .github/workflows/ci-software-factory.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-software-factory.yaml b/.github/workflows/ci-software-factory.yaml index 0dff7c80aa..8716a5e14b 100644 --- a/.github/workflows/ci-software-factory.yaml +++ b/.github/workflows/ci-software-factory.yaml @@ -13,7 +13,6 @@ on: - "packages/base/**" - "packages/boxel-icons/**" - "packages/host/**" - - "packages/matrix/**" - "packages/postgres/**" - "packages/realm-server/**" - "packages/realm-test-harness/**" From 9557d55d36e79d64eb8427e66c440607c979107f Mon Sep 17 00:00:00 2001 From: Buck Doyle Date: Thu, 4 Jun 2026 09:49:49 -0500 Subject: [PATCH 2/5] ci: scope Software Factory's matrix trigger to the shared harness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI Software Factory boots Synapse for its test stack via realm-test-harness's startFactorySupportServices, which dynamically imports matrix's synapse docker + environment-config helpers. So the workflow does depend on a slice of the matrix package — dropping `packages/matrix/**` from its trigger entirely (as this branch first did) would let a regression in that harness code slip past PR CI. Rather than re-add the broad `packages/matrix/**` filter (which also fires for matrix-test-only changes that SF never loads), extract the SF-shared harness into a dedicated `packages/matrix/support/` directory and point the trigger at that boundary instead: - Move synapse/ (incl. templates), the docker pull util, and the isolated-realm-server / environment-config / matrix-constants helpers into packages/matrix/support/. These form a self-contained cluster (no imports of matrix test-only code), so the boundary is clean. - Update all importers (matrix specs/helpers/scripts) and the realm-test-harness dynamic-import specifiers to the new paths. - Trigger CI Software Factory on `packages/matrix/support/**` only. Net effect: SF still runs when the harness code it loads changes, but matrix-test-only changes no longer trigger it. Co-Authored-By: Claude Opus 4.8 (1M context) --- .eslintrc.js | 2 +- .github/workflows/ci-software-factory.yaml | 1 + packages/matrix/docker/smtp4dev.ts | 7 +- .../docker/synapse/templates/_base.html | 42 ------- .../synapse/templates/add_threepid.html | 9 -- .../templates/add_threepid_failure.html | 7 -- .../templates/add_threepid_success.html | 6 - .../synapse/templates/password_reset.html | 9 -- .../password_reset_confirmation.html | 17 --- .../templates/password_reset_failure.html | 6 - .../templates/password_reset_success.html | 5 - .../synapse/templates/registration.html | 8 -- .../templates/registration_failure.html | 5 - .../templates/registration_success.html | 5 - packages/matrix/helpers/index.ts | 10 +- .../migrate-account-data-http-to-https.ts | 10 +- packages/matrix/scripts/migrate-realm-user.ts | 2 +- .../matrix/scripts/register-matrix-users.ts | 7 +- .../scripts/register-realm-user-using-api.ts | 2 +- .../matrix/scripts/register-realm-user.ts | 4 +- .../matrix/scripts/register-test-token.ts | 2 +- packages/matrix/scripts/register-test-user.ts | 4 +- packages/matrix/scripts/synapse.ts | 6 +- .../{docker/index.ts => support/docker.ts} | 0 .../environment-config.ts | 0 .../isolated-realm-server.ts | 2 +- .../{helpers => support}/matrix-constants.ts | 0 .../synapse/dev/homeserver.yaml | 0 .../synapse/dev/log.config | 0 .../{docker => support}/synapse/index.ts | 8 +- .../support/synapse/templates/_base.html | 104 ++++++++++++++++++ .../synapse/templates/add_threepid.html | 28 +++++ .../templates/add_threepid_failure.html | 7 ++ .../templates/add_threepid_success.html | 7 ++ .../synapse/templates/password_reset.html | 32 ++++++ .../synapse/templates/password_reset.txt | 0 .../password_reset_confirmation.html | 40 +++++++ .../templates/password_reset_failure.html | 7 ++ .../templates/password_reset_success.html | 7 ++ .../synapse/templates/registration.html | 28 +++++ .../synapse/templates/registration.txt | 0 .../templates/registration_failure.html | 6 + .../templates/registration_success.html | 8 ++ .../homeserver.yaml | 0 .../log.config | 0 .../synapse/test/homeserver.yaml | 0 .../synapse/test/log.config | 0 packages/matrix/tests/auth-rooms.spec.ts | 4 +- packages/matrix/tests/broken-linksto.spec.ts | 10 +- packages/matrix/tests/commands.spec.ts | 6 +- .../matrix/tests/correctness-checks.spec.ts | 8 +- packages/matrix/tests/create-realm.spec.ts | 2 +- packages/matrix/tests/download-realm.spec.ts | 10 +- packages/matrix/tests/forgot-password.spec.ts | 2 +- .../matrix/tests/glimmer-scoped-css.spec.ts | 2 +- packages/matrix/tests/global.setup.ts | 6 +- packages/matrix/tests/head-tags.spec.ts | 2 +- packages/matrix/tests/host-mode.spec.ts | 2 +- packages/matrix/tests/live-cards.spec.ts | 2 +- .../matrix/tests/login-using-email.spec.ts | 2 +- packages/matrix/tests/login.spec.ts | 10 +- packages/matrix/tests/messages.spec.ts | 19 ++-- packages/matrix/tests/profile.spec.ts | 2 +- packages/matrix/tests/publish-realm.spec.ts | 2 +- packages/matrix/tests/realm-urls.spec.ts | 6 +- .../tests/registration-with-token.spec.ts | 9 +- packages/matrix/tests/room-creation.spec.ts | 9 +- packages/matrix/tests/skills.spec.ts | 2 +- .../matrix/tests/workspace-chooser.spec.ts | 2 +- .../src/support-services.ts | 4 +- 70 files changed, 368 insertions(+), 215 deletions(-) delete mode 100644 packages/matrix/docker/synapse/templates/_base.html delete mode 100644 packages/matrix/docker/synapse/templates/add_threepid.html delete mode 100644 packages/matrix/docker/synapse/templates/add_threepid_failure.html delete mode 100644 packages/matrix/docker/synapse/templates/add_threepid_success.html delete mode 100644 packages/matrix/docker/synapse/templates/password_reset.html delete mode 100644 packages/matrix/docker/synapse/templates/password_reset_confirmation.html delete mode 100644 packages/matrix/docker/synapse/templates/password_reset_failure.html delete mode 100644 packages/matrix/docker/synapse/templates/password_reset_success.html delete mode 100755 packages/matrix/docker/synapse/templates/registration.html delete mode 100644 packages/matrix/docker/synapse/templates/registration_failure.html delete mode 100644 packages/matrix/docker/synapse/templates/registration_success.html rename packages/matrix/{docker/index.ts => support/docker.ts} (100%) rename packages/matrix/{helpers => support}/environment-config.ts (100%) rename packages/matrix/{helpers => support}/isolated-realm-server.ts (99%) rename packages/matrix/{helpers => support}/matrix-constants.ts (100%) rename packages/matrix/{docker => support}/synapse/dev/homeserver.yaml (100%) rename packages/matrix/{docker => support}/synapse/dev/log.config (100%) rename packages/matrix/{docker => support}/synapse/index.ts (98%) create mode 100644 packages/matrix/support/synapse/templates/_base.html create mode 100644 packages/matrix/support/synapse/templates/add_threepid.html create mode 100644 packages/matrix/support/synapse/templates/add_threepid_failure.html create mode 100644 packages/matrix/support/synapse/templates/add_threepid_success.html create mode 100644 packages/matrix/support/synapse/templates/password_reset.html rename packages/matrix/{docker => support}/synapse/templates/password_reset.txt (100%) create mode 100644 packages/matrix/support/synapse/templates/password_reset_confirmation.html create mode 100644 packages/matrix/support/synapse/templates/password_reset_failure.html create mode 100644 packages/matrix/support/synapse/templates/password_reset_success.html create mode 100755 packages/matrix/support/synapse/templates/registration.html rename packages/matrix/{docker => support}/synapse/templates/registration.txt (100%) create mode 100644 packages/matrix/support/synapse/templates/registration_failure.html create mode 100644 packages/matrix/support/synapse/templates/registration_success.html rename packages/matrix/{docker => support}/synapse/test-without-registration-token/homeserver.yaml (100%) rename packages/matrix/{docker => support}/synapse/test-without-registration-token/log.config (100%) rename packages/matrix/{docker => support}/synapse/test/homeserver.yaml (100%) rename packages/matrix/{docker => support}/synapse/test/log.config (100%) diff --git a/.eslintrc.js b/.eslintrc.js index 3e9a062064..40de0f1e39 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -108,7 +108,7 @@ module.exports = { 'packages/boxel-cli/src/commands/realm/status.ts', 'packages/boxel-cli/src/commands/realm/sync.ts', 'packages/boxel-cli/src/lib/realm-sync-base.ts', - 'packages/matrix/helpers/isolated-realm-server.ts', + 'packages/matrix/support/isolated-realm-server.ts', 'packages/postgres/pg-queue.ts', 'packages/postgres/pg-transaction-manager.ts', 'packages/realm-server/node-realm.ts', diff --git a/.github/workflows/ci-software-factory.yaml b/.github/workflows/ci-software-factory.yaml index 8716a5e14b..6526207b5f 100644 --- a/.github/workflows/ci-software-factory.yaml +++ b/.github/workflows/ci-software-factory.yaml @@ -13,6 +13,7 @@ on: - "packages/base/**" - "packages/boxel-icons/**" - "packages/host/**" + - "packages/matrix/support/**" - "packages/postgres/**" - "packages/realm-server/**" - "packages/realm-test-harness/**" diff --git a/packages/matrix/docker/smtp4dev.ts b/packages/matrix/docker/smtp4dev.ts index 2da7690aec..adfc6bbe99 100644 --- a/packages/matrix/docker/smtp4dev.ts +++ b/packages/matrix/docker/smtp4dev.ts @@ -1,4 +1,9 @@ -import { dockerCreateNetwork, dockerRun, dockerStop, dockerRm } from './index'; +import { + dockerCreateNetwork, + dockerRun, + dockerStop, + dockerRm, +} from '../support/docker'; interface Options { mailClientPort?: number; diff --git a/packages/matrix/docker/synapse/templates/_base.html b/packages/matrix/docker/synapse/templates/_base.html deleted file mode 100644 index f483b634fa..0000000000 --- a/packages/matrix/docker/synapse/templates/_base.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - Boxel Email Verification - - - - - - - - - - -
- - - - - -
-
- -
-
-
- Boxel -
-
- - - - - - - -
{% block title %}{% endblock %}
{% block body %}{% endblock %}
-
- - \ No newline at end of file diff --git a/packages/matrix/docker/synapse/templates/add_threepid.html b/packages/matrix/docker/synapse/templates/add_threepid.html deleted file mode 100644 index 899e91f6ca..0000000000 --- a/packages/matrix/docker/synapse/templates/add_threepid.html +++ /dev/null @@ -1,9 +0,0 @@ - -{% extends "_base.html" %} -{% block title %}Verify a new email for your Boxel account{% endblock %} -{% block body %} -

Please confirm that this is your e-mail address by clicking on the button below or use this link.

-
- Verify Email -
-{% endblock %} \ No newline at end of file diff --git a/packages/matrix/docker/synapse/templates/add_threepid_failure.html b/packages/matrix/docker/synapse/templates/add_threepid_failure.html deleted file mode 100644 index 5bd48c8a6c..0000000000 --- a/packages/matrix/docker/synapse/templates/add_threepid_failure.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends "_base.html" %} -{% block title %}Request failed{% endblock %} - -{% block body %} -

The request failed for the following reason: {{ failure_reason }}.

-

No changes have been made to your account.

-{% endblock %} \ No newline at end of file diff --git a/packages/matrix/docker/synapse/templates/add_threepid_success.html b/packages/matrix/docker/synapse/templates/add_threepid_success.html deleted file mode 100644 index 8b2a63e9c9..0000000000 --- a/packages/matrix/docker/synapse/templates/add_threepid_success.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "_base.html" %} -{% block title %}Your email has now been validated{% endblock %} - -{% block body %} -

Your email has now been validated, please return to Boxel. You may now close this window.

-{% endblock %} \ No newline at end of file diff --git a/packages/matrix/docker/synapse/templates/password_reset.html b/packages/matrix/docker/synapse/templates/password_reset.html deleted file mode 100644 index 83caac542f..0000000000 --- a/packages/matrix/docker/synapse/templates/password_reset.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "_base.html" %} -{% block title %}Reset password requested{% endblock %} -{% block body %} -

If you've lost your password or wish to reset it, use the button below to get started.

-

If you did not request a password reset, you can safely ignore this email. Only a person with access to your email can reset your account password.

-
- Reset Password -
-{% endblock %} diff --git a/packages/matrix/docker/synapse/templates/password_reset_confirmation.html b/packages/matrix/docker/synapse/templates/password_reset_confirmation.html deleted file mode 100644 index 510a55c618..0000000000 --- a/packages/matrix/docker/synapse/templates/password_reset_confirmation.html +++ /dev/null @@ -1,17 +0,0 @@ -{% extends "_base.html" %} -{% block title %}Password reset confirmation{% endblock %} -{% block body %} - - -
- - - - -

You have requested to reset your Boxel account password. Click the link below to confirm this action.

- If you did not mean to do this, please close this page and your password will not be changed.

-

-
- - -{% endblock %} diff --git a/packages/matrix/docker/synapse/templates/password_reset_failure.html b/packages/matrix/docker/synapse/templates/password_reset_failure.html deleted file mode 100644 index 0d65103ece..0000000000 --- a/packages/matrix/docker/synapse/templates/password_reset_failure.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "_base.html" %} -{% block title %}Password reset confirmation failure{% endblock %} -{% block body %} -

The request failed for the following reason: {{ failure_reason }}.

-

Your password has not been reset.

-{% endblock %} diff --git a/packages/matrix/docker/synapse/templates/password_reset_success.html b/packages/matrix/docker/synapse/templates/password_reset_success.html deleted file mode 100644 index a7cacd2a5a..0000000000 --- a/packages/matrix/docker/synapse/templates/password_reset_success.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "_base.html" %} -{% block title %}Password reset confirmation success{% endblock %} -{% block body %} -

Your email has now been validated, please return to Boxel forgot password screen to reset your password. You may now close this window.

-{% endblock %} diff --git a/packages/matrix/docker/synapse/templates/registration.html b/packages/matrix/docker/synapse/templates/registration.html deleted file mode 100755 index 7c567984c2..0000000000 --- a/packages/matrix/docker/synapse/templates/registration.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "_base.html" %} -{% block title %}Verify your email to register your Boxel account{% endblock %} -{% block body %} -

Please confirm that this is your e-mail address by clicking on the button below or use this link.

-
- Verify Email -
-{% endblock %} \ No newline at end of file diff --git a/packages/matrix/docker/synapse/templates/registration_failure.html b/packages/matrix/docker/synapse/templates/registration_failure.html deleted file mode 100644 index 07af1753df..0000000000 --- a/packages/matrix/docker/synapse/templates/registration_failure.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "_base.html" %} -{% block title %}Registration failure{% endblock %} -{% block body %} -

Validation failed for the following reason: {{ failure_reason }}.

-{% endblock %} diff --git a/packages/matrix/docker/synapse/templates/registration_success.html b/packages/matrix/docker/synapse/templates/registration_success.html deleted file mode 100644 index 63e7bb2c67..0000000000 --- a/packages/matrix/docker/synapse/templates/registration_success.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "_base.html" %} -{% block title %}Your email has now been validated{% endblock %} -{% block body %} -

Your email has now been validated, please return to the Boxel registration screen. You may now close this window.

-{% endblock %} diff --git a/packages/matrix/helpers/index.ts b/packages/matrix/helpers/index.ts index b2ebb3b62f..712707c5cd 100644 --- a/packages/matrix/helpers/index.ts +++ b/packages/matrix/helpers/index.ts @@ -1,5 +1,5 @@ import { expect, type Page } from '@playwright/test'; -import type { Credentials } from '../docker/synapse'; +import type { Credentials } from '../support/synapse'; import { loginUser, getAllRoomEvents, @@ -9,11 +9,11 @@ import { sync, updateUser, type UpdateUserOptions, -} from '../docker/synapse'; +} from '../support/synapse'; import { realmPassword } from './realm-credentials'; -import type { SQLExecutor } from './isolated-realm-server'; -import { appURL, BasicSQLExecutor } from './isolated-realm-server'; -import { APP_BOXEL_MESSAGE_MSGTYPE } from './matrix-constants'; +import type { SQLExecutor } from '../support/isolated-realm-server'; +import { appURL, BasicSQLExecutor } from '../support/isolated-realm-server'; +import { APP_BOXEL_MESSAGE_MSGTYPE } from '../support/matrix-constants'; import { randomUUID } from 'crypto'; export const testHost = 'https://localhost:4205/test'; diff --git a/packages/matrix/scripts/migrate-account-data-http-to-https.ts b/packages/matrix/scripts/migrate-account-data-http-to-https.ts index c09bf78ccf..5ac77d5c12 100644 --- a/packages/matrix/scripts/migrate-account-data-http-to-https.ts +++ b/packages/matrix/scripts/migrate-account-data-http-to-https.ts @@ -21,7 +21,7 @@ // Safe to re-run: rows already in the target scheme are left // untouched, and the PUT only fires when at least one URL changed. -import { getSynapseURL } from '../helpers/environment-config'; +import { getSynapseURL } from '../support/environment-config'; const ADMIN_USERNAME = 'admin'; const ADMIN_PASSWORD = 'password'; @@ -122,9 +122,7 @@ async function impersonate( ): Promise { // Synapse admin endpoint that returns an access token for any user. let response = await fetch( - `${synapseURL}/_synapse/admin/v1/users/${encodeURIComponent( - userId, - )}/login`, + `${synapseURL}/_synapse/admin/v1/users/${encodeURIComponent(userId)}/login`, { method: 'POST', headers: { Authorization: `Bearer ${adminToken}` }, @@ -259,7 +257,9 @@ async function main(): Promise { console.log(` Users migrated: ${migratedUsers}`); console.log(` URLs rewritten: ${totalURLsChanged}`); console.log(` Skipped (no data): ${skippedNoData}`); - console.log(` Skipped (${TO_SCHEME.padEnd(5)}):${' '.repeat(8 - TO_SCHEME.length)}${skippedAlreadyOnTargetScheme}`); + console.log( + ` Skipped (${TO_SCHEME.padEnd(5)}):${' '.repeat(8 - TO_SCHEME.length)}${skippedAlreadyOnTargetScheme}`, + ); } main().catch((err) => { diff --git a/packages/matrix/scripts/migrate-realm-user.ts b/packages/matrix/scripts/migrate-realm-user.ts index 3bd3178364..d35b08db77 100755 --- a/packages/matrix/scripts/migrate-realm-user.ts +++ b/packages/matrix/scripts/migrate-realm-user.ts @@ -1,4 +1,4 @@ -import { loginUser, updateUser } from '../docker/synapse'; +import { loginUser, updateUser } from '../support/synapse'; import { realmPassword } from '../helpers/realm-credentials'; diff --git a/packages/matrix/scripts/register-matrix-users.ts b/packages/matrix/scripts/register-matrix-users.ts index d73e327106..b443f95cd6 100644 --- a/packages/matrix/scripts/register-matrix-users.ts +++ b/packages/matrix/scripts/register-matrix-users.ts @@ -1,11 +1,11 @@ import * as childProcess from 'child_process'; -import { createRegistrationToken, loginUser } from '../docker/synapse'; +import { createRegistrationToken, loginUser } from '../support/synapse'; import { ensureUserRecord } from '../helpers/ensure-user-record'; import { getSynapseContainerName, getSynapseURL, -} from '../helpers/environment-config'; +} from '../support/environment-config'; import { realmPassword } from '../helpers/realm-credentials'; type Mode = 'all' | 'realms-only'; @@ -149,7 +149,8 @@ async function main() { process.exit(-1); } - const realmSecretSeed = process.env.REALM_SECRET_SEED || "shhh! it's a secret"; + const realmSecretSeed = + process.env.REALM_SECRET_SEED || "shhh! it's a secret"; // In 'all' mode we'll INSERT into the users table for bot/writer accounts, // so ensure Postgres is reachable too. 'realms-only' mode never touches diff --git a/packages/matrix/scripts/register-realm-user-using-api.ts b/packages/matrix/scripts/register-realm-user-using-api.ts index 45b027c14f..21014ea8d2 100644 --- a/packages/matrix/scripts/register-realm-user-using-api.ts +++ b/packages/matrix/scripts/register-realm-user-using-api.ts @@ -1,4 +1,4 @@ -import { loginUser } from '../docker/synapse'; +import { loginUser } from '../support/synapse'; const matrixURL = process.env.MATRIX_URL || 'http://localhost:8008'; const realmServerURL = process.env.REALM_SERVER_URL || 'http://localhost:4201'; diff --git a/packages/matrix/scripts/register-realm-user.ts b/packages/matrix/scripts/register-realm-user.ts index ccdc187623..f252fa572d 100755 --- a/packages/matrix/scripts/register-realm-user.ts +++ b/packages/matrix/scripts/register-realm-user.ts @@ -1,7 +1,7 @@ import * as childProcess from 'child_process'; -import { loginUser } from '../docker/synapse'; -import { getSynapseContainerName } from '../helpers/environment-config'; +import { loginUser } from '../support/synapse'; +import { getSynapseContainerName } from '../support/environment-config'; import { realmPassword } from '../helpers/realm-credentials'; diff --git a/packages/matrix/scripts/register-test-token.ts b/packages/matrix/scripts/register-test-token.ts index a3bb0332ac..67ad489075 100644 --- a/packages/matrix/scripts/register-test-token.ts +++ b/packages/matrix/scripts/register-test-token.ts @@ -1,4 +1,4 @@ -import { createRegistrationToken, loginUser } from '../docker/synapse'; +import { createRegistrationToken, loginUser } from '../support/synapse'; import { adminUsername, adminPassword } from './register-test-user'; (async () => { diff --git a/packages/matrix/scripts/register-test-user.ts b/packages/matrix/scripts/register-test-user.ts index f6f37f9a9e..614ca2e965 100644 --- a/packages/matrix/scripts/register-test-user.ts +++ b/packages/matrix/scripts/register-test-user.ts @@ -1,8 +1,8 @@ import * as childProcess from 'child_process'; -import { loginUser } from '../docker/synapse'; +import { loginUser } from '../support/synapse'; import { ensureUserRecord } from '../helpers/ensure-user-record'; -import { getSynapseContainerName } from '../helpers/environment-config'; +import { getSynapseContainerName } from '../support/environment-config'; export const adminUsername = 'admin'; export const adminPassword = 'password'; diff --git a/packages/matrix/scripts/synapse.ts b/packages/matrix/scripts/synapse.ts index 958b425e90..0e4c0a44fd 100644 --- a/packages/matrix/scripts/synapse.ts +++ b/packages/matrix/scripts/synapse.ts @@ -1,10 +1,10 @@ -import { synapseStart } from '../docker/synapse'; -import { dockerStop } from '../docker'; +import { synapseStart } from '../support/synapse'; +import { dockerStop } from '../support/docker'; import { resolve } from 'path'; import { getSynapseContainerName, deregisterSynapseFromTraefik, -} from '../helpers/environment-config'; +} from '../support/environment-config'; const [command] = process.argv.slice(2); let dataDir = process.env.SYNAPSE_DATA_DIR diff --git a/packages/matrix/docker/index.ts b/packages/matrix/support/docker.ts similarity index 100% rename from packages/matrix/docker/index.ts rename to packages/matrix/support/docker.ts diff --git a/packages/matrix/helpers/environment-config.ts b/packages/matrix/support/environment-config.ts similarity index 100% rename from packages/matrix/helpers/environment-config.ts rename to packages/matrix/support/environment-config.ts diff --git a/packages/matrix/helpers/isolated-realm-server.ts b/packages/matrix/support/isolated-realm-server.ts similarity index 99% rename from packages/matrix/helpers/isolated-realm-server.ts rename to packages/matrix/support/isolated-realm-server.ts index 4347011a48..185e069576 100644 --- a/packages/matrix/helpers/isolated-realm-server.ts +++ b/packages/matrix/support/isolated-realm-server.ts @@ -5,7 +5,7 @@ import { dirSync, setGracefulCleanup } from 'tmp'; import { ensureDirSync, copySync, readFileSync } from 'fs-extra'; import { Pool } from 'pg'; import { createServer as createNetServer, type AddressInfo } from 'net'; -import type { SynapseInstance } from '../docker/synapse'; +import type { SynapseInstance } from './synapse'; setGracefulCleanup(); diff --git a/packages/matrix/helpers/matrix-constants.ts b/packages/matrix/support/matrix-constants.ts similarity index 100% rename from packages/matrix/helpers/matrix-constants.ts rename to packages/matrix/support/matrix-constants.ts diff --git a/packages/matrix/docker/synapse/dev/homeserver.yaml b/packages/matrix/support/synapse/dev/homeserver.yaml similarity index 100% rename from packages/matrix/docker/synapse/dev/homeserver.yaml rename to packages/matrix/support/synapse/dev/homeserver.yaml diff --git a/packages/matrix/docker/synapse/dev/log.config b/packages/matrix/support/synapse/dev/log.config similarity index 100% rename from packages/matrix/docker/synapse/dev/log.config rename to packages/matrix/support/synapse/dev/log.config diff --git a/packages/matrix/docker/synapse/index.ts b/packages/matrix/support/synapse/index.ts similarity index 98% rename from packages/matrix/docker/synapse/index.ts rename to packages/matrix/support/synapse/index.ts index 312107845e..c2684c71e7 100644 --- a/packages/matrix/docker/synapse/index.ts +++ b/packages/matrix/support/synapse/index.ts @@ -10,15 +10,15 @@ import { dockerLogs, dockerRun, dockerStop, -} from '../index'; -import { APP_BOXEL_REALMS_EVENT_TYPE } from '../../helpers/matrix-constants'; -import { appURL } from '../../helpers/isolated-realm-server'; +} from '../docker'; +import { APP_BOXEL_REALMS_EVENT_TYPE } from '../matrix-constants'; +import { appURL } from '../isolated-realm-server'; import { isEnvironmentMode, getSynapseContainerName, getSynapseURL, registerSynapseWithTraefik, -} from '../../helpers/environment-config'; +} from '../environment-config'; export const SYNAPSE_IP_ADDRESS = '172.20.0.5'; export const SYNAPSE_PORT = 8008; diff --git a/packages/matrix/support/synapse/templates/_base.html b/packages/matrix/support/synapse/templates/_base.html new file mode 100644 index 0000000000..b865d49946 --- /dev/null +++ b/packages/matrix/support/synapse/templates/_base.html @@ -0,0 +1,104 @@ + + + + + + Boxel Email Verification + + + + + + + + + + +
+ + + + + +
+
+ +
+
+
+ Boxel +
+
+ + + + + + + +
+ {% block title %}{% endblock %} +
+ {% block body %}{% endblock %} +
+
+ + diff --git a/packages/matrix/support/synapse/templates/add_threepid.html b/packages/matrix/support/synapse/templates/add_threepid.html new file mode 100644 index 0000000000..e5d28163a5 --- /dev/null +++ b/packages/matrix/support/synapse/templates/add_threepid.html @@ -0,0 +1,28 @@ +{% extends "_base.html" %} {% block title %}Verify a new email for your Boxel +account{% endblock %} {% block body %} +

+ Please confirm that this is your e-mail address by clicking on the button + below or use this link. +

+ +{% endblock %} diff --git a/packages/matrix/support/synapse/templates/add_threepid_failure.html b/packages/matrix/support/synapse/templates/add_threepid_failure.html new file mode 100644 index 0000000000..6db708b2f4 --- /dev/null +++ b/packages/matrix/support/synapse/templates/add_threepid_failure.html @@ -0,0 +1,7 @@ +{% extends "_base.html" %} {% block title %}Request failed{% endblock %} {% +block body %} +

+ The request failed for the following reason: {{ failure_reason }}. +

+

No changes have been made to your account.

+{% endblock %} diff --git a/packages/matrix/support/synapse/templates/add_threepid_success.html b/packages/matrix/support/synapse/templates/add_threepid_success.html new file mode 100644 index 0000000000..e8fbf4dc26 --- /dev/null +++ b/packages/matrix/support/synapse/templates/add_threepid_success.html @@ -0,0 +1,7 @@ +{% extends "_base.html" %} {% block title %}Your email has now been validated{% +endblock %} {% block body %} +

+ Your email has now been validated, please return to Boxel. You may now close + this window. +

+{% endblock %} diff --git a/packages/matrix/support/synapse/templates/password_reset.html b/packages/matrix/support/synapse/templates/password_reset.html new file mode 100644 index 0000000000..d2a01091bb --- /dev/null +++ b/packages/matrix/support/synapse/templates/password_reset.html @@ -0,0 +1,32 @@ +{% extends "_base.html" %} {% block title %}Reset password requested{% endblock +%} {% block body %} +

+ If you've lost your password or wish to reset it, use the button below to get + started. +

+

+ If you did not request a password reset, you can safely ignore this email. + Only a person with access to your email can reset your account password. +

+ +{% endblock %} diff --git a/packages/matrix/docker/synapse/templates/password_reset.txt b/packages/matrix/support/synapse/templates/password_reset.txt similarity index 100% rename from packages/matrix/docker/synapse/templates/password_reset.txt rename to packages/matrix/support/synapse/templates/password_reset.txt diff --git a/packages/matrix/support/synapse/templates/password_reset_confirmation.html b/packages/matrix/support/synapse/templates/password_reset_confirmation.html new file mode 100644 index 0000000000..db2a732a82 --- /dev/null +++ b/packages/matrix/support/synapse/templates/password_reset_confirmation.html @@ -0,0 +1,40 @@ +{% extends "_base.html" %} {% block title %}Password reset confirmation{% +endblock %} {% block body %} + + +
+ + + + +

+ You have requested to + reset your Boxel account password. Click the link below + to confirm this action.

+ If you did not mean to do this, please close this page and your password + will not be changed. +

+

+ +

+
+ + +{% endblock %} diff --git a/packages/matrix/support/synapse/templates/password_reset_failure.html b/packages/matrix/support/synapse/templates/password_reset_failure.html new file mode 100644 index 0000000000..2b49697167 --- /dev/null +++ b/packages/matrix/support/synapse/templates/password_reset_failure.html @@ -0,0 +1,7 @@ +{% extends "_base.html" %} {% block title %}Password reset confirmation +failure{% endblock %} {% block body %} +

+ The request failed for the following reason: {{ failure_reason }}. +

+

Your password has not been reset.

+{% endblock %} diff --git a/packages/matrix/support/synapse/templates/password_reset_success.html b/packages/matrix/support/synapse/templates/password_reset_success.html new file mode 100644 index 0000000000..7e6fb15b9e --- /dev/null +++ b/packages/matrix/support/synapse/templates/password_reset_success.html @@ -0,0 +1,7 @@ +{% extends "_base.html" %} {% block title %}Password reset confirmation +success{% endblock %} {% block body %} +

+ Your email has now been validated, please return to Boxel forgot password + screen to reset your password. You may now close this window. +

+{% endblock %} diff --git a/packages/matrix/support/synapse/templates/registration.html b/packages/matrix/support/synapse/templates/registration.html new file mode 100755 index 0000000000..b36e8fd072 --- /dev/null +++ b/packages/matrix/support/synapse/templates/registration.html @@ -0,0 +1,28 @@ +{% extends "_base.html" %} {% block title %}Verify your email to register your +Boxel account{% endblock %} {% block body %} +

+ Please confirm that this is your e-mail address by clicking on the button + below or use this link. +

+ +{% endblock %} diff --git a/packages/matrix/docker/synapse/templates/registration.txt b/packages/matrix/support/synapse/templates/registration.txt similarity index 100% rename from packages/matrix/docker/synapse/templates/registration.txt rename to packages/matrix/support/synapse/templates/registration.txt diff --git a/packages/matrix/support/synapse/templates/registration_failure.html b/packages/matrix/support/synapse/templates/registration_failure.html new file mode 100644 index 0000000000..48ea0ea020 --- /dev/null +++ b/packages/matrix/support/synapse/templates/registration_failure.html @@ -0,0 +1,6 @@ +{% extends "_base.html" %} {% block title %}Registration failure{% endblock %} +{% block body %} +

+ Validation failed for the following reason: {{ failure_reason }}. +

+{% endblock %} diff --git a/packages/matrix/support/synapse/templates/registration_success.html b/packages/matrix/support/synapse/templates/registration_success.html new file mode 100644 index 0000000000..ecf037480a --- /dev/null +++ b/packages/matrix/support/synapse/templates/registration_success.html @@ -0,0 +1,8 @@ +{% extends "_base.html" %} {% block title %}Your email has now been validated{% +endblock %} {% block body %} +

+ Your email has now been validated, please return to the + Boxel registration screen. You may now + close this window. +

+{% endblock %} diff --git a/packages/matrix/docker/synapse/test-without-registration-token/homeserver.yaml b/packages/matrix/support/synapse/test-without-registration-token/homeserver.yaml similarity index 100% rename from packages/matrix/docker/synapse/test-without-registration-token/homeserver.yaml rename to packages/matrix/support/synapse/test-without-registration-token/homeserver.yaml diff --git a/packages/matrix/docker/synapse/test-without-registration-token/log.config b/packages/matrix/support/synapse/test-without-registration-token/log.config similarity index 100% rename from packages/matrix/docker/synapse/test-without-registration-token/log.config rename to packages/matrix/support/synapse/test-without-registration-token/log.config diff --git a/packages/matrix/docker/synapse/test/homeserver.yaml b/packages/matrix/support/synapse/test/homeserver.yaml similarity index 100% rename from packages/matrix/docker/synapse/test/homeserver.yaml rename to packages/matrix/support/synapse/test/homeserver.yaml diff --git a/packages/matrix/docker/synapse/test/log.config b/packages/matrix/support/synapse/test/log.config similarity index 100% rename from packages/matrix/docker/synapse/test/log.config rename to packages/matrix/support/synapse/test/log.config diff --git a/packages/matrix/tests/auth-rooms.spec.ts b/packages/matrix/tests/auth-rooms.spec.ts index 3131b9e1f8..764084ed64 100644 --- a/packages/matrix/tests/auth-rooms.spec.ts +++ b/packages/matrix/tests/auth-rooms.spec.ts @@ -3,9 +3,9 @@ import { getJoinedRooms, getRoomMembers, getRoomRetentionPolicy, -} from '../docker/synapse'; +} from '../support/synapse'; import { createSubscribedUser } from '../helpers'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; test.describe('Auth rooms', () => { // CS-8988 - was flaky before, making it a toPass to attempt to stabilize diff --git a/packages/matrix/tests/broken-linksto.spec.ts b/packages/matrix/tests/broken-linksto.spec.ts index 0b3eaedea7..9af3bd5599 100644 --- a/packages/matrix/tests/broken-linksto.spec.ts +++ b/packages/matrix/tests/broken-linksto.spec.ts @@ -5,7 +5,7 @@ import { postCardSource, postNewCard, } from '../helpers'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; const serverIndexUrl = new URL(appURL).origin; @@ -308,9 +308,7 @@ test.describe('Broken linksTo tolerance', () => { page.locator('[data-test-pets-slot] [data-test-broken-link-state]'), ).toHaveAttribute('data-test-broken-link-state', 'not-found'); await expect( - page - .locator('[data-test-pets-slot] [data-test-broken-link-url]') - .first(), + page.locator('[data-test-pets-slot] [data-test-broken-link-url]').first(), ).toContainText(ringoId); // Sibling slot continues to render Mango as a normal embedded pet. await expect( @@ -336,9 +334,7 @@ test.describe('Broken linksTo tolerance', () => { page.locator('[data-test-pets-slot] [data-test-broken-link-state]'), ).toHaveAttribute('data-test-broken-link-state', 'not-found'); await expect( - page - .locator('[data-test-pets-slot] [data-test-broken-link-url]') - .first(), + page.locator('[data-test-pets-slot] [data-test-broken-link-url]').first(), ).toContainText(ringoId); await expect( page.locator('[data-test-pets-slot] [data-test-pet-name]'), diff --git a/packages/matrix/tests/commands.spec.ts b/packages/matrix/tests/commands.spec.ts index d3a261c12e..82efc7f696 100644 --- a/packages/matrix/tests/commands.spec.ts +++ b/packages/matrix/tests/commands.spec.ts @@ -1,5 +1,5 @@ import { expect, test } from './fixtures'; -import { putEvent } from '../docker/synapse'; +import { putEvent } from '../support/synapse'; import { getRoomId, sendMessage, @@ -17,8 +17,8 @@ import { APP_BOXEL_COMMAND_RESULT_WITH_NO_OUTPUT_MSGTYPE, APP_BOXEL_COMMAND_RESULT_WITH_OUTPUT_MSGTYPE, APP_BOXEL_COMMAND_RESULT_REL_TYPE, -} from '../helpers/matrix-constants'; -import { appURL } from '../helpers/isolated-realm-server'; +} from '../support/matrix-constants'; +import { appURL } from '../support/isolated-realm-server'; const serverIndexUrl = new URL(appURL).origin; diff --git a/packages/matrix/tests/correctness-checks.spec.ts b/packages/matrix/tests/correctness-checks.spec.ts index f89c7c49c0..57580e8921 100644 --- a/packages/matrix/tests/correctness-checks.spec.ts +++ b/packages/matrix/tests/correctness-checks.spec.ts @@ -1,5 +1,5 @@ import { expect, test } from './fixtures'; -import { putEvent } from '../docker/synapse'; +import { putEvent } from '../support/synapse'; import { getRoomId, createSubscribedUserAndLogin, @@ -10,15 +10,15 @@ import { postCardSource, } from '../helpers'; import { getMatrixTestContext } from '../helpers'; -import { registerUser, loginUser } from '../docker/synapse'; +import { registerUser, loginUser } from '../support/synapse'; import { APP_BOXEL_MESSAGE_MSGTYPE, APP_BOXEL_COMMAND_REQUESTS_KEY, APP_BOXEL_COMMAND_RESULT_EVENT_TYPE, APP_BOXEL_COMMAND_RESULT_WITH_OUTPUT_MSGTYPE, APP_BOXEL_COMMAND_RESULT_REL_TYPE, -} from '../helpers/matrix-constants'; -import { appURL } from '../helpers/isolated-realm-server'; +} from '../support/matrix-constants'; +import { appURL } from '../support/isolated-realm-server'; const serverIndexUrl = new URL(appURL).origin; diff --git a/packages/matrix/tests/create-realm.spec.ts b/packages/matrix/tests/create-realm.spec.ts index bca6a75a0d..b460c58b67 100644 --- a/packages/matrix/tests/create-realm.spec.ts +++ b/packages/matrix/tests/create-realm.spec.ts @@ -1,5 +1,5 @@ import { test, expect } from './fixtures'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; import { clearLocalStorage, createRealm, diff --git a/packages/matrix/tests/download-realm.spec.ts b/packages/matrix/tests/download-realm.spec.ts index 0ceefe3c2b..7e460692db 100644 --- a/packages/matrix/tests/download-realm.spec.ts +++ b/packages/matrix/tests/download-realm.spec.ts @@ -1,11 +1,7 @@ import { test, expect } from './fixtures'; -import { appURL } from '../helpers/isolated-realm-server'; -import { - createSubscribedUser, - login, - setupPermissions, -} from '../helpers'; -import type { Credentials } from '../docker/synapse'; +import { appURL } from '../support/isolated-realm-server'; +import { createSubscribedUser, login, setupPermissions } from '../helpers'; +import type { Credentials } from '../support/synapse'; test.describe('Download Realm', () => { let credentials: Credentials; diff --git a/packages/matrix/tests/forgot-password.spec.ts b/packages/matrix/tests/forgot-password.spec.ts index 70cd00e78b..da5d8045df 100644 --- a/packages/matrix/tests/forgot-password.spec.ts +++ b/packages/matrix/tests/forgot-password.spec.ts @@ -1,5 +1,5 @@ import { expect, test } from './fixtures'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; import { clearLocalStorage, assertLoggedIn, diff --git a/packages/matrix/tests/glimmer-scoped-css.spec.ts b/packages/matrix/tests/glimmer-scoped-css.spec.ts index ebbddae95b..4be0be07e8 100644 --- a/packages/matrix/tests/glimmer-scoped-css.spec.ts +++ b/packages/matrix/tests/glimmer-scoped-css.spec.ts @@ -1,5 +1,5 @@ import { test, expect } from './fixtures'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; import { clearLocalStorage, createRealm, diff --git a/packages/matrix/tests/global.setup.ts b/packages/matrix/tests/global.setup.ts index b70ce27f5b..b460d8c172 100644 --- a/packages/matrix/tests/global.setup.ts +++ b/packages/matrix/tests/global.setup.ts @@ -3,12 +3,12 @@ import { synapseStop, registerUser, createRegistrationToken, -} from '../docker/synapse'; +} from '../support/synapse'; import { startServer as startRealmServer, startPrerenderServer, -} from '../helpers/isolated-realm-server'; -import type { IsolatedRealmServer } from '../helpers/isolated-realm-server'; +} from '../support/isolated-realm-server'; +import type { IsolatedRealmServer } from '../support/isolated-realm-server'; import { registerRealmUsers, REGISTRATION_TOKEN } from '../helpers'; import { smtpStart, smtpStop } from '../docker/smtp4dev'; diff --git a/packages/matrix/tests/head-tags.spec.ts b/packages/matrix/tests/head-tags.spec.ts index 51dff3da43..3d3da145fb 100644 --- a/packages/matrix/tests/head-tags.spec.ts +++ b/packages/matrix/tests/head-tags.spec.ts @@ -1,7 +1,7 @@ import { test, expect } from './fixtures'; import type { Page } from '@playwright/test'; import { randomUUID } from 'crypto'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; import { clearLocalStorage, createRealm, diff --git a/packages/matrix/tests/host-mode.spec.ts b/packages/matrix/tests/host-mode.spec.ts index 773d114b6c..3960c7bb9c 100644 --- a/packages/matrix/tests/host-mode.spec.ts +++ b/packages/matrix/tests/host-mode.spec.ts @@ -7,7 +7,7 @@ import { postCardSource, waitUntil, } from '../helpers'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; import { randomUUID } from 'crypto'; test.describe('Host mode', () => { diff --git a/packages/matrix/tests/live-cards.spec.ts b/packages/matrix/tests/live-cards.spec.ts index 561ab4638b..8be999a705 100644 --- a/packages/matrix/tests/live-cards.spec.ts +++ b/packages/matrix/tests/live-cards.spec.ts @@ -1,5 +1,5 @@ import { test, expect } from './fixtures'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; import { createRealm, showAllCards, diff --git a/packages/matrix/tests/login-using-email.spec.ts b/packages/matrix/tests/login-using-email.spec.ts index 17bd16e0c1..052bfd50fa 100644 --- a/packages/matrix/tests/login-using-email.spec.ts +++ b/packages/matrix/tests/login-using-email.spec.ts @@ -1,5 +1,5 @@ import { expect, test } from './fixtures'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; import { openRoot, assertLoggedIn, diff --git a/packages/matrix/tests/login.spec.ts b/packages/matrix/tests/login.spec.ts index 39d239c10c..627bf256fe 100644 --- a/packages/matrix/tests/login.spec.ts +++ b/packages/matrix/tests/login.spec.ts @@ -3,8 +3,8 @@ import { getJoinedRooms, getAccountData, type Credentials, -} from '../docker/synapse'; -import { appURL } from '../helpers/isolated-realm-server'; +} from '../support/synapse'; +import { appURL } from '../support/isolated-realm-server'; import { assertLoggedIn, assertLoggedOut, @@ -23,9 +23,9 @@ test.describe('Login', () => { let username: string; let password: string; -test.beforeEach(async () => { - ({ username, password, credentials } = - await createSubscribedUser('login-tests')); + test.beforeEach(async () => { + ({ username, password, credentials } = + await createSubscribedUser('login-tests')); await setupPermissions(credentials.userId, `${appURL}/`); }); diff --git a/packages/matrix/tests/messages.spec.ts b/packages/matrix/tests/messages.spec.ts index 691b07bd5b..c2af7a3e94 100644 --- a/packages/matrix/tests/messages.spec.ts +++ b/packages/matrix/tests/messages.spec.ts @@ -1,7 +1,8 @@ import { expect, test } from './fixtures'; import type { Page } from '@playwright/test'; -import { Credentials, putEvent } from '../docker/synapse'; +import type { Credentials } from '../support/synapse'; +import { putEvent } from '../support/synapse'; import { login, logout, @@ -20,8 +21,8 @@ import { showAllCards, waitUntil, } from '../helpers'; -import { appURL } from '../helpers/isolated-realm-server'; -import { APP_BOXEL_MESSAGE_MSGTYPE } from '../helpers/matrix-constants'; +import { appURL } from '../support/isolated-realm-server'; +import { APP_BOXEL_MESSAGE_MSGTYPE } from '../support/matrix-constants'; test.describe('Room messages', () => { test(`it can send a message in a room`, async ({ page }) => { @@ -291,9 +292,7 @@ test.describe('Room messages', () => { await showAllCards(page); const testCard = `${appURL}/hassan`; await page.locator(`[data-test-cards-grid-item="${testCard}"]`).click(); - await page - .locator(`[data-test-submode-switcher-button]`) - .click(); + await page.locator(`[data-test-submode-switcher-button]`).click(); await page.locator(`[data-test-boxel-menu-item-text="Code"]`).click(); await expect(page.locator(`[data-test-attached-file]`)).toHaveCount(2); @@ -352,9 +351,7 @@ test.describe('Room messages', () => { await expect( page.locator(`[data-test-attached-card="${appURL}/hassan"]`), ).toHaveCount(1); - await page - .locator(`[data-test-submode-switcher-button]`) - .click(); + await page.locator(`[data-test-submode-switcher-button]`).click(); await page.locator(`[data-test-boxel-menu-item-text="Code"]`).click(); await expect( @@ -441,9 +438,7 @@ test.describe('Room messages', () => { ); expect(petFile).toBeDefined(); expect(petFile?.name).toStrictEqual('pet.gts'); - expect(petFile?.contentType).toStrictEqual( - 'text/typescript+glimmer', - ); + expect(petFile?.contentType).toStrictEqual('text/typescript+glimmer'); expect(petFile?.sourceUrl).toStrictEqual(`${appURL}/pet.gts`); expect(petFile?.url).toMatch( /^http:\/\/localhost:8008\/_matrix\/client\/v1\/media\/download\/localhost\/[A-Za-z0-9]+\?allow_redirect=true$/, diff --git a/packages/matrix/tests/profile.spec.ts b/packages/matrix/tests/profile.spec.ts index 74f746b426..03020307a8 100644 --- a/packages/matrix/tests/profile.spec.ts +++ b/packages/matrix/tests/profile.spec.ts @@ -9,7 +9,7 @@ import { createUser, updateSynapseUser, } from '../helpers'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; test.describe('Profile', () => { let user: { diff --git a/packages/matrix/tests/publish-realm.spec.ts b/packages/matrix/tests/publish-realm.spec.ts index 6ad907848b..c8df235aad 100644 --- a/packages/matrix/tests/publish-realm.spec.ts +++ b/packages/matrix/tests/publish-realm.spec.ts @@ -1,6 +1,6 @@ import { test, expect } from './fixtures'; import type { Page } from '@playwright/test'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; import { clearLocalStorage, createRealm, diff --git a/packages/matrix/tests/realm-urls.spec.ts b/packages/matrix/tests/realm-urls.spec.ts index 0922d5c38f..7b260e4c2f 100644 --- a/packages/matrix/tests/realm-urls.spec.ts +++ b/packages/matrix/tests/realm-urls.spec.ts @@ -1,9 +1,9 @@ import { expect, test } from './fixtures'; -import { updateAccountData } from '../docker/synapse'; +import { updateAccountData } from '../support/synapse'; import { createSubscribedUser, login, updateSynapseUser } from '../helpers'; -import { appURL } from '../helpers/isolated-realm-server'; -import { APP_BOXEL_REALMS_EVENT_TYPE } from '../helpers/matrix-constants'; +import { appURL } from '../support/isolated-realm-server'; +import { APP_BOXEL_REALMS_EVENT_TYPE } from '../support/matrix-constants'; test.describe('Realm URLs in Matrix account data', () => { let user: { diff --git a/packages/matrix/tests/registration-with-token.spec.ts b/packages/matrix/tests/registration-with-token.spec.ts index 0d44909736..0635a21662 100644 --- a/packages/matrix/tests/registration-with-token.spec.ts +++ b/packages/matrix/tests/registration-with-token.spec.ts @@ -4,8 +4,8 @@ import { registerUser, getAccountData, type SynapseInstance, -} from '../docker/synapse'; -import { appURL } from '../helpers/isolated-realm-server'; +} from '../support/synapse'; +import { appURL } from '../support/isolated-realm-server'; import { validateEmail, gotoRegistration, @@ -21,7 +21,7 @@ import { REGISTRATION_TOKEN, getMatrixTestContext, } from '../helpers'; -import { APP_BOXEL_REALMS_EVENT_TYPE } from '../helpers/matrix-constants'; +import { APP_BOXEL_REALMS_EVENT_TYPE } from '../support/matrix-constants'; const serverIndexUrl = new URL(appURL).origin; @@ -45,8 +45,7 @@ function makeRegistrationUser( } test.describe('User Registration w/ Token', () => { - test.beforeEach(async () => { - }); + test.beforeEach(async () => {}); test('it can register a user with a registration token', async ({ page }) => { let secondUser = await createSubscribedUser('token-registration-2'); diff --git a/packages/matrix/tests/room-creation.spec.ts b/packages/matrix/tests/room-creation.spec.ts index 438d026109..20421d0ffe 100644 --- a/packages/matrix/tests/room-creation.spec.ts +++ b/packages/matrix/tests/room-creation.spec.ts @@ -1,5 +1,5 @@ import { expect, test } from './fixtures'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; import { login, logout, @@ -379,7 +379,12 @@ test.describe('Room creation', () => { let roomEl = page.locator('[data-test-room]'); if ((await roomEl.count()) === 0) return false; let roomId = await roomEl.getAttribute('data-test-room'); - if (roomId && roomId !== room1 && roomId !== room2 && roomId !== room3) { + if ( + roomId && + roomId !== room1 && + roomId !== room2 && + roomId !== room3 + ) { newRoom = roomId; return true; } diff --git a/packages/matrix/tests/skills.spec.ts b/packages/matrix/tests/skills.spec.ts index 7510be425c..8e26790bad 100644 --- a/packages/matrix/tests/skills.spec.ts +++ b/packages/matrix/tests/skills.spec.ts @@ -15,7 +15,7 @@ import { createSubscribedUserAndLogin, createRealm, } from '../helpers'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; import { randomUUID } from 'crypto'; test.describe('Skills', () => { diff --git a/packages/matrix/tests/workspace-chooser.spec.ts b/packages/matrix/tests/workspace-chooser.spec.ts index ee4a806106..baa2e38809 100644 --- a/packages/matrix/tests/workspace-chooser.spec.ts +++ b/packages/matrix/tests/workspace-chooser.spec.ts @@ -1,5 +1,5 @@ import { test, expect } from './fixtures'; -import { appURL } from '../helpers/isolated-realm-server'; +import { appURL } from '../support/isolated-realm-server'; import { clearLocalStorage, createRealm, diff --git a/packages/realm-test-harness/src/support-services.ts b/packages/realm-test-harness/src/support-services.ts index a278de9010..30834dec11 100644 --- a/packages/realm-test-harness/src/support-services.ts +++ b/packages/realm-test-harness/src/support-services.ts @@ -181,7 +181,7 @@ function assertUsableHostDist(hostPackageDir: string): void { } async function loadSynapseModule() { - let moduleSpecifier = '../../matrix/docker/synapse/index.ts'; + let moduleSpecifier = '../../matrix/support/synapse/index.ts'; return (maybeRequire(moduleSpecifier) ?? (await import(moduleSpecifier))) as { registerUser: ( synapse: SynapseInstance, @@ -202,7 +202,7 @@ async function loadSynapseModule() { } async function loadMatrixEnvironmentConfigModule() { - let moduleSpecifier = '../../matrix/helpers/environment-config.ts'; + let moduleSpecifier = '../../matrix/support/environment-config.ts'; return (maybeRequire(moduleSpecifier) ?? (await import(moduleSpecifier))) as { getSynapseURL: (synapse?: { baseUrl?: string; port?: number }) => string; }; From 99201e3ff9049b4d5abd49e9a18a2ce06abe7736 Mon Sep 17 00:00:00 2001 From: Buck Doyle Date: Thu, 4 Jun 2026 10:52:56 -0500 Subject: [PATCH 3/5] chore(matrix): import spawn instead of lazy-requiring it environment-config.ts already statically imports from 'child_process', so the lazy `require('child_process')` for `spawn` was needless and tripped `no-var-requires`. Hoist `spawn` into the existing top-level import. Behavior-preserving. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/matrix/support/environment-config.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/matrix/support/environment-config.ts b/packages/matrix/support/environment-config.ts index 2d4a0693b3..760f808474 100644 --- a/packages/matrix/support/environment-config.ts +++ b/packages/matrix/support/environment-config.ts @@ -1,4 +1,4 @@ -import { execSync } from 'child_process'; +import { execSync, spawn } from 'child_process'; import { writeFileSync, renameSync, unlinkSync } from 'fs'; import { join, resolve } from 'path'; import yaml from 'yaml'; @@ -139,7 +139,6 @@ export function registerSynapseWithTraefik(hostPort: number): void { // polling option. See dev-service-registry.ts for the full rationale. function kickTraefikIfNeeded(): void { if (process.platform !== 'darwin') return; - let { spawn } = require('child_process') as typeof import('child_process'); let child = spawn('docker', ['restart', 'boxel-traefik'], { stdio: 'ignore', detached: true, From 4086b6a2e7d51c5e4c5783fd1e9763428512cef4 Mon Sep 17 00:00:00 2001 From: Buck Doyle Date: Thu, 4 Jun 2026 17:05:34 -0500 Subject: [PATCH 4/5] ci: follow the support/ move in the synapse-template sync workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Synapse email templates moved to packages/matrix/support/synapse/ templates with the rest of the shared harness, but sync-synapse-templates.yml still watched, sed-edited, and S3-synced the old packages/matrix/docker/synapse/templates path — so a dispatch would fail at the sed steps and future template edits wouldn't trigger the sync, letting staging/prod Synapse email templates silently drift. Point the trigger path, both sed steps, and the S3 sync at the new location. Also fix the now-stale path in scripts/env-slug.js's consumer list. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/sync-synapse-templates.yml | 8 ++++---- scripts/env-slug.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sync-synapse-templates.yml b/.github/workflows/sync-synapse-templates.yml index 86ea8a375a..a1c9076a98 100644 --- a/.github/workflows/sync-synapse-templates.yml +++ b/.github/workflows/sync-synapse-templates.yml @@ -4,7 +4,7 @@ on: push: branches: [main] paths: - - "packages/matrix/docker/synapse/templates/**" + - "packages/matrix/support/synapse/templates/**" workflow_dispatch: inputs: environment: @@ -56,15 +56,15 @@ jobs: - name: Replace URL in registration success template run: | - sed -i "s/http:\/\/localhost:4200/https:\/\/${{ env.HOST_DOMAIN }}/" packages/matrix/docker/synapse/templates/registration_success.html + sed -i "s/http:\/\/localhost:4200/https:\/\/${{ env.HOST_DOMAIN }}/" packages/matrix/support/synapse/templates/registration_success.html - name: Replace icon URL with one from matching subdomain run: | - sed -i "s/d12nxmpmo97fii.cloudfront.net\/boxel-icon.png/${{ env.BOXEL_ICON_DOMAIN_AND_PATH }}/" packages/matrix/docker/synapse/templates/_base.html + sed -i "s/d12nxmpmo97fii.cloudfront.net\/boxel-icon.png/${{ env.BOXEL_ICON_DOMAIN_AND_PATH }}/" packages/matrix/support/synapse/templates/_base.html - name: S3 Sync run: | - aws s3 sync packages/matrix/docker/synapse/templates s3://${{ env.AWS_S3_BUCKET }}/templates + aws s3 sync packages/matrix/support/synapse/templates s3://${{ env.AWS_S3_BUCKET }}/templates - name: Restart Synapse ECS Service run: | diff --git a/scripts/env-slug.js b/scripts/env-slug.js index b4c01b6aba..6ae2486a47 100644 --- a/scripts/env-slug.js +++ b/scripts/env-slug.js @@ -3,7 +3,7 @@ * Mirror of scripts/env-slug.sh's `compute_env_slug` — keep the two in * sync. Required by: * packages/host/scripts/traefik-helpers.js - * packages/matrix/helpers/environment-config.ts + * packages/matrix/support/environment-config.ts * packages/realm-server/lib/dev-service-registry.ts */ From 2066d6a3d9e7b1aa6b404912327a14054d11061a Mon Sep 17 00:00:00 2001 From: Buck Doyle Date: Thu, 4 Jun 2026 17:15:36 -0500 Subject: [PATCH 5/5] chore: update remaining references to the moved matrix/support paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Chase the last references to the harness files relocated under packages/matrix/support/: - assert-synapse-running.sh: the inline ts-node re-registration ran `import … from './helpers/environment-config'`, which broke after the move — so `pnpm assert-synapse-running` failed (instead of re-adding the Traefik route) on the common dev path where BOXEL_ENVIRONMENT is set and Synapse is already running. Point it at './support/'. - Doc/comment path references (README, observability docker-compose + prometheus comments, indexing-diagnostics skill) updated to the new support/synapse locations. Co-Authored-By: Claude Opus 4.8 (1M context) --- .claude/skills/indexing-diagnostics/SKILL.md | 2 +- README.md | 2 +- packages/matrix/scripts/assert-synapse-running.sh | 2 +- packages/observability/docker-compose.yml | 4 ++-- packages/observability/prometheus/prometheus.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.claude/skills/indexing-diagnostics/SKILL.md b/.claude/skills/indexing-diagnostics/SKILL.md index d524fe988a..42db1bfc6a 100644 --- a/.claude/skills/indexing-diagnostics/SKILL.md +++ b/.claude/skills/indexing-diagnostics/SKILL.md @@ -1268,7 +1268,7 @@ WHERE realm_url = '' AND username = ''; Then re-mint with `--permissions read,write,realm-owner` (or whatever the columns are). Booleans translate one-to-one to array entries; column `realm_owner` becomes `realm-owner` (note the dash). -For local dev: matrix `server_name` is `localhost` (`packages/matrix/docker/synapse/dev/homeserver.yaml:1`), so user IDs are `@:localhost`. Two local-dev modes are supported: +For local dev: matrix `server_name` is `localhost` (`packages/matrix/support/synapse/dev/homeserver.yaml:1`), so user IDs are `@:localhost`. Two local-dev modes are supported: - **Standard mode** (no `BOXEL_ENVIRONMENT` set) — realm at `https://localhost:4201/...`, host-app at `https://localhost:4200`. - **Environment mode** (`BOXEL_ENVIRONMENT=` set) — realm at `http://realm-server..localhost/...`, host-app at `http://host..localhost` (Traefik routing per `mise-tasks/lib/env-vars.sh`). diff --git a/README.md b/README.md index 63d7d3aa2b..752ae6f599 100644 --- a/README.md +++ b/README.md @@ -436,7 +436,7 @@ This will create a new SQLite schema based on the current postgres DB (the schem ### Matrix Server -The boxel platform leverages a Matrix server called Synapse in order to support identity, workflow, and chat behaviors. This project uses a dockerized Matrix server. We have multiple matrix server configurations (currently one for development that uses a persistent DB, and one for testing that uses an in-memory DB). You can find and configure these matrix servers at `packages/matrix/docker/synapse/*`. +The boxel platform leverages a Matrix server called Synapse in order to support identity, workflow, and chat behaviors. This project uses a dockerized Matrix server. We have multiple matrix server configurations (currently one for development that uses a persistent DB, and one for testing that uses an in-memory DB). You can find and configure these matrix servers at `packages/matrix/support/synapse/*`. This server is automatically started as part of `mise run dev`, but if you wish to control it separately: diff --git a/packages/matrix/scripts/assert-synapse-running.sh b/packages/matrix/scripts/assert-synapse-running.sh index 4f6ed8d254..06750b0f7f 100755 --- a/packages/matrix/scripts/assert-synapse-running.sh +++ b/packages/matrix/scripts/assert-synapse-running.sh @@ -25,7 +25,7 @@ if [ "$RUNNING" = "$CONTAINER_NAME" ]; then if [ -n "$BOXEL_ENVIRONMENT" ]; then HOST_PORT=$(docker port "$CONTAINER_NAME" 8008/tcp 2>/dev/null | head -1 | awk -F: '{print $NF}') if [ -n "$HOST_PORT" ]; then - pnpm exec ts-node --transpileOnly -e "import { registerSynapseWithTraefik } from './helpers/environment-config'; registerSynapseWithTraefik($HOST_PORT);" + pnpm exec ts-node --transpileOnly -e "import { registerSynapseWithTraefik } from './support/environment-config'; registerSynapseWithTraefik($HOST_PORT);" fi fi else diff --git a/packages/observability/docker-compose.yml b/packages/observability/docker-compose.yml index 1a50434d8e..0dc82b8274 100644 --- a/packages/observability/docker-compose.yml +++ b/packages/observability/docker-compose.yml @@ -146,7 +146,7 @@ services: # Local Prometheus — scrapes the dev Synapse container's `/metrics` # endpoint so the vendored Synapse dashboard works without an AMP # workspace. Joined to the `boxel` Docker network (created by - # `mise run start-synapse` / packages/matrix/docker/synapse/index.ts) + # `mise run start-synapse` / packages/matrix/support/synapse/index.ts) # so it can resolve `boxel-synapse:9001` directly. Staging and # production scrape via AMP and ignore this service entirely. prometheus: @@ -166,7 +166,7 @@ services: networks: default: # The synapse dev container runs on the `boxel` Docker network (created - # by packages/matrix/docker/synapse/index.ts). Marked external so this + # by packages/matrix/support/synapse/index.ts). Marked external so this # compose project doesn't try to manage its lifecycle. If you bring up # the observability stack BEFORE starting synapse, run # `docker network create boxel` first — or just `mise run start-synapse`, diff --git a/packages/observability/prometheus/prometheus.yml b/packages/observability/prometheus/prometheus.yml index f68269e195..29e883ab8f 100644 --- a/packages/observability/prometheus/prometheus.yml +++ b/packages/observability/prometheus/prometheus.yml @@ -5,7 +5,7 @@ # directly; this file is local-only. # # Synapse exposes its metrics on container port 9001 (see -# packages/matrix/docker/synapse/dev/homeserver.yaml). This Prometheus +# packages/matrix/support/synapse/dev/homeserver.yaml). This Prometheus # joins the `boxel` Docker network where the synapse container also lives, # so the scrape target resolves via Docker DNS as `boxel-synapse:9001` — # no host port mapping needed.