Skip to content

Commit

Permalink
Merge pull request #84 from GeorgianaElena/handle_ssl
Browse files Browse the repository at this point in the history
Handle ssl
  • Loading branch information
GeorgianaElena authored Jan 25, 2020
2 parents 068845a + 7674565 commit 2e96af5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions jupyterhub_traefik_proxy/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,24 @@ async def _setup_traefik_static_config(self):
self._generate_htpassword()

self.static_config = {}
self.static_config["defaultentrypoints"] = ["http"]
self.static_config["debug"] = True
self.static_config["logLevel"] = self.traefik_log_level
entryPoints = {}
entryPoints["http"] = {"address": ":" + str(urlparse(self.public_url).port)}

if self.ssl_cert and self.ssl_key:
self.static_config["defaultentrypoints"] = ["https"]
entryPoints["https"] = {
"address": ":" + str(urlparse(self.public_url).port),
"tls": {
"certificates": [
{"certFile": self.ssl_cert, "keyFile": self.ssl_key}
]
},
}
else:
self.static_config["defaultentrypoints"] = ["http"]
entryPoints["http"] = {"address": ":" + str(urlparse(self.public_url).port)}

auth = {
"basic": {
"users": [
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
jupyterhub>=0.9
etcd3
aiohttp
aiohttp==3.6.2
python-consul
passlib
toml
Expand Down

0 comments on commit 2e96af5

Please sign in to comment.