diff --git a/.gitignore b/.gitignore index f730905a..c94f04b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /.data.dev/ -.idea/ \ No newline at end of file +.idea/ +/.idea/ diff --git a/client/package.json b/client/package.json index dc742af4..ca540545 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "ssm-client", - "version": "0.1.23", + "version": "0.1.24", "private": true, "description": "SSM Client - A simple way to manage all your servers", "author": "Squirrel Team", diff --git a/server/package.json b/server/package.json index 42235cad..14579f79 100644 --- a/server/package.json +++ b/server/package.json @@ -13,7 +13,7 @@ "test:python:run": "cd ./src/ansible && python3 -m unittest discover -s . -p \"*.py\"", "coverage": "vitest run --coverage" }, - "version": "0.1.23", + "version": "0.1.24", "author": "Squirrel Team", "dependencies": { "@aws-sdk/client-ecr": "^3.687.0", diff --git a/server/src/controllers/rest/user/user.ts b/server/src/controllers/rest/user/user.ts index 77d2ebab..8201fa96 100644 --- a/server/src/controllers/rest/user/user.ts +++ b/server/src/controllers/rest/user/user.ts @@ -5,6 +5,7 @@ import { getAnsibleRunnerVersion, getAnsibleVersion } from '../../../core/system import { getFromCache, getIntConfFromCache } from '../../../data/cache'; import { Role } from '../../../data/database/model/User'; import UserRepo from '../../../data/database/repository/UserRepo'; +import logger from '../../../logger'; import { AuthFailureError } from '../../../middlewares/api/ApiError'; import { SuccessResponse } from '../../../middlewares/api/ApiResponse'; import { createADefaultLocalUserRepository } from '../../../modules/repository/default-playbooks-repositories'; @@ -110,7 +111,11 @@ export const createFirstUser = async (req, res) => { role: Role.ADMIN, avatar: avatar || '/avatars/squirrel.svg', }); - await createADefaultLocalUserRepository(); + try { + await createADefaultLocalUserRepository(); + } catch (error: any) { + logger.error(error); + } new SuccessResponse('Create first user').send(res); }; diff --git a/server/src/core/startup/index.ts b/server/src/core/startup/index.ts index 55e0f1a7..138caf79 100644 --- a/server/src/core/startup/index.ts +++ b/server/src/core/startup/index.ts @@ -43,6 +43,7 @@ class Startup { private async initializeModules() { await PlaybooksRepositoryEngine.init(); + void PlaybooksRepositoryEngine.syncAllRegistered(); void sshPrivateKeyFileManager.removeAllAnsibleTemporaryPrivateKeys(); void NotificationComponent.init(); void Crons.initScheduledJobs(); @@ -89,13 +90,6 @@ class Startup { this.logger.error(`Error setting Ansible versions: ${error.message}`); } - try { - await PlaybooksRepositoryEngine.syncAllRegistered(); - this.logger.info('All registered playbooks synced successfully.'); - } catch (error: any) { - this.logger.error(`Error syncing all registered playbooks: ${error.message}`); - } - try { this.registerPersistedProviders(); this.logger.info('Persisted providers registered successfully.'); diff --git a/shared-lib/package.json b/shared-lib/package.json index f1c06e4d..dc71458e 100644 --- a/shared-lib/package.json +++ b/shared-lib/package.json @@ -1,6 +1,6 @@ { "name": "ssm-shared-lib", - "version": "0.1.23", + "version": "0.1.24", "description": "", "main": "./distribution/index.js", "author": "Squirrel Team", diff --git a/shared-lib/src/enums/settings.ts b/shared-lib/src/enums/settings.ts index ac3abb7a..09c62d00 100644 --- a/shared-lib/src/enums/settings.ts +++ b/shared-lib/src/enums/settings.ts @@ -12,7 +12,7 @@ export enum GeneralSettingsKeys { } export enum DefaultValue { - SCHEME_VERSION = '16', + SCHEME_VERSION = '17', SERVER_LOG_RETENTION_IN_DAYS = '30', CONSIDER_DEVICE_OFFLINE_AFTER_IN_MINUTES = '3', CONSIDER_PERFORMANCE_GOOD_MEM_IF_GREATER = '10',