upate bootloader

This commit is contained in:
SrGooglo 2024-09-09 18:51:34 +00:00
parent 03badcbfd9
commit 78a55768cb
3 changed files with 51 additions and 12 deletions

41
packages/server/.gitignore vendored Executable file
View File

@ -0,0 +1,41 @@
# Secrets
/**/**/.env
/**/**/origin.server
/**/**/server.manifest
/**/**/server.registry
/**/**/_shared
# Trash
/**/**/*.log
/**/**/dumps.log
/**/**/.crash.log
/**/**/.tmp
/**/**/.cache
/**/**/cache
/**/**/out
/**/**/.out
/**/**/dist
/**/**/node_modules
/**/**/corenode_modules
/**/**/.DS_Store
/**/**/package-lock.json
/**/**/yarn.lock
/**/**/.evite
/**/**/uploads
/**/**/d_data
/**/**/redis_data
/**/**/*.tar
/**/**/*.7z
/**/**/*.zip
/**/**/*.env
# Logs
/**/**/npm-debug.log*
/**/**/yarn-error.log
/**/**/dumps.log
/**/**/corenode.log
# Temporal configurations
/**/**/.aliaser
/ssl/

View File

@ -107,7 +107,12 @@ async function injectEnvFromInfisical() {
console.log(`[BOOT] 🔑 Injecting env variables from INFISICAL in [${envMode}] mode...`) console.log(`[BOOT] 🔑 Injecting env variables from INFISICAL in [${envMode}] mode...`)
const client = new InfisicalClient({ const client = new InfisicalClient({
accessToken: process.env.INFISICAL_TOKEN, auth: {
universalAuth: {
clientId: process.env.INFISICAL_CLIENT_ID,
clientSecret: process.env.INFISICAL_CLIENT_SECRET,
}
},
}) })
const secrets = await client.listSecrets({ const secrets = await client.listSecrets({
@ -130,8 +135,8 @@ async function Boot(main) {
throw new Error("main class is not defined") throw new Error("main class is not defined")
} }
if (process.env.INFISICAL_TOKEN) { if (process.env.INFISICAL_CLIENT_ID && process.env.INFISICAL_CLIENT_SECRET) {
console.log(`[BOOT] INFISICAL_TOKEN found, injecting env variables from INFISICAL...`) console.log(`[BOOT] INFISICAL Credentials found, injecting env variables from INFISICAL...`)
await injectEnvFromInfisical() await injectEnvFromInfisical()
} }

View File

@ -1,11 +1,10 @@
{ {
"name": "@comty/server", "name": "@comty/server",
"version": "0.70.0", "version": "1.0.0-beta",
"license": "MIT", "license": "ComtyLicense",
"workspaces": [ "workspaces": [
"services/*" "services/*"
], ],
"private": true,
"scripts": { "scripts": {
"start:prod": "cross-env NODE_ENV=production hermes-node ./index.js", "start:prod": "cross-env NODE_ENV=production hermes-node ./index.js",
"dev": "cross-env NODE_ENV=development hermes-node ./index.js", "dev": "cross-env NODE_ENV=development hermes-node ./index.js",
@ -44,11 +43,5 @@
}, },
"resolutions": { "resolutions": {
"string-width": "4.2.3" "string-width": "4.2.3"
},
"pkg": {
"targets": [
"node18-linux-arm64"
],
"outputPath": "dist"
} }
} }