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

added https support

parent 428c3d9e
No related branches found
No related tags found
No related merge requests found
db/urls.db
import.csv
.thumb/
__pycache__/
builddate.txt
db/urls.db-journal
.vscode/settings.json
......@@ -11,6 +11,7 @@ services:
- domains=192.168.233.136:5000;google.de #List of domains (with port if not 80/443) seperated with ";"
- show_build_date=1 #Disable this, if you don't want to see the builddate
- production=0 #Enable this, if you want to run the server in production
- url_scheme=http #If you use a reverse Proxy with https set this to https
volumes:
url_shorter_db:
\ No newline at end of file
......@@ -11,6 +11,7 @@ services:
- domains=192.168.233.136:5000;google.de #List of domains (with port if not 80/443) seperated with ";"
- show_build_date=0 #Normaly disable this
- production=1 #You should only disable this for debugging
- url_scheme=http #If you use a reverse Proxy with https set this to https
volumes:
url_shorter_db:
\ No newline at end of file
......@@ -32,6 +32,11 @@ try:
except:
production = False
try:
url_scheme = os.environ["url_scheme"]
except:
url_scheme = "http"
index = 0
for domains in domain: #Make from every domnain a entry for the select box later
domains = domains
......@@ -133,6 +138,6 @@ def redirect_short_url(short_url):
if __name__ == '__main__':
table_check()# This code checks whether database table is created or not
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='0.0.0.0', port= 5000) #Start the Webserver for all users on port 5000
serve(app, host='0.0.0.0', port= 5000, url_scheme=url_scheme) #Start the Webserver for all users on port 5000
else:
app.run(host='0.0.0.0', port=5000, debug=True) #Start the Webserver in Debug mode. This means, if the script runs in an error, it will show the error message in Browser.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment