Skip to content

Commit

Permalink
Rename dev homeservers
Browse files Browse the repository at this point in the history
  • Loading branch information
estellecomment committed Nov 13, 2023
1 parent 149c567 commit 802c493
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ FULL_PAGE_ERRORS=0
E2E_TEST_USER_EMAIL=''
E2E_TEST_USER_PASSWORD=''
E2E_TEST_USER_SECURITY_KEY='' # in Tchap interfaces, it is called "Code de Récupération" or "Recovery Code"
# E2E_TEST_USER_HOMESERVER_URL='https://matrix.agent1.tchap.incubateur.net'
# E2E_TEST_USER_HOMESERVER_SHORT='agent1.tchap.incubateur.net'
# E2E_TEST_USER_HOMESERVER_URL='https://matrix.dev01.tchap.incubateur.net'
# E2E_TEST_USER_HOMESERVER_SHORT='dev01.tchap.incubateur.net'
30 changes: 15 additions & 15 deletions config.dev.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"default_server_config": {
"m.homeserver": {
"base_url": "https://matrix.agent1.tchap.incubateur.net",
"base_url": "https://matrix.dev01.tchap.incubateur.net",
"server_name": "Agents 1"
},
"m.identity_server": {
"base_url": "https://matrix.agent1.tchap.incubateur.net"
"base_url": "https://matrix.dev01.tchap.incubateur.net"
}
},
"homeserver_list": [
{
"base_url": "https://matrix.agent1.tchap.incubateur.net",
"base_url": "https://matrix.dev01.tchap.incubateur.net",
"server_name": "Agents 1"
},
{
"base_url": "https://matrix.agent2.tchap.incubateur.net",
"base_url": "https://matrix.dev02.tchap.incubateur.net",
"server_name": "Agents 2"
},
{
"base_url": "https://matrix.externe.tchap.incubateur.net",
"base_url": "https://matrix.ext01.tchap.incubateur.net",
"server_name": "Externes"
}
],
Expand All @@ -42,12 +42,12 @@
"default_federate": true,
"default_theme": "light",
"room_directory": {
"servers": ["agent1.tchap.incubateur.net", "agent2.tchap.incubateur.net", "externe.tchap.incubateur.net"]
"servers": ["dev01.tchap.incubateur.net", "dev02.tchap.incubateur.net", "ext01.tchap.incubateur.net"]
},
"enable_presence_by_hs_url": {
"https://matrix.agent1.tchap.incubateur.net": false,
"https://matrix.agent2.tchap.incubateur.net": false,
"https://matrix.externe.tchap.incubateur.net": false
"https://matrix.dev01.tchap.incubateur.net": false,
"https://matrix.dev02.tchap.incubateur.net": false,
"https://matrix.ext01.tchap.incubateur.net": false
},
"setting_defaults": {
"breadcrumbs": true,
Expand All @@ -71,7 +71,7 @@
"branding": {
"auth_header_logo_url": "themes/tchap/img/logos/tchap-logo-dev.svg",
"auth_footer_links": [
{ "text": "DEV", "url": "https://matrix.agent1.tchap.incubateur.net/_matrix/client/versions" },
{ "text": "DEV", "url": "https://matrix.dev01.tchap.incubateur.net/_matrix/client/versions" },
{ "text": "Gouvernement", "url": "https://www.gouvernement.fr" },
{ "text": "OpenData", "url": "https://www.data.gouv.fr" },
{ "text": "DINUM", "url": "https://numerique.gouv.fr" },
Expand Down Expand Up @@ -107,11 +107,11 @@
],
"tchap_features": {
"feature_email_notification": [
"agent1.tchap.incubateur.net",
"agent2.tchap.incubateur.net",
"externe.tchap.incubateur.net"
"dev01.tchap.incubateur.net",
"dev02.tchap.incubateur.net",
"ext01.tchap.incubateur.net"
],
"feature_space": ["agent1.tchap.incubateur.net", "agent2.tchap.incubateur.net", "externe.tchap.incubateur.net"],
"feature_thread": ["agent1.tchap.incubateur.net", "agent2.tchap.incubateur.net", "externe.tchap.incubateur.net"]
"feature_space": ["dev01.tchap.incubateur.net", "dev02.tchap.incubateur.net", "ext01.tchap.incubateur.net"],
"feature_thread": ["dev01.tchap.incubateur.net", "dev02.tchap.incubateur.net", "ext01.tchap.incubateur.net"]
}
}
6 changes: 3 additions & 3 deletions cypress/e2e/create-room/create-room.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe("Create Room", () => {
});

// Url of room looks like :
// http://localhost:8080/#/room/!kshfkshfkKSHJ:agent1.tchap.incubateur.net
// http://localhost:8080/#/room/!kshfkshfkKSHJ:dev01.tchap.incubateur.net
const roomUrlRegex = new RegExp("/#/room/![A-z0-9]+:" + homeserverShortname);
cy.url().should("match", roomUrlRegex);
cy.stopMeasuring("from-submit-to-room");
Expand All @@ -91,7 +91,7 @@ describe("Create Room", () => {
});

// Url of room looks like :
// http://localhost:8080/#/room/!kshfkshfkKSHJ:agent1.tchap.incubateur.net
// http://localhost:8080/#/room/!kshfkshfkKSHJ:dev01.tchap.incubateur.net
const roomUrlRegex = new RegExp("/#/room/![A-z0-9]+:" + homeserverShortname);
cy.url().should("match", roomUrlRegex);
cy.stopMeasuring("from-submit-to-room");
Expand All @@ -114,7 +114,7 @@ describe("Create Room", () => {
});

// Url of room looks like :
// http://localhost:8080/#/room/!kshfkshfkKSHJ:agent1.tchap.incubateur.net
// http://localhost:8080/#/room/!kshfkshfkKSHJ:dev01.tchap.incubateur.net
const roomUrlRegex = new RegExp("/#/room/![A-z0-9]+:" + homeserverShortname);
cy.url().should("match", roomUrlRegex);
cy.stopMeasuring("from-submit-to-room");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/matrix-react-sdk/src/IConfigOptions.ts b/node_modules/matrix-react-sdk/src/IConfigOptions.ts
index 2df5e7f..daa8874 100644
index 2df5e7f..1eb1365 100644
--- a/node_modules/matrix-react-sdk/src/IConfigOptions.ts
+++ b/node_modules/matrix-react-sdk/src/IConfigOptions.ts
@@ -213,3 +213,14 @@ export interface ISsoRedirectOptions {
Expand All @@ -13,7 +13,7 @@ index 2df5e7f..daa8874 100644
+*/
+export interface IConfigOptions {
+ tchap_features?: {
+ feature_email_notification?:[string]//activate email notification on a list of home servers, ie : "agent1.tchap.incubateur.net"
+ feature_email_notification?:[string]//activate email notification on a list of home servers, ie : "dev01.tchap.incubateur.net"
+ }
+}
+//end :tchap:
Expand Down
10 changes: 5 additions & 5 deletions src/tchap/util/TchapUIFeature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ export default class TchapUIFeature {
*/
public static activateClearCacheAndReloadAtVersion4 = true;

/**
/**
get list of homeservers where the feature should be activated from config.json
example
for feature : feature_email_notification
for feature : feature_email_notification
add this in config.json
{..
"tchap":{
"feature_email_notification": ["agent1.tchap.incubateur.net"]
"feature_email_notification": ["dev01.tchap.incubateur.net"]
}
..
}
*/
public static isFeatureActiveForHomeserver(feature:string):boolean {
public static isFeatureActiveForHomeserver(feature:string):boolean {

const homeserversWithFeature:[string] = SdkConfig.get("tchap_features")?.[feature] || [];
const userHomeServer = MatrixClientPeg.getHomeserverName();
return homeserversWithFeature.includes(userHomeServer);
Expand Down

0 comments on commit 802c493

Please sign in to comment.