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,4 +1,5 @@
const constants = require("../../lib/constants")
const switcher = require("../../lib/utils/torswitcher")
const {fetchUser, getOrFetchShortcode, userRequestCache, history} = require("../../lib/collectors")
const {render, redirect} = require("pinski/plugins")
const {pugCache} = require("../passthrough")
@@ -8,7 +9,8 @@ module.exports = [
route: "/", methods: ["GET"], code: async () => {
return render(200, "pug/home.pug", {
rssEnabled: constants.settings.rss_enabled,
allUnblocked: history.testNoneBlocked()
allUnblocked: history.testNoneBlocked(),
torAvailable: switcher.canUseTor()
})
}
},