mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
1
setup.py
1
setup.py
@@ -15,6 +15,7 @@ setup(
|
|||||||
'jinja2',
|
'jinja2',
|
||||||
'pluggy>0.7<1.0',
|
'pluggy>0.7<1.0',
|
||||||
'passlib',
|
'passlib',
|
||||||
|
'backoff',
|
||||||
'jupyterhub-traefik-proxy==0.1.*'
|
'jupyterhub-traefik-proxy==0.1.*'
|
||||||
],
|
],
|
||||||
entry_points={
|
entry_points={
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
"""Traefik installation and setup"""
|
"""Traefik installation and setup"""
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
from urllib.request import urlretrieve
|
from urllib.request import urlretrieve, ContentTooShortError
|
||||||
|
|
||||||
from jinja2 import Template
|
from jinja2 import Template
|
||||||
from passlib.apache import HtpasswdFile
|
from passlib.apache import HtpasswdFile
|
||||||
|
import backoff
|
||||||
|
|
||||||
from tljh.configurer import load_config
|
from tljh.configurer import load_config
|
||||||
|
|
||||||
@@ -26,7 +27,12 @@ def checksum_file(path):
|
|||||||
hasher.update(chunk)
|
hasher.update(chunk)
|
||||||
return hasher.hexdigest()
|
return hasher.hexdigest()
|
||||||
|
|
||||||
|
@backoff.on_exception(
|
||||||
|
backoff.expo,
|
||||||
|
# Retry when connection is reset or we think we didn't download entire file
|
||||||
|
(ConnectionResetError, ContentTooShortError),
|
||||||
|
max_tries=2
|
||||||
|
)
|
||||||
def ensure_traefik_binary(prefix):
|
def ensure_traefik_binary(prefix):
|
||||||
"""Download and install the traefik binary"""
|
"""Download and install the traefik binary"""
|
||||||
traefik_bin = os.path.join(prefix, "bin", "traefik")
|
traefik_bin = os.path.join(prefix, "bin", "traefik")
|
||||||
|
|||||||
Reference in New Issue
Block a user