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

added versioncheck

parent aeb3e34b
Branches
Tags
No related merge requests found
......@@ -6,6 +6,7 @@ from os import environ #Used for getting the enviorement variables
from itsdangerous import URLSafeSerializer #used for signing the cookies
from random import choice#used for signing the cookies
from string import ascii_lowercase #used for signing the cookies
from requests import get #used to get the current version on the Server
#Import of shorter specific files
from table_check import table_check #import the table check file
......@@ -197,6 +198,9 @@ def apiDocs():
def startup():
table_check()# This code checks whether database table is created or not
versionServer = get("https://gitlab.jonasled.de/jonasled/url_shorter_docker/raw/master/VERSION").text
if(open("VERSION", "r").read() != versionServer): print("Different version on the server found. Your version: " + open("VERSION", "r").read() + ", server version: " + versionServer + ".")
if production: #Check if production variable is set to true use the waitress webserver, else use the buildin flask webserver, with more debug output
serve(app, host=host, port= 5000, url_scheme=url_scheme) #Start the Webserver for all users on port 5000
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment