Skip to content

Commit f09dacb

Browse files
committed
Listen on 0.0.0.0
Parametrize ssl files Signed-off-by: Mateus Caruccio <[email protected]>
1 parent a8bec78 commit f09dacb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tutorials/a-simple-walkthrough/astre.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ def run():
4343
cherrypy.config.update({
4444
"environment": "production",
4545
"log.screen": True,
46+
"server.socket_host": "0.0.0.0",
4647
"server.socket_port": 8444,
4748
"server.ssl_module": "builtin",
48-
"server.ssl_private_key": os.path.join(cur_dir, "key.pem"),
49-
"server.ssl_certificate": os.path.join(cur_dir, "cert.pem")
49+
"server.ssl_private_key": os.path.join(cur_dir, os.environ.get("SSL_KEY", "key.pem")),
50+
"server.ssl_certificate": os.path.join(cur_dir, os.environ.get("SSL_CRT","cert.pem"))
5051
})
5152
PIDFile(cherrypy.engine, 'astre.pid').subscribe()
5253
cherrypy.quickstart(Root())

tutorials/a-simple-walkthrough/sunset.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import requests
66

77
cur_dir = os.path.abspath(os.path.dirname(__file__))
8-
key_path = os.path.join(cur_dir, "key.pem")
9-
cert_path = os.path.join(cur_dir, "cert.pem")
8+
key_path = os.path.join(cur_dir, os.environ.get("SSL_KEY", "key.pem"))
9+
cert_path = os.path.join(cur_dir, os.environ.get("SSL_CRT", "cert.pem"))
1010

1111

1212
class Root:
@@ -30,6 +30,7 @@ def run():
3030
cherrypy.config.update({
3131
"environment": "production",
3232
"log.screen": True,
33+
"server.socket_host": "0.0.0.0",
3334
"server.socket_port": 8443,
3435
"server.ssl_module": "builtin",
3536
"server.ssl_private_key": key_path,

0 commit comments

Comments
 (0)