load admin npubs from env

This commit is contained in:
pablof7z 2023-06-25 15:04:40 +02:00
parent c43f1cc95e
commit 6712c4d48a
4 changed files with 41 additions and 39 deletions

View File

@ -1,4 +1,4 @@
FROM --platform=linux/amd64 node:19 as build
FROM --platform=linux/amd64 node:19-alpine as build
WORKDIR /app
COPY package.json .

64
package-lock.json generated
View File

@ -1,18 +1,18 @@
{
"name": "nsecbunkerd",
"version": "0.5.9",
"version": "0.6.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "nsecbunkerd",
"version": "0.5.9",
"version": "0.6.1",
"license": "CC BY-NC-ND 4.0",
"dependencies": {
"@inquirer/password": "^1.0.0",
"@inquirer/prompts": "^1.0.0",
"@nostr-dev-kit/ndk": "^0.3.32",
"@prisma/client": "^4.15.0",
"@prisma/client": "^4.16.1",
"@scure/base": "^1.1.1",
"@types/yargs": "^17.0.24",
"@typescript-eslint/eslint-plugin": "^5.57.0",
@ -32,7 +32,7 @@
"devDependencies": {
"@types/debug": "^4.1.7",
"@types/node": "^18.15.11",
"prisma": "^4.15.0",
"prisma": "^4.16.1",
"ts-node": "^10.9.1",
"typescript": "^5.0.3"
}
@ -1143,12 +1143,12 @@
}
},
"node_modules/@prisma/client": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.15.0.tgz",
"integrity": "sha512-xnROvyABcGiwqRNdrObHVZkD9EjkJYHOmVdlKy1yGgI+XOzvMzJ4tRg3dz1pUlsyhKxXGCnjIQjWW+2ur+YXuw==",
"version": "4.16.1",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.16.1.tgz",
"integrity": "sha512-CoDHu7Bt+NuDo40ijoeHP79EHtECsPBTy3yte5Yo3op8TqXt/kV0OT5OrsWewKvQGKFMHhYQ+ePed3zzjYdGAw==",
"hasInstallScript": true,
"dependencies": {
"@prisma/engines-version": "4.15.0-28.8fbc245156db7124f997f4cecdd8d1219e360944"
"@prisma/engines-version": "4.16.0-66.b20ead4d3ab9e78ac112966e242ded703f4a052c"
},
"engines": {
"node": ">=14.17"
@ -1163,16 +1163,16 @@
}
},
"node_modules/@prisma/engines": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.15.0.tgz",
"integrity": "sha512-FTaOCGs0LL0OW68juZlGxFtYviZa4xdQj/rQEdat2txw0s3Vu/saAPKjNVXfIgUsGXmQ72HPgNr6935/P8FNAA==",
"version": "4.16.1",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.16.1.tgz",
"integrity": "sha512-gpZG0kGGxfemgvK/LghHdBIz+crHkZjzszja94xp4oytpsXrgt/Ice82MvPsWMleVIniKuARrowtsIsim0PFJQ==",
"devOptional": true,
"hasInstallScript": true
},
"node_modules/@prisma/engines-version": {
"version": "4.15.0-28.8fbc245156db7124f997f4cecdd8d1219e360944",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.15.0-28.8fbc245156db7124f997f4cecdd8d1219e360944.tgz",
"integrity": "sha512-sVOig4tjGxxlYaFcXgE71f/rtFhzyYrfyfNFUsxCIEJyVKU9rdOWIlIwQ2NQ7PntvGnn+x0XuFo4OC1jvPJKzg=="
"version": "4.16.0-66.b20ead4d3ab9e78ac112966e242ded703f4a052c",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.16.0-66.b20ead4d3ab9e78ac112966e242ded703f4a052c.tgz",
"integrity": "sha512-tMWAF/qF00fbUH1HB4Yjmz6bjh7fzkb7Y3NRoUfMlHu6V+O45MGvqwYxqwBjn1BIUXkl3r04W351D4qdJjrgvA=="
},
"node_modules/@scure/base": {
"version": "1.1.1",
@ -4199,13 +4199,13 @@
}
},
"node_modules/prisma": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-4.15.0.tgz",
"integrity": "sha512-iKZZpobPl48gTcSZVawLMQ3lEy6BnXwtoMj7hluoGFYu2kQ6F9LBuBrUyF95zRVnNo8/3KzLXJXJ5TEnLSJFiA==",
"version": "4.16.1",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-4.16.1.tgz",
"integrity": "sha512-C2Xm7yxHxjFjjscBEW4tmoraPHH/Vyu/A0XABdbaFtoiOZARsxvOM7rwc2iZ0qVxbh0bGBGBWZUSXO/52/nHBQ==",
"devOptional": true,
"hasInstallScript": true,
"dependencies": {
"@prisma/engines": "4.15.0"
"@prisma/engines": "4.16.1"
},
"bin": {
"prisma": "build/index.js",
@ -5898,23 +5898,23 @@
}
},
"@prisma/client": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.15.0.tgz",
"integrity": "sha512-xnROvyABcGiwqRNdrObHVZkD9EjkJYHOmVdlKy1yGgI+XOzvMzJ4tRg3dz1pUlsyhKxXGCnjIQjWW+2ur+YXuw==",
"version": "4.16.1",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.16.1.tgz",
"integrity": "sha512-CoDHu7Bt+NuDo40ijoeHP79EHtECsPBTy3yte5Yo3op8TqXt/kV0OT5OrsWewKvQGKFMHhYQ+ePed3zzjYdGAw==",
"requires": {
"@prisma/engines-version": "4.15.0-28.8fbc245156db7124f997f4cecdd8d1219e360944"
"@prisma/engines-version": "4.16.0-66.b20ead4d3ab9e78ac112966e242ded703f4a052c"
}
},
"@prisma/engines": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.15.0.tgz",
"integrity": "sha512-FTaOCGs0LL0OW68juZlGxFtYviZa4xdQj/rQEdat2txw0s3Vu/saAPKjNVXfIgUsGXmQ72HPgNr6935/P8FNAA==",
"version": "4.16.1",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.16.1.tgz",
"integrity": "sha512-gpZG0kGGxfemgvK/LghHdBIz+crHkZjzszja94xp4oytpsXrgt/Ice82MvPsWMleVIniKuARrowtsIsim0PFJQ==",
"devOptional": true
},
"@prisma/engines-version": {
"version": "4.15.0-28.8fbc245156db7124f997f4cecdd8d1219e360944",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.15.0-28.8fbc245156db7124f997f4cecdd8d1219e360944.tgz",
"integrity": "sha512-sVOig4tjGxxlYaFcXgE71f/rtFhzyYrfyfNFUsxCIEJyVKU9rdOWIlIwQ2NQ7PntvGnn+x0XuFo4OC1jvPJKzg=="
"version": "4.16.0-66.b20ead4d3ab9e78ac112966e242ded703f4a052c",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.16.0-66.b20ead4d3ab9e78ac112966e242ded703f4a052c.tgz",
"integrity": "sha512-tMWAF/qF00fbUH1HB4Yjmz6bjh7fzkb7Y3NRoUfMlHu6V+O45MGvqwYxqwBjn1BIUXkl3r04W351D4qdJjrgvA=="
},
"@scure/base": {
"version": "1.1.1",
@ -8073,12 +8073,12 @@
}
},
"prisma": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-4.15.0.tgz",
"integrity": "sha512-iKZZpobPl48gTcSZVawLMQ3lEy6BnXwtoMj7hluoGFYu2kQ6F9LBuBrUyF95zRVnNo8/3KzLXJXJ5TEnLSJFiA==",
"version": "4.16.1",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-4.16.1.tgz",
"integrity": "sha512-C2Xm7yxHxjFjjscBEW4tmoraPHH/Vyu/A0XABdbaFtoiOZARsxvOM7rwc2iZ0qVxbh0bGBGBWZUSXO/52/nHBQ==",
"devOptional": true,
"requires": {
"@prisma/engines": "4.15.0"
"@prisma/engines": "4.16.1"
}
},
"punycode": {

View File

@ -1,6 +1,6 @@
{
"name": "nsecbunkerd",
"version": "0.6.0",
"version": "0.6.1",
"description": "nsecbunker daemon",
"main": "dist/index.js",
"bin": {
@ -36,7 +36,7 @@
"@inquirer/password": "^1.0.0",
"@inquirer/prompts": "^1.0.0",
"@nostr-dev-kit/ndk": "^0.3.32",
"@prisma/client": "^4.15.0",
"@prisma/client": "^4.16.1",
"@scure/base": "^1.1.1",
"@types/yargs": "^17.0.24",
"@typescript-eslint/eslint-plugin": "^5.57.0",
@ -52,7 +52,7 @@
"devDependencies": {
"@types/debug": "^4.1.7",
"@types/node": "^18.15.11",
"prisma": "^4.15.0",
"prisma": "^4.16.1",
"ts-node": "^10.9.1",
"typescript": "^5.0.3"
}

View File

@ -13,7 +13,9 @@ console.log(`Copyright by pablof7z <pablo@f7z.io> 2023`);
console.log(`Contact for licensing`);
console.log(``);
yargs(hideBin(process.argv))
const adminNpubs = process.env.ADMIN_NPUBS ? process.env.ADMIN_NPUBS.split(',') : [];
const argv = yargs(hideBin(process.argv))
.command('setup', 'Setup nsecBunker', {}, (argv) => {
setup(argv.config as string);
})
@ -42,7 +44,7 @@ yargs(hideBin(process.argv))
keys: argv.key as string[],
verbose: argv.verbose as boolean,
config: argv.config as string,
adminNpubs: argv.admin as string[],
adminNpubs: [...new Set([...((argv.admin||[]) as string[]), ...adminNpubs])]
});
})
@ -69,5 +71,5 @@ yargs(hideBin(process.argv))
default: 'nsecbunker.json',
},
})
.demandCommand(1)
.demandCommand(0, 1)
.parse();