From 752e5d1755b5f5cc13e024c87eba3ed3622998af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Garc=C3=ADa=20Montoro?= Date: Fri, 21 Aug 2026 00:18:06 +0200 Subject: [PATCH] MM-70307: Change Postgres test password to mostest_password (#38060) * Change test password to mostest_password This makes the password compliant with the 112 bits minimum length requirement. Otherwise, FIPS-compliant OpenSSL implementations will panic when trying to connect from `lib/pq` with a shorter password. * Simplify test templates' POSTGRES_PASSWORD values * make generated * Modify missing "mostest" strings --- .github/workflows/mmctl-test-template.yml | 8 ++++---- .github/workflows/server-ci-nightly-race.yml | 2 +- .github/workflows/server-ci-weekly.yml | 6 +++--- .github/workflows/server-ci.yml | 16 ++++++++-------- .github/workflows/server-test-template.yml | 8 ++++---- .../develop/contribute/developer-setup/docker.md | 4 ++-- docs/develop/contribute/developer-setup/index.md | 2 +- .../contribute/more-info/webapp/e2e-testing.md | 2 +- .../configure/configuration-in-your-database.mdx | 4 ++-- .../manage/command-line-tools.mdx | 2 +- .../manage/mmctl-command-line-tool.mdx | 2 +- .../server/prepare-mattermost-mysql-database.mdx | 2 +- e2e-tests/.ci/dashboard.override.yml | 2 +- e2e-tests/.ci/server.generate.sh | 6 +++--- e2e-tests/.ci/server.prepare.sh | 8 ++++---- e2e-tests/.ci/server.start.sh | 2 +- e2e-tests/cypress/cypress.config.ts | 4 ++-- .../tests/support/api/cloud_default_config.json | 2 +- .../tests/support/api/keycloak_realm.json | 2 +- .../support/api/on_prem_default_config.json | 4 ++-- .../cypress/tests/support/keycloak_commands.ts | 2 +- .../tests/support/ldap_server_commands.ts | 4 ++-- .../playwright/lib/src/containers/constants.ts | 4 ++-- .../playwright/lib/src/server/default_config.ts | 2 +- e2e-tests/playwright/lib/src/test_config.ts | 2 +- server/Makefile | 8 ++++---- server/build/docker-compose.common.yml | 4 ++-- server/build/docker-preview/Dockerfile | 2 +- server/build/docker-preview/config_docker.json | 2 +- .../build/docker/keycloak/ldap.mmsettings.json | 2 +- server/build/dotenv/test.env | 2 +- server/build/local-test-env.sh | 14 +++++++------- server/channels/api4/apitestlib.go | 2 +- server/channels/store/sqlstore/store_test.go | 6 +++--- server/channels/store/storetest/settings.go | 2 +- server/cmd/mattermost/commands/db_ping.go | 2 +- server/cmd/mmctl/commands/config.go | 2 +- server/cmd/mmctl/commands/ldap_e2e_test.go | 2 +- server/cmd/mmctl/docs/mmctl_config_migrate.rst | 2 +- server/config/database_test.go | 2 +- server/docker-compose.yaml | 6 +++--- server/public/model/config.go | 2 +- server/public/model/config_test.go | 8 ++++---- server/scripts/psql-migration-test.sh | 4 ++-- server/tests/test-config.json | 2 +- tools/sharedchannel-test/server.go | 8 ++++---- .../.github/workflows/performance-benchmarks.yml | 4 ++-- .../admin_console/database_settings.test.tsx | 2 +- 48 files changed, 96 insertions(+), 96 deletions(-) diff --git a/.github/workflows/mmctl-test-template.yml b/.github/workflows/mmctl-test-template.yml index ffdddc482d8..3805a4cd2ae 100644 --- a/.github/workflows/mmctl-test-template.yml +++ b/.github/workflows/mmctl-test-template.yml @@ -81,13 +81,13 @@ jobs: echo "$INPUT_PR_NUMBER" > server/pr-number - name: Run docker compose env: - POSTGRES_PASSWORD: ${{ inputs.fips-enabled && 'mostest-fips-test' || 'mostest' }} + POSTGRES_PASSWORD: 'mostest_password' run: | cd server/build docker compose --ansi never run --rm start_dependencies - cat ../tests/custom-schema-objectID.ldif | docker compose --ansi never exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest || true'; - cat ../tests/custom-schema-cpa.ldif | docker compose --ansi never exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest || true'; - cat ../tests/test-data.ldif | docker compose --ansi never exec -T openldap bash -c 'ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest'; + cat ../tests/custom-schema-objectID.ldif | docker compose --ansi never exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest_password || true'; + cat ../tests/custom-schema-cpa.ldif | docker compose --ansi never exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest_password || true'; + cat ../tests/test-data.ldif | docker compose --ansi never exec -T openldap bash -c 'ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest_password'; docker compose --ansi never exec -T minio sh -c 'mkdir -p /data/mattermost-test'; docker compose --ansi never ps diff --git a/.github/workflows/server-ci-nightly-race.yml b/.github/workflows/server-ci-nightly-race.yml index d21a978961c..b0b78dab5a7 100644 --- a/.github/workflows/server-ci-nightly-race.yml +++ b/.github/workflows/server-ci-nightly-race.yml @@ -45,7 +45,7 @@ jobs: uses: ./.github/workflows/server-test-template.yml with: name: Race Detector - datasource: postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 + datasource: postgres://mmuser:mostest_password@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 drivername: postgres logsartifact: race-detector-server-test-logs go-version: ${{ needs.buildenv.outputs.version }} diff --git a/.github/workflows/server-ci-weekly.yml b/.github/workflows/server-ci-weekly.yml index e7bb3dfe4da..c20d70f650b 100644 --- a/.github/workflows/server-ci-weekly.yml +++ b/.github/workflows/server-ci-weekly.yml @@ -46,7 +46,7 @@ jobs: uses: ./.github/workflows/server-test-template.yml with: name: Postgres with binary parameters - datasource: postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes + datasource: postgres://mmuser:mostest_password@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes drivername: postgres logsartifact: postgres-binary-server-test-logs go-version: ${{ needs.buildenv.outputs.version }} @@ -68,7 +68,7 @@ jobs: DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} with: name: Postgres FIPS - datasource: postgres://mmuser:mostest-fips-test@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 + datasource: postgres://mmuser:mostest_password@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 drivername: postgres logsartifact: postgres-server-fips-test-logs go-version: ${{ needs.buildenv.outputs.version }} @@ -89,7 +89,7 @@ jobs: MM_E2E_ZEPHYR_API_KEY: ${{ secrets.MM_E2E_ZEPHYR_API_KEY }} with: name: mmctl - datasource: postgres://mmuser:mostest-fips-test@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 + datasource: postgres://mmuser:mostest_password@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 drivername: postgres logsartifact: mmctl-fips-test-logs go-version: ${{ needs.buildenv.outputs.version }} diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 0b1ca9b112d..a320129a80b 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -85,7 +85,7 @@ jobs: image: postgres:15 env: POSTGRES_USER: mmuser - POSTGRES_PASSWORD: mostest + POSTGRES_PASSWORD: mostest_password POSTGRES_DB: mattermost_test ports: - 5432:5432 @@ -103,7 +103,7 @@ jobs: with: run: | export IS_CI=true - export TEST_DATABASE_POSTGRESQL_DSN="postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10" + export TEST_DATABASE_POSTGRESQL_DSN="postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10" make generated - name: Check generated files run: | @@ -179,7 +179,7 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: name: "Postgres (shard ${{ matrix.shard }})" - datasource: postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 + datasource: postgres://mmuser:mostest_password@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 drivername: postgres # Each shard gets a unique artifact name so they don't collide logsartifact: "postgres-server-test-logs-shard-${{ matrix.shard }}" @@ -213,7 +213,7 @@ jobs: uses: ./.github/workflows/server-test-template.yml with: name: Elasticsearch v8 Compatibility - datasource: postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 + datasource: postgres://mmuser:mostest_password@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 drivername: postgres logsartifact: elasticsearch-v8-server-test-logs go-version: ${{ needs.go.outputs.version }} @@ -231,7 +231,7 @@ jobs: uses: ./.github/workflows/server-test-template.yml with: name: OpenSearch v2 Compatibility - datasource: postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 + datasource: postgres://mmuser:mostest_password@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 drivername: postgres logsartifact: opensearch-v2-server-test-logs go-version: ${{ needs.go.outputs.version }} @@ -260,7 +260,7 @@ jobs: DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} with: name: "Postgres FIPS (shard ${{ matrix.shard }})" - datasource: postgres://mmuser:mostest-fips-test@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 + datasource: postgres://mmuser:mostest_password@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 drivername: postgres logsartifact: "postgres-server-fips-test-logs-shard-${{ matrix.shard }}" go-version: ${{ needs.go.outputs.version }} @@ -291,7 +291,7 @@ jobs: MM_E2E_ZEPHYR_API_KEY: ${{ secrets.MM_E2E_ZEPHYR_API_KEY }} with: name: mmctl - datasource: postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 + datasource: postgres://mmuser:mostest_password@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 drivername: postgres logsartifact: mmctl-test-logs go-version: ${{ needs.go.outputs.version }} @@ -312,7 +312,7 @@ jobs: MM_E2E_ZEPHYR_API_KEY: ${{ secrets.MM_E2E_ZEPHYR_API_KEY }} with: name: mmctl - datasource: postgres://mmuser:mostest-fips-test@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 + datasource: postgres://mmuser:mostest_password@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 drivername: postgres logsartifact: mmctl-fips-test-logs go-version: ${{ needs.go.outputs.version }} diff --git a/.github/workflows/server-test-template.yml b/.github/workflows/server-test-template.yml index 6bb4569c47a..7e6e7787fcc 100644 --- a/.github/workflows/server-test-template.yml +++ b/.github/workflows/server-test-template.yml @@ -155,13 +155,13 @@ jobs: env: ELASTICSEARCH_VERSION: ${{ inputs.elasticsearch-version }} OPENSEARCH_VERSION: ${{ inputs.opensearch-version }} - POSTGRES_PASSWORD: ${{ inputs.fips-enabled && 'mostest-fips-test' || 'mostest' }} + POSTGRES_PASSWORD: 'mostest_password' run: | cd server/build docker compose --ansi never run --rm start_dependencies - cat ../tests/custom-schema-objectID.ldif | docker compose --ansi never exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest || true'; - cat ../tests/custom-schema-cpa.ldif | docker compose --ansi never exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest || true'; - cat ../tests/test-data.ldif | docker compose --ansi never exec -T openldap bash -c 'ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest'; + cat ../tests/custom-schema-objectID.ldif | docker compose --ansi never exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest_password || true'; + cat ../tests/custom-schema-cpa.ldif | docker compose --ansi never exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest_password || true'; + cat ../tests/test-data.ldif | docker compose --ansi never exec -T openldap bash -c 'ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest_password'; docker compose --ansi never exec -T minio sh -c 'mkdir -p /data/mattermost-test'; docker compose --ansi never ps diff --git a/docs/develop/contribute/developer-setup/docker.md b/docs/develop/contribute/developer-setup/docker.md index 6cdd8e8e4c7..6ee08d6cacf 100644 --- a/docs/develop/contribute/developer-setup/docker.md +++ b/docs/develop/contribute/developer-setup/docker.md @@ -27,7 +27,7 @@ This is the default and recommended database to use with Mattermost. No addition ``` MM_SQLSETTINGS_DRIVERNAME=postgres -MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable\u0026connect_timeout=10 +MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable\u0026connect_timeout=10 ``` ## mysql @@ -41,7 +41,7 @@ This is an alternate database supported by Mattermost, but not recommended for n To use with Mattermost, be sure to configure the following settings: ``` MM_SQLSETTINGS_DRIVERNAME=mysql -MM_SQLSETTINGS_DATASOURCE=mmuser:mostest@tcp(localhost:3306)/mattermost_test?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s +MM_SQLSETTINGS_DATASOURCE=mmuser:mostest_password@tcp(localhost:3306)/mattermost_test?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s ``` ## inbucket diff --git a/docs/develop/contribute/developer-setup/index.md b/docs/develop/contribute/developer-setup/index.md index 74f2b3135dc..4bfa0c68368 100644 --- a/docs/develop/contribute/developer-setup/index.md +++ b/docs/develop/contribute/developer-setup/index.md @@ -141,7 +141,7 @@ The `make package` command will package the application and place it under the ` ``` 1. Copy the file `server/config.mk` as `server/config.override.mk` and set `MM_NO_DOCKER` to `true` in the copy. 1. Install [PostgreSQL](https://www.postgresql.org/download/) -1. Run `psql postgres`. Then create `mmuser` by running `CREATE ROLE mmuser WITH LOGIN PASSWORD 'mostest';` +1. Run `psql postgres`. Then create `mmuser` by running `CREATE ROLE mmuser WITH LOGIN PASSWORD 'mostest_password';` 1. Modify the role to give rights to create a database by running `ALTER ROLE mmuser CREATEDB;` 1. Confirm the role rights by running `\du` 1. Before creating the database, exit by running `\q` diff --git a/docs/develop/contribute/more-info/webapp/e2e-testing.md b/docs/develop/contribute/more-info/webapp/e2e-testing.md index 9d3366846a4..44cefa841a0 100644 --- a/docs/develop/contribute/more-info/webapp/e2e-testing.md +++ b/docs/develop/contribute/more-info/webapp/e2e-testing.md @@ -247,7 +247,7 @@ Environment variables are [defined in cypress.config.ts](https://github.com/matt | CYPRESS\_adminUsername | Admin's username for the test server.

*Default*: `sysadmin` when server is seeded by `make test-data`. | | CYPRESS\_adminPassword | Admin's password for the test server.

*Default*: `Sys@dmin-sample1` when server is seeded by `make test-data`. | | CYPRESS\_dbClient | The database of the test server. It should match the server config `SqlSettings.DriverName`.

*Default*: `postgres`
*Valid values*: `postgres` or `mysql` | -| CYPRESS\_dbConnection | The database connection string of the test server. It should match the server config `SqlSettings.DataSource`.

*Default*: `"postgres://mmuser:mostest@localhost/mattermost_test?sslmode=disable\u0026connect_timeout=10"` | +| CYPRESS\_dbConnection | The database connection string of the test server. It should match the server config `SqlSettings.DataSource`.

*Default*: `"postgres://mmuser:mostest_password@localhost/mattermost_test?sslmode=disable\u0026connect_timeout=10"` | | CYPRESS\_enableVisualTest | Use for visual regression testing.

*Default*: `false`
*Valid values*: `true` or `false` | | CYPRESS\_ldapServer | Host of the Lightweight Directory Access Protocol (LDAP) server.

*Default*: `localhost` | | CYPRESS\_ldapPort | Port of the LDAP server.

*Default*: `389` | diff --git a/docs/main/administration-guide/configure/configuration-in-your-database.mdx b/docs/main/administration-guide/configure/configuration-in-your-database.mdx index 1959c034d40..0f064f94bfc 100644 --- a/docs/main/administration-guide/configure/configuration-in-your-database.mdx +++ b/docs/main/administration-guide/configure/configuration-in-your-database.mdx @@ -46,7 +46,7 @@ The first step is to get your master database connection string. We recommend ac Create the file `/opt/mattermost/config/mattermost.environment` to set the `MM_CONFIG` environment variable to the database connection string. For example: ``` text -MM_CONFIG='postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10' +MM_CONFIG='postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10' ``` Run this command to verify the permissions on your Mattermost directory: @@ -72,7 +72,7 @@ sudo systemctl restart mattermost You can use the [mmctl config migrate](/administration-guide/manage/mmctl-command-line-tool#mmctl-config-migrate) command to migrate the configuration by running the following command: ``` sh -./bin/mmctl config migrate path/to/config.json "postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10" --local +./bin/mmctl config migrate path/to/config.json "postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10" --local ``` diff --git a/docs/main/administration-guide/manage/command-line-tools.mdx b/docs/main/administration-guide/manage/command-line-tools.mdx index 1dc0b514273..0663f4c2081 100644 --- a/docs/main/administration-guide/manage/command-line-tools.mdx +++ b/docs/main/administration-guide/manage/command-line-tools.mdx @@ -56,7 +56,7 @@ sudo -u mattermost bin/mattermost version - When running CLI commands on a Mattermost installation that has the configuration stored in the database, you might need to pass the database connection string as: ``` sh - bin/mattermost --config="postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable\u0026connect_timeout=10" + bin/mattermost --config="postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable\u0026connect_timeout=10" ``` diff --git a/docs/main/administration-guide/manage/mmctl-command-line-tool.mdx b/docs/main/administration-guide/manage/mmctl-command-line-tool.mdx index 9d1d2723f9c..f75d429304c 100644 --- a/docs/main/administration-guide/manage/mmctl-command-line-tool.mdx +++ b/docs/main/administration-guide/manage/mmctl-command-line-tool.mdx @@ -2533,7 +2533,7 @@ mmctl config migrate [from_config] [to_config] [flags] **Examples** ``` sh -mmctl config migrate path/to/config.json "postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10" --local +mmctl config migrate path/to/config.json "postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10" --local ``` **Options** diff --git a/docs/main/deployment-guide/server/prepare-mattermost-mysql-database.mdx b/docs/main/deployment-guide/server/prepare-mattermost-mysql-database.mdx index 774daac1588..b5e1cbd644d 100644 --- a/docs/main/deployment-guide/server/prepare-mattermost-mysql-database.mdx +++ b/docs/main/deployment-guide/server/prepare-mattermost-mysql-database.mdx @@ -178,7 +178,7 @@ If you're running Mattermost in a High Availability cluster-based deployment, th Create the file `/opt/mattermost/config/mattermost.environment` to set the `MM_CONFIG` environment variable to the database connection string. For example: ``` text -MM_CONFIG='mysql://mmuser:mostest@tcp(127.0.0.1:3306)/mattermost?charset=utf8mb4,utf8&writeTimeout=30s' +MM_CONFIG='mysql://mmuser:mostest_password@tcp(127.0.0.1:3306)/mattermost?charset=utf8mb4,utf8&writeTimeout=30s' ``` diff --git a/e2e-tests/.ci/dashboard.override.yml b/e2e-tests/.ci/dashboard.override.yml index 2ae00bb0845..577795abc89 100644 --- a/e2e-tests/.ci/dashboard.override.yml +++ b/e2e-tests/.ci/dashboard.override.yml @@ -3,7 +3,7 @@ services: dashboard: image: mattermostdevelopment/mirrored-node:18.17 environment: - PG_URI: postgres://mmuser:mostest@db:5432/automation_dashboard_db + PG_URI: postgres://mmuser:mostest_password@db:5432/automation_dashboard_db JWT_SECRET: s8gGBA3ujKRohSw1L8HLOY7Jjnu2ZYv8 # Generated with e.g. `dd if=/dev/urandom count=24 bs=1 2>/dev/null | base64 -w0` JWT_USER: cypress-test JWT_ROLE: integration diff --git a/e2e-tests/.ci/server.generate.sh b/e2e-tests/.ci/server.generate.sh index 8ec5d0c774f..3fc7a52bf0a 100755 --- a/e2e-tests/.ci/server.generate.sh +++ b/e2e-tests/.ci/server.generate.sh @@ -59,7 +59,7 @@ services: MM_CONNECTEDWORKSPACESSETTINGS_ENABLEREMOTECLUSTERSERVICE: "true" MM_CONNECTEDWORKSPACESSETTINGS_ENABLESHAREDWORKSPACES: "true" MM_FEATUREFLAGS_ENABLEREMOTECLUSTERSERVICE: "true" - MM_SQLSETTINGS_DATASOURCE: "postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes" + MM_SQLSETTINGS_DATASOURCE: "postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes" MM_SQLSETTINGS_DRIVERNAME: "postgres" MM_EMAILSETTINGS_SMTPSERVER: "localhost" MM_CLUSTERSETTINGS_READONLYCONFIG: "false" @@ -241,7 +241,7 @@ $(if mme2e_is_token_in_list "cypress" "$ENABLED_DOCKER_SERVICES"; then - "../../e2e-tests/.ci/.env.cypress" environment: CYPRESS_baseUrl: "http://localhost:8065" - CYPRESS_dbConnection: "postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10" + CYPRESS_dbConnection: "postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10" CYPRESS_smtpUrl: "http://localhost:9001" CYPRESS_webhookBaseUrl: "http://localhost:3000" CYPRESS_chromeWebSecurity: "false" @@ -319,7 +319,7 @@ $(if mme2e_is_token_in_list "playwright" "$ENABLED_DOCKER_SERVICES"; then PW_ADMIN_PASSWORD: Sys@dmin-sample1 PW_ADMIN_EMAIL: sysadmin@sample.mattermost.com PW_ENSURE_PLUGINS_INSTALLED: "" - MM_TEST_DB_URL: "postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes" + MM_TEST_DB_URL: "postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes" PW_HA_CLUSTER_ENABLED: "false" PW_RESET_BEFORE_TEST: "false" PW_HEADLESS: "true" diff --git a/e2e-tests/.ci/server.prepare.sh b/e2e-tests/.ci/server.prepare.sh index 863eee7f113..632217213e4 100755 --- a/e2e-tests/.ci/server.prepare.sh +++ b/e2e-tests/.ci/server.prepare.sh @@ -55,14 +55,14 @@ for SERVICE in $ENABLED_DOCKER_SERVICES; do openldap) LDIF_FILE=../../server/tests/test-data.ldif LDIF_CANARY=$(sed -n -E 's/^dn:[[:space:]]*(.*)$/\1/p' ${LDIF_FILE} | tail -n1) - if ${MME2E_DC_SERVER} exec -T -- openldap bash -c "ldapsearch -x -D \"cn=admin,dc=mm,dc=test,dc=com\" -w mostest -b \"$LDIF_CANARY\" >/dev/null"; then + if ${MME2E_DC_SERVER} exec -T -- openldap bash -c "ldapsearch -x -D \"cn=admin,dc=mm,dc=test,dc=com\" -w mostest_password -b \"$LDIF_CANARY\" >/dev/null"; then mme2e_log "Skipping configuration for the $SERVICE container: already initialized" continue fi mme2e_log "Configuring the $SERVICE container" - ${MME2E_DC_SERVER} exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest || true' <../../server/tests/custom-schema-objectID.ldif - ${MME2E_DC_SERVER} exec -T -- openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest || true' <../../server/tests/custom-schema-cpa.ldif - ${MME2E_DC_SERVER} exec -T -- openldap bash -c 'ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest' <../../server/tests/test-data.ldif + ${MME2E_DC_SERVER} exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest_password || true' <../../server/tests/custom-schema-objectID.ldif + ${MME2E_DC_SERVER} exec -T -- openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest_password || true' <../../server/tests/custom-schema-cpa.ldif + ${MME2E_DC_SERVER} exec -T -- openldap bash -c 'ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest_password' <../../server/tests/test-data.ldif ;; minio) mme2e_log "Configuring the $SERVICE container" diff --git a/e2e-tests/.ci/server.start.sh b/e2e-tests/.ci/server.start.sh index 1c0689cbc3a..7713b6d5cff 100755 --- a/e2e-tests/.ci/server.start.sh +++ b/e2e-tests/.ci/server.start.sh @@ -90,7 +90,7 @@ fi # shellcheck disable=SC2043 for MIGRATION in migration_advanced_permissions_phase_2; do # Query explanation: if it doesn't find the migration in the table, there are 0 results and the command fails with a divide-by-zero error. Otherwise the command succeeds - MIGRATION_CHECK_COMMAND="${MME2E_DC_SERVER} exec -T postgres sh -c 'PGPASSWORD=mostest psql -U mmuser mattermost_test -c \"select 1 / (select count(*) from Systems where name = '\''${MIGRATION}'\'' and value = '\''true'\'');\"'" + MIGRATION_CHECK_COMMAND="${MME2E_DC_SERVER} exec -T postgres sh -c 'PGPASSWORD=mostest_password psql -U mmuser mattermost_test -c \"select 1 / (select count(*) from Systems where name = '\''${MIGRATION}'\'' and value = '\''true'\'');\"'" if ! mme2e_wait_command_success "$MIGRATION_CHECK_COMMAND" "Waiting for migration to be completed: ${MIGRATION}" "10" "10"; then mme2e_log "Migration ${MIGRATION} not completed, retry attempts exhausted. Giving up." >&2 diff --git a/e2e-tests/cypress/cypress.config.ts b/e2e-tests/cypress/cypress.config.ts index cca14200584..2acc5e58f0f 100644 --- a/e2e-tests/cypress/cypress.config.ts +++ b/e2e-tests/cypress/cypress.config.ts @@ -34,13 +34,13 @@ export default defineConfig({ cwsURL: 'http://localhost:8076', cwsAPIURL: 'http://localhost:8076', dbClient: 'postgres', - dbConnection: 'postgres://mmuser:mostest@localhost/mattermost_test?sslmode=disable&connect_timeout=10', + dbConnection: 'postgres://mmuser:mostest_password@localhost/mattermost_test?sslmode=disable&connect_timeout=10', elasticsearchConnectionURL: 'http://localhost:9200', firstTest: false, keycloakAppName: 'mattermost', keycloakBaseUrl: 'http://localhost:8484', keycloakUsername: 'mmuser', - keycloakPassword: 'mostest', + keycloakPassword: 'mostest_password', ldapServer: 'localhost', ldapPort: 389, minioAccessKey: 'minioaccesskey', diff --git a/e2e-tests/cypress/tests/support/api/cloud_default_config.json b/e2e-tests/cypress/tests/support/api/cloud_default_config.json index 99de903bee6..c3232d67198 100644 --- a/e2e-tests/cypress/tests/support/api/cloud_default_config.json +++ b/e2e-tests/cypress/tests/support/api/cloud_default_config.json @@ -267,7 +267,7 @@ "ConnectionSecurity": "", "BaseDN": "dc=mm,dc=test,dc=com", "BindUsername": "cn=admin,dc=mm,dc=test,dc=com", - "BindPassword": "mostest", + "BindPassword": "mostest_password", "UserFilter": "", "GroupFilter": "", "GuestFilter": "", diff --git a/e2e-tests/cypress/tests/support/api/keycloak_realm.json b/e2e-tests/cypress/tests/support/api/keycloak_realm.json index a0149da196a..0d5f4dfe307 100644 --- a/e2e-tests/cypress/tests/support/api/keycloak_realm.json +++ b/e2e-tests/cypress/tests/support/api/keycloak_realm.json @@ -1393,7 +1393,7 @@ "bindDn" : [ "cn=admin,dc=mm,dc=test,dc=com" ], "changedSyncPeriod" : [ "-1" ], "usernameLDAPAttribute" : [ "uid" ], - "bindCredential" : [ "mostest" ], + "bindCredential" : [ "mostest_password" ], "lastSync" : [ "1518169262" ], "vendor" : [ "other" ], "uuidLDAPAttribute" : [ "entryUUID" ], diff --git a/e2e-tests/cypress/tests/support/api/on_prem_default_config.json b/e2e-tests/cypress/tests/support/api/on_prem_default_config.json index 27bd956d616..4a16df0ad94 100644 --- a/e2e-tests/cypress/tests/support/api/on_prem_default_config.json +++ b/e2e-tests/cypress/tests/support/api/on_prem_default_config.json @@ -144,7 +144,7 @@ }, "SqlSettings": { "DriverName": "postgres", - "DataSource": "postgres://mmuser:mostest@localhost/mattermost_test?sslmode=disable\u0026connect_timeout=10\u0026binary_parameters=yes", + "DataSource": "postgres://mmuser:mostest_password@localhost/mattermost_test?sslmode=disable\u0026connect_timeout=10\u0026binary_parameters=yes", "DataSourceReplicas": [], "DataSourceSearchReplicas": [], "ConnMaxLifetimeMilliseconds": 3600000, @@ -358,7 +358,7 @@ "ConnectionSecurity": "", "BaseDN": "dc=mm,dc=test,dc=com", "BindUsername": "cn=admin,dc=mm,dc=test,dc=com", - "BindPassword": "mostest", + "BindPassword": "mostest_password", "UserFilter": "", "GroupFilter": "", "GuestFilter": "", diff --git a/e2e-tests/cypress/tests/support/keycloak_commands.ts b/e2e-tests/cypress/tests/support/keycloak_commands.ts index 91869ac78f0..6e4d37c6bc6 100644 --- a/e2e-tests/cypress/tests/support/keycloak_commands.ts +++ b/e2e-tests/cypress/tests/support/keycloak_commands.ts @@ -36,7 +36,7 @@ function keycloakGetAccessTokenAPI(): ChainableT { path: '', method: 'post', headers: {'Content-type': 'application/x-www-form-urlencoded'}, - data: 'grant_type=password&username=mmuser&password=mostest&client_id=admin-cli', + data: 'grant_type=password&username=mmuser&password=mostest_password&client_id=admin-cli', // cy.task() returns untyped data }).then((response: any) => { expect(response.status).to.equal(200); diff --git a/e2e-tests/cypress/tests/support/ldap_server_commands.ts b/e2e-tests/cypress/tests/support/ldap_server_commands.ts index b0da7bb0937..b19517052a1 100644 --- a/e2e-tests/cypress/tests/support/ldap_server_commands.ts +++ b/e2e-tests/cypress/tests/support/ldap_server_commands.ts @@ -19,7 +19,7 @@ export interface LdapUser { } function modifyLDAPUsers(filename: string) { - cy.exec(`ldapmodify -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest -H ldap://${Cypress.expose('ldapServer')}:${Cypress.expose('ldapPort')} -f tests/fixtures/${filename} -c`, {failOnNonZeroExit: false}); + cy.exec(`ldapmodify -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest_password -H ldap://${Cypress.expose('ldapServer')}:${Cypress.expose('ldapPort')} -f tests/fixtures/${filename} -c`, {failOnNonZeroExit: false}); } Cypress.Commands.add('modifyLDAPUsers', modifyLDAPUsers); @@ -88,7 +88,7 @@ Cypress.Commands.add('ldapModify', ldapModify); function getLDAPCredentials() { const host = `ldap://${Cypress.expose('ldapServer')}:${Cypress.expose('ldapPort')}`; const bindDn = 'cn=admin,dc=mm,dc=test,dc=com'; - const password = 'mostest'; + const password = 'mostest_password'; return {host, bindDn, password}; } diff --git a/e2e-tests/playwright/lib/src/containers/constants.ts b/e2e-tests/playwright/lib/src/containers/constants.ts index 873bbe98ece..9c696a78f00 100644 --- a/e2e-tests/playwright/lib/src/containers/constants.ts +++ b/e2e-tests/playwright/lib/src/containers/constants.ts @@ -10,7 +10,7 @@ export const POSTGRES_ALIAS = 'postgres'; export const POSTGRES_PORT = 5432; export const POSTGRES_DB = 'mattermost_test'; export const POSTGRES_USER = 'mmuser'; -export const POSTGRES_PASSWORD = 'mostest'; +export const POSTGRES_PASSWORD = 'mostest_password'; export const INBUCKET_ALIAS = 'inbucket'; export const INBUCKET_WEB_PORT = 9001; @@ -28,7 +28,7 @@ export const WEBHOOK_PORT = 3000; export const OPENLDAP_ALIAS = 'openldap'; export const OPENLDAP_PORT = 389; export const OPENLDAP_ADMIN_DN = 'cn=admin,dc=mm,dc=test,dc=com'; -export const OPENLDAP_ADMIN_PASSWORD = 'mostest'; +export const OPENLDAP_ADMIN_PASSWORD = 'mostest_password'; export const OPENLDAP_BASE_DN = 'dc=mm,dc=test,dc=com'; export const KEYCLOAK_ALIAS = 'keycloak'; diff --git a/e2e-tests/playwright/lib/src/server/default_config.ts b/e2e-tests/playwright/lib/src/server/default_config.ts index 3a0be9b8e53..8febb0f8cfd 100644 --- a/e2e-tests/playwright/lib/src/server/default_config.ts +++ b/e2e-tests/playwright/lib/src/server/default_config.ts @@ -265,7 +265,7 @@ const defaultServerConfig: AdminConfig = { SqlSettings: { DriverName: 'postgres', DataSource: - 'postgres://mmuser:mostest@localhost/mattermost_test?sslmode=disable\u0026connect_timeout=10\u0026binary_parameters=yes', + 'postgres://mmuser:mostest_password@localhost/mattermost_test?sslmode=disable\u0026connect_timeout=10\u0026binary_parameters=yes', DataSourceReplicas: [], DataSourceSearchReplicas: [], MaxIdleConns: 50, diff --git a/e2e-tests/playwright/lib/src/test_config.ts b/e2e-tests/playwright/lib/src/test_config.ts index 821018a451c..7e66629d5fb 100644 --- a/e2e-tests/playwright/lib/src/test_config.ts +++ b/e2e-tests/playwright/lib/src/test_config.ts @@ -153,7 +153,7 @@ export class TestConfig { this.smtpURL = process.env.PW_SMTP_URL || 'http://localhost:9001'; this.postgresUrl = process.env.PW_POSTGRES_URL || - 'postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes'; + 'postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes'; this.webhookBaseUrl = process.env.PW_WEBHOOK_BASE_URL || 'http://localhost:3000'; // Testcontainers diff --git a/server/Makefile b/server/Makefile index 1b27a330e0d..70290d0a8a6 100644 --- a/server/Makefile +++ b/server/Makefile @@ -259,9 +259,9 @@ endif docker compose rm start_dependencies $(GO) run ./build/docker-compose-generator/main.go $(ENABLED_DOCKER_SERVICES) | docker compose -f docker-compose.makefile.yml -f /dev/stdin $(DOCKER_COMPOSE_OVERRIDE) run -T --rm start_dependencies ifneq (,$(findstring openldap,$(ENABLED_DOCKER_SERVICES))) - cat tests/custom-schema-objectID.ldif | docker compose -f docker-compose.makefile.yml $(DOCKER_COMPOSE_OVERRIDE) exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest || true'; - cat tests/custom-schema-cpa.ldif | docker compose -f docker-compose.makefile.yml ${DOCKER_COMPOSE_OVERRIDE} exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest || true'; - cat tests/${LDAP_DATA}-data.ldif | docker compose -f docker-compose.makefile.yml ${DOCKER_COMPOSE_OVERRIDE} exec -T openldap bash -c 'ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest || true'; + cat tests/custom-schema-objectID.ldif | docker compose -f docker-compose.makefile.yml $(DOCKER_COMPOSE_OVERRIDE) exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest_password || true'; + cat tests/custom-schema-cpa.ldif | docker compose -f docker-compose.makefile.yml ${DOCKER_COMPOSE_OVERRIDE} exec -T openldap bash -c 'ldapadd -Y EXTERNAL -H ldapi:/// -w mostest_password || true'; + cat tests/${LDAP_DATA}-data.ldif | docker compose -f docker-compose.makefile.yml ${DOCKER_COMPOSE_OVERRIDE} exec -T openldap bash -c 'ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest_password || true'; endif endif @@ -740,7 +740,7 @@ run-node: export MM_SERVICESETTINGS_LISTENADDRESS=:8066 run-node: export MM_SERVICESETTINGS_ENABLELOCALMODE=true run-node: export MM_SERVICESETTINGS_LOCALMODESOCKETLOCATION=/var/tmp/mattermost_local_node.socket run-node: export MM_SQLSETTINGS_DRIVERNAME=postgres -run-node: export MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest@localhost/mattermost_node_test?sslmode=disable&sslmode=disable&connect_timeout=10&binary_parameters=yes +run-node: export MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest_password@localhost/mattermost_node_test?sslmode=disable&sslmode=disable&connect_timeout=10&binary_parameters=yes run-node: setup-go-work start-docker ## Runs a shared channel node. @echo Running mattermost node diff --git a/server/build/docker-compose.common.yml b/server/build/docker-compose.common.yml index 475464c30e0..c187f28c9ef 100644 --- a/server/build/docker-compose.common.yml +++ b/server/build/docker-compose.common.yml @@ -12,7 +12,7 @@ services: - mm-test environment: POSTGRES_USER: mmuser - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-mostest} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-mostest_password} POSTGRES_DB: mattermost_test POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256 --auth-local=scram-sha-256" command: postgres -c 'config_file=/etc/postgresql/postgresql.conf' @@ -60,7 +60,7 @@ services: LDAP_TLS_VERIFY_CLIENT: "never" LDAP_ORGANISATION: "Mattermost Test" LDAP_DOMAIN: "mm.test.com" - LDAP_ADMIN_PASSWORD: "mostest" + LDAP_ADMIN_PASSWORD: "mostest_password" elasticsearch: build: context: . diff --git a/server/build/docker-preview/Dockerfile b/server/build/docker-preview/Dockerfile index 1b2f307cdc8..97c37a543a4 100644 --- a/server/build/docker-preview/Dockerfile +++ b/server/build/docker-preview/Dockerfile @@ -10,7 +10,7 @@ ARG MATTERMOST_VERSION # ENV POSTGRES_USER=mmuser -ENV POSTGRES_PASSWORD=mostest +ENV POSTGRES_PASSWORD=mostest_password ENV POSTGRES_DB=mattermost_test # diff --git a/server/build/docker-preview/config_docker.json b/server/build/docker-preview/config_docker.json index 3c7aa4b2d07..5b95be53fcd 100644 --- a/server/build/docker-preview/config_docker.json +++ b/server/build/docker-preview/config_docker.json @@ -6,7 +6,7 @@ }, "SqlSettings": { "DriverName": "postgres", - "DataSource": "postgres://mmuser:mostest@localhost/mattermost_test?sslmode=disable\u0026connect_timeout=10\u0026binary_parameters=yes", + "DataSource": "postgres://mmuser:mostest_password@localhost/mattermost_test?sslmode=disable\u0026connect_timeout=10\u0026binary_parameters=yes", "AtRestEncryptKey": "" }, "FileSettings": { diff --git a/server/build/docker/keycloak/ldap.mmsettings.json b/server/build/docker/keycloak/ldap.mmsettings.json index b635749de53..ba9e15b3c96 100644 --- a/server/build/docker/keycloak/ldap.mmsettings.json +++ b/server/build/docker/keycloak/ldap.mmsettings.json @@ -7,7 +7,7 @@ "ConnectionSecurity": "", "BaseDN": "dc=mm,dc=test,dc=com", "BindUsername": "cn=admin,dc=mm,dc=test,dc=com", - "BindPassword": "mostest", + "BindPassword": "mostest_password", "UserFilter": "", "GroupFilter": "", "GuestFilter": "", diff --git a/server/build/dotenv/test.env b/server/build/dotenv/test.env index 41eeb99cf3a..09302ddccf1 100644 --- a/server/build/dotenv/test.env +++ b/server/build/dotenv/test.env @@ -1,4 +1,4 @@ -TEST_DATABASE_POSTGRESQL_DSN=postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 +TEST_DATABASE_POSTGRESQL_DSN=postgres://mmuser:mostest_password@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10 GOBIN=/mattermost/server/bin CI_INBUCKET_HOST=inbucket diff --git a/server/build/local-test-env.sh b/server/build/local-test-env.sh index 3650710dce7..2dc409e4ed9 100755 --- a/server/build/local-test-env.sh +++ b/server/build/local-test-env.sh @@ -16,12 +16,12 @@ up() { docker compose run --rm start_dependencies - docker compose exec openldap bash -c 'echo -e "dn: ou=testusers,dc=mm,dc=test,dc=com\nobjectclass: organizationalunit" | ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest' - docker compose exec openldap bash -c 'echo -e "dn: uid=test.one,ou=testusers,dc=mm,dc=test,dc=com\nobjectclass: iNetOrgPerson\nsn: User\ncn: Test1\nmail: success+testone@simulator.amazonses.com" | ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest' - docker compose exec openldap bash -c 'ldappasswd -s Password1 -D "cn=admin,dc=mm,dc=test,dc=com" -x "uid=test.one,ou=testusers,dc=mm,dc=test,dc=com" -w mostest' - docker compose exec openldap bash -c 'echo -e "dn: uid=test.two,ou=testusers,dc=mm,dc=test,dc=com\nobjectclass: iNetOrgPerson\nsn: User\ncn: Test2\nmail: success+testtwo@simulator.amazonses.com" | ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest' - docker compose exec openldap bash -c 'ldappasswd -s Password1 -D "cn=admin,dc=mm,dc=test,dc=com" -x "uid=test.two,ou=testusers,dc=mm,dc=test,dc=com" -w mostest' - docker compose exec openldap bash -c 'echo -e "dn: cn=tgroup,ou=testusers,dc=mm,dc=test,dc=com\nobjectclass: groupOfUniqueNames\nuniqueMember: uid=test.one,ou=testusers,dc=mm,dc=test,dc=com" | ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest' + docker compose exec openldap bash -c 'echo -e "dn: ou=testusers,dc=mm,dc=test,dc=com\nobjectclass: organizationalunit" | ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest_password' + docker compose exec openldap bash -c 'echo -e "dn: uid=test.one,ou=testusers,dc=mm,dc=test,dc=com\nobjectclass: iNetOrgPerson\nsn: User\ncn: Test1\nmail: success+testone@simulator.amazonses.com" | ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest_password' + docker compose exec openldap bash -c 'ldappasswd -s Password1 -D "cn=admin,dc=mm,dc=test,dc=com" -x "uid=test.one,ou=testusers,dc=mm,dc=test,dc=com" -w mostest_password' + docker compose exec openldap bash -c 'echo -e "dn: uid=test.two,ou=testusers,dc=mm,dc=test,dc=com\nobjectclass: iNetOrgPerson\nsn: User\ncn: Test2\nmail: success+testtwo@simulator.amazonses.com" | ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest_password' + docker compose exec openldap bash -c 'ldappasswd -s Password1 -D "cn=admin,dc=mm,dc=test,dc=com" -x "uid=test.two,ou=testusers,dc=mm,dc=test,dc=com" -w mostest_password' + docker compose exec openldap bash -c 'echo -e "dn: cn=tgroup,ou=testusers,dc=mm,dc=test,dc=com\nobjectclass: groupOfUniqueNames\nuniqueMember: uid=test.one,ou=testusers,dc=mm,dc=test,dc=com" | ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest_password' docker run -it -u root \ --privileged \ @@ -30,7 +30,7 @@ up() --net ${COMPOSE_PROJECT_NAME}_mm-test \ --env-file=dotenv/test.env -e GOPATH="/go" \ - -e MM_SQLSETTINGS_DATASOURCE="postgres://mmuser:mostest@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10" \ + -e MM_SQLSETTINGS_DATASOURCE="postgres://mmuser:mostest_password@postgres:5432/mattermost_test?sslmode=disable&connect_timeout=10" \ -e MM_SQLSETTINGS_DRIVERNAME=postgres mattermost/mattermost-build-server:20210810_golang-1.16.7 bash } diff --git a/server/channels/api4/apitestlib.go b/server/channels/api4/apitestlib.go index cf6ce88db35..46c9df47256 100644 --- a/server/channels/api4/apitestlib.go +++ b/server/channels/api4/apitestlib.go @@ -782,7 +782,7 @@ func (th *TestHelper) SetupLdapConfig() { *cfg.LdapSettings.LdapServer = "dockerhost" *cfg.LdapSettings.BaseDN = "dc=mm,dc=test,dc=com" *cfg.LdapSettings.BindUsername = "cn=admin,dc=mm,dc=test,dc=com" - *cfg.LdapSettings.BindPassword = "mostest" + *cfg.LdapSettings.BindPassword = "mostest_password" *cfg.LdapSettings.FirstNameAttribute = "cn" *cfg.LdapSettings.LastNameAttribute = "sn" *cfg.LdapSettings.NicknameAttribute = "cn" diff --git a/server/channels/store/sqlstore/store_test.go b/server/channels/store/sqlstore/store_test.go index 5ba889a4691..c3e5f9ccbef 100644 --- a/server/channels/store/sqlstore/store_test.go +++ b/server/channels/store/sqlstore/store_test.go @@ -630,7 +630,7 @@ func TestIsBinaryParamEnabled(t *testing.T) { store: SqlStore{ settings: &model.SqlSettings{ DriverName: model.NewPointer(model.DatabaseDriverPostgres), - DataSource: new("postgres://mmuser:mostest@localhost/loadtest?sslmode=disable\u0026binary_parameters=yes"), + DataSource: new("postgres://mmuser:mostest_password@localhost/loadtest?sslmode=disable\u0026binary_parameters=yes"), }, }, expected: true, @@ -639,7 +639,7 @@ func TestIsBinaryParamEnabled(t *testing.T) { store: SqlStore{ settings: &model.SqlSettings{ DriverName: model.NewPointer(model.DatabaseDriverPostgres), - DataSource: new("postgres://mmuser:mostest@localhost/loadtest?sslmode=disable&binary_parameters=yes"), + DataSource: new("postgres://mmuser:mostest_password@localhost/loadtest?sslmode=disable&binary_parameters=yes"), }, }, expected: true, @@ -648,7 +648,7 @@ func TestIsBinaryParamEnabled(t *testing.T) { store: SqlStore{ settings: &model.SqlSettings{ DriverName: model.NewPointer(model.DatabaseDriverPostgres), - DataSource: new("postgres://mmuser:mostest@localhost/loadtest?sslmode=disable"), + DataSource: new("postgres://mmuser:mostest_password@localhost/loadtest?sslmode=disable"), }, }, expected: false, diff --git a/server/channels/store/storetest/settings.go b/server/channels/store/storetest/settings.go index 6692a3df324..a236f043735 100644 --- a/server/channels/store/storetest/settings.go +++ b/server/channels/store/storetest/settings.go @@ -19,7 +19,7 @@ import ( ) const ( - defaultPostgresqlDSN = "postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10" + defaultPostgresqlDSN = "postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10" ) func getDefaultPostgresqlDSN() string { diff --git a/server/cmd/mattermost/commands/db_ping.go b/server/cmd/mattermost/commands/db_ping.go index a79ae303e5a..1eb9e101d9a 100644 --- a/server/cmd/mattermost/commands/db_ping.go +++ b/server/cmd/mattermost/commands/db_ping.go @@ -37,7 +37,7 @@ Resolves the DSN exactly like 'mattermost db migrate' / 'mattermost db init': the --config flag, then MM_CONFIG, then config.json (which is then loaded as a config store and SqlSettings.DataSource is used).`, Example: ` # Database DSN passed via --config (preferred for readiness probes) - $ mattermost db ping --config postgres://mmuser:mostest@localhost/mattermost --timeout 2m + $ mattermost db ping --config postgres://mmuser:mostest_password@localhost/mattermost --timeout 2m # Or via MM_CONFIG $ MM_CONFIG=postgres://localhost/mattermost mattermost db ping`, diff --git a/server/cmd/mmctl/commands/config.go b/server/cmd/mmctl/commands/config.go index e2904c1e952..dc53049e880 100644 --- a/server/cmd/mmctl/commands/config.go +++ b/server/cmd/mmctl/commands/config.go @@ -99,7 +99,7 @@ var ConfigMigrateCmd = &cobra.Command{ Use: "migrate [from_config] [to_config]", Short: "Migrate existing config between backends", Long: "Migrate a file-based configuration to (or from) a database-based configuration. Point the Mattermost server at the target configuration to start using it. Note that this command is only available in `--local` mode.", - Example: `config migrate path/to/config.json "postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10"`, + Example: `config migrate path/to/config.json "postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10"`, Args: cobra.ExactArgs(2), RunE: withClient(configMigrateCmdF), } diff --git a/server/cmd/mmctl/commands/ldap_e2e_test.go b/server/cmd/mmctl/commands/ldap_e2e_test.go index 69368f03b48..0e4497c9b3e 100644 --- a/server/cmd/mmctl/commands/ldap_e2e_test.go +++ b/server/cmd/mmctl/commands/ldap_e2e_test.go @@ -30,7 +30,7 @@ func configForLdap(th *api4.TestHelper) { *cfg.LdapSettings.BaseDN = "dc=mm,dc=test,dc=com" *cfg.LdapSettings.LdapServer = ldapHost *cfg.LdapSettings.BindUsername = "cn=admin,dc=mm,dc=test,dc=com" - *cfg.LdapSettings.BindPassword = "mostest" + *cfg.LdapSettings.BindPassword = "mostest_password" *cfg.LdapSettings.FirstNameAttribute = "cn" *cfg.LdapSettings.LastNameAttribute = "sn" *cfg.LdapSettings.NicknameAttribute = "cn" diff --git a/server/cmd/mmctl/docs/mmctl_config_migrate.rst b/server/cmd/mmctl/docs/mmctl_config_migrate.rst index 9124ef308ba..6145542b5cd 100644 --- a/server/cmd/mmctl/docs/mmctl_config_migrate.rst +++ b/server/cmd/mmctl/docs/mmctl_config_migrate.rst @@ -20,7 +20,7 @@ Examples :: - config migrate path/to/config.json "postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10" + config migrate path/to/config.json "postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10" Options ~~~~~~~ diff --git a/server/config/database_test.go b/server/config/database_test.go index ec7e5431a8a..60a2ec0e01c 100644 --- a/server/config/database_test.go +++ b/server/config/database_test.go @@ -1057,7 +1057,7 @@ func TestDatabaseStoreString(t *testing.T) { maskedDSN := ds.String() assert.True(t, strings.HasPrefix(maskedDSN, "postgres://")) assert.False(t, strings.Contains(maskedDSN, "mmuser")) - assert.False(t, strings.Contains(maskedDSN, "mostest")) + assert.False(t, strings.Contains(maskedDSN, "mostest_password")) } func TestCleanUp(t *testing.T) { diff --git a/server/docker-compose.yaml b/server/docker-compose.yaml index a553909b981..2fc02bfcc7b 100644 --- a/server/docker-compose.yaml +++ b/server/docker-compose.yaml @@ -117,7 +117,7 @@ services: working_dir: '/home/mattermost-server/server' environment: - "MM_SQLSETTINGS_DRIVERNAME=postgres" - - "MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest@postgres/mattermost_test?sslmode=disable&connect_timeout=10" + - "MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest_password@postgres/mattermost_test?sslmode=disable&connect_timeout=10" - "MM_NO_DOCKER=true" - "RUN_SERVER_IN_BACKGROUND=false" - "MM_CLUSTERSETTINGS_ENABLE=true" @@ -151,7 +151,7 @@ services: working_dir: '/home/mattermost-server/server' environment: - "MM_SQLSETTINGS_DRIVERNAME=postgres" - - "MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest@postgres/mattermost_test?sslmode=disable&connect_timeout=10" + - "MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest_password@postgres/mattermost_test?sslmode=disable&connect_timeout=10" - "MM_NO_DOCKER=true" - "RUN_SERVER_IN_BACKGROUND=false" - "MM_CLUSTERSETTINGS_ENABLE=true" @@ -185,7 +185,7 @@ services: working_dir: '/home/mattermost-server/server' environment: - "MM_SQLSETTINGS_DRIVERNAME=postgres" - - "MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest@postgres/mattermost_test?sslmode=disable&connect_timeout=10" + - "MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest_password@postgres/mattermost_test?sslmode=disable&connect_timeout=10" - "MM_NO_DOCKER=true" - "RUN_SERVER_IN_BACKGROUND=false" - "MM_CLUSTERSETTINGS_ENABLE=true" diff --git a/server/public/model/config.go b/server/public/model/config.go index 686336782d4..a2cdb15f0db 100644 --- a/server/public/model/config.go +++ b/server/public/model/config.go @@ -150,7 +150,7 @@ const ( TeamSettingsLockProfileFieldsNameAndUsername = "name_and_username" TeamSettingsLockProfileFieldsAll = "all" - SqlSettingsDefaultDataSource = "postgres://mmuser:mostest@localhost/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes" + SqlSettingsDefaultDataSource = "postgres://mmuser:mostest_password@localhost/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes" FileSettingsDefaultDirectory = "./data/" FileSettingsDefaultS3UploadPartSizeBytes = 5 * 1024 * 1024 // 5MB diff --git a/server/public/model/config_test.go b/server/public/model/config_test.go index 793a5790a72..0a328061f8f 100644 --- a/server/public/model/config_test.go +++ b/server/public/model/config_test.go @@ -2052,7 +2052,7 @@ func TestConfigSanitize(t *testing.T) { t.Run("partially sanitize DataSource", func(t *testing.T) { c := Config{} c.SetDefaults() - *c.SqlSettings.DataSource = "postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable" + *c.SqlSettings.DataSource = "postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable" c.Sanitize(nil, &SanitizeOptions{PartiallyRedactDataSources: true}) expectedURL := "postgres://" + SanitizedPassword + ":" + SanitizedPassword + "@localhost:5432/mattermost_test?sslmode=disable" @@ -2334,15 +2334,15 @@ func TestSanitizeDataSource(t *testing.T) { "", }, { - "postgres://mmuser:mostest@localhost", + "postgres://mmuser:mostest_password@localhost", "postgres://" + SanitizedPassword + ":" + SanitizedPassword + "@localhost", }, { - "postgres://mmuser:mostest@localhost/dummy?sslmode=disable", + "postgres://mmuser:mostest_password@localhost/dummy?sslmode=disable", "postgres://" + SanitizedPassword + ":" + SanitizedPassword + "@localhost/dummy?sslmode=disable", }, { - "postgres://localhost/dummy?sslmode=disable&user=mmuser&password=mostest", + "postgres://localhost/dummy?sslmode=disable&user=mmuser&password=mostest_password", "postgres://" + SanitizedPassword + ":" + SanitizedPassword + "@localhost/dummy?sslmode=disable", }, } diff --git a/server/scripts/psql-migration-test.sh b/server/scripts/psql-migration-test.sh index 1a17228dc68..102cae687c6 100755 --- a/server/scripts/psql-migration-test.sh +++ b/server/scripts/psql-migration-test.sh @@ -14,7 +14,7 @@ docker exec -i mattermost-postgres psql -U mmuser -d migrated -c "INSERT INTO Sy echo "Setting up config for db migration" cat config/config.json | \ - jq '.SqlSettings.DataSource = "postgres://mmuser:mostest@localhost:5432/migrated?sslmode=disable&connect_timeout=10"'| \ + jq '.SqlSettings.DataSource = "postgres://mmuser:mostest_password@localhost:5432/migrated?sslmode=disable&connect_timeout=10"'| \ jq '.SqlSettings.DriverName = "postgres"' > $TMPDIR/config.json echo "Running the migration" @@ -22,7 +22,7 @@ make ARGS="db migrate --config $TMPDIR/config.json" run-cli echo "Setting up config for fresh db setup" cat config/config.json | \ - jq '.SqlSettings.DataSource = "postgres://mmuser:mostest@localhost:5432/latest?sslmode=disable&connect_timeout=10"'| \ + jq '.SqlSettings.DataSource = "postgres://mmuser:mostest_password@localhost:5432/latest?sslmode=disable&connect_timeout=10"'| \ jq '.SqlSettings.DriverName = "postgres"' > $TMPDIR/config.json echo "Setting up fresh db" diff --git a/server/tests/test-config.json b/server/tests/test-config.json index 780e905b53d..99203377b09 100644 --- a/server/tests/test-config.json +++ b/server/tests/test-config.json @@ -91,7 +91,7 @@ }, "SqlSettings": { "DriverName": "postgres", - "DataSource": "postgres://mmuser:mostest@localhost:5432/mattermost_test?sslmode=disable\u0026connect_timeout=10", + "DataSource": "postgres://mmuser:mostest_password@localhost:5432/mattermost_test?sslmode=disable\u0026connect_timeout=10", "DataSourceReplicas": [], "DataSourceSearchReplicas": [], "Trace": false, diff --git a/tools/sharedchannel-test/server.go b/tools/sharedchannel-test/server.go index 398b98082c4..d7c7c258053 100644 --- a/tools/sharedchannel-test/server.go +++ b/tools/sharedchannel-test/server.go @@ -99,7 +99,7 @@ func (sm *ServerManager) resetDatabases(ctx context.Context) error { fmt.Sprintf("CREATE DATABASE %s", db), } { cmd := exec.CommandContext(ctx, "docker", "exec", - "-e", "PGPASSWORD=mostest", + "-e", "PGPASSWORD=mostest_password", "mattermost-postgres", "psql", "-U", "mmuser", "-d", "postgres", "-c", sql, ) @@ -143,7 +143,7 @@ func (sm *ServerManager) launchServerB(logsDir string, truncate bool) error { sm.procB.Env = append(sm.procB.Env, "MM_SERVICESETTINGS_SITEURL="+sm.cfg.ServerBURL, "MM_SERVICESETTINGS_LISTENADDRESS=:9066", - "MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest@localhost/mattermost_node_test?sslmode=disable&connect_timeout=10&binary_parameters=yes", + "MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest_password@localhost/mattermost_node_test?sslmode=disable&connect_timeout=10&binary_parameters=yes", "MM_LOGSETTINGS_FILELOCATION="+filepath.Join(logsDir, "server_b.log"), ) flags := os.O_CREATE | os.O_WRONLY | os.O_APPEND @@ -176,7 +176,7 @@ func (sm *ServerManager) startServers(ctx context.Context) error { sm.procA.Env = append(sm.procA.Env, "MM_SERVICESETTINGS_SITEURL="+sm.cfg.ServerAURL, "MM_SERVICESETTINGS_LISTENADDRESS=:9065", - "MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest@localhost/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes", + "MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest_password@localhost/mattermost_test?sslmode=disable&connect_timeout=10&binary_parameters=yes", "MM_LOGSETTINGS_FILELOCATION="+filepath.Join(logsDir, "server_a.log"), ) outA, err := os.Create(filepath.Join(logsDir, "server_a_stdout.log")) @@ -265,7 +265,7 @@ func ProvisionAdmin(ctx context.Context, serverURL, dbName, username, email, pas // (psql -v variable substitution is not supported with -c) cmd := exec.CommandContext(ctx, "docker", "exec", "-i", - "-e", "PGPASSWORD=mostest", + "-e", "PGPASSWORD=mostest_password", "mattermost-postgres", "psql", "-U", "mmuser", "-d", dbName, "-v", "uname="+username, diff --git a/webapp/channels/.github/workflows/performance-benchmarks.yml b/webapp/channels/.github/workflows/performance-benchmarks.yml index 7d5fd60e55d..7f33a80b648 100644 --- a/webapp/channels/.github/workflows/performance-benchmarks.yml +++ b/webapp/channels/.github/workflows/performance-benchmarks.yml @@ -10,7 +10,7 @@ jobs: postgres: image: postgres env: - POSTGRES_PASSWORD: mostest + POSTGRES_PASSWORD: mostest_password POSTGRES_USER: mmuser options: >- --health-cmd pg_isready @@ -68,7 +68,7 @@ jobs: env: MM_LOGSETTINGS_ENABLECONSOLE: false MM_LOGSETTINGS_FILELEVEL: debug - MM_SQLSETTINGS_DATASOURCE: postgres://mmuser:mostest@localhost/postgres?sslmode=disable&connect_timeout=10&binary_parameters=yes + MM_SQLSETTINGS_DATASOURCE: postgres://mmuser:mostest_password@localhost/postgres?sslmode=disable&connect_timeout=10&binary_parameters=yes MM_TEAMSETTINGS_ENABLEOPENSERVER: true - name: Upload Cypress logs if: ${{ always() }} diff --git a/webapp/channels/src/components/admin_console/database_settings.test.tsx b/webapp/channels/src/components/admin_console/database_settings.test.tsx index b8b90314672..9850f44675b 100644 --- a/webapp/channels/src/components/admin_console/database_settings.test.tsx +++ b/webapp/channels/src/components/admin_console/database_settings.test.tsx @@ -33,7 +33,7 @@ describe('components/DatabaseSettings', () => { MaxOpenConns: 100, Trace: false, DisableDatabaseSearch: true, - DataSource: 'postgres://mmuser:mostest@localhost/mattermost_test?sslmode=disable\u0026connect_timeout=10', + DataSource: 'postgres://mmuser:mostest_password@localhost/mattermost_test?sslmode=disable\u0026connect_timeout=10', QueryTimeout: 10, AnalyticsQueryTimeout: 300, ConnMaxLifetimeMilliseconds: 10,