From 88811fbcd26c6a2b7069131aabcf651ea36c03f2 Mon Sep 17 00:00:00 2001 From: pablof7z Date: Thu, 6 Jul 2023 22:58:38 +0200 Subject: [PATCH] save package version in config file --- Dockerfile | 4 +++- package.json | 2 +- src/config/index.ts | 3 +++ src/package.json | 1 + tsconfig.json | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) create mode 120000 src/package.json diff --git a/Dockerfile b/Dockerfile index a322f76..89b9609 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,9 +10,11 @@ COPY tsconfig.json . RUN apt-get update -y && apt-get install -y openssl +RUN npx prisma generate + RUN npm run build -RUN npx prisma generate +RUN npm i RUN npx prisma migrate deploy ENTRYPOINT [ "node", "dist/index.js" ] diff --git a/package.json b/package.json index 6eeb8dd..99bd02f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nsecbunkerd", - "version": "0.7.2", + "version": "0.7.3", "description": "nsecbunker daemon", "main": "dist/index.js", "bin": { diff --git a/src/config/index.ts b/src/config/index.ts index af395bf..f668e67 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -2,6 +2,8 @@ import { readFileSync, writeFileSync } from 'fs'; import { NDKPrivateKeySigner } from '@nostr-dev-kit/ndk'; import { IAdminOpts } from '../daemon/admin'; +import { version } from '../package.json'; + const generatedKey = NDKPrivateKeySigner.generate(); export interface IConfig { @@ -56,6 +58,7 @@ async function getCurrentConfig(config: string): Promise { export function saveCurrentConfig(config: string, currentConfig: any) { try { + currentConfig.version = version; const configString = JSON.stringify(currentConfig, null, 2); writeFileSync(config, configString); } catch (err: any) { diff --git a/src/package.json b/src/package.json new file mode 120000 index 0000000..4e26811 --- /dev/null +++ b/src/package.json @@ -0,0 +1 @@ +../package.json \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 8f01cfc..dd6d0f5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,7 @@ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ "declaration": true, /* Generates corresponding '.d.ts' file. */ "sourceMap": true, /* Generates corresponding '.map' file. */ + "resolveJsonModule": true, // "outFile": "./", /* Concatenate and emit output to single file. */ "outDir": "dist", /* Redirect output structure to the directory. */ "rootDir": "src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */