Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
50587721
Commit
50587721
authored
Jul 29, 2020
by
Alexander Lercher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secured homepage with ssl
parent
3051a5d2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
Dockerfile
tools/welcome-page/Dockerfile
+5
-1
main.py
tools/welcome-page/main.py
+9
-1
No files found.
tools/welcome-page/Dockerfile
View file @
50587721
...
@@ -18,3 +18,7 @@ COPY templates/ /app/templates/
...
@@ -18,3 +18,7 @@ COPY templates/ /app/templates/
RUN
chmod
a+x main.py
RUN
chmod
a+x main.py
CMD
["python", "./main.py"]
CMD
["python", "./main.py"]
# docker build -t alexx882/hello-articonf .
# docker run --name articonf-home -p 80:5000 -v /srv/articonf:/srv/articonf -d alexx882/hello-articonf
# docker run --name articonf-home-ssl -p 443:5000 -v /srv/articonf:/srv/articonf -d alexx882/hello-articonf
\ No newline at end of file
tools/welcome-page/main.py
View file @
50587721
import
os
from
flask
import
Flask
,
render_template
from
flask
import
Flask
,
render_template
app
=
Flask
(
__name__
)
app
=
Flask
(
__name__
)
...
@@ -6,4 +7,11 @@ app = Flask(__name__)
...
@@ -6,4 +7,11 @@ app = Flask(__name__)
def
hello_world
():
def
hello_world
():
return
render_template
(
'index.html'
)
return
render_template
(
'index.html'
)
app
.
run
(
host
=
'0.0.0.0'
,
port
=
5000
,
debug
=
True
)
# SSL configuration
\ No newline at end of file
try
:
certificate_path
=
os
.
environ
[
'ARTICONF_CERTIFICATE_PATH'
]
except
KeyError
:
certificate_path
=
'/srv/articonf/'
context
=
(
os
.
path
.
normpath
(
f
'{certificate_path}/articonf1.crt'
),
os
.
path
.
normpath
(
f
'{certificate_path}/articonf1.key'
))
# certificate and key files
app
.
run
(
host
=
'0.0.0.0'
,
port
=
5000
,
debug
=
False
,
ssl_context
=
context
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment