Skip to content

Commit

Permalink
added SHOW_SHYNET_VERSION env var to control display of version info
Browse files Browse the repository at this point in the history
  • Loading branch information
sudiptog81 committed Aug 31, 2020
1 parent c524325 commit 101d26d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
3 changes: 3 additions & 0 deletions TEMPLATE.env
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ PERFORM_CHECKS_AND_SETUP=True
# The port that Shynet should bind to. Don't set this if you're deploying on Heroku.
PORT=8080

# Set to "False" if you do not want the version to be displayed on the frontend.
SHOW_SHYNET_VERSION=True

# Redis, queue, and parellization settings; not necessary for single-instance deployments.
# Don't uncomment these unless you know what you are doing!
# NUM_WORKERS=1
Expand Down
21 changes: 13 additions & 8 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "Shynet",
"description":"Modern, privacy-friendly, and detailed web analytics that works without cookies or JS.",
"keywords":[
"app.json",
"shynet",
"heroku",
"analytics",
"privacy",
"friendly"
"description": "Modern, privacy-friendly, and detailed web analytics that works without cookies or JS.",
"keywords": [
"app.json",
"shynet",
"heroku",
"analytics",
"privacy",
"friendly"
],
"website": "https://github.com/milesmcc/shynet",
"repository": "https://github.com/milesmcc/shynet",
Expand Down Expand Up @@ -117,6 +117,11 @@
"description": "Whether to perform checks and setup at startup. Recommended value is 'True' for Heroku users.",
"value": "True",
"required": false
},
"SHOW_SHYNET_VERSION": {
"description": "Set to 'False' if you do not want the version to be displayed on the frontend.",
"value": "True",
"required": false
}
}
}
4 changes: 3 additions & 1 deletion shynet/dashboard/templatetags/helpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from urllib.parse import urlparse

import os
import flag
import pycountry
from django import template
Expand Down Expand Up @@ -84,7 +85,8 @@ def percent_change_display(start, end):

@register.inclusion_tag("dashboard/includes/sidebar_footer.html")
def sidebar_footer():
return {"version": settings.VERSION}
return {"version": "" if settings.SHOW_SHYNET_VERSION
else settings.VERSION}


@register.inclusion_tag("dashboard/includes/stat_comparison.html")
Expand Down
3 changes: 3 additions & 0 deletions shynet/shynet/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,6 @@
# How much time can elapse between requests from the same user before a new
# session is created, in seconds?
SESSION_MEMORY_TIMEOUT = int(os.getenv("SESSION_MEMORY_TIMEOUT", "1800"))

# Should the Shynet version information be displayed?
SHOW_SHYNET_VERSION = os.getenv("SHOW_SHYNET_VERSION", "True") == "True"

0 comments on commit 101d26d

Please sign in to comment.