-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
562 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@nordeck/matrix-meetings-bot': minor | ||
--- | ||
|
||
Enables encryption support for the Bot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 14 additions & 2 deletions
16
charts/matrix-meetings-bot/files/shell-tools/get_meetings_bot_token.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,16 @@ | ||
#/bin/sh | ||
|
||
TOKEN=$(psql -X -A -w -t -c "select token from access_tokens where user_id='@$USERTOCREATE:$SERVER'") | ||
echo "ACCESS_TOKEN=$TOKEN" > /work-dir/.env | ||
# Get the login token | ||
TOKEN_RESPONSE=$(curl -s -X POST -H "Content-Type: application/json" -d '{"type":"m.login.password","user":"'${USERTOCREATE}'","password":"'${BOT_PASSWORD}'"}' "${HOMESERVER}/_matrix/client/r0/login") | ||
|
||
# Extract the access token from the response | ||
ACCESS_TOKEN=$(echo $TOKEN_RESPONSE | grep -o '"access_token":"[^"]*' | cut -d'"' -f4) | ||
|
||
if [ "$ACCESS_TOKEN" != "null" ]; then | ||
echo "Login successful. Access token: $ACCESS_TOKEN" | ||
else | ||
echo "Login failed. Check your credentials and try again." | ||
fi | ||
|
||
# Add it to the env file so it can be used by the bot | ||
echo "ACCESS_TOKEN=$ACCESS_TOKEN" > /work-dir/.env |
2 changes: 1 addition & 1 deletion
2
charts/matrix-meetings-bot/files/shell-tools/set_ratelimit_bot_db.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,5 @@ matrix-meetings-bot: | |
value: 'info' | ||
- name: AUTO_DELETION_OFFSET | ||
value: '60' | ||
- name: ENABLE_CRYPTO | ||
value: 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
/* | ||
* Copyright 2024 Nordeck IT + Consulting GmbH | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { expect } from '@playwright/test'; | ||
import { test } from './fixtures'; | ||
|
||
test.describe('Encrypted Meeting Room', () => { | ||
test.beforeEach( | ||
async ({ | ||
bob, | ||
aliceEncryptedMeetingsWidgetPage, | ||
aliceElementWebPage, | ||
aliceJitsiWidgetPage, | ||
}) => { | ||
test.setTimeout(60000); | ||
|
||
await aliceEncryptedMeetingsWidgetPage.setDateFilter( | ||
[2040, 10, 1], | ||
[2040, 10, 8], | ||
); | ||
|
||
const aliceScheduleMeetingWidgetPage = | ||
await aliceEncryptedMeetingsWidgetPage.scheduleMeeting(); | ||
|
||
await aliceScheduleMeetingWidgetPage.titleTextbox.fill('My Meeting'); | ||
await aliceScheduleMeetingWidgetPage.descriptionTextbox.fill( | ||
'My Description', | ||
); | ||
await aliceScheduleMeetingWidgetPage.setStart([2040, 10, 3], '10:30 AM'); | ||
await aliceScheduleMeetingWidgetPage.addParticipant(bob.displayName); | ||
await aliceScheduleMeetingWidgetPage.submit(); | ||
|
||
await aliceElementWebPage.inviteUser(bob.username); | ||
|
||
await aliceElementWebPage.waitForRoomJoin('My Meeting'); | ||
await aliceEncryptedMeetingsWidgetPage | ||
.getMeeting('My Meeting', '10/03/2040') | ||
.joinMeeting(); | ||
await aliceJitsiWidgetPage.joinConferenceButton.waitFor(); | ||
}, | ||
); | ||
|
||
test('should have jitsi, breakout sessions, and settings widget setup in the room', async ({ | ||
aliceElementWebPage, | ||
aliceCockpitWidgetPage, | ||
}) => { | ||
expect(await aliceElementWebPage.getWidgets()).toEqual([ | ||
'Breakout Sessions', | ||
'NeoDateFix Details', | ||
'Video Conference', | ||
]); | ||
|
||
await expect(aliceElementWebPage.roomNameText).toHaveText('My Meeting'); | ||
await expect(aliceElementWebPage.roomTopicText).toHaveText( | ||
'My Description', | ||
); | ||
|
||
await aliceElementWebPage.showWidgetInSidebar('NeoDateFix Details'); | ||
const meetingDetails = aliceCockpitWidgetPage.getMeeting(); | ||
await aliceElementWebPage.approveWidgetIdentity(); | ||
await expect(meetingDetails.meetingDescriptionText).toHaveText( | ||
'My Description', | ||
); | ||
await expect(meetingDetails.meetingTitleText).toHaveText('My Meeting'); | ||
await expect(meetingDetails.meetingTimeRangeText).toHaveText( | ||
'October 3, 2040, 10:30 – 11:30 AM', | ||
); | ||
}); | ||
|
||
test('should edit the meeting title from within the meeting', async ({ | ||
aliceElementWebPage, | ||
aliceCockpitWidgetPage, | ||
}) => { | ||
await aliceElementWebPage.showWidgetInSidebar('NeoDateFix Details'); | ||
|
||
const meetingDetails = aliceCockpitWidgetPage.getMeeting(); | ||
await aliceElementWebPage.approveWidgetIdentity(); | ||
const aliceEditMeetingWidgetPage = await meetingDetails.editMeeting(); | ||
await aliceEditMeetingWidgetPage.titleTextbox.fill('New Meeting'); | ||
await aliceEditMeetingWidgetPage.submit(); | ||
|
||
await expect(meetingDetails.meetingTitleText).toHaveText('New Meeting'); | ||
await expect(aliceElementWebPage.roomNameText).toHaveText('New Meeting'); | ||
await expect( | ||
aliceElementWebPage.locateChatMessageInRoom(/Title: New Meeting/), | ||
).toBeVisible(); | ||
}); | ||
|
||
// eslint-disable-next-line playwright/expect-expect | ||
test('should add the meeting participant from within the meeting', async ({ | ||
aliceElementWebPage, | ||
aliceCockpitWidgetPage, | ||
charlie, | ||
}) => { | ||
await aliceElementWebPage.showWidgetInSidebar('NeoDateFix Details'); | ||
|
||
const meetingDetails = aliceCockpitWidgetPage.getMeeting(); | ||
await aliceElementWebPage.approveWidgetIdentity(); | ||
|
||
const aliceEditMeetingWidgetPage = await meetingDetails.editMeeting(); | ||
await aliceEditMeetingWidgetPage.addParticipant(charlie.displayName); | ||
await aliceEditMeetingWidgetPage.submit(); | ||
|
||
await aliceElementWebPage.waitForUserMembership(charlie.username, 'invite'); | ||
}); | ||
|
||
test('should disable the video conference from within the meeting', async ({ | ||
aliceElementWebPage, | ||
aliceCockpitWidgetPage, | ||
}) => { | ||
await aliceElementWebPage.showWidgetInSidebar('NeoDateFix Details'); | ||
const meetingDetails = aliceCockpitWidgetPage.getMeeting(); | ||
await aliceElementWebPage.approveWidgetIdentity(); | ||
const aliceEditMeetingWidgetPage = await meetingDetails.editMeeting(); | ||
await aliceEditMeetingWidgetPage.removeLastWidget(); | ||
await aliceEditMeetingWidgetPage.submit(); | ||
|
||
await aliceElementWebPage | ||
.locateChatMessageInRoom('Video conference ended by Bot') | ||
.waitFor(); | ||
|
||
await aliceElementWebPage.closeWidgetInSidebar(); | ||
|
||
await expect | ||
.poll(async () => { | ||
return await aliceElementWebPage.getWidgets(); | ||
}) | ||
.toEqual(['Breakout Sessions', 'NeoDateFix Details']); | ||
}); | ||
|
||
test('should enable the optional widget from within the meeting', async ({ | ||
aliceElementWebPage, | ||
aliceCockpitWidgetPage, | ||
}) => { | ||
await aliceElementWebPage.showWidgetInSidebar('NeoDateFix Details'); | ||
const meetingDetails = aliceCockpitWidgetPage.getMeeting(); | ||
await aliceElementWebPage.approveWidgetIdentity(); | ||
|
||
const aliceEditMeetingWidgetPage = await meetingDetails.editMeeting(); | ||
await aliceEditMeetingWidgetPage.addWidget('Video Conference (optional)'); | ||
await aliceEditMeetingWidgetPage.submit(); | ||
|
||
await expect | ||
.poll(async () => { | ||
return await aliceElementWebPage.getWidgets(); | ||
}) | ||
.toEqual([ | ||
'Breakout Sessions', | ||
'NeoDateFix Details', | ||
'Video Conference', | ||
'Video Conference (optional)', | ||
]); | ||
}); | ||
|
||
test('should toggle whether users can use the chat', async ({ | ||
aliceElementWebPage, | ||
aliceCockpitWidgetPage, | ||
bobElementWebPage, | ||
bobMeetingsWidgetPage, | ||
}) => { | ||
await bobElementWebPage.navigateToRoomOrInvitation('Calendar'); | ||
await bobElementWebPage.acceptRoomInvitation(); | ||
await bobElementWebPage.approveWidgetWarning(); | ||
await bobElementWebPage.approveWidgetCapabilities(); | ||
|
||
await bobMeetingsWidgetPage.setDateFilter([2040, 10, 1], [2040, 10, 8]); | ||
|
||
await bobMeetingsWidgetPage | ||
.getMeeting('My Meeting', '10/03/2040') | ||
.joinMeeting(); | ||
await bobElementWebPage.acceptRoomInvitation(); | ||
await bobElementWebPage.sendMessage('I am Bob'); | ||
await aliceElementWebPage.sendMessage('I am Alice'); | ||
await aliceElementWebPage.showWidgetInSidebar('NeoDateFix Details'); | ||
const meetingCard = aliceCockpitWidgetPage.getMeeting(); | ||
await aliceElementWebPage.approveWidgetIdentity(); | ||
let aliceEditMeetingWidgetPage = await meetingCard.editMeeting(); | ||
await aliceEditMeetingWidgetPage.toggleChatPermission(); | ||
await aliceEditMeetingWidgetPage.submit(); | ||
await aliceElementWebPage.sendMessage('I am still here'); | ||
await expect(bobElementWebPage.noChatPermissionText).toBeVisible(); | ||
aliceEditMeetingWidgetPage = await meetingCard.editMeeting(); | ||
await aliceEditMeetingWidgetPage.toggleChatPermission(); | ||
await aliceEditMeetingWidgetPage.submit(); | ||
await expect(bobElementWebPage.noChatPermissionText).toBeHidden(); | ||
await bobElementWebPage.sendMessage('I am Bob again'); | ||
await aliceElementWebPage.sendMessage('I am Alice again'); | ||
}); | ||
}); |
Oops, something went wrong.