Commit 65422028 authored by Eric Eastwood's avatar Eric Eastwood

Merge branch 'release/19.37.1'

parents b31d0abc 2ac0de88
......@@ -100,5 +100,5 @@ unread-notification.out.html
/scripts/useful-queries/*.png
node_modules_2
config/overrides
.env
.env*
webpack-report/
......@@ -67,6 +67,7 @@ mobile-asset-build:
only:
- master
script:
- npm run task-js
- npm run build-android-assets
- npm run build-ios-assets
artifacts:
......
# 19.38.0 - *upcoming*
- Make Gitter markdown readme badge snippet visible for all rooms (share modal)
- Thanks to [@jamesgeorge007](https://gitlab.com/jamesgeorge007) for the contribution, https://gitlab.com/gitlab-org/gitter/webapp/merge_requests/1324
- On the homepage, use green caribbean button style for primary room creation action (just like community creation)
- Thanks to [@gtsiolis](https://gitlab.com/gtsiolis) for the contribution, https://gitlab.com/gitlab-org/gitter/webapp/merge_requests/1341
- Update version badge at the top(`DEV`) to link to the GitLab repo
- Thanks to [@vicek22](https://gitlab.com/vicek22) for the contribution, https://gitlab.com/gitlab-org/gitter/webapp/merge_requests/1345
- Update create room primary button style in `/home/explore` for better consistency
- Thanks to [@gtsiolis](https://gitlab.com/gtsiolis) for the contribution, https://gitlab.com/gitlab-org/gitter/webapp/merge_requests/1342
Developer facing:
- Fix mobile(Android/iOS) asset CI build missing `webpack-manifest.json`, https://gitlab.com/gitlab-org/gitter/webapp/merge_requests/1347
- Add docs on how Gitter uses Prettier for styling/formatting(lint), https://gitlab.com/gitlab-org/gitter/webapp/merge_requests/1348
- Update `.gitignore` to ignore anything `.env*` related to avoid leaking mis-named files or backup files created by editors
- Thanks to [@gtsiolis](https://gitlab.com/gtsiolis) for the contribution, https://gitlab.com/gitlab-org/gitter/webapp/merge_requests/1349
# 19.37.0 - 2019-2-19
- Fix inline code blocks showing vertical scrollbar in the dark theme
......
......@@ -183,6 +183,22 @@ and [some notes on touching production](https://gitlab.com/gl-infra/gitter-infra
### Submitting a merge request
#### Code style/formatting (lint)
This project uses [Prettier](https://prettier.io/docs/en/install.html) for opinionated automatic formatting.
You can run the following commands to check and fix the formatting before submitting your merge request.
Checking is done in the `validate` CI job and this should pass regardless of your what project secrets you setup
```
npm run prettier -- --check "**/*.js"
npm run prettier -- --write "**/*.js"
```
There are also [Prettier plugins/integrations for your editor](https://prettier.io/docs/en/editors.html) if you prefer to have it built in and format on save.
#### Getting the GitLab CI tests green :white\_check\_mark:
Just add all of the variables from your `.env` file to your forked projects [**Settings** -> **CI/CD** -> **Environment variables**](https://docs.gitlab.com/ee/ci/variables/#variables) section
......
......@@ -43,8 +43,8 @@ function getBranch() {
return branch;
}
function getGithubLink() {
if (commit) return 'https://github.com/troupe/gitter-webapp/commit/' + commit;
function getGitlabLink() {
if (commit) return 'https://gitlab.com/gitlab-org/gitter/webapp/commit/' + commit;
return '';
}
......@@ -54,5 +54,5 @@ module.exports = {
getAssetTag: getAssetTag,
getCommit: getCommit,
getBranch: getBranch,
getGithubLink: getGithubLink
getGitlabLink: getGitlabLink
};
......@@ -1371,34 +1371,6 @@
}
}
},
"@gitterhq/passport-github": {
"version": "0.1.8-g",
"resolved": "https://registry.npmjs.org/@gitterhq/passport-github/-/passport-github-0.1.8-g.tgz",
"integrity": "sha1-stnDgt91jyQMrahUBUP3sSlK34U=",
"requires": {
"@gitterhq/passport-oauth": "^1.0.0-f",
"pkginfo": "0.2.x"
}
},
"@gitterhq/passport-oauth": {
"version": "1.0.0-f",
"resolved": "https://registry.npmjs.org/@gitterhq/passport-oauth/-/passport-oauth-1.0.0-f.tgz",
"integrity": "sha1-sc6zowbsR/eQY/u+h7t4/nAk+Gg=",
"requires": {
"@gitterhq/passport-oauth2": "^1.1.2-b",
"passport-oauth1": "1.x.x"
}
},
"@gitterhq/passport-oauth2": {
"version": "1.1.2-b",
"resolved": "https://registry.npmjs.org/@gitterhq/passport-oauth2/-/passport-oauth2-1.1.2-b.tgz",
"integrity": "sha1-1O/iZO3BjgMbdIYYg8vgHjBVaW0=",
"requires": {
"oauth": "0.9.x",
"passport-strategy": "1.x.x",
"uid2": "0.0.x"
}
},
"@gitterhq/redis-sentinel-client": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/@gitterhq/redis-sentinel-client/-/redis-sentinel-client-0.3.0.tgz",
......@@ -21207,18 +21179,26 @@
"dev": true
},
"passport": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/passport/-/passport-0.2.2.tgz",
"integrity": "sha1-nDjxe+uSnz2Br3uIOOhDDbhwPys=",
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/passport/-/passport-0.4.0.tgz",
"integrity": "sha1-xQlWkTR71a07XhgCOMORTRbwWBE=",
"requires": {
"passport-strategy": "1.x.x",
"pause": "0.0.1"
}
},
"passport-github2": {
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/passport-github2/-/passport-github2-0.1.11.tgz",
"integrity": "sha1-yStW88OKROdmqsfp58E4TF6TyZk=",
"requires": {
"passport-oauth2": "1.x.x"
}
},
"passport-gitlab2": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/passport-gitlab2/-/passport-gitlab2-4.0.0.tgz",
"integrity": "sha512-C/8/L8piHwv57J6fY/MzsEJc8yCkgsyBSzMWxfTfEHRvCaTkD08vJ5b/txydKrWrRPl4MHuZfisFnKlZHmq4yw==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/passport-gitlab2/-/passport-gitlab2-5.0.0.tgz",
"integrity": "sha512-cXQMgM6JQx9wHVh7JLH30D8fplfwjsDwRz+zS0pqC8JS+4bNmc1J04NGp5g2M4yfwylH9kQRrMN98GxMw7q7cg==",
"requires": {
"passport-oauth2": "^1.4.0"
}
......@@ -21446,11 +21426,6 @@
}
}
},
"pkginfo": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.2.3.tgz",
"integrity": "sha1-cjnEKl72wwuPMoQ52bn/cQQkkPg="
},
"platform": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/platform/-/platform-1.3.5.tgz",
......
......@@ -4,8 +4,6 @@
"private": true,
"dependencies": {
"@gitterhq/faye-redis": "^0.4.4",
"@gitterhq/passport-github": "0.1.8-g",
"@gitterhq/passport-oauth2": "^1.1.2-b",
"@gitterhq/services": "^1.23.0",
"@gitterhq/translations": "^1.9.0",
"apn": "1.7.5",
......@@ -131,12 +129,13 @@
"octonode": "^0.6.8",
"on-headers": "^1.0.1",
"parse-links": "~0.1.0",
"passport": "^0.2.2",
"passport-gitlab2": "^4.0.0",
"passport": "^0.4.0",
"passport-github2": "^0.1.11",
"passport-gitlab2": "^5.0.0",
"passport-google-oauth2": "^0.1.6",
"passport-linkedin-oauth2": "^1.4.0",
"passport-oauth2-client-password": "^0.1.2",
"passport-twitter": "^1.0.3",
"passport-twitter": "^1.0.4",
"permessage-deflate": "^0.1.2",
"readme-badger": "^0.3.0",
"redis-lock": "0.0.8",
......@@ -281,6 +280,7 @@
"nodeselektor": "ns",
"node-gyp": "node-gyp",
"prettier": "prettier",
"task-js": "gulp clientapp:compile:webpack",
"task-css": "gulp css:compile",
"task-fasttest": "gulp test:test --test-fast",
"task-validate-diff": "gulp validate-eslint-diff",
......
......@@ -80,7 +80,7 @@
<div class="explore-pill-list-section__header-secondary-action-annotation">
Can't find what you're looking for?
</div>
<button class="subdued-button-jaffa--xsmall js-explore-create-button">
<button class="subdued-button-caribbean--xsmall js-explore-create-button">
Create your own
</button>
</div>
......
......@@ -10,7 +10,6 @@
{{/if}}
</section>
{{#if isRepo}}
<h3 class="share-view__heading">
README badge ( <img class="share-view__badge" src="{{badgeUrl}}"> )
</h3>
......@@ -22,11 +21,12 @@
<button class="button-jaffa--small js-copy" data-clipboard-text="{{badgeMD}}">Copy</button>
{{/if}}
{{#if allowBadgePR}}
<button class='button-jaffa--small js-badge'>Send Pull Request</button>
{{#if isRepo}}
{{#if allowBadgePR}}
<button class='button-jaffa--small js-badge'>Send Pull Request</button>
{{/if}}
{{/if}}
</section>
{{/if}}
{{#if isPublic}}
<h3 class="share-view__heading">
......
......@@ -139,10 +139,10 @@
<h1>
{{ __ "Some of our communities"}}
<a class="button-jaffa--small communites-panel-heading-button" href="/login?action=signup&source=communities&returnTo=%23createcommunity">
<a class="button-caribbean--small communites-panel-heading-button" href="/login?action=signup&source=communities&returnTo=%23createcommunity">
{{ __ "Create your own"}}
</a>
<a class="button-caribbean--small communites-panel-heading-button" href="/explore/tags/?action=explore&source=homepage">
<a class="button-jaffa--small communites-panel-heading-button" href="/explore/tags/?action=explore&source=homepage">
<span class='desktopOnly'>{{ __ "Explore rooms"}}</span>
<span class='exceptDesktop'>{{ __ "Explore"}}</span>
</a>
......
......@@ -18,11 +18,11 @@ switch (nconf.get('NODE_ENV')) {
case 'beta':
var branch = appVersion.getBranch();
stagingText = branch ? branch.split('/').pop() : 'BETA';
stagingLink = appVersion.getGithubLink();
stagingLink = appVersion.getGitlabLink();
break;
case 'dev':
stagingText = 'DEV';
stagingLink = 'https://github.com/troupe/gitter-webapp/tree/develop';
stagingLink = 'https://gitlab.com/gitlab-org/gitter/webapp';
break;
}
......
......@@ -3,8 +3,7 @@
var env = require('gitter-web-env');
var config = env.config;
var logger = env.logger;
var GitHubStrategy = require('@gitterhq/passport-github').Strategy;
var TokenStateProvider = require('@gitterhq/passport-oauth2').TokenStateProvider;
var GitHubStrategy = require('passport-github2').Strategy;
var callbackUrlBuilder = require('./callback-url-builder');
function githubUpgradeCallback(req, accessToken, refreshToken, params, _profile, done) {
......@@ -28,14 +27,15 @@ function githubUpgradeCallback(req, accessToken, refreshToken, params, _profile,
});
}
var statePassphrase = config.get('github:statePassphrase');
var githubUpgradeStrategy = new GitHubStrategy(
{
clientID: config.get('github:client_id'),
clientSecret: config.get('github:client_secret'),
callbackURL: callbackUrlBuilder(),
stateProvider: statePassphrase && new TokenStateProvider({ passphrase: statePassphrase }),
// Prevent CSRF by adding a state query parameter through the OAuth flow that is connected to the users session.
// These options come from the `require('passport-oauth2').Strategy`,
// https://github.com/jaredhanson/passport-oauth2/blob/master/lib/strategy.js
state: true,
skipUserProfile: true,
passReqToCallback: true
},
......
......@@ -7,8 +7,7 @@ var stats = env.stats;
var logger = env.logger;
var moment = require('moment');
var GitHubStrategy = require('@gitterhq/passport-github').Strategy;
var TokenStateProvider = require('@gitterhq/passport-oauth2').TokenStateProvider;
var GitHubStrategy = require('passport-github2').Strategy;
var extractGravatarVersion = require('gitter-web-avatars/server/extract-gravatar-version');
var gaCookieParser = require('../ga-cookie-parser');
var userService = require('gitter-web-users');
......@@ -169,14 +168,15 @@ function githubUserCallback(req, accessToken, refreshToken, params, _profile, do
.asCallback(done);
}
var statePassphrase = config.get('github:statePassphrase');
var githubUserStrategy = new GitHubStrategy(
{
clientID: config.get('github:user_client_id'),
clientSecret: config.get('github:user_client_secret'),
callbackURL: callbackUrlBuilder(),
stateProvider: statePassphrase && new TokenStateProvider({ passphrase: statePassphrase }),
// Prevent CSRF by adding a state query parameter through the OAuth flow that is connected to the users session.
// These options come from the `require('passport-oauth2').Strategy`,
// https://github.com/jaredhanson/passport-oauth2/blob/master/lib/strategy.js
state: true,
skipUserProfile: true,
passReqToCallback: true
},
......
......@@ -44,6 +44,10 @@ var gitlabStrategy = new GitLabStrategy(
clientID: config.get('gitlaboauth:client_id'),
clientSecret: config.get('gitlaboauth:client_secret'),
callbackURL: callbackUrlBuilder('gitlab'),
// Prevent CSRF by adding a state query parameter through the OAuth flow that is connected to the users session.
// These options come from the `require('passport-oauth2').Strategy`,
// https://github.com/jaredhanson/passport-oauth2/blob/master/lib/strategy.js
state: true,
passReqToCallback: true,
scope: ['read_user', 'api'],
scopeSeparator: ' '
......
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