Skip to content

Commit

Permalink
ui: remove version number from login screen
Browse files Browse the repository at this point in the history
As part of a client security audit, we want to not expose any
machine or version information on web UI pages that are publicly
accessible.

This PR removes:
- the version info on the top-right of the login screen
- the "new in 2.1" callout

Release note (admin ui change): Remove version information from
login screen.
  • Loading branch information
celiala committed Jun 12, 2019
1 parent a581c20 commit 90cc663
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 43 deletions.
3 changes: 0 additions & 3 deletions pkg/ui/assets/paperPlane.svg

This file was deleted.

10 changes: 8 additions & 2 deletions pkg/ui/src/util/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@

import { getDataFromServer } from "src/util/dataFromServer";

const version = getDataFromServer().Version || "stable";
const stable = "stable";
const version = getDataFromServer().Version || stable;
const docsURLBase = "https://www.cockroachlabs.com/docs/" + version;
const docsURLBaseNoVersion = "https://www.cockroachlabs.com/docs/" + stable;

function docsURL(pageName: string): string {
return `${docsURLBase}/${pageName}`;
}

export const adminUILogin = docsURL("admin-ui-access-and-navigate.html#secure-the-admin-ui");
function docsURLNoVersion(pageName: string): string {
return `${docsURLBaseNoVersion}/${pageName}`;
}

export const adminUILoginNoVersion = docsURLNoVersion("admin-ui-access-and-navigate.html#secure-the-admin-ui");
export const startFlags = docsURL("start-a-node.html#flags");
export const pauseJob = docsURL("pause-job.html");
export const cancelJob = docsURL("cancel-job.html");
Expand Down
23 changes: 3 additions & 20 deletions pkg/ui/src/views/login/loginPage.styl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
width 486px

.form-container
margin-top 120px
padding-left 50px
padding-right 50px

Expand All @@ -52,15 +53,6 @@
width 350px
font-size 14px

.version
color $body-color
text-align right
margin-top 10px
margin-bottom 100px

.version-tag
color #54b30e

.logo
height 32px
position relative
Expand Down Expand Up @@ -107,17 +99,8 @@
color $alert-color
margin 12px 0

.login-new-feature
margin-left 30px

&__blurb
margin-top 5px
line-height 24px
color $body-color

.login-new-feature-heading
&__text
color $link-color
.info-box
margin-top 36px

.login-note-box
&__sql-command
Expand Down
19 changes: 1 addition & 18 deletions pkg/ui/src/views/login/loginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,14 @@ import { withRouter, WithRouterProps } from "react-router";

import { doLogin, LoginAPIState } from "src/redux/login";
import { AdminUIState } from "src/redux/state";
import { getDataFromServer } from "src/util/dataFromServer";
import * as docsURL from "src/util/docs";
import { trustIcon } from "src/util/trust";
import InfoBox from "src/views/shared/components/infoBox";

import logo from "assets/crdb.png";
import docsIcon from "!!raw-loader!assets/docs.svg";
import newFeatureIcon from "!!raw-loader!assets/paperPlane.svg";
import "./loginPage.styl";

const version = getDataFromServer().Tag || "UNKNOWN";

interface LoginPageProps {
loginState: LoginAPIState;
handleLogin: (username: string, password: string) => Promise<void>;
Expand Down Expand Up @@ -105,16 +101,6 @@ class LoginPage extends React.Component<LoginPageProps & WithRouterProps, LoginP
<div className="content">
<section className="section login-page__info">
<img className="logo" alt="CockroachDB" src={logo} />
<div className="login-new-feature">
<div className="login-new-feature-heading">
<span dangerouslySetInnerHTML={trustIcon(newFeatureIcon)} />
<span className="login-new-feature-heading__text">New in v2.1</span>
</div>
<p className="login-new-feature__blurb">
A user with a password is required to log in to the UI
on secure clusters.
</p>
</div>
<InfoBox>
<h4 className="login-note-box__heading">Note:</h4>
<p className="login-note-box__blurb">
Expand All @@ -129,17 +115,14 @@ class LoginPage extends React.Component<LoginPageProps & WithRouterProps, LoginP
<span className="sql-keyword">;</span>
</pre>
<p className="aside">
<a href={docsURL.adminUILogin} className="login-docs-link" target="_blank">
<a href={docsURL.adminUILoginNoVersion} className="login-docs-link" target="_blank">
<span className="login-docs-link__icon" dangerouslySetInnerHTML={trustIcon(docsIcon)} />
<span className="login-docs-link__text">Read more about configuring login</span>
</a>
</p>
</InfoBox>
</section>
<section className="section login-page__form">
<p className="version">
Version: <span className="version-tag">{ version }</span>
</p>
<div className="form-container">
<h1 className="heading">Log in to the Web UI</h1>
{this.renderError()}
Expand Down

0 comments on commit 90cc663

Please sign in to comment.