Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c8bd95bf8 | ||
|
|
da68486f69 | ||
|
|
e338d70303 | ||
|
|
0e793468aa | ||
|
|
1ed71044fd | ||
|
|
61f6bf7e11 | ||
|
|
08ce8185b7 | ||
|
|
7f405a1e6b | ||
|
|
630b30e9cd | ||
|
|
7ceec54658 | ||
|
|
9ff85f5103 | ||
|
|
3402ad2131 | ||
|
|
5410b2b017 | ||
|
|
c9814e25db | ||
|
|
89eb13fa70 | ||
|
|
e8316ee377 | ||
|
|
6603220ece | ||
|
|
9b790d39b7 | ||
|
|
6fbd0e437c | ||
|
|
f03c4e5243 | ||
|
|
3969cc4fe5 | ||
|
|
d4356d2e75 | ||
|
|
3f416461fb | ||
|
|
f951536f97 | ||
|
|
213dcc79bf | ||
|
|
43631d9042 | ||
|
|
7889bd5bba | ||
|
|
a29ec53ef8 | ||
|
|
ff7dc454d1 | ||
|
|
9e0b281b9f | ||
|
|
44dbaf4e5f | ||
|
|
d124978826 |
88
CHANGELOG.md
88
CHANGELOG.md
@@ -1035,3 +1035,91 @@
|
|||||||
[1.74.0]
|
[1.74.0]
|
||||||
* Turn addon can be optionally enabled/disabled
|
* Turn addon can be optionally enabled/disabled
|
||||||
|
|
||||||
|
[1.75.0]
|
||||||
|
* Update Synapse to 1.91.0
|
||||||
|
* [Full changelog](https://github.com/matrix-org/synapse/releases/tag/v1.91.0)
|
||||||
|
|
||||||
|
[1.75.1]
|
||||||
|
* Update Synapse to 1.91.1
|
||||||
|
* [Full changelog](https://github.com/matrix-org/synapse/releases/tag/v1.91.1)
|
||||||
|
* Fix a performance regression introduced in Synapse 1.91.0 where event persistence would cause an excessive linear growth in CPU usage. (#16220)
|
||||||
|
|
||||||
|
[1.75.2]
|
||||||
|
* Update Synapse to 1.91.2
|
||||||
|
* [Full changelog](https://github.com/matrix-org/synapse/releases/tag/v1.91.2)
|
||||||
|
* Revert MSC3861 introspection cache, admin impersonation and account lock. (#16258)
|
||||||
|
|
||||||
|
[1.76.0]
|
||||||
|
* Update Synapse to 1.92.1
|
||||||
|
* [Full changelog](https://github.com/matrix-org/synapse/releases/tag/v1.92.0)
|
||||||
|
* Revert MSC3861 introspection cache, admin impersonation and account lock. (#16258)
|
||||||
|
* Fix incorrect docstring for Ratelimiter. (#16255)
|
||||||
|
|
||||||
|
[1.76.1]
|
||||||
|
* Update Synapse to 1.92.2
|
||||||
|
* [Full changelog](https://github.com/matrix-org/synapse/releases/tag/v1.92.2)
|
||||||
|
|
||||||
|
[1.76.2]
|
||||||
|
* Update Synapse to 1.92.3
|
||||||
|
* [Full changelog](https://github.com/matrix-org/synapse/releases/tag/v1.92.3)
|
||||||
|
* Pillow 10.0.1 is now mandatory because of libwebp CVE-2023-4863, since Pillow provides libwebp in the wheels. (#16347)
|
||||||
|
|
||||||
|
[1.77.0]
|
||||||
|
* Update Synapse to 1.93.0
|
||||||
|
* [Full changelog](https://github.com/matrix-org/synapse/releases/tag/v1.93.0)
|
||||||
|
* GHSA-4f74-84v3-j9q5 / CVE-2023-41335 — Low Severity Temporary storage of plaintext passwords during password changes.
|
||||||
|
* GHSA-7565-cq32-vx2x / CVE-2023-42453 — Low Severity Improper validation of receipts allows forged read receipts.
|
||||||
|
* Add automatic purge after all users have forgotten a room. (#15488)
|
||||||
|
* Restore room purge/shutdown after a Synapse restart. (#15488)
|
||||||
|
* Support resolving homeservers using matrix-fed DNS SRV records from MSC4040. (#16137)
|
||||||
|
* Add the ability to use G (GiB) and T (TiB) suffixes in configuration options that refer to numbers of bytes. (#16219)
|
||||||
|
* Add span information to requests sent to appservices. Contributed by MTRNord. (#16227)
|
||||||
|
* Add the ability to enable/disable registrations when using CAS. Contributed by Aurélien Grimpard. (#16262)
|
||||||
|
* Allow the /notifications endpoint to be routed to workers. (#16265)
|
||||||
|
|
||||||
|
[1.78.0]
|
||||||
|
* Update base image to 4.2.0
|
||||||
|
|
||||||
|
[1.79.0]
|
||||||
|
* Update Synapse to 1.94.0
|
||||||
|
* [Full changelog](https://github.com/matrix-org/synapse/releases/tag/v1.94.0)
|
||||||
|
* Render plain, CSS, CSV, JSON and common image formats in the browser (inline) when requested through the /download endpoint. (#15988)
|
||||||
|
* Add experimental support for MSC4028 to push all encrypted events to clients. (#16361)
|
||||||
|
* Minor performance improvement when sending presence to federated servers. (#16385)
|
||||||
|
* Minor performance improvement by caching server ACL checking. (#16360)
|
||||||
|
|
||||||
|
[1.80.0]
|
||||||
|
* Update Synapse to 1.95.0
|
||||||
|
* [Full changelog](https://github.com/matrix-org/synapse/releases/tag/v1.95.0)
|
||||||
|
* Remove legacy unspecced `knock_state_events` field returned in some responses. (#16403)
|
||||||
|
* Fix a bug introduced in Synapse 1.81.0 where an AttributeError would be raised when `_matrix/client/v3/account/whoami` is called over a unix socket. Contributed by @Sir-Photch. (#16404)
|
||||||
|
* Properly return inline media when content types have parameters. (#16440)
|
||||||
|
* Prevent the purging of large rooms from timing out when Postgres is in use. The timeout which causes this issue was introduced in Synapse 1.88.0. (#16455)
|
||||||
|
* Improve the performance of purging rooms, particularly encrypted rooms. (#16457)
|
||||||
|
* Fix a bug introduced in Synapse 1.59.0 where servers could be incorrectly marked as available after an error response was received. (#16506)
|
||||||
|
|
||||||
|
[1.80.1]
|
||||||
|
* Update Synapse to 1.95.1
|
||||||
|
* [Full changelog](https://github.com/matrix-org/synapse/releases/tag/v1.95.1)
|
||||||
|
* GHSA-mp92-3jfm-3575 / CVE-2023-43796 — Moderate Severity
|
||||||
|
|
||||||
|
[1.81.0]
|
||||||
|
* Update Synapse to 1.96.1
|
||||||
|
* [Full changelog](https://github.com/matrix-org/synapse/releases/tag/v1.96.1)
|
||||||
|
* Add experimental support to allow multiple workers to write to receipts stream. (#16432)
|
||||||
|
* Add a new module API for controller presence. (#16544)
|
||||||
|
* Add a new module API callback that allows adding extra fields to events' unsigned section when sent down to clients. (#16549)
|
||||||
|
* Improve the performance of claiming encryption keys. (#16565, #16570)
|
||||||
|
|
||||||
|
[1.82.0]
|
||||||
|
* Switch LDAP authentication to OIDC login
|
||||||
|
|
||||||
|
[1.83.0]
|
||||||
|
* Update Synapse to 1.97.0
|
||||||
|
* [Full changelog](https://github.com/matrix-org/synapse/releases/tag/v1.97.0)
|
||||||
|
* Add support for asynchronous uploads as defined by MSC2246. Contributed by @sumnerevans at @beeper. (#15503)
|
||||||
|
* Improve the performance of some operations in multi-worker deployments. (#16613, #16616)
|
||||||
|
* Fix a long-standing bug where some queries updated the same row twice. Introduced in Synapse 1.57.0. (#16609)
|
||||||
|
* Fix a long-standing bug where Synapse would not unbind third-party identifiers for Application Service users when deactivated and would not emit a compliant response. (#16617)
|
||||||
|
* Fix sending out of order POSITION over replication, causing additional database load. (#16639)
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
"description": "file://DESCRIPTION.md",
|
"description": "file://DESCRIPTION.md",
|
||||||
"changelog": "file://CHANGELOG.md",
|
"changelog": "file://CHANGELOG.md",
|
||||||
"tagline": "Secure & decentralized communication",
|
"tagline": "Secure & decentralized communication",
|
||||||
"version": "1.74.0-1",
|
"version": "1.83.0",
|
||||||
"upstreamVersion": "1.90.0",
|
"upstreamVersion": "1.97.0",
|
||||||
"healthCheckPath": "/",
|
"healthCheckPath": "/",
|
||||||
"httpPort": 8008,
|
"httpPort": 8008,
|
||||||
"memoryLimit": 536870912,
|
"memoryLimit": 536870912,
|
||||||
"addons": {
|
"addons": {
|
||||||
"localstorage": {},
|
"localstorage": {},
|
||||||
"ldap": {},
|
"oidc": { "loginRedirectUri": "/_synapse/client/oidc/callback" },
|
||||||
"postgresql": {},
|
"postgresql": {},
|
||||||
"sendmail": { "supportsDisplayName": true },
|
"sendmail": { "supportsDisplayName": true },
|
||||||
"turn": { "optional": true }
|
"turn": { "optional": true }
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM cloudron/base:4.0.0@sha256:31b195ed0662bdb06a6e8a5ddbedb6f191ce92e8bee04c03fb02dd4e9d0286df
|
FROM cloudron/base:4.2.0@sha256:46da2fffb36353ef714f97ae8e962bd2c212ca091108d768ba473078319a47f4
|
||||||
|
|
||||||
RUN mkdir -p /app/pkg
|
RUN mkdir -p /app/pkg
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ RUN virtualenv -p python3 /app/code/env
|
|||||||
ENV VIRTUAL_ENV=/app/code/env
|
ENV VIRTUAL_ENV=/app/code/env
|
||||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||||
|
|
||||||
ARG VERSION=1.90.0
|
ARG VERSION=1.97.0
|
||||||
|
|
||||||
# https://github.com/matrix-org/synapse-s3-storage-provider
|
# https://github.com/matrix-org/synapse-s3-storage-provider
|
||||||
ARG STORAGE_PROVIDER_VERSION=1beb6af95e1f5caedb8e6e7e1cc176cdb2106d37
|
ARG STORAGE_PROVIDER_VERSION=1beb6af95e1f5caedb8e6e7e1cc176cdb2106d37
|
||||||
|
|||||||
28
start.sh
28
start.sh
@@ -35,7 +35,7 @@ if [[ ! -f /app/data/configs/homeserver.yaml ]]; then
|
|||||||
yq eval -i ".auto_join_rooms=[]" /app/data/configs/homeserver.yaml
|
yq eval -i ".auto_join_rooms=[]" /app/data/configs/homeserver.yaml
|
||||||
yq eval -i ".auto_join_rooms[0]=\"#discuss:${server_name}\"" /app/data/configs/homeserver.yaml
|
yq eval -i ".auto_join_rooms[0]=\"#discuss:${server_name}\"" /app/data/configs/homeserver.yaml
|
||||||
|
|
||||||
if [[ -z "${CLOUDRON_LDAP_SERVER:-}" ]]; then
|
if [[ -z "${CLOUDRON_OIDC_ISSUER:-}" ]]; then
|
||||||
yq eval -i ".enable_registration=true" /app/data/configs/homeserver.yaml
|
yq eval -i ".enable_registration=true" /app/data/configs/homeserver.yaml
|
||||||
yq eval -i ".password_config.pepper=\"$(pwgen -1s 12)\"" /app/data/configs/homeserver.yaml
|
yq eval -i ".password_config.pepper=\"$(pwgen -1s 12)\"" /app/data/configs/homeserver.yaml
|
||||||
# just setting enabled to false is not enough. see https://github.com/matrix-org/matrix-synapse-ldap3/issues/123
|
# just setting enabled to false is not enough. see https://github.com/matrix-org/matrix-synapse-ldap3/issues/123
|
||||||
@@ -65,15 +65,25 @@ yq eval -i ".email.smtp_user=\"${CLOUDRON_MAIL_SMTP_USERNAME}\"" /app/data/confi
|
|||||||
yq eval -i ".email.smtp_pass=\"${CLOUDRON_MAIL_SMTP_PASSWORD}\"" /app/data/configs/homeserver.yaml
|
yq eval -i ".email.smtp_pass=\"${CLOUDRON_MAIL_SMTP_PASSWORD}\"" /app/data/configs/homeserver.yaml
|
||||||
yq eval -i ".email.notif_from=\"${CLOUDRON_MAIL_FROM_DISPLAY_NAME:-Matrix} <${CLOUDRON_MAIL_FROM}>\"" /app/data/configs/homeserver.yaml
|
yq eval -i ".email.notif_from=\"${CLOUDRON_MAIL_FROM_DISPLAY_NAME:-Matrix} <${CLOUDRON_MAIL_FROM}>\"" /app/data/configs/homeserver.yaml
|
||||||
|
|
||||||
# ldap
|
# oidc
|
||||||
if [[ -n "${CLOUDRON_LDAP_SERVER:-}" ]]; then
|
if [[ -n "${CLOUDRON_OIDC_ISSUER:-}" ]]; then
|
||||||
yq eval -i ".password_providers[0].config.uri=\"${CLOUDRON_LDAP_URL}\"" /app/data/configs/homeserver.yaml
|
yq eval -i "del(.password_providers)" /app/data/configs/homeserver.yaml # remove old ldap config
|
||||||
yq eval -i ".password_providers[0].config.start_tls=false" /app/data/configs/homeserver.yaml
|
echo " ==> Configuring OIDC auth"
|
||||||
yq eval -i ".password_providers[0].config.base=\"${CLOUDRON_LDAP_USERS_BASE_DN}\"" /app/data/configs/homeserver.yaml
|
yq eval -i ".oidc_providers[0].idp_id=\"cloudron\"" /app/data/configs/homeserver.yaml
|
||||||
yq eval -i ".password_providers[0].config.bind_dn=\"${CLOUDRON_LDAP_BIND_DN}\"" /app/data/configs/homeserver.yaml
|
yq eval -i ".oidc_providers[0].idp_name=\"Cloudron\"" /app/data/configs/homeserver.yaml
|
||||||
yq eval -i ".password_providers[0].config.bind_password=\"${CLOUDRON_LDAP_BIND_PASSWORD}\"" /app/data/configs/homeserver.yaml
|
yq eval -i ".oidc_providers[0].issuer=\"${CLOUDRON_OIDC_ISSUER}\"" /app/data/configs/homeserver.yaml
|
||||||
yq eval -i ".password_providers[0].config.filter=\"(objectClass=user)\"" /app/data/configs/homeserver.yaml
|
yq eval -i ".oidc_providers[0].client_id=\"${CLOUDRON_OIDC_CLIENT_ID}\"" /app/data/configs/homeserver.yaml
|
||||||
|
yq eval -i ".oidc_providers[0].client_secret=\"${CLOUDRON_OIDC_CLIENT_SECRET}\"" /app/data/configs/homeserver.yaml
|
||||||
|
|
||||||
|
yq eval -i ".oidc_providers[0].scopes=[\"openid\", \"email\", \"profile\"]" /app/data/configs/homeserver.yaml
|
||||||
|
yq eval -i ".oidc_providers[0].authorization_endpoint=\"${CLOUDRON_OIDC_AUTH_ENDPOINT}\"" /app/data/configs/homeserver.yaml
|
||||||
|
yq eval -i ".oidc_providers[0].token_endpoint=\"${CLOUDRON_OIDC_TOKEN_ENDPOINT}\"" /app/data/configs/homeserver.yaml
|
||||||
|
yq eval -i ".oidc_providers[0].userinfo_endpoint=\"${CLOUDRON_OIDC_PROFILE_ENDPOINT}\"" /app/data/configs/homeserver.yaml
|
||||||
|
# https://s3lph.me/ldap-to-oidc-migration-3-matrix.html
|
||||||
|
yq eval -i ".oidc_providers[0].allow_existing_users=true" /app/data/configs/homeserver.yaml
|
||||||
|
yq eval -i ".oidc_providers[0].skip_verification=true" /app/data/configs/homeserver.yaml
|
||||||
|
yq eval -i ".oidc_providers[0].user_mapping_provider.config.localpart_template=\"{{ user.sub }}\"" /app/data/configs/homeserver.yaml
|
||||||
|
yq eval -i ".oidc_providers[0].user_mapping_provider.config.display_name_template=\"{{ user.name }}\"" /app/data/configs/homeserver.yaml
|
||||||
else
|
else
|
||||||
yq eval -i ".password_config.localdb_enabled=true" /app/data/configs/homeserver.yaml
|
yq eval -i ".password_config.localdb_enabled=true" /app/data/configs/homeserver.yaml
|
||||||
# just setting enabled to false is not enough. see https://github.com/matrix-org/matrix-synapse-ldap3/issues/123
|
# just setting enabled to false is not enough. see https://github.com/matrix-org/matrix-synapse-ldap3/issues/123
|
||||||
|
|||||||
110
test/package-lock.json
generated
110
test/package-lock.json
generated
@@ -9,17 +9,17 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chromedriver": "^116.0.0",
|
"chromedriver": "^119.0.1",
|
||||||
"expect.js": "^0.3.1",
|
"expect.js": "^0.3.1",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"selenium-webdriver": "^4.11.1",
|
"selenium-webdriver": "^4.15.0",
|
||||||
"superagent": "^8.1.2"
|
"superagent": "^8.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@testim/chrome-version": {
|
"node_modules/@testim/chrome-version": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.4.tgz",
|
||||||
"integrity": "sha512-g697J3WxV/Zytemz8aTuKjTGYtta9+02kva3C1xc7KXB8GdbfE1akGJIsZLyY/FSh2QrnE+fiB7vmWU3XNcb6A=="
|
"integrity": "sha512-kIhULpw9TrGYnHp/8VfdcneIcxKnLixmADtukQRtJUmsVlMg0niMkwV0xZmi8hqa57xqilIHjWFA0GKvEjVU5g=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "16.11.7",
|
"version": "16.11.7",
|
||||||
@@ -105,9 +105,9 @@
|
|||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||||
},
|
},
|
||||||
"node_modules/axios": {
|
"node_modules/axios": {
|
||||||
"version": "1.4.0",
|
"version": "1.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz",
|
||||||
"integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==",
|
"integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"follow-redirects": "^1.15.0",
|
"follow-redirects": "^1.15.0",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
@@ -236,24 +236,24 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/chromedriver": {
|
"node_modules/chromedriver": {
|
||||||
"version": "116.0.0",
|
"version": "119.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-116.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-119.0.1.tgz",
|
||||||
"integrity": "sha512-/TQaRn+RUAYnVqy5Vx8VtU8DvtWosU8QLM2u7BoNM5h55PRQPXF/onHAehEi8Sj/CehdKqH50NFdiumQAUr0DQ==",
|
"integrity": "sha512-lpCFFLaXPpvElTaUOWKdP74pFb/sJhWtWqMjn7Ju1YriWn8dT5JBk84BGXMPvZQs70WfCYWecxdMmwfIu1Mupg==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@testim/chrome-version": "^1.1.3",
|
"@testim/chrome-version": "^1.1.4",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.6.0",
|
||||||
"compare-versions": "^6.0.0",
|
"compare-versions": "^6.1.0",
|
||||||
"extract-zip": "^2.0.1",
|
"extract-zip": "^2.0.1",
|
||||||
"https-proxy-agent": "^5.0.1",
|
"https-proxy-agent": "^5.0.1",
|
||||||
"proxy-from-env": "^1.1.0",
|
"proxy-from-env": "^1.1.0",
|
||||||
"tcp-port-used": "^1.0.1"
|
"tcp-port-used": "^1.0.2"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"chromedriver": "bin/chromedriver"
|
"chromedriver": "bin/chromedriver"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cliui": {
|
"node_modules/cliui": {
|
||||||
@@ -294,9 +294,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/compare-versions": {
|
"node_modules/compare-versions": {
|
||||||
"version": "6.0.0",
|
"version": "6.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.0.tgz",
|
||||||
"integrity": "sha512-s2MzYxfRsE9f/ow8hjn7ysa7pod1xhHdQMsgiJtKx6XSNf4x2N1KG4fjrkUmXcP/e9Y2ZX4zB6sHIso0Lm6evQ=="
|
"integrity": "sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg=="
|
||||||
},
|
},
|
||||||
"node_modules/component-emitter": {
|
"node_modules/component-emitter": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
@@ -479,9 +479,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/follow-redirects": {
|
"node_modules/follow-redirects": {
|
||||||
"version": "1.15.2",
|
"version": "1.15.3",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
|
||||||
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
|
"integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "individual",
|
"type": "individual",
|
||||||
@@ -1166,13 +1166,13 @@
|
|||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||||
},
|
},
|
||||||
"node_modules/selenium-webdriver": {
|
"node_modules/selenium-webdriver": {
|
||||||
"version": "4.11.1",
|
"version": "4.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.11.1.tgz",
|
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.15.0.tgz",
|
||||||
"integrity": "sha512-bvrnr3UZlLScErOmn8gV6cqc+1PYDHn0575CxUR2U14fMWt7OKxSy0lAThhZq4sq4d1HqP8ebz11oiHSlAQ2WA==",
|
"integrity": "sha512-BNG1bq+KWiBGHcJ/wULi0eKY0yaDqFIbEmtbsYJmfaEghdCkXBsx1akgOorhNwjBipOr0uwpvNXqT6/nzl+zjg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
"tmp": "^0.2.1",
|
"tmp": "^0.2.1",
|
||||||
"ws": ">=8.13.0"
|
"ws": ">=8.14.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 14.20.0"
|
"node": ">= 14.20.0"
|
||||||
@@ -1374,9 +1374,9 @@
|
|||||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||||
},
|
},
|
||||||
"node_modules/ws": {
|
"node_modules/ws": {
|
||||||
"version": "8.13.0",
|
"version": "8.14.2",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz",
|
||||||
"integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==",
|
"integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
},
|
},
|
||||||
@@ -1468,9 +1468,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@testim/chrome-version": {
|
"@testim/chrome-version": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.4.tgz",
|
||||||
"integrity": "sha512-g697J3WxV/Zytemz8aTuKjTGYtta9+02kva3C1xc7KXB8GdbfE1akGJIsZLyY/FSh2QrnE+fiB7vmWU3XNcb6A=="
|
"integrity": "sha512-kIhULpw9TrGYnHp/8VfdcneIcxKnLixmADtukQRtJUmsVlMg0niMkwV0xZmi8hqa57xqilIHjWFA0GKvEjVU5g=="
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "16.11.7",
|
"version": "16.11.7",
|
||||||
@@ -1538,9 +1538,9 @@
|
|||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||||
},
|
},
|
||||||
"axios": {
|
"axios": {
|
||||||
"version": "1.4.0",
|
"version": "1.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz",
|
||||||
"integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==",
|
"integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"follow-redirects": "^1.15.0",
|
"follow-redirects": "^1.15.0",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
@@ -1633,17 +1633,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"chromedriver": {
|
"chromedriver": {
|
||||||
"version": "116.0.0",
|
"version": "119.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-116.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-119.0.1.tgz",
|
||||||
"integrity": "sha512-/TQaRn+RUAYnVqy5Vx8VtU8DvtWosU8QLM2u7BoNM5h55PRQPXF/onHAehEi8Sj/CehdKqH50NFdiumQAUr0DQ==",
|
"integrity": "sha512-lpCFFLaXPpvElTaUOWKdP74pFb/sJhWtWqMjn7Ju1YriWn8dT5JBk84BGXMPvZQs70WfCYWecxdMmwfIu1Mupg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@testim/chrome-version": "^1.1.3",
|
"@testim/chrome-version": "^1.1.4",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.6.0",
|
||||||
"compare-versions": "^6.0.0",
|
"compare-versions": "^6.1.0",
|
||||||
"extract-zip": "^2.0.1",
|
"extract-zip": "^2.0.1",
|
||||||
"https-proxy-agent": "^5.0.1",
|
"https-proxy-agent": "^5.0.1",
|
||||||
"proxy-from-env": "^1.1.0",
|
"proxy-from-env": "^1.1.0",
|
||||||
"tcp-port-used": "^1.0.1"
|
"tcp-port-used": "^1.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cliui": {
|
"cliui": {
|
||||||
@@ -1678,9 +1678,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"compare-versions": {
|
"compare-versions": {
|
||||||
"version": "6.0.0",
|
"version": "6.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.0.tgz",
|
||||||
"integrity": "sha512-s2MzYxfRsE9f/ow8hjn7ysa7pod1xhHdQMsgiJtKx6XSNf4x2N1KG4fjrkUmXcP/e9Y2ZX4zB6sHIso0Lm6evQ=="
|
"integrity": "sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg=="
|
||||||
},
|
},
|
||||||
"component-emitter": {
|
"component-emitter": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
@@ -1814,9 +1814,9 @@
|
|||||||
"integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ=="
|
"integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ=="
|
||||||
},
|
},
|
||||||
"follow-redirects": {
|
"follow-redirects": {
|
||||||
"version": "1.15.2",
|
"version": "1.15.3",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
|
||||||
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA=="
|
"integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q=="
|
||||||
},
|
},
|
||||||
"form-data": {
|
"form-data": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
@@ -2300,13 +2300,13 @@
|
|||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||||
},
|
},
|
||||||
"selenium-webdriver": {
|
"selenium-webdriver": {
|
||||||
"version": "4.11.1",
|
"version": "4.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.11.1.tgz",
|
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.15.0.tgz",
|
||||||
"integrity": "sha512-bvrnr3UZlLScErOmn8gV6cqc+1PYDHn0575CxUR2U14fMWt7OKxSy0lAThhZq4sq4d1HqP8ebz11oiHSlAQ2WA==",
|
"integrity": "sha512-BNG1bq+KWiBGHcJ/wULi0eKY0yaDqFIbEmtbsYJmfaEghdCkXBsx1akgOorhNwjBipOr0uwpvNXqT6/nzl+zjg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
"tmp": "^0.2.1",
|
"tmp": "^0.2.1",
|
||||||
"ws": ">=8.13.0"
|
"ws": ">=8.14.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"semver": {
|
"semver": {
|
||||||
@@ -2457,9 +2457,9 @@
|
|||||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||||
},
|
},
|
||||||
"ws": {
|
"ws": {
|
||||||
"version": "8.13.0",
|
"version": "8.14.2",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz",
|
||||||
"integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==",
|
"integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"y18n": {
|
"y18n": {
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chromedriver": "^116.0.0",
|
"chromedriver": "^119.0.1",
|
||||||
"expect.js": "^0.3.1",
|
"expect.js": "^0.3.1",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"selenium-webdriver": "^4.11.1",
|
"selenium-webdriver": "^4.15.0",
|
||||||
"superagent": "^8.1.2"
|
"superagent": "^8.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
392
test/test.js
392
test/test.js
@@ -1,214 +1,360 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
/* jshint esversion: 8 */
|
/* jshint esversion: 8 */
|
||||||
/* global describe */
|
/* global it:false */
|
||||||
/* global before */
|
/* global xit:false */
|
||||||
/* global after */
|
/* global describe:false */
|
||||||
/* global it */
|
/* global before:false */
|
||||||
/* global xit */
|
/* global after:false */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
require('chromedriver');
|
require('chromedriver');
|
||||||
|
|
||||||
var execSync = require('child_process').execSync,
|
const execSync = require('child_process').execSync,
|
||||||
expect = require('expect.js'),
|
expect = require('expect.js'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
superagent = require('superagent'),
|
|
||||||
{ Builder, By, Key, until } = require('selenium-webdriver'),
|
{ Builder, By, Key, until } = require('selenium-webdriver'),
|
||||||
{ Options } = require('selenium-webdriver/chrome');
|
{ Options } = require('selenium-webdriver/chrome');
|
||||||
|
|
||||||
|
|
||||||
|
if (!process.env.USERNAME || !process.env.PASSWORD) {
|
||||||
|
console.log('USERNAME and PASSWORD env vars need to be set');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
describe('Application life cycle test', function () {
|
describe('Application life cycle test', function () {
|
||||||
this.timeout(0);
|
this.timeout(0);
|
||||||
|
|
||||||
|
const ELEMENT_LOCATION = 'element-test';
|
||||||
const LOCATION = 'test';
|
const LOCATION = 'test';
|
||||||
const TEST_TIMEOUT = 10000;
|
const TEST_TIMEOUT = parseInt(process.env.TIMEOUT, 10) || 10000;
|
||||||
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
|
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
|
||||||
|
const USERNAME = process.env.USERNAME;
|
||||||
|
const PASSWORD = process.env.PASSWORD;
|
||||||
|
const ROOM_ID = Math.floor((Math.random() * 100) + 1);
|
||||||
|
const ROOM_NAME = 'Test room ' + ROOM_ID;
|
||||||
|
const MSG_TEXT = 'Test message ';
|
||||||
|
|
||||||
const username = process.env.USERNAME;
|
let browser, app;
|
||||||
const password = process.env.PASSWORD;
|
let athenticated_by_oidc = false;
|
||||||
|
|
||||||
var app, browser;
|
|
||||||
var token, roomId;
|
|
||||||
|
|
||||||
before(function () {
|
before(function () {
|
||||||
if (!process.env.USERNAME) throw new Error('USERNAME env var not set');
|
const options = new Options().windowSize({ width: 1280, height: 1024 });
|
||||||
if (!process.env.PASSWORD) throw new Error('PASSWORD env var not set');
|
if (process.env.HEADLESS) options.addArguments('headless');
|
||||||
|
|
||||||
browser = new Builder().forBrowser('chrome').setChromeOptions(new Options().windowSize({ width: 1280, height: 1024 })).build();
|
browser = new Builder().forBrowser('chrome').setChromeOptions(options).build();
|
||||||
});
|
});
|
||||||
|
|
||||||
after(function () {
|
after(function () {
|
||||||
browser.quit();
|
browser.quit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function sleep(millis) {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, millis));
|
||||||
|
}
|
||||||
|
|
||||||
|
async function waitForElement(elem) {
|
||||||
|
await browser.wait(until.elementLocated(elem), TEST_TIMEOUT);
|
||||||
|
await browser.wait(until.elementIsVisible(browser.findElement(elem)), TEST_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
function getAppInfo() {
|
function getAppInfo() {
|
||||||
var inspect = JSON.parse(execSync('cloudron inspect'));
|
const inspect = JSON.parse(execSync('cloudron inspect'));
|
||||||
app = inspect.apps.filter(function (a) { return a.location.indexOf(LOCATION) === 0; })[0];
|
app = inspect.apps.filter(function (a) { return a.location.indexOf(LOCATION) === 0; })[0];
|
||||||
expect(app).to.be.an('object');
|
expect(app).to.be.an('object');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getElementAppInfo() {
|
||||||
|
const inspect = JSON.parse(execSync('cloudron inspect'));
|
||||||
|
app = inspect.apps.filter(function (a) { return a.location.indexOf(ELEMENT_LOCATION) === 0; })[0];
|
||||||
|
expect(app).to.be.an('object');
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMessage() {
|
||||||
|
return MSG_TEXT + Math.floor((Math.random() * 100) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function updateSynapseConfig() {
|
||||||
|
console.log(`Setting Synapse Matrix server location to "https://${app.fqdn}"`);
|
||||||
|
execSync(`cloudron exec --app ${ELEMENT_LOCATION} -- bash -c "jq '.default_server_config[\\"m.homeserver\\"].base_url = \\"https://${app.fqdn}\\"' /app/data/config.json | sponge /app/data/config.json"`);
|
||||||
|
execSync(`cloudron restart --app ${ELEMENT_LOCATION}`);
|
||||||
|
// wait when all services are up and running
|
||||||
|
await sleep(15000);
|
||||||
|
}
|
||||||
|
|
||||||
async function checkLandingPage() {
|
async function checkLandingPage() {
|
||||||
await browser.get(`https://${app.fqdn}`);
|
await browser.get(`https://${app.fqdn}`);
|
||||||
await browser.wait(until.elementLocated(By.xpath('//h1[contains(text(),"Synapse is running")]')), TEST_TIMEOUT);
|
await browser.wait(until.elementLocated(By.xpath('//h1[contains(text(),"Synapse is running")]')), TEST_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://matrix.org/docs/spec/client_server/latest#user-interactive-api-in-the-rest-api
|
async function registerUser() {
|
||||||
function registerUser(done) {
|
await browser.get(`https://${app.fqdn}/#/register`);
|
||||||
superagent.post('https://' + app.fqdn + '/_matrix/client/r0/register?kind=user').send({
|
await waitForElement(By.xpath('//input[@label="Username"]'));
|
||||||
username: username,
|
await browser.findElement(By.xpath('//input[@label="Username"]')).sendKeys(USERNAME);
|
||||||
password: password,
|
await browser.sleep(2000);
|
||||||
inhibit_login: false
|
await browser.findElement(By.xpath('//input[@label="Password"]')).sendKeys(PASSWORD);
|
||||||
}).end(function (error, result) {
|
await browser.sleep(2000);
|
||||||
// we will first get a 401
|
await browser.findElement(By.xpath('//input[@label="Confirm password"]')).sendKeys(PASSWORD);
|
||||||
let session = result.body.session;
|
await browser.sleep(2000);
|
||||||
console.log('session is', session);
|
await browser.findElement(By.xpath('//input[@value="Register"]')).click();
|
||||||
if (result.statusCode !== 401) return done(new Error('Expecting a 401 ' + result.statusCode));
|
await browser.sleep(2000);
|
||||||
|
await waitForElement(By.xpath('//h1[text()="You\'re in"]'));
|
||||||
superagent.post('https://' + app.fqdn + '/_matrix/client/r0/register?kind=user').send({
|
await browser.sleep(2000);
|
||||||
auth: {
|
await browser.findElement(By.xpath('//div[@role="button" and text()="Skip"]')).click();
|
||||||
type: 'm.login.dummy',
|
await browser.sleep(2000);
|
||||||
session: session
|
await waitForElement(By.xpath(`//h1[contains(., "Welcome")]`));
|
||||||
},
|
|
||||||
username: username,
|
|
||||||
password: password,
|
|
||||||
inhibit_login: false
|
|
||||||
}).end(function (error, result) {
|
|
||||||
if (error) return done(error);
|
|
||||||
if (result.statusCode !== 200) return done(new Error('Login failed with status ' + result.statusCode));
|
|
||||||
|
|
||||||
console.log('registered user with id', result.body.user_id);
|
|
||||||
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://matrix.org/docs/spec/client_server/latest
|
async function loginOIDC(username, password) {
|
||||||
function checkLogin(done) {
|
browser.manage().deleteAllCookies();
|
||||||
superagent.post('https://' + app.fqdn + '/_matrix/client/r0/login').send({
|
await browser.get(`https://${app.fqdn}/#/login`);
|
||||||
type: 'm.login.password',
|
await browser.sleep(6000);
|
||||||
user: username,
|
|
||||||
password: password
|
|
||||||
}).end(function (error, result) {
|
|
||||||
if (error) return done(error);
|
|
||||||
if (result.statusCode !== 200) return done(new Error('Login failed with status ' + result.statusCode));
|
|
||||||
|
|
||||||
token = result.body.access_token;
|
await waitForElement(By.xpath('//div[@role="button" and contains(., "Continue with Cloudron")]'));
|
||||||
if (!token) return done(new Error('No token'));
|
await browser.findElement(By.xpath('//div[@role="button" and contains(., "Continue with Cloudron")]')).click();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
done();
|
if (!athenticated_by_oidc) {
|
||||||
});
|
await waitForElement(By.xpath('//input[@name="username"]'));
|
||||||
|
await browser.findElement(By.xpath('//input[@name="username"]')).sendKeys(username);
|
||||||
|
await browser.findElement(By.xpath('//input[@name="password"]')).sendKeys(password);
|
||||||
|
await browser.sleep(2000);
|
||||||
|
await browser.findElement(By.xpath('//button[@type="submit" and contains(text(), "Sign in")]')).click();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
athenticated_by_oidc = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
await waitForElement(By.xpath('//p[@class="confirm-trust" and contains(., "Continuing will grant ")]'));
|
||||||
|
await browser.findElement(By.xpath('//a[contains(., "Continue")]')).click();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
if (await browser.findElements(By.xpath('//div[@aria-label="Skip verification for now"]')).then(found => !!found.length)) {
|
||||||
|
await skipVerification();
|
||||||
|
}
|
||||||
|
|
||||||
|
await browser.sleep(3000);
|
||||||
|
await waitForElement(By.xpath(`//h1[contains(., "Welcome")]`));
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkAutoJoinRoom(done) {
|
async function login() {
|
||||||
superagent.get('https://' + app.fqdn + '/_matrix/client/r0/joined_rooms?access_token=' + token).end(function (error, result) {
|
await browser.get('https://' + app.fqdn + '/#/login');
|
||||||
if (error) return done(error);
|
await browser.wait(until.elementLocated(By.xpath('//input[@value="Sign in"]')), TEST_TIMEOUT);
|
||||||
if (result.statusCode !== 200) return done(new Error('Room listing failed with status ' + result.statusCode));
|
await browser.findElement(By.xpath('//input[@name="username"]')).sendKeys(USERNAME);
|
||||||
|
await browser.findElement(By.xpath('//input[@name="password"]')).sendKeys(PASSWORD);
|
||||||
|
await browser.findElement(By.xpath('//input[@value="Sign in"]')).click();
|
||||||
|
await browser.sleep(5000);
|
||||||
|
|
||||||
if (result.body.joined_rooms.length !== 1) return done(new Error('User must have auto-joined discuss channel:' + result.statusCode));
|
if (await browser.findElements(By.xpath('//div[@aria-label="Skip verification for now"]')).then(found => !!found.length)) {
|
||||||
done();
|
await skipVerification();
|
||||||
});
|
}
|
||||||
|
|
||||||
|
await browser.wait(until.elementLocated(By.xpath('//span[text()="Rooms"]')), TEST_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
function createRoom(done) {
|
async function skipVerification() {
|
||||||
superagent.post('https://' + app.fqdn + '/_matrix/client/r0/createRoom?access_token=' + token).send({
|
await browser.wait(until.elementLocated(By.xpath('//div[@aria-label="Skip verification for now"]')), TEST_TIMEOUT);
|
||||||
room_alias_name: 'general'
|
await browser.sleep(5000);
|
||||||
}).end(function (error, result) {
|
await browser.findElement(By.xpath('//div[@aria-label="Skip verification for now"]')).click();
|
||||||
if (error) return done(error);
|
await browser.wait(until.elementLocated(By.xpath('//div[contains(text(), "verify later")]')), TEST_TIMEOUT);
|
||||||
if (result.statusCode !== 200) return done(new Error('Room creation failed with status ' + result.statusCode));
|
await browser.sleep(5000);
|
||||||
|
await browser.findElement(By.xpath('//div[contains(text(), "verify later")]')).click();
|
||||||
roomId = result.body.room_id;
|
await browser.sleep(5000);
|
||||||
if (!roomId) return done(new Error('No room id'));
|
|
||||||
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkRoom(done) {
|
async function logout() {
|
||||||
superagent.get('https://' + app.fqdn + '/_matrix/client/r0/joined_rooms?access_token=' + token).end(function (error, result) {
|
await browser.get('https://' + app.fqdn + '/#/home');
|
||||||
if (error) return done(error);
|
await browser.sleep(5000);
|
||||||
if (result.statusCode !== 200) return done(new Error('Room listing failed with status ' + result.statusCode));
|
await waitForElement(By.xpath('//div[@role="button" and @title="User menu"]'));
|
||||||
|
|
||||||
if (!result.body.joined_rooms.includes(roomId)) return done(new Error('No room in list: ' + JSON.stringify(result.body)));
|
await browser.findElement(By.xpath('//div[@role="button" and @title="User menu"]')).click();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
done();
|
await browser.findElement(By.xpath('//li[@role="menuitem" and @aria-label="Sign out"]')).click();
|
||||||
});
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
if (await browser.findElements(By.xpath('//button[contains(text(), "I don\'t want my encrypted messages")]')).then(found => !!found.length)) {
|
||||||
|
await browser.findElement(By.xpath('//button[contains(text(), "I don\'t want my encrypted messages")]')).click();
|
||||||
|
await browser.sleep(3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
await waitForElement(By.xpath('//h1[text()="Sign in"]'));
|
||||||
|
}
|
||||||
|
|
||||||
|
async function isLoggedIn() {
|
||||||
|
await browser.get('https://' + app.fqdn + '/#/home');
|
||||||
|
await browser.wait(until.elementLocated(By.xpath('//span[text()="Rooms"]')), TEST_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function createRoom() {
|
||||||
|
await browser.get('https://' + app.fqdn + '/#/home');
|
||||||
|
await browser.sleep(4000);
|
||||||
|
await waitForElement(By.xpath('//div[@role="button" and @aria-label="Add room"]'));
|
||||||
|
await browser.findElement(By.xpath('//div[@role="button" and @aria-label="Add room"]')).click();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
await browser.findElement(By.xpath('//li[@role="menuitem" and @aria-label="New room"]')).click();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
await browser.findElement(By.xpath('//input[@label="Name"]')).sendKeys(ROOM_NAME);
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
await browser.findElement(By.xpath('//button[text()="Create room"]')).click();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
await waitForElement(By.xpath('//div[@role="button" and @aria-label="Add room"]'));
|
||||||
|
|
||||||
|
await waitForElement(By.xpath('//div[@class="mx_RoomTile_titleContainer"]/div[@title="' + ROOM_NAME + '"]'));
|
||||||
|
}
|
||||||
|
|
||||||
|
async function checkRoom() {
|
||||||
|
await browser.get('https://' + app.fqdn + '/#/home');
|
||||||
|
await browser.sleep(4000);
|
||||||
|
await waitForElement(By.xpath('//div[@role="treeitem" and @aria-label="' + ROOM_NAME + '"]'));
|
||||||
|
await browser.findElement(By.xpath('//div[@role="treeitem" and @aria-label="' + ROOM_NAME + '"]')).click();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
await waitForElement(By.xpath('//h2[text()="' + ROOM_NAME + '"]'));
|
||||||
|
}
|
||||||
|
|
||||||
|
async function sendMessage() {
|
||||||
|
await checkRoom();
|
||||||
|
|
||||||
|
await browser.findElement(By.xpath('//div[contains(@class, "mx_BasicMessageComposer_input")]')).sendKeys(getMessage());
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
await browser.findElement(By.xpath('//div[@role="button" and @aria-label="Send message"]')).click();
|
||||||
|
await browser.sleep(2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
|
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
|
||||||
|
|
||||||
// No SSO
|
// No SSO
|
||||||
it('install app (no sso)', function () { execSync('cloudron install --no-sso --location ' + LOCATION, EXEC_ARGS); });
|
it('install app (no sso)', function () { execSync('cloudron install --no-sso --location ' + LOCATION, EXEC_ARGS); });
|
||||||
|
|
||||||
it('can get app information', getAppInfo);
|
it('can get app information', getAppInfo);
|
||||||
|
|
||||||
it('check landing page', checkLandingPage);
|
it('check landing page', checkLandingPage);
|
||||||
it('can register new user', registerUser);
|
|
||||||
it('can login', checkLogin);
|
|
||||||
it('check autojoin', checkAutoJoinRoom);
|
|
||||||
it('create room', createRoom);
|
|
||||||
it('check room', checkRoom);
|
|
||||||
|
|
||||||
|
it('can install element-web app', function () { execSync('cloudron install --appstore-id im.riot.cloudronapp --location ' + ELEMENT_LOCATION, EXEC_ARGS); });
|
||||||
|
it('update element-app config', updateSynapseConfig);
|
||||||
|
|
||||||
|
it('can get Element app info', getElementAppInfo);
|
||||||
|
it('can register new user', registerUser);
|
||||||
|
it('create room', createRoom);
|
||||||
|
it('can send message', sendMessage);
|
||||||
|
|
||||||
|
it('can logout', logout);
|
||||||
|
|
||||||
|
it('can login', login);
|
||||||
|
it('check room', checkRoom);
|
||||||
|
it('can logout', logout);
|
||||||
|
|
||||||
|
it('can get app info', getAppInfo);
|
||||||
|
|
||||||
|
it('uninstall element-web app', async function () {
|
||||||
|
await browser.get('about:blank');
|
||||||
|
execSync(`cloudron uninstall --app ${ELEMENT_LOCATION}`, EXEC_ARGS);
|
||||||
|
});
|
||||||
it('uninstall app', function () { execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS); });
|
it('uninstall app', function () { execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS); });
|
||||||
|
|
||||||
// SSO
|
// SSO
|
||||||
it('install app', function () { execSync('cloudron install --location ' + LOCATION, EXEC_ARGS); });
|
it('install app', function () { execSync('cloudron install --location ' + LOCATION, EXEC_ARGS); });
|
||||||
|
it('can get app info', getAppInfo);
|
||||||
|
|
||||||
it('can get app information', getAppInfo);
|
it('can install element-web app', function () { execSync('cloudron install --appstore-id im.riot.cloudronapp --location ' + ELEMENT_LOCATION, EXEC_ARGS); });
|
||||||
|
it('update element-app config', updateSynapseConfig);
|
||||||
|
|
||||||
it('check landing page', checkLandingPage);
|
it('can get Element app info', getElementAppInfo);
|
||||||
it('can login', checkLogin);
|
it('can login via OIDC', loginOIDC.bind(null, USERNAME, PASSWORD));
|
||||||
it('check autojoin', checkAutoJoinRoom);
|
|
||||||
it('create room', createRoom);
|
it('create room', createRoom);
|
||||||
|
it('can send message', sendMessage);
|
||||||
|
it('can get app info', getAppInfo);
|
||||||
|
|
||||||
|
it('can restart app', function () { execSync(`cloudron restart ${app.id}`); });
|
||||||
|
|
||||||
|
it('backup app', function () { execSync(`cloudron backup create --app ${app.id}`, EXEC_ARGS); });
|
||||||
|
|
||||||
|
it('can get Element app info', getElementAppInfo);
|
||||||
|
it('is logged in', isLoggedIn);
|
||||||
it('check room', checkRoom);
|
it('check room', checkRoom);
|
||||||
|
it('can get app info', getAppInfo);
|
||||||
|
|
||||||
it('can restart app', function () { execSync('cloudron restart'); });
|
it('restore app', async function () {
|
||||||
|
const backups = JSON.parse(execSync(`cloudron backup list --raw --app ${app.id}`));
|
||||||
|
|
||||||
it('check landing page', checkLandingPage);
|
await browser.get('about:blank');
|
||||||
it('check room', checkRoom);
|
execSync(`cloudron uninstall --app ${app.id}`, EXEC_ARGS);
|
||||||
|
execSync(`cloudron install --location ${LOCATION}`, EXEC_ARGS);
|
||||||
|
|
||||||
it('backup app', function () { execSync('cloudron backup create --app ' + app.id, EXEC_ARGS); });
|
|
||||||
|
|
||||||
it('check landing page', checkLandingPage);
|
|
||||||
it('check room', checkRoom);
|
|
||||||
|
|
||||||
it('restore app', function () {
|
|
||||||
const backups = JSON.parse(execSync('cloudron backup list --raw'));
|
|
||||||
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
|
||||||
execSync('cloudron install --location ' + LOCATION, EXEC_ARGS);
|
|
||||||
getAppInfo();
|
getAppInfo();
|
||||||
|
|
||||||
execSync(`cloudron restore --backup ${backups[0].id} --app ${app.id}`, EXEC_ARGS);
|
execSync(`cloudron restore --backup ${backups[0].id} --app ${app.id}`, EXEC_ARGS);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('check landing page', checkLandingPage);
|
it('can get Element app info', getElementAppInfo);
|
||||||
|
it('is logged in', isLoggedIn);
|
||||||
it('check room', checkRoom);
|
it('check room', checkRoom);
|
||||||
|
it('can send message', sendMessage);
|
||||||
|
it('can logout', logout);
|
||||||
|
it('can get app info', getAppInfo);
|
||||||
|
|
||||||
it('move to different location', function () {
|
it('move to different location', async function () {
|
||||||
browser.manage().deleteAllCookies();
|
browser.manage().deleteAllCookies();
|
||||||
execSync('cloudron configure --location ' + LOCATION + '2', EXEC_ARGS);
|
await browser.get('about:blank');
|
||||||
|
|
||||||
|
execSync(`cloudron configure --location ${LOCATION}2`, EXEC_ARGS);
|
||||||
getAppInfo();
|
getAppInfo();
|
||||||
|
// wait when all services are up and running
|
||||||
|
await sleep(15000);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('check landing page', checkLandingPage);
|
it('update element-app config', updateSynapseConfig);
|
||||||
it('check room', checkRoom);
|
|
||||||
|
|
||||||
it('uninstall app', function () { execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS); });
|
it('can get Element app info', getElementAppInfo);
|
||||||
|
it('can login via OIDC', loginOIDC.bind(null, USERNAME, PASSWORD));
|
||||||
|
it('check room', checkRoom);
|
||||||
|
it('can send message', sendMessage);
|
||||||
|
|
||||||
|
it('can logout', logout);
|
||||||
|
it('can get app info', getAppInfo);
|
||||||
|
|
||||||
|
it('uninstall app', async function () {
|
||||||
|
await browser.get('about:blank');
|
||||||
|
execSync(`cloudron uninstall --app ${app.id}`, EXEC_ARGS);
|
||||||
|
});
|
||||||
|
|
||||||
// test update
|
// test update
|
||||||
it('can install app', function () { execSync('cloudron install --appstore-id org.matrix.synapse --location ' + LOCATION, EXEC_ARGS); });
|
it('can install app for update', function () { execSync('cloudron install --appstore-id org.matrix.synapse --location ' + LOCATION, EXEC_ARGS); });
|
||||||
|
it('can get app info', getAppInfo);
|
||||||
|
it('update element-app config', updateSynapseConfig);
|
||||||
|
|
||||||
it('can get app information', getAppInfo);
|
it('can get Element app info', getElementAppInfo);
|
||||||
|
|
||||||
it('check landing page', checkLandingPage);
|
it('can login via OIDC', loginOIDC.bind(null, USERNAME, PASSWORD));
|
||||||
it('can login', checkLogin);
|
it('is logged in', isLoggedIn);
|
||||||
it('create room', createRoom);
|
it('create room', createRoom);
|
||||||
|
it('can send message', sendMessage);
|
||||||
|
it('can logout', logout);
|
||||||
|
it('can get app info', getAppInfo);
|
||||||
|
|
||||||
|
it('can update', async function () {
|
||||||
|
await browser.get('about:blank');
|
||||||
|
execSync(`cloudron update --app ${app.id}`, EXEC_ARGS);
|
||||||
|
// wait when all services are up and running
|
||||||
|
await sleep(15000);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can get Element app info', getElementAppInfo);
|
||||||
|
it('can login via OIDC', loginOIDC.bind(null, USERNAME, PASSWORD));
|
||||||
|
it('is logged in', isLoggedIn);
|
||||||
it('check room', checkRoom);
|
it('check room', checkRoom);
|
||||||
|
it('can send message', sendMessage);
|
||||||
|
it('can get app info', getAppInfo);
|
||||||
|
|
||||||
it('can update', function () { execSync('cloudron update --app ' + LOCATION, EXEC_ARGS); });
|
it('uninstall app', async function () {
|
||||||
|
await browser.get('about:blank');
|
||||||
|
execSync(`cloudron uninstall --app ${app.id}`, EXEC_ARGS);
|
||||||
|
});
|
||||||
|
|
||||||
it('check landing page', checkLandingPage);
|
it('uninstall element-web app', function () {
|
||||||
it('check room', checkRoom);
|
execSync(`cloudron uninstall --app ${ELEMENT_LOCATION}`, EXEC_ARGS);
|
||||||
|
});
|
||||||
it('uninstall app', function () { execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS); });
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user