From 9d35514cf3cb67707c1a38e2cb9fb2de633204bf Mon Sep 17 00:00:00 2001 From: R Midhun Suresh Date: Wed, 8 Jan 2025 20:09:02 +0530 Subject: [PATCH] Switch over from template to container hs --- playwright/e2e/right-panel/memberlist.spec.ts | 7 +- .../synapse/templates/no-presence/README.md | 1 - .../templates/no-presence/homeserver.yaml | 110 ------------------ .../synapse/templates/no-presence/log.config | 50 -------- playwright/testcontainers/synapse.ts | 4 + 5 files changed, 10 insertions(+), 162 deletions(-) delete mode 100644 playwright/plugins/homeserver/synapse/templates/no-presence/README.md delete mode 100644 playwright/plugins/homeserver/synapse/templates/no-presence/homeserver.yaml delete mode 100644 playwright/plugins/homeserver/synapse/templates/no-presence/log.config diff --git a/playwright/e2e/right-panel/memberlist.spec.ts b/playwright/e2e/right-panel/memberlist.spec.ts index 8a7e13606d1..f15501286bd 100644 --- a/playwright/e2e/right-panel/memberlist.spec.ts +++ b/playwright/e2e/right-panel/memberlist.spec.ts @@ -13,8 +13,13 @@ const NAME = "Alice"; test.describe("Memberlist", () => { test.use({ + synapseConfigOptions: { + presence: { + enabled: false, + include_offline_users_on_sync: false, + }, + }, displayName: NAME, - startHomeserverOpts: "no-presence", disablePresence: true, }); diff --git a/playwright/plugins/homeserver/synapse/templates/no-presence/README.md b/playwright/plugins/homeserver/synapse/templates/no-presence/README.md deleted file mode 100644 index 9bfa7c43f86..00000000000 --- a/playwright/plugins/homeserver/synapse/templates/no-presence/README.md +++ /dev/null @@ -1 +0,0 @@ -A synapse configured with presence disabled diff --git a/playwright/plugins/homeserver/synapse/templates/no-presence/homeserver.yaml b/playwright/plugins/homeserver/synapse/templates/no-presence/homeserver.yaml deleted file mode 100644 index 686b2176935..00000000000 --- a/playwright/plugins/homeserver/synapse/templates/no-presence/homeserver.yaml +++ /dev/null @@ -1,110 +0,0 @@ -server_name: "localhost" -pid_file: /data/homeserver.pid -public_baseurl: "{{PUBLIC_BASEURL}}" -listeners: - - port: 8008 - tls: false - bind_addresses: ["::"] - type: http - x_forwarded: true - - resources: - - names: [client] - compress: false - -database: - name: "sqlite3" - args: - database: ":memory:" - -log_config: "/data/log.config" - -rc_messages_per_second: 10000 -rc_message_burst_count: 10000 -rc_registration: - per_second: 10000 - burst_count: 10000 -rc_joins: - local: - per_second: 9999 - burst_count: 9999 - remote: - per_second: 9999 - burst_count: 9999 -rc_joins_per_room: - per_second: 9999 - burst_count: 9999 -rc_3pid_validation: - per_second: 1000 - burst_count: 1000 - -rc_invites: - per_room: - per_second: 1000 - burst_count: 1000 - per_user: - per_second: 1000 - burst_count: 1000 - -rc_login: - address: - per_second: 10000 - burst_count: 10000 - account: - per_second: 10000 - burst_count: 10000 - failed_attempts: - per_second: 10000 - burst_count: 10000 - -media_store_path: "/data/media_store" -uploads_path: "/data/uploads" -enable_registration: true -enable_registration_without_verification: true -disable_msisdn_registration: false -registration_shared_secret: "{{REGISTRATION_SECRET}}" -report_stats: false -macaroon_secret_key: "{{MACAROON_SECRET_KEY}}" -form_secret: "{{FORM_SECRET}}" -signing_key_path: "/data/localhost.signing.key" - -trusted_key_servers: - - server_name: "matrix.org" -suppress_key_server_warning: true - -ui_auth: - session_timeout: "300s" - -oidc_providers: - - idp_id: test - idp_name: "OAuth test" - issuer: "http://localhost:{{OAUTH_SERVER_PORT}}/oauth" - authorization_endpoint: "http://localhost:{{OAUTH_SERVER_PORT}}/oauth/auth.html" - # the token endpoint receives requests from synapse, rather than the webapp, so needs to escape the docker container. - token_endpoint: "http://host.containers.internal:{{OAUTH_SERVER_PORT}}/oauth/token" - userinfo_endpoint: "http://host.containers.internal:{{OAUTH_SERVER_PORT}}/oauth/userinfo" - client_id: "synapse" - discover: false - scopes: ["profile"] - skip_verification: true - client_auth_method: none - user_mapping_provider: - config: - display_name_template: "{{ user.name }}" - -# Inhibit background updates as this Synapse isn't long-lived -background_updates: - min_batch_size: 100000 - sleep_duration_ms: 100000 - -experimental_features: - # Needed for e2e/crypto/crypto.spec.ts > Cryptography > decryption failure - # messages > non-joined historical messages. - # Can be removed after Synapse enables it by default - msc4115_membership_on_events: true - -enable_authenticated_media: true - -presence: - enabled: false - include_offline_users_on_sync: false diff --git a/playwright/plugins/homeserver/synapse/templates/no-presence/log.config b/playwright/plugins/homeserver/synapse/templates/no-presence/log.config deleted file mode 100644 index b9123d0f5b9..00000000000 --- a/playwright/plugins/homeserver/synapse/templates/no-presence/log.config +++ /dev/null @@ -1,50 +0,0 @@ -# Log configuration for Synapse. -# -# This is a YAML file containing a standard Python logging configuration -# dictionary. See [1] for details on the valid settings. -# -# Synapse also supports structured logging for machine readable logs which can -# be ingested by ELK stacks. See [2] for details. -# -# [1]: https://docs.python.org/3.7/library/logging.config.html#configuration-dictionary-schema -# [2]: https://matrix-org.github.io/synapse/latest/structured_logging.html - -version: 1 - -formatters: - precise: - format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s' - -handlers: - # A handler that writes logs to stderr. Unused by default, but can be used - # instead of "buffer" and "file" in the logger handlers. - console: - class: logging.StreamHandler - formatter: precise - -loggers: - synapse.storage.SQL: - # beware: increasing this to DEBUG will make synapse log sensitive - # information such as access tokens. - level: DEBUG - - twisted: - # We send the twisted logging directly to the file handler, - # to work around https://github.com/matrix-org/synapse/issues/3471 - # when using "buffer" logger. Use "console" to log to stderr instead. - handlers: [console] - propagate: false - -root: - level: DEBUG - - # Write logs to the `buffer` handler, which will buffer them together in memory, - # then write them to a file. - # - # Replace "buffer" with "console" to log to stderr instead. (Note that you'll - # also need to update the configuration for the `twisted` logger above, in - # this case.) - # - handlers: [console] - -disable_existing_loggers: false diff --git a/playwright/testcontainers/synapse.ts b/playwright/testcontainers/synapse.ts index 46a4bcb415c..13319fb95ed 100644 --- a/playwright/testcontainers/synapse.ts +++ b/playwright/testcontainers/synapse.ts @@ -134,6 +134,10 @@ const DEFAULT_CONFIG = { experimental_features: {}, oidc_providers: [], serve_server_wellknown: true, + presence: { + enabled: true, + include_offline_users_on_sync: true, + }, }; export type SynapseConfigOptions = Partial;