Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: local setup issues #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ git clone <nsecbunkerd-repo>
npm i
npm run build
npx prisma migrate deploy
npm start setup
npm start start
```

_and then copy your connection string from the output to [nsecBunker UI](https://app.nsecbunker.com/). Your config is located at `./config/nsecbunker.json`_

## Configure

### Easy: Remote configuration
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"prisma:migrate": "npx prisma migrate deploy",
"prisma:create": "npx prisma db push --preview-feature",
"start": "node ./scripts/start.js",
"setup": "node ./scripts/start.js setup",
"lfg": "node ./scripts/start.js start",
"nsecbunkerd": "node dist/index.js",
"client": "node dist/client/client.js"
Expand Down
1 change: 1 addition & 0 deletions scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ const childProcess = spawn('node', ['./dist/index.js', ...args], {
});

childProcess.on('exit', (code) => {
console.log("Exiting nsecbunkerd with code " + code)
process.exit(code);
});
1 change: 1 addition & 0 deletions src/daemon/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
globalThis.crypto = require('crypto');
import "websocket-polyfill";
import run from './run';
import type {IConfig} from '../config/index';
Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { start } from './commands/start.js';

const adminNpubs = process.env.ADMIN_NPUBS ? process.env.ADMIN_NPUBS.split(',') : [];

const argv = yargs(hideBin(process.argv))

yargs(hideBin(process.argv))
.command('setup', 'Setup nsecBunker', {}, (argv) => {
setup(argv.config as string);
})
Expand Down Expand Up @@ -65,5 +66,5 @@ const argv = yargs(hideBin(process.argv))
default: 'config/nsecbunker.json',
},
})
.demandCommand(0, 1)
.demandCommand(1, 1, "Please provide exactly one argument (e.g. setup, start, add)")
.parse();