Add Tor status to home and stats

This commit is contained in:
Cadence Fish
2020-02-03 04:09:40 +13:00
parent 6e136dc77a
commit 1fcdfce868
5 changed files with 23 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
const {Pinski} = require("pinski")
const {subdirs} = require("node-dir")
const constants = require("../lib/constants")
const passthrough = require("./passthrough")
@@ -8,7 +9,7 @@ const pinski = new Pinski({
relativeRoot: __dirname
})
subdirs("pug", (err, dirs) => {
subdirs("pug", async (err, dirs) => {
if (err) throw err
//pinski.addRoute("/", "pug/index.pug", "pug")
@@ -20,6 +21,11 @@ subdirs("pug", (err, dirs) => {
pinski.muteLogsStartingWith("/imageproxy")
pinski.muteLogsStartingWith("/videoproxy")
pinski.muteLogsStartingWith("/static")
if (constants.tor.enabled) {
await require("../lib/utils/tor") // make sure tor state is known before going further
}
pinski.startServer()
pinski.enableWS()