settings: Rename SERVER_URI to ROOT_DOMAIN_URI.

This should be a lot less confusing.

See #6013 for discussion.
This commit is contained in:
Tim Abbott 2017-08-28 14:01:18 -07:00
parent 659bff1ffb
commit a0a1fe1512
19 changed files with 30 additions and 30 deletions

View File

@ -92,7 +92,7 @@ function _setup_page() {
zuliprc: 'zuliprc',
flaskbotrc: 'flaskbotrc',
timezones: moment.tz.names(),
server_uri: page_params.server_uri,
root_domain_uri: page_params.root_domain_uri,
});
$(".settings-box").html(settings_tab);

View File

@ -1,7 +1,7 @@
<div id="bot-settings" class="settings-section" data-name="your-bots">
<div class="bot-settings-form">
<div class="tip">
{{#tr this}}Looking for our <a href="/integrations" target="_blank">Integrations</a> or <a href="__server_uri__/api" target="_blank">API</a> documentation?{{/tr}}
{{#tr this}}Looking for our <a href="/integrations" target="_blank">Integrations</a> or <a href="__root_domain_uri__/api" target="_blank">API</a> documentation?{{/tr}}
</div>
<div>

View File

@ -38,7 +38,7 @@ the registration flow has its own (nearly identical) copy of the fields below in
#}
<input id="id_terms" class="required" type="checkbox" name="terms"
{% if form.terms.value() %}checked="checked"{% endif %} />
{% trans %}I agree to the <a href="{{ server_uri }}/terms">Terms of Service</a>.{% endtrans %}
{% trans %}I agree to the <a href="{{ root_domain_uri }}/terms">Terms of Service</a>.{% endtrans %}
</label>
{% if form.terms.errors %}
{% for error in form.terms.errors %}

View File

@ -28,11 +28,11 @@
{% endif %}
{% if google_error %}
{{ render_markdown_path('zerver/google-error.md', {"server_uri": server_uri, "settings_path": settings_path, "secrets_path": secrets_path}) }}
{{ render_markdown_path('zerver/google-error.md', {"root_domain_uri": root_domain_uri, "settings_path": settings_path, "secrets_path": secrets_path}) }}
{% endif %}
{% if github_error %}
{{ render_markdown_path('zerver/github-error.md', {"server_uri": server_uri, "settings_path": settings_path, "secrets_path": secrets_path}) }}
{{ render_markdown_path('zerver/github-error.md', {"root_domain_uri": root_domain_uri, "settings_path": settings_path, "secrets_path": secrets_path}) }}
{% endif %}
<p>After making your changes, remember to restart

View File

@ -26,10 +26,10 @@
<ul>
{% if find_team_link_disabled %}
{% else %}
<li><a href="{{ server_uri }}/find_my_team/">{{ _("Find account") }}</a></li>
<li><a href="{{ root_domain_uri }}/find_my_team/">{{ _("Find account") }}</a></li>
{% endif %}
{% if open_realm_creation %}
<li><a href="{{ server_uri }}/create_realm/">{{ _("New organization") }}</a></li>
<li><a href="{{ root_domain_uri }}/create_realm/">{{ _("New organization") }}</a></li>
{% endif %}
{% if login_link_disabled %}
{% else %}
@ -40,8 +40,8 @@
{% else %}
<li><a href="{{ url('register') }}">{{ _("Register") }}</a></li>
{% endif %}
<li><a href="{{ server_uri }}/terms/">{{ _("Terms of service") }}</a></li>
<li><a href="{{ server_uri }}/privacy/">{{ _("Privacy policy") }}</a></li>
<li><a href="{{ root_domain_uri }}/terms/">{{ _("Terms of service") }}</a></li>
<li><a href="{{ root_domain_uri }}/privacy/">{{ _("Privacy policy") }}</a></li>
</ul>
</section>
<section>

View File

@ -1,7 +1,7 @@
You are using the **GitHub auth backend**, but it is not properly
configured. Please check the following:
You have added `{{ server_uri }}/complete/github/` as the callback URL
You have added `{{ root_domain_uri }}/complete/github/` as the callback URL
in the OAuth application in GitHub. You can create OAuth apps from
[GitHub's developer site](https://github.com/settings/developers).

View File

@ -5,7 +5,7 @@ configured. Please check the following:
You can create OAuth2 apps at [the Google developer console](https://console.developers.google.com).
* You have configured your OAuth2 client to allow redirects to your
server's Google auth URL: `{{ server_uri }}/accounts/login/google/done/`.
server's Google auth URL: `{{ root_domain_uri }}/accounts/login/google/done/`.
* You have set `GOOGLE_OAUTH2_CLIENT_ID` in `{{ settings_path }}` and
`google_oauth2_client_secret` in `{{ secrets_path }}`.

View File

@ -1,6 +1,6 @@
<nav class="{{className}}">
<div class="content">
<a class="brand logo no-style" href="{{ server_uri }}">
<a class="brand logo no-style" href="{{ root_domain_uri }}">
<svg class="brand-logo" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 40 40" version="1.1">
<g transform="translate(-297.14285,-466.64792)">
<circle cx="317.14285" cy="486.64792" r="19.030317" style="fill:#fff;stroke-width:1.93936479;stroke:transparent"></circle>

View File

@ -3,9 +3,9 @@
<div class="column-left">
<div>
{% if custom_logo_url %}
<a class="brand logo" href="{{ server_uri }}/"><img draggable="false" src="{{ custom_logo_url }}" class="portico-logo" alt="{{ _('Zulip') }}" content="Zulip" /></a>
<a class="brand logo" href="{{ root_domain_uri }}/"><img draggable="false" src="{{ custom_logo_url }}" class="portico-logo" alt="{{ _('Zulip') }}" content="Zulip" /></a>
{% else %}
<a class="brand logo" href="{{ server_uri }}{% if page_is_help_center %}/help/{% endif %}">
<a class="brand logo" href="{{ root_domain_uri }}{% if page_is_help_center %}/help/{% endif %}">
<svg class="brand-logo" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 40 40" version="1.1">
<g transform="translate(-297.14285,-466.64792)">
<circle cx="317.14285" cy="486.64792" r="19.030317" style="fill:#fff;stroke-width:1.93936479;stroke:transparent"></circle>

View File

@ -148,7 +148,7 @@ Form is validated both client-side using jquery-validate (see signup.js) and ser
<input id="id_terms" class="required" type="checkbox" name="terms"
{% if form.terms.value() %}checked="checked"{% endif %} />
<label for="id_terms" class="inline-block">
{% trans %}I agree to the <a href="{{ server_uri }}/terms" target="_blank">Terms of Service</a>.{% endtrans %}
{% trans %}I agree to the <a href="{{ root_domain_uri }}/terms" target="_blank">Terms of Service</a>.{% endtrans %}
</label>
{% if form.terms.errors %}
{% for error in form.terms.errors %}

View File

@ -69,7 +69,7 @@ IGNORED_PHRASES = [
'<a href="/#streams">Streams page</a>.'),
(r'Looking for our '
'<a href="/integrations" target="_blank">Integrations</a> or '
'<a href="{{ server_uri }}/api" target="_blank">API</a> '
'<a href="{{ root_domain_uri }}/api" target="_blank">API</a> '
'documentation?'),
r'Most stream administration is done on the <a href="/#streams">Streams page</a>.',
r"one or more people...",

View File

@ -134,7 +134,7 @@ class CheckCapitalizationTestCase(TestCase):
"Not ignored phrase",
('<p class="bot-settings-note padded-container"> Looking for our '
'<a href="/integrations" target="_blank">Integrations</a> or '
'<a href="{{ server_uri }}/api" target="_blank">API</a> '
'<a href="{{ root_domain_uri }}/api" target="_blank">API</a> '
'documentation? </p>'),
]
errored, ignored = check_capitalization(strings)
@ -148,6 +148,6 @@ class CheckCapitalizationTestCase(TestCase):
"Some number 25MiB",
('<p class="bot-settings-note padded-container"> Looking '
'for our <a href="/integrations" target="_blank">'
'Integrations</a> or <a href="{{ server_uri }}/api" '
'Integrations</a> or <a href="{{ root_domain_uri }}/api" '
'target="_blank">API</a> documentation? </p>'),
]))

View File

@ -28,7 +28,7 @@ def common_context(user):
"""
return {
'realm_uri': user.realm.uri,
'server_uri': settings.SERVER_URI,
'root_domain_uri': settings.ROOT_DOMAIN_URI,
'external_uri_scheme': settings.EXTERNAL_URI_SCHEME,
'external_host': settings.EXTERNAL_HOST,
}
@ -57,7 +57,7 @@ def zulip_default_context(request):
realm = get_realm_from_request(request)
if realm is None:
realm_uri = settings.SERVER_URI
realm_uri = settings.ROOT_DOMAIN_URI
realm_name = None
realm_icon = None
realm_description = None
@ -118,7 +118,7 @@ def zulip_default_context(request):
'realm_name': realm_name,
'realm_icon': realm_icon,
'realm_description': realm_description,
'server_uri': settings.SERVER_URI,
'root_domain_uri': settings.ROOT_DOMAIN_URI,
'api_site_required': settings.EXTERNAL_API_PATH != "api.zulip.com",
'email_gateway_example': settings.EMAIL_GATEWAY_EXAMPLE,
'apps_page_url': apps_page_url,

View File

@ -33,7 +33,7 @@ def build_email(template_prefix, to_user_id=None, to_email=None, from_name=None,
'realm_name_in_notifications': False,
'support_email': FromAddress.SUPPORT,
'verbose_support_offers': settings.VERBOSE_SUPPORT_OFFERS,
'email_images_base_uri': settings.SERVER_URI + '/static/images/emails/',
'email_images_base_uri': settings.ROOT_DOMAIN_URI + '/static/images/emails/',
})
subject = loader.render_to_string(template_prefix + '.subject',
context=context,

View File

@ -252,7 +252,7 @@ class Realm(ModelReprMixin, models.Model):
if self.subdomain not in [None, ""]:
return '%s%s.%s' % (settings.EXTERNAL_URI_SCHEME,
self.subdomain, settings.EXTERNAL_HOST)
return settings.SERVER_URI
return settings.ROOT_DOMAIN_URI
@property
def host(self):

View File

@ -135,11 +135,11 @@ class HomeTest(ZulipTestCase):
"realm_uri",
"realm_users",
"realm_waiting_period_threshold",
"root_domain_uri",
"save_stacktraces",
"server_generation",
"server_inline_image_preview",
"server_inline_url_embed_preview",
"server_uri",
"subscriptions",
"test_suite",
"timezone",

View File

@ -172,7 +172,7 @@ def home_real(request):
test_suite = settings.TEST_SUITE,
poll_timeout = settings.POLL_TIMEOUT,
login_page = settings.HOME_NOT_LOGGED_IN,
server_uri = settings.SERVER_URI,
root_domain_uri = settings.ROOT_DOMAIN_URI,
maxfilesize = settings.MAX_FILE_UPLOAD_SIZE,
max_avatar_file_size = settings.MAX_AVATAR_FILE_SIZE,
server_generation = settings.SERVER_GENERATION,

View File

@ -50,13 +50,13 @@ def email_page(request):
'referrer_email': 'runner@acme.com',
'referrer_realm_name': 'Acme Corporation',
'realm_uri': realm.uri,
'server_uri': settings.SERVER_URI,
'root_domain_uri': settings.ROOT_DOMAIN_URI,
'old_email': 'old_address@acme.com',
'new_email': 'new_address@acme.com',
'is_realm_admin': True,
'activate_url': '%s/accounts/do_confirm/5348720e4af7d2e8f296cbbd04d439489917ddc0' % (settings.SERVER_URI,),
'unsubscribe_link': '%s/accounts/unsubscribe/<type>/cf88931365ef1b0f12eae8d488bbc7af3563d7f0' % (settings.SERVER_URI,),
'organization_setup_advice_link': '%s/help/getting-your-organization-started-with-zulip' % (settings.SERVER_URI,),
'activate_url': '%s/accounts/do_confirm/5348720e4af7d2e8f296cbbd04d439489917ddc0' % (settings.ROOT_DOMAIN_URI,),
'unsubscribe_link': '%s/accounts/unsubscribe/<type>/cf88931365ef1b0f12eae8d488bbc7af3563d7f0' % (settings.ROOT_DOMAIN_URI,),
'organization_setup_advice_link': '%s/help/getting-your-organization-started-with-zulip' % (settings.ROOT_DOMAIN_URI,),
}
templates = [

View File

@ -539,7 +539,7 @@ else:
if "EXTERNAL_API_PATH" not in vars():
EXTERNAL_API_PATH = EXTERNAL_HOST + "/api"
EXTERNAL_API_URI = EXTERNAL_URI_SCHEME + EXTERNAL_API_PATH
SERVER_URI = EXTERNAL_URI_SCHEME + EXTERNAL_HOST
ROOT_DOMAIN_URI = EXTERNAL_URI_SCHEME + EXTERNAL_HOST
if "NAGIOS_BOT_HOST" not in vars():
NAGIOS_BOT_HOST = EXTERNAL_HOST