From a1f21ea4fbe1aa56957622d8eddc0b0e6ab92425 Mon Sep 17 00:00:00 2001
From: Jonas Leder <jonas@jonasled.de>
Date: Mon, 28 Feb 2022 17:48:08 +0100
Subject: [PATCH] remove versioning

---
 app/home.py             |  4 ++--
 app/main.py             | 12 ++----------
 app/templates/home.html |  3 ---
 3 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/app/home.py b/app/home.py
index 5010b10..732adec 100644
--- a/app/home.py
+++ b/app/home.py
@@ -1,5 +1,5 @@
 from flask import render_template, abort
-def home(request, builddate, version, domain_prepared, recaptchaPublicKey, showDomainSelect, cookieNotice, domain_to_index, s, loginEnabled, passwordProtected):
+def home(request, builddate, domain_prepared, recaptchaPublicKey, showDomainSelect, cookieNotice, domain_to_index, s, loginEnabled, passwordProtected):
     try:
         loginbar = "Hello " + s.loads(request.cookies.get('username')) + ' (<a href="/user/links" >your links</a>, <a href="/user/logout" >logout</a>)'
     except:
@@ -11,7 +11,7 @@ def home(request, builddate, version, domain_prepared, recaptchaPublicKey, showD
         prefilledDomain = 0
 
     try:
-        return render_template('home.html', builddate=builddate, version=version, domain=domain_prepared, recaptchaPublicKey=recaptchaPublicKey, showDomainSelect=showDomainSelect, loginbar=loginbar, cookieNotice=cookieNotice ,domain_prefilled=prefilledDomain, loginEnabled=loginEnabled, passwordProtected=passwordProtected) #return the default site to create a new shorten link
+        return render_template('home.html', builddate=builddate, domain=domain_prepared, recaptchaPublicKey=recaptchaPublicKey, showDomainSelect=showDomainSelect, loginbar=loginbar, cookieNotice=cookieNotice ,domain_prefilled=prefilledDomain, loginEnabled=loginEnabled, passwordProtected=passwordProtected) #return the default site to create a new shorten link
     except:
         abort(500)
 
diff --git a/app/main.py b/app/main.py
index 597a06d..9f732a7 100644
--- a/app/main.py
+++ b/app/main.py
@@ -37,14 +37,6 @@ try:
 except:
     builddate = "" #If the enviorement Variable is not set also skip the builddate
 
-try:
-    if(environ["show_version"] == "1"): #If you want to see the builddate you can enable this enviorement variable
-        version = open("VERSION", "r").read()
-    else:
-        version = ""
-except:
-    version = "" #If the enviorement Variable is not set also skip the version
-
 try:
     recaptchaPrivateKey = environ["recaptcha_private"] #Get the recaptcha keys, if not set set skipRecaptcha to true to skip the check. If the publicKey is not set the user also will not get the code needed for recaptcha delivered in the page.
     recaptchaPublicKey = environ["recaptcha_public"]
@@ -143,11 +135,11 @@ app = Flask(__name__)
 
 @app.route('/', methods=['GET'])
 def home_get():
-    return home(request, builddate, version, domain_prepared, recaptchaPublicKey, showDomainSelect, cookieNotice, domain_to_index, s, loginEnabled, passwordProtected)
+    return home(request, builddate, domain_prepared, recaptchaPublicKey, showDomainSelect, cookieNotice, domain_to_index, s, loginEnabled, passwordProtected)
 
 @app.route('/', methods=['POST']) #This function is used to create a new url
 def home_post():
-    return newurl(request, skipCaptcha, recaptchaPrivateKey, recaptchaPublicKey, builddate, version, domain_prepared, domain_to_index, showDomainSelect, cookieNotice, s, url_scheme, loginEnabled, passwordProtected, password)
+    return newurl(request, skipCaptcha, recaptchaPrivateKey, recaptchaPublicKey, builddate, domain_prepared, domain_to_index, showDomainSelect, cookieNotice, s, url_scheme, loginEnabled, passwordProtected, password)
 
 @app.route('/favicon.ico') #Redirect to the static url of the favicon
 def favicon():
diff --git a/app/templates/home.html b/app/templates/home.html
index 939677c..ee79bf8 100644
--- a/app/templates/home.html
+++ b/app/templates/home.html
@@ -60,9 +60,6 @@
             {% if builddate %}
                Builddate: {{builddate}}<br>
             {% endif %}
-            {% if version %}
-               Version: {{version}}
-            {% endif %}
             </p>
          </div>
       </div>
-- 
GitLab