Skip to content

Commit 99d72fc

Browse files
committed
Refactor Mothership integration to use WebSocket-based UnraidServerClient
- Updated package.json scripts to remove MOTHERSHIP_GRAPHQL_LINK environment variable. - Changed MOTHERSHIP_GRAPHQL_LINK to MOTHERSHIP_BASE_URL in environment.ts. - Removed GraphQL code generation for Mothership types in codegen.ts. - Updated connection status services to use MOTHERSHIP_BASE_URL. - Refactored MothershipSubscriptionHandler to utilize UnraidServerClient instead of GraphQL client. - Implemented UnraidServerClient for WebSocket communication with Mothership. - Enhanced MothershipController to manage UnraidServerClient lifecycle. - Added reconnection logic and ping/pong handling in UnraidServerClient. - Simplified GraphQL execution logic in UnraidServerClient.
1 parent 52f2267 commit 99d72fc

14 files changed

Lines changed: 628 additions & 441 deletions

‎api/.env.development‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ PATHS_RCLONE_SOCKET=./dev/rclone-socket
1717
PATHS_LOG_BASE=./dev/log # Where we store logs
1818
PATHS_LOGS_FILE=./dev/log/graphql-api.log
1919
PATHS_CONNECT_STATUS_FILE_PATH=./dev/connectStatus.json # Connect plugin status file
20+
PATHS_CONNECT_STATUS=./dev/states/connectStatus.json # Connect status file for development
2021
ENVIRONMENT="development"
2122
NODE_ENV="development"
2223
PORT="3001"
2324
PLAYGROUND=true
2425
INTROSPECTION=true
25-
MOTHERSHIP_GRAPHQL_LINK="http://authenticator:3000/graphql"
26+
MOTHERSHIP_BASE_URL="http://localhost:8787"
2627
NODE_TLS_REJECT_UNAUTHORIZED=0
2728
BYPASS_PERMISSION_CHECKS=false
2829
BYPASS_CORS_CHECKS=true

‎api/dev/configs/api.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "4.11.0",
2+
"version": "4.12.0",
33
"extraOrigins": [],
44
"sandbox": false,
55
"ssoSubIds": [],

‎api/dev/configs/connect.json‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,12 @@
88
"username": "zspearmint",
99
"avatar": "https://via.placeholder.com/200",
1010
"regWizTime": "1611175408732_0951-1653-3509-FBA155FA23C0",
11-
"dynamicRemoteAccessType": "DISABLED"
11+
"dynamicRemoteAccessType": "DISABLED",
12+
"version": "4.4.1",
13+
"extraOrigins": "https://google.com,https://test.com",
14+
"sandbox": "yes",
15+
"accesstoken": "",
16+
"idtoken": "",
17+
"refreshtoken": "",
18+
"ssoSubIds": ""
1219
}

‎api/dev/states/connectStatus.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"connectionStatus": "PRE_INIT",
3+
"error": null,
4+
"lastPing": null,
5+
"allowedOrigins": "",
6+
"timestamp": 1752935274494
7+
}

0 commit comments

Comments
 (0)