diff --git a/.gitignore b/.gitignore index 3bc06ec..6500c0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .dart_tool/ .direnv -secret \ No newline at end of file +secrets/ \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index f4d08eb..64e643b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,19 +5,25 @@ "version": "0.2.0", "configurations": [ { - "name": "matrix-oauth2oidc", + "name": "nexusbot", "program": "bin/nexusbot.dart", "args": [ + "--socket", + "./socket", "--homeserver", "https://matrix.federated.nexus", - "--jwtSecretFile", - "secret", - "--issuer", - "http://localhost:8080", - "--authorizeEndpoint", - "http://localhost:4321/login", - "--serviceDomain", - "federated.nexus" + "--name", + "nexusbot", + "--inviteTo", + "#community:federated.nexus", + "--adminRoom", + "#admins:federated.nexus", + "--successUri", + "https://federated.nexus/success", + "--botPasswordFile", + "secrets/botPassword.txt", + "--smtpPasswordFile", + "secrets/smtpPassword.txt" ], "request": "launch", "type": "dart" diff --git a/JUSTFILE b/JUSTFILE index 0a86649..5fa18e3 100644 --- a/JUSTFILE +++ b/JUSTFILE @@ -5,4 +5,4 @@ build: dart run build_runner build test: - oauth2c http://localhost:8080 --client-id yourclientid --scopes openid --grant-type authorization_code --auth-method none --response-mode query \ No newline at end of file + curl --unix-socket ./socket http:/root -X POST -d '{"email": "foo", "username": "bar"}' \ No newline at end of file diff --git a/lib/helpers/api_helper.dart b/lib/helpers/api_helper.dart index 5e9c42a..da9d2d6 100644 --- a/lib/helpers/api_helper.dart +++ b/lib/helpers/api_helper.dart @@ -43,7 +43,7 @@ class ApiHelper { final response = await http.post( settings.homeserver.replace( path: - "_matrix/client/v3/rooms/${getRoomId(settings.adminRoom)}/send/m.room.message/${getTxn()}", + "_matrix/client/v3/rooms/${await getRoomId(settings.adminRoom)}/send/m.room.message/${getTxn()}", ), headers: await getHeaders(), body: json.encode({