diff --git a/.gitignore b/.gitignore
index de9d7c8..0047632 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
.env
list.txt
+__pycache__/
diff --git a/Dockerfile b/Dockerfile
index f5aa291..8cfc9ec 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -14,7 +14,9 @@ RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 5000
# Define environment variable
-ENV NAME World
+ENV NAME=World
+ENV FLASK_DEBUG=true
# Run app.py when the container launches
CMD ["python3", "app.py"]
+
diff --git a/app.py b/app.py
index f122bed..0dea1e2 100644
--- a/app.py
+++ b/app.py
@@ -1,14 +1,22 @@
from flask import Flask, render_template_string, request
+from werkzeug.middleware.proxy_fix import ProxyFix
+import os
app = Flask(__name__)
+USER1 = os.environ.get("USER1")
+ROLE1 = os.environ.get("ROLE1")
+USER2 = os.environ.get("USER2")
+ROLE2 = os.environ.get("ROLE2")
+DOCUMENTTYPE = os.environ.get("DOCUMENTTYPE")
+
# Define the HTML template for the list
HTML_TEMPLATE = '''
- Chris/Alice Master/Kitten Contract (Read Only)
+ ''' + str(USER1) + " and " + str(USER2) + " " + str(ROLE1) + " and " + str(ROLE2) + " " + DOCUMENTTYPE + '''
- Chris/Alice Master/Kitten Contract (Read Only)
+
+ ''' + str(ROLE1) + " " + str(USER1) + '''
+ ''' + str(ROLE2) + " " + str(USER2) + '''
+ ''' + str(DOCUMENTTYPE) + '''
{% for item in items %}
- {{ item }}
@@ -69,7 +80,7 @@ READ_ONLY_HTML_TEMPLATE = '''
- Chris/Alice Master/Kitten Contract
+ ''' + str(USER1) + " and " + str(USER2) + " " + str(ROLE1) + " and " + str(ROLE2) + " " + DOCUMENTTYPE + ''' (Read Only)
- Chris/Alice Master/Kitten Contract
+
+ ''' + str(ROLE1) + " " + str(USER1) + '''
+ ''' + str(ROLE2) + " " + str(USER2) + '''
+ ''' + str(DOCUMENTTYPE) + '''
{% for item in items %}
- {{ item }}
@@ -155,5 +169,10 @@ def manage_read_only():
items = read_list()
return render_template_string(HTML_TEMPLATE, items=items)
+from werkzeug.middleware.proxy_fix import ProxyFix
+
+app.wsgi_app = ProxyFix(
+ app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1
+)
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=5000)
diff --git a/package.json b/package.json
index 3ed33d5..230f85d 100644
--- a/package.json
+++ b/package.json
@@ -6,6 +6,7 @@
"scripts": {
"start": "python3 app.py"
},
+ "homepage" : "https://alice.contract.17th.me",
"dependencies": {
"flask": "^2.0.1"
}
diff --git a/requirements.txt b/requirements.txt
index ebbd888..005be4a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,4 @@
+gunicorn
flask==2.2.2
Werkzeug==2.3.7
+python-dotenv