Document environment variables and allow in-memory mode for temp datas

Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
Yonle 2023-10-30 15:10:24 +07:00
parent a05c81c936
commit db838be289
2 changed files with 6 additions and 1 deletions

View File

@ -36,6 +36,10 @@ Or run in background with `tmux`:
tmux new -d "node index.js"
```
## Environment Variable
- `CLUSTERS` - Run Bostr with specified numbers of clusters.
- `IN_MEMORY` - Store temporary data in memory (RAM) instead of disk.
## License
Copyright 2023 Yonle <yonle@lecturify.net>

View File

@ -2,7 +2,7 @@ const SQLite = require("better-sqlite3");
const WebSocket = require("ws");
const { relays } = require("./config");
const socks = new Set();
const sess = new SQLite(".temporary.db");
const sess = new SQLite(process.env.IN_MEMORY ? null : (__dirname + "/6.temporary.db"));
const csess = new Map();
// Handle database....
@ -119,6 +119,7 @@ function newConn(addr) {
break;
}
case "NOTICE":
console.log(process.pid, relay.addr, "NOTICE", data[1]);
bc_c(data);
break;
}