Commit fc97e8b9 authored by Elias Nahum's avatar Elias Nahum
Browse files

Merge branch 'release-3.3' RC3

parents 0a90d705 50ecb68e
......@@ -32,7 +32,7 @@ const MAX_WEBSOCKET_FAILS = 7;
export function initialize() {
if (window.WebSocket) {
let connUrl = window.mm_config.SiteURL;
let connUrl = Utils.getSiteURL();
// replace the protocol with a websocket one
if (connUrl.startsWith('https:')) {
......
......@@ -28,6 +28,7 @@ export default class ConfigurationSettings extends AdminSettings {
}
getConfigFromState(config) {
config.ServiceSettings.SiteURL = this.state.siteURL;
config.ServiceSettings.ListenAddress = this.state.listenAddress;
config.ServiceSettings.WebserverMode = this.state.webserverMode;
......@@ -36,6 +37,7 @@ export default class ConfigurationSettings extends AdminSettings {
getStateFromConfig(config) {
return {
siteURL: config.ServiceSettings.SiteURL,
listenAddress: config.ServiceSettings.ListenAddress,
webserverMode: config.ServiceSettings.WebserverMode
};
......@@ -55,6 +57,24 @@ export default class ConfigurationSettings extends AdminSettings {
renderSettings() {
return (
<SettingsGroup>
<TextSetting
id='siteURL'
label={
<FormattedMessage
id='admin.service.siteURL'
defaultMessage='Site URL:'
/>
}
placeholder={Utils.localizeMessage('admin.service.siteURLExample', 'Ex "https://mattermost.example.com:1234"')}
helpText={
<FormattedMessage
id='admin.service.siteURLDescription'
defaultMessage='The URL, including port number and protocol, from which users will access Mattermost. Leave blank to automatically configure based on incoming traffic.'
/>
}
value={this.state.siteURL}
onChange={this.handleChange}
/>
<TextSetting
id='listenAddress'
label={
......
......@@ -3,17 +3,10 @@
import ReactDOM from 'react-dom';
import Client from 'client/web_client.jsx';
import Constants from 'utils/constants.jsx';
import * as Utils from 'utils/utils.jsx';
import {Modal} from 'react-bootstrap';
import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'react-intl';
var holders = defineMessages({
submit: {
id: 'admin.reset_password.submit',
defaultMessage: 'Please enter at least {chars} characters.'
}
});
import {injectIntl, intlShape, FormattedMessage} from 'react-intl';
import React from 'react';
......@@ -31,13 +24,13 @@ class ResetPasswordModal extends React.Component {
doSubmit(e) {
e.preventDefault();
var password = ReactDOM.findDOMNode(this.refs.password).value;
const password = this.refs.password.value;
if (!password || password.length < Constants.MIN_PASSWORD_LENGTH) {
this.setState({serverError: this.props.intl.formatMessage(holders.submit, {chars: Constants.MIN_PASSWORD_LENGTH})});
const passwordErr = Utils.isValidPassword(password);
if (passwordErr) {
this.setState({serverError: passwordErr});
return;
}
this.setState({serverError: null});
Client.adminResetPassword(
......
......@@ -105,7 +105,7 @@ export default class TeamUrl extends React.Component {
nameDivClass += ' has-error';
}
const title = `${window.mm_config.SiteURL}/`;
const title = `${Utils.getSiteURL()}/`;
const urlTooltip = (
<Tooltip id='urlTooltip'>{title}</Tooltip>
);
......
......@@ -97,7 +97,7 @@ export default class InstalledIncomingWebhook extends React.Component {
id='installed_integrations.url'
defaultMessage='URL: {url}'
values={{
url: window.mm_config.SiteURL + '/hooks/' + incomingWebhook.id
url: Utils.getSiteURL() + '/hooks/' + incomingWebhook.id
}}
/>
</span>
......
......@@ -591,7 +591,7 @@ export default class SignupUserComplete extends React.Component {
<a
className='btn btn-custom-login google'
key='google'
href={Client.getOAuthRoute() + '/google/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
href={Client.getOAuthRoute() + '/google/signup' + window.location.search}
>
<span className='icon'/>
<span>
......@@ -609,7 +609,7 @@ export default class SignupUserComplete extends React.Component {
<a
className='btn btn-custom-login office365'
key='office365'
href={Client.getOAuthRoute() + '/office365/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
href={Client.getOAuthRoute() + '/office365/signup' + window.location.search}
>
<span className='icon'/>
<span>
......
This diff is collapsed.
......@@ -640,6 +640,9 @@
"admin.service.sessionCache": "Session Cache (minutes):",
"admin.service.sessionCacheDesc": "The number of minutes to cache a session in memory.",
"admin.service.sessionDaysEx": "Ex \"30\"",
"admin.service.siteURL": "Site URL:",
"admin.service.siteURLDescription": "The URL, including port number and protocol, from which users will access Mattermost. Leave blank to automatically configure based on incoming traffic.",
"admin.service.siteURLExample": "Ex \"https://mattermost.example.com:1234\"",
"admin.service.ssoSessionDays": "Session length SSO (days):",
"admin.service.ssoSessionDaysDesc": "The number of days from the last time a user entered their credentials to the expiry of the user's session. If the authentication method is SAML or GitLab, the user may automatically be logged back in to Mattermost if they are already logged in to SAML or GitLab. After changing this setting, the setting will take effect after the next time the user enters their credentials.",
"admin.service.testingDescription": "When true, /loadtest slash command is enabled to load test accounts, data and text formatting. Changing this requires a server restart before taking effect.",
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1338,3 +1338,7 @@ export function isValidPassword(password) {
return errorMsg;
}
export function getSiteURL() {
return global.mm_config.SiteURL || window.location.origin;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment