Skip to content

Commit d182329

Browse files
authored
Merge branch 'main' into chore/csrf
2 parents aea383e + ee9fc99 commit d182329

Some content is hidden

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

51 files changed

+640
-985
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/sessions/sess_mock-user-session

Whitespace-only changes.

api/package-lock.json

Lines changed: 94 additions & 106 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": "",

api/src/__test__/mothership/api-key/api-key-check-jobs.test.ts

Lines changed: 0 additions & 110 deletions
This file was deleted.

api/src/__test__/mothership/api-key/retry-validate-api-key.test.ts

Lines changed: 0 additions & 54 deletions
This file was deleted.

api/src/__test__/mothership/api-key/validate-api-key-with-keyserver.test.ts

Lines changed: 0 additions & 75 deletions
This file was deleted.

api/src/__test__/store/modules/config.test.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,12 @@ test('Before init returns default values for all fields', async () => {
1414
"minigraph": "PRE_INIT",
1515
"upnpStatus": "",
1616
},
17-
"local": {
18-
"2Fa": "",
19-
"showT2Fa": "",
20-
},
17+
"local": {},
2118
"nodeEnv": "test",
2219
"notifier": {
2320
"apikey": "",
2421
},
2522
"remote": {
26-
"2Fa": "",
2723
"accesstoken": "",
2824
"allowedOrigins": "",
2925
"apikey": "",
@@ -65,16 +61,12 @@ test('After init returns values from cfg file for all fields', async () => {
6561
minigraph: 'PRE_INIT',
6662
upnpStatus: '',
6763
},
68-
local: {
69-
'2Fa': '',
70-
showT2Fa: '',
71-
},
64+
local: {},
7265
nodeEnv: 'test',
7366
notifier: {
7467
apikey: 'unnotify_30994bfaccf839c65bae75f7fa12dd5ee16e69389f754c3b98ed7d5',
7568
},
7669
remote: {
77-
'2Fa': '',
7870
accesstoken: '',
7971
allowedOrigins: '',
8072
apikey: '_______________________BIG_API_KEY_HERE_________________________',
@@ -122,16 +114,12 @@ test('updateUserConfig merges in changes to current state', async () => {
122114
minigraph: 'PRE_INIT',
123115
upnpStatus: '',
124116
},
125-
local: {
126-
'2Fa': '',
127-
showT2Fa: '',
128-
},
117+
local: {},
129118
nodeEnv: 'test',
130119
notifier: {
131120
apikey: 'unnotify_30994bfaccf839c65bae75f7fa12dd5ee16e69389f754c3b98ed7d5',
132121
},
133122
remote: {
134-
'2Fa': '',
135123
accesstoken: '',
136124
allowedOrigins: '',
137125
apikey: '_______________________BIG_API_KEY_HERE_________________________',

0 commit comments

Comments
 (0)