diff --git a/main.py b/main.py index 8f0849bb2a92c59b66bbabc62fb238591b1f43be..8fba6fef75b66ec75d914d33a74b6459c391a226 100644 --- a/main.py +++ b/main.py @@ -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: