New env vars are optional
@@ -100,18 +100,14 @@ jupyterhub:
return super().start()
def get_env(self):
- if 'repo_url' not in self.user_options:
- raise web.HTTPError(400, "repo_url required")
- if 'ref_url' not in self.user_options:
- raise web.HTTPError(400, "ref_url required")
- if 'binder_url' not in self.user_options:
- raise web.HTTPError(400, "binder_url required")
- if 'persistent_binder_url' not in self.user_options:
- raise web.HTTPError(400, "persistent_binder_url required")
env = super(BinderSpawner, self).get_env()
+ if 'repo_url' in self.user_options:
env['BINDER_REPO_URL'] = self.user_options['repo_url']
+ if 'ref_url' in self.user_options:
env['BINDER_REF_URL'] = self.user_options['ref_url']
+ if 'binder_url' in self.user_options:
env['BINDER_URL'] = self.user_options['binder_url']
+ if 'persistent_binder_url' in self.user_options:
env['BINDER_PERSISTENT_URL'] = self.user_options['persistent_binder_url']
return env
