mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
Add option for hosting each realm on its own subdomain.
This adds support for running a Zulip production server with each realm on its own unique subdomain, e.g. https://realm_name.example.com. This patch includes a ton of important features: * Configuring the Zulip sesion middleware to issue cookier correctly for the subdomains case. * Throwing an error if the user tries to visit an invalid subdomain. * Runs a portion of the Casper tests with REALMS_HAVE_SUBDOMAINS enabled to test the subdomain signup process. * Updating our integrations documentation to refer to the current subdomain. * Enforces that users can only login to the subdomain of their realm (but does not restrict the API; that will be tightened in a future commit). Note that toggling settings.REALMS_HAVE_SUBDOMAINS on a live server is not supported without manual intervention (the main problem will be adding "subdomain" values for all the existing realms). [substantially modified by tabbott as part of merging]
This commit is contained in:
@@ -1929,12 +1929,12 @@ def do_change_stream_description(realm, stream_name, new_description):
|
||||
value=new_description)
|
||||
send_event(event, stream_user_ids(stream))
|
||||
|
||||
def do_create_realm(domain, name, restricted_to_domain=True):
|
||||
# type: (text_type, text_type, bool) -> Tuple[Realm, bool]
|
||||
def do_create_realm(domain, name, restricted_to_domain=True, subdomain=None):
|
||||
# type: (text_type, text_type, bool, Optional[text_type]) -> Tuple[Realm, bool]
|
||||
realm = get_realm(domain)
|
||||
created = not realm
|
||||
if created:
|
||||
realm = Realm(domain=domain, name=name,
|
||||
realm = Realm(domain=domain, name=name, subdomain=subdomain,
|
||||
restricted_to_domain=restricted_to_domain)
|
||||
realm.save()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user