diff --git a/api/src/__test__/core/utils/files/config-file-normalizer.test.ts b/api/src/__test__/core/utils/files/config-file-normalizer.test.ts index c3fea3322..7b4774d38 100644 --- a/api/src/__test__/core/utils/files/config-file-normalizer.test.ts +++ b/api/src/__test__/core/utils/files/config-file-normalizer.test.ts @@ -15,7 +15,9 @@ test('it creates a FLASH config with NO OPTIONAL values', () => { "extraOrigins": "", "version": "", }, - "local": {}, + "local": { + "sandbox": "no", + }, "remote": { "accesstoken": "", "apikey": "", @@ -49,7 +51,9 @@ test('it creates a MEMORY config with NO OPTIONAL values', () => { "minigraph": "PRE_INIT", "upnpStatus": "", }, - "local": {}, + "local": { + "sandbox": "no", + }, "remote": { "accesstoken": "", "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", @@ -88,7 +92,9 @@ test('it creates a FLASH config with OPTIONAL values', () => { "extraOrigins": "myextra.origins", "version": "", }, - "local": {}, + "local": { + "sandbox": "no", + }, "remote": { "accesstoken": "", "apikey": "", @@ -129,7 +135,9 @@ test('it creates a MEMORY config with OPTIONAL values', () => { "minigraph": "PRE_INIT", "upnpStatus": "Turned On", }, - "local": {}, + "local": { + "sandbox": "no", + }, "remote": { "accesstoken": "", "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", diff --git a/api/src/__test__/store/modules/__snapshots__/config.test.ts.snap b/api/src/__test__/store/modules/__snapshots__/config.test.ts.snap index 0ac090781..a39f3d22c 100644 --- a/api/src/__test__/store/modules/__snapshots__/config.test.ts.snap +++ b/api/src/__test__/store/modules/__snapshots__/config.test.ts.snap @@ -10,7 +10,9 @@ exports[`Before init returns default values for all fields 1`] = ` "minigraph": "PRE_INIT", "upnpStatus": "", }, - "local": {}, + "local": { + "sandbox": "no", + }, "nodeEnv": "test", "remote": { "accesstoken": "", diff --git a/api/src/__test__/store/modules/config.test.ts b/api/src/__test__/store/modules/config.test.ts index 484960a44..0e889b4e4 100644 --- a/api/src/__test__/store/modules/config.test.ts +++ b/api/src/__test__/store/modules/config.test.ts @@ -26,7 +26,9 @@ test('After init returns values from cfg file for all fields', async () => { minigraph: 'PRE_INIT', upnpStatus: '', }, - local: {}, + local: { + sandbox: 'no' + }, nodeEnv: 'test', remote: { accesstoken: '', @@ -74,7 +76,9 @@ test('updateUserConfig merges in changes to current state', async () => { minigraph: 'PRE_INIT', upnpStatus: '', }, - local: {}, + local: { + sandbox: 'no' + }, nodeEnv: 'test', remote: { accesstoken: '', diff --git a/api/src/unraid-api/cli/developer/developer.command.ts b/api/src/unraid-api/cli/developer/developer.command.ts index f4bc35686..c52b13476 100644 --- a/api/src/unraid-api/cli/developer/developer.command.ts +++ b/api/src/unraid-api/cli/developer/developer.command.ts @@ -6,6 +6,7 @@ import { loadConfigFile, updateUserConfig } from '@app/store/modules/config'; import { writeConfigSync } from '@app/store/sync/config-disk-sync'; import { DeveloperQuestions } from '@app/unraid-api/cli/developer/developer.questions'; import { LogService } from '@app/unraid-api/cli/log.service'; +import { RestartCommand } from '@app/unraid-api/cli/restart.command'; interface DeveloperOptions { disclaimer: boolean; @@ -19,7 +20,8 @@ interface DeveloperOptions { export class DeveloperCommand extends CommandRunner { constructor( private logger: LogService, - private readonly inquirerService: InquirerService + private readonly inquirerService: InquirerService, + private readonly restartCommand: RestartCommand ) { super(); } @@ -34,6 +36,10 @@ export class DeveloperCommand extends CommandRunner { store.dispatch(updateUserConfig({ local: { sandbox: options.sandbox ? 'yes' : 'no' } })); writeConfigSync('flash'); - this.logger.info('Updated Developer Configuration'); + this.logger.info( + 'Updated Developer Configuration - restart the API in 5 seconds to apply them...' + ); + await new Promise((resolve) => setTimeout(resolve, 5000)); + await this.restartCommand.run([]); } } diff --git a/api/src/unraid-api/cli/sso/validate-token.command.ts b/api/src/unraid-api/cli/sso/validate-token.command.ts index 1af7cc41c..0b6566535 100644 --- a/api/src/unraid-api/cli/sso/validate-token.command.ts +++ b/api/src/unraid-api/cli/sso/validate-token.command.ts @@ -86,6 +86,7 @@ export class ValidateTokenCommand extends CommandRunner { } const possibleUserIds = configFile.remote.ssoSubIds.split(','); if (possibleUserIds.includes(username)) { + this.logger.clear(); this.logger.info(JSON.stringify({ error: null, valid: true, username })); process.exit(0); } else { diff --git a/api/src/unraid-api/unraid-file-modifier/__snapshots__/unraid-file-modifier.spec.ts.snap b/api/src/unraid-api/unraid-file-modifier/__snapshots__/unraid-file-modifier.spec.ts.snap deleted file mode 100644 index 6fc335f7f..000000000 --- a/api/src/unraid-api/unraid-file-modifier/__snapshots__/unraid-file-modifier.spec.ts.snap +++ /dev/null @@ -1,3 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`FileModificationService > should apply modifications 1`] = `[Error: Application not implemented.]`;