Add privacy policy template

This commit is contained in:
Cadence Fish
2020-02-05 23:11:00 +13:00
parent 4fc7d6aa1e
commit 8b964a18e4
6 changed files with 153 additions and 2 deletions

View File

@@ -10,10 +10,27 @@ module.exports = [
return render(200, "pug/home.pug", {
rssEnabled: constants.settings.rss_enabled,
allUnblocked: history.testNoneBlocked(),
torAvailable: switcher.canUseTor()
torAvailable: switcher.canUseTor(),
hasPrivacyPolicy: constants.has_privacy_policy
})
}
},
{
route: "/privacy", methods: ["GET"], code: async () => {
if (constants.has_privacy_policy && pugCache.has("pug/privacy.pug")) {
return render(200, "pug/privacy.pug")
} else {
return render(404, "pug/friendlyerror.pug", {
statusCode: 404,
title: "No privacy policy",
message: "No privacy policy",
explanation:
"The owner of this instance has not actually written a privacy policy."
+"\nIf you own this instance, please read the file stored at /src/site/pug/privacy.pug.template."
})
}
}
},
{
route: `/u`, methods: ["GET"], code: async ({url}) => {
if (url.searchParams.has("u")) {