Skip to content
Snippets Groups Projects
Verified Commit a1f21ea4 authored by Jonas Leder's avatar Jonas Leder
Browse files

remove versioning

parent 6ff0fec5
Branches
No related tags found
No related merge requests found
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)
......
......@@ -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():
......
......@@ -60,9 +60,6 @@
{% if builddate %}
Builddate: {{builddate}}<br>
{% endif %}
{% if version %}
Version: {{version}}
{% endif %}
</p>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment