Skip to content

Commit 20d846a

Browse files
authored
Merge branch 'main' into feat/oem-whitelabel
2 parents 05c9dd4 + a3a61e1 commit 20d846a

File tree

70 files changed

+852
-1211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+852
-1211
lines changed

api/.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
PATHS_UNRAID_DATA=./dev/data # Where we store plugin data (e.g. permissions.json)
22
PATHS_STATES=./dev/states # Where .ini files live (e.g. vars.ini)
3+
PATHS_AUTH_SESSIONS=./dev/sessions # Where user sessions live
34
PATHS_AUTH_KEY=./dev/keys # Auth key directory
45
PATHS_DYNAMIX_BASE=./dev/dynamix # Dynamix's data directory
56
PATHS_DYNAMIX_CONFIG_DEFAULT=./dev/dynamix/default.cfg # Dynamix's default config file, which ships with unraid

api/dev/Unraid.net/myservers.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ wanaccess="yes"
99
wanport="8443"
1010
upnpEnabled="no"
1111
apikey="_______________________BIG_API_KEY_HERE_________________________"
12+
localApiKey="_______________________LOCAL_API_KEY_HERE_________________________"
1213
1314
username="zspearmint"
1415
avatar="https://via.placeholder.com/200"

api/dev/keys/10f356da-1e9e-43b8-9028-a26a645539a6.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"key": "73717ca0-8c15-40b9-bcca-8d85656d1438",
44
"name": "Test API Key",
55
"description": "Testing API key creation",
6-
"roles": ["guest", "upc"],
6+
"roles": ["guest", "connect"],
77
"createdAt": "2024-10-29T19:59:12.569Z"
88
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"createdAt": "2024-12-20T15:05:55.336Z",
3+
"description": "API key for Connect user",
4+
"id": "d166bf8b-3615-444a-8932-c460b2132ba3",
5+
"key": "_______________________LOCAL_API_KEY_HERE_________________________",
6+
"name": "Connect",
7+
"roles": [
8+
"connect"
9+
]
10+
}

api/dev/sessions/sess_mock-user-session

Whitespace-only changes.

api/dev/states/myservers.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ wanaccess="yes"
99
wanport="8443"
1010
upnpEnabled="no"
1111
apikey="_______________________BIG_API_KEY_HERE_________________________"
12+
localApiKey="_______________________LOCAL_API_KEY_HERE_________________________"
1213
1314
username="zspearmint"
1415
avatar="https://via.placeholder.com/200"
@@ -21,4 +22,4 @@ dynamicRemoteAccessType="DISABLED"
2122
[upc]
2223
apikey="unupc_fab6ff6ffe51040595c6d9ffb63a353ba16cc2ad7d93f813a2e80a5810"
2324
[connectionStatus]
24-
minigraph="ERROR_RETRYING"
25+
minigraph="PRE_INIT"

api/package-lock.json

Lines changed: 101 additions & 114 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/scripts/build.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ try {
6464

6565
await $`npm prune --omit=dev`;
6666
await $`npm install --omit=dev`;
67+
await $`npm install github:unraid/libvirt`;
6768

6869
// Now we'll pack everything in the pre-pack directory
6970
await $`tar -czf ../unraid-api-${deploymentVersion}.tgz .`;

api/scripts/create-session.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
# By default, this is my-session
88

99
sessions_dir=/var/lib/php
10-
default_session_name=my-session
10+
default_session_name=mock-user-session
1111

1212
if [ "$1" = "--help" ]; then
1313
echo "This script creates a mock session on a server."
1414
echo ""
1515
echo "Usage: $0 [options]"
1616
echo ""
1717
echo "Options:"
18-
echo " [name] Name of the session to create (default: my-session)"
18+
echo " [name] Name of the session to create (default: mock-user-session)"
1919
echo " --help Display this help message and exit"
2020
echo ""
2121
echo "Example: $0 a-session-name"

api/src/__test__/core/utils/files/config-file-normalizer.test.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ test('it creates a MEMORY config with NO OPTIONAL values', () => {
8080

8181
test('it creates a FLASH config with OPTIONAL values', () => {
8282
const basicConfig = cloneDeep(initialState);
83+
// 2fa & t2fa should be ignored
8384
basicConfig.remote['2Fa'] = 'yes';
8485
basicConfig.local['2Fa'] = 'yes';
8586
basicConfig.local.showT2Fa = 'yes';
87+
8688
basicConfig.api.extraOrigins = 'myextra.origins';
8789
basicConfig.remote.upnpEnabled = 'yes';
8890
basicConfig.connectionStatus.upnpStatus = 'Turned On';
@@ -93,15 +95,11 @@ test('it creates a FLASH config with OPTIONAL values', () => {
9395
"extraOrigins": "myextra.origins",
9496
"version": "",
9597
},
96-
"local": {
97-
"2Fa": "yes",
98-
"showT2Fa": "yes",
99-
},
98+
"local": {},
10099
"notifier": {
101100
"apikey": "",
102101
},
103102
"remote": {
104-
"2Fa": "yes",
105103
"accesstoken": "",
106104
"apikey": "",
107105
"avatar": "",
@@ -125,6 +123,7 @@ test('it creates a FLASH config with OPTIONAL values', () => {
125123

126124
test('it creates a MEMORY config with OPTIONAL values', () => {
127125
const basicConfig = cloneDeep(initialState);
126+
// 2fa & t2fa should be ignored
128127
basicConfig.remote['2Fa'] = 'yes';
129128
basicConfig.local['2Fa'] = 'yes';
130129
basicConfig.local.showT2Fa = 'yes';
@@ -142,15 +141,11 @@ test('it creates a MEMORY config with OPTIONAL values', () => {
142141
"minigraph": "PRE_INIT",
143142
"upnpStatus": "Turned On",
144143
},
145-
"local": {
146-
"2Fa": "yes",
147-
"showT2Fa": "yes",
148-
},
144+
"local": {},
149145
"notifier": {
150146
"apikey": "",
151147
},
152148
"remote": {
153-
"2Fa": "yes",
154149
"accesstoken": "",
155150
"allowedOrigins": "/var/run/unraid-notifications.sock, /var/run/unraid-php.sock, /var/run/unraid-cli.sock, https://connect.myunraid.net, https://connect-staging.myunraid.net, https://dev-my.myunraid.net:4000",
156151
"apikey": "",

0 commit comments

Comments
 (0)