[WIP]: allow running single-user servers on subdomains

relies on CHP's host-based routing (a feature I didn't add!)

requires wildcard DNS and wildcard SSL for a proper setup

still lots to workout and cleanup in terms of cookies and where to use host, domain, path, but it works locally.
This commit is contained in:
Min RK
2016-02-22 16:45:50 +01:00
parent 6e7fc0574e
commit b54bfad8c2
6 changed files with 108 additions and 13 deletions

View File

@@ -176,10 +176,10 @@ class Proxy(Base):
def add_user(self, user, client=None):
"""Add a user's server to the proxy table."""
self.log.info("Adding user %s to proxy %s => %s",
user.name, user.server.base_url, user.server.host,
user.name, user.proxy_path, user.server.host,
)
yield self.api_request(user.server.base_url,
yield self.api_request(user.proxy_path,
method='POST',
body=dict(
target=user.server.host,
@@ -192,7 +192,7 @@ class Proxy(Base):
def delete_user(self, user, client=None):
"""Remove a user's server to the proxy table."""
self.log.info("Removing user %s from proxy", user.name)
yield self.api_request(user.server.base_url,
yield self.api_request(user.proxy_path,
method='DELETE',
client=client,
)