Skip to content
This repository was archived by the owner on Apr 19, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
691 commits
Select commit Hold shift + click to select a range
8545be3
removed snakecase
wyattjoh Jan 8, 2018
55c2c00
Merge branch 'next' into fix-live-status-changes
wyattjoh Jan 8, 2018
9513502
Merge pull request #1255 from coralproject/fix-live-status-changes
wyattjoh Jan 8, 2018
6e8b28c
Translation for hide off topic comments
Jan 9, 2018
37d1f33
Translation update to make it more appropriate.
Jan 9, 2018
2bcb324
Merge branch 'next' into fix-set-username
cvle Jan 9, 2018
a2eb474
Fully implement SetUsername
cvle Jan 9, 2018
0705282
updated tests
okbel Jan 9, 2018
fb26d67
updated tests
okbel Jan 9, 2018
4490ea5
Merge branch 'next' of github.com:coralproject/talk into next
okbel Jan 9, 2018
54b504e
typo
okbel Jan 9, 2018
579644c
Adding doNotStore
okbel Jan 9, 2018
ff016e2
Adding TALK_PERSPECTIVE_DO_NOT_STORE to the docs
okbel Jan 9, 2018
13347a6
Merge branch 'next' into fix-set-username
cvle Jan 9, 2018
1a39635
Merge pull request #1257 from larrylizhao/feature/RefineTranslation
kgardnr Jan 9, 2018
eb33eb7
Merge branch 'master' into toxic-update
kgardnr Jan 9, 2018
abc6cf6
Merge pull request #1258 from coralproject/toxic-update
kgardnr Jan 9, 2018
3957934
Merge branch 'master' into next
kgardnr Jan 9, 2018
e61c09f
Merge branch 'next' into fix-set-username
kgardnr Jan 9, 2018
13bf20d
Merge pull request #1259 from coralproject/fix-set-username
kgardnr Jan 9, 2018
d3c1286
extracted events from opts
wyattjoh Jan 9, 2018
7f25f46
extracted more funcs
wyattjoh Jan 9, 2018
25e29cb
extracted asset url
wyattjoh Jan 9, 2018
20f9bba
Merge branch 'master' into embed-events
wyattjoh Jan 9, 2018
20453df
refactor to cleanup
wyattjoh Jan 9, 2018
c43051c
Small grammar fixes
losowsky Jan 9, 2018
7bdfb55
Merge pull request #1260 from coralproject/embed-events
wyattjoh Jan 9, 2018
0067714
Merge branch 'master' into losowsky-patch-1
kgardnr Jan 9, 2018
bf76f04
Merge pull request #1261 from coralproject/losowsky-patch-1
kgardnr Jan 9, 2018
63bd630
Merge branch 'master' into next
kgardnr Jan 9, 2018
36f7c31
Fix deselect bug of action menu in ff
cvle Jan 10, 2018
dca85ad
Merge branch 'next' into firefox-actionmenu-deselect
cvle Jan 10, 2018
bdcc927
Add some margin to loadmore
cvle Jan 10, 2018
25ac66e
Merge branch 'next' into firefox-actionmenu-deselect
okbel Jan 10, 2018
9c75f3f
Adding missing proptypes
okbel Jan 10, 2018
5db8209
Removing replyButton in Stream is closed
okbel Jan 10, 2018
e1ead8f
Adding e2e for the stream - open and closed asset features
okbel Jan 10, 2018
24f7405
remove uncommitted
okbel Jan 10, 2018
1898941
Merge branch 'master' into reply
okbel Jan 10, 2018
7036aa5
Use lodash with es modules
cvle Jan 10, 2018
4c3d3fb
Updated tests
okbel Jan 10, 2018
9c7b6e0
Merge branch 'reply' of github.com:coralproject/talk into reply
okbel Jan 10, 2018
845c99d
Updated tests
okbel Jan 10, 2018
6a3be92
Merge branch 'next' into reply
cvle Jan 10, 2018
2ef3e29
Merge branch 'reply' of github.com:coralproject/talk into reply
okbel Jan 10, 2018
caf2b88
Fix typo
cvle Jan 10, 2018
3687fc1
adjusted build script to build the next branch and release it
wyattjoh Jan 10, 2018
bbdd69b
removed debug...
wyattjoh Jan 10, 2018
fb7ff24
Merge pull request #1266 from coralproject/circle-next
wyattjoh Jan 10, 2018
9d8867b
Merge branch 'next' into reply
cvle Jan 10, 2018
d0d9a38
Merge branch 'next' into firefox-actionmenu-deselect
cvle Jan 10, 2018
1b373b5
Merge branch 'next' into lodash-size-opt
cvle Jan 10, 2018
1e372b5
Merge pull request #1265 from coralproject/lodash-size-opt
wyattjoh Jan 10, 2018
75d1bb2
Merge branch 'next' into firefox-actionmenu-deselect
wyattjoh Jan 10, 2018
7d6fd69
Merge branch 'next' into reply
okbel Jan 10, 2018
acc2e00
Merge pull request #1264 from coralproject/reply
wyattjoh Jan 10, 2018
44648fa
fixed perms issue
wyattjoh Jan 10, 2018
7127aea
Icon User Drawer
okbel Jan 10, 2018
eef2578
ignore user box over flow, fixed
okbel Jan 10, 2018
1f6d38c
Updating copy
okbel Jan 10, 2018
d055e0b
Feature Button
okbel Jan 10, 2018
ec38b83
Merge branch 'next' into perm-fix
wyattjoh Jan 10, 2018
d35d0e3
Merge branch 'next' into firefox-actionmenu-deselect
wyattjoh Jan 10, 2018
14dd9ac
changed copy for error
wyattjoh Jan 10, 2018
1f2caad
Finished drafting translations. Let's spin it up for a test run
Jan 11, 2018
6e813e9
Translations refinement for plugins
Jan 11, 2018
89c929f
Fix suspect label
cvle Jan 11, 2018
139d319
Merge branch 'next' into perm-fix
cvle Jan 11, 2018
f89a501
Merge branch 'next' into suspect-label
cvle Jan 11, 2018
e5c3474
dutch translation was not added yet without adding it to i18n.js - an…
Jan 11, 2018
11b38f7
Fix no status history error
cvle Jan 11, 2018
737b77a
Merge pull request #1269 from larrylizhao/feature/pluginTranslation
kgardnr Jan 11, 2018
d922761
Merge branch 'next' into firefox-actionmenu-deselect
kgardnr Jan 11, 2018
1337873
Remove unwanted scroll in configure
cvle Jan 11, 2018
210b0ab
Only show scrollbars when necessary
cvle Jan 11, 2018
2269c91
Restore shortcut functionality
cvle Jan 11, 2018
92b506c
Merge pull request #1270 from coralproject/suspect-label
kgardnr Jan 11, 2018
eb5b736
Merge branch 'next' into fix-no-status-history
kgardnr Jan 11, 2018
90f1ef0
Change Flags to Reports and make a bit bigger
cvle Jan 11, 2018
2bc60b1
fixes
okbel Jan 11, 2018
9187231
Merge branch 'next' into account-history
okbel Jan 11, 2018
8cdc881
Merge branch 'next' into flags-enh
cvle Jan 11, 2018
1dcf297
added email fixes
wyattjoh Jan 11, 2018
6d3d717
Merge pull request #1271 from coralproject/fix-no-status-history
kgardnr Jan 11, 2018
f2e63b7
Merge branch 'next' into fix-scrollbars
kgardnr Jan 11, 2018
24b6a4f
Merge pull request #1272 from coralproject/fix-scrollbars
kgardnr Jan 11, 2018
f340cdd
Merge branch 'next' into selected-bug
kgardnr Jan 11, 2018
be40594
Merge pull request #1273 from coralproject/selected-bug
kgardnr Jan 11, 2018
f51eda4
Merge branch 'next' into flags-enh
kgardnr Jan 11, 2018
54ec9ea
Merge pull request #1275 from coralproject/flags-enh
kgardnr Jan 11, 2018
9b4dcd8
Merge branch 'next' into account-history
kgardnr Jan 11, 2018
1e85894
Merge pull request #1274 from coralproject/account-history
kgardnr Jan 11, 2018
fddba1e
Merge branch 'next' into email-send-fix
kgardnr Jan 11, 2018
d837562
hides the user status histories and tokens from the auth endpoints, w…
wyattjoh Jan 11, 2018
eec7d0f
Merge branch 'next' into hide-user-status-auth
wyattjoh Jan 11, 2018
4d65052
allow moderators to view role
wyattjoh Jan 11, 2018
838083e
Merge branch 'next' into perm-fix
kgardnr Jan 11, 2018
5865c30
added a plugin context
wyattjoh Jan 11, 2018
4eda547
removed config from context
wyattjoh Jan 11, 2018
f070d47
Merge pull request #1267 from coralproject/perm-fix
kgardnr Jan 11, 2018
943c3e9
Merge branch 'next' into hide-user-status-auth
okbel Jan 11, 2018
7e465f7
Merge branch 'next' into email-send-fix
okbel Jan 11, 2018
f79f521
Merge branch 'next' into plugin-context
okbel Jan 11, 2018
07826a9
fixing spelling :(
wyattjoh Jan 11, 2018
4c6ec75
Merge pull request #1277 from coralproject/hide-user-status-auth
kgardnr Jan 11, 2018
ca49b37
Merge branch 'next' into email-send-fix
kgardnr Jan 11, 2018
a4e8ea9
fixed import typo
wyattjoh Jan 11, 2018
f269829
Merge branch 'next' into plugin-context
wyattjoh Jan 11, 2018
81d2927
Merge pull request #1278 from coralproject/plugin-context
wyattjoh Jan 11, 2018
7706a05
Merge branch 'next' into email-send-fix
wyattjoh Jan 11, 2018
7f291cf
Merge pull request #1276 from coralproject/email-send-fix
wyattjoh Jan 11, 2018
c1f5450
Merge branch 'master' into next
kgardnr Jan 11, 2018
7f02d4f
fixed circle.yml
wyattjoh Jan 11, 2018
876f4ef
updated docs for 4.0
wyattjoh Jan 11, 2018
204b442
added deprecation warning
wyattjoh Jan 12, 2018
c906b2d
Merge branch 'next' into docs
kgardnr Jan 12, 2018
bb9a939
Small wording tweak
kgardnr Jan 12, 2018
d56c190
Merge pull request #1279 from coralproject/docs
wyattjoh Jan 12, 2018
0abc2ca
replaced eslint:recommended with prettier
wyattjoh Jan 12, 2018
c19a6c8
Merge branch 'next' into firefox-actionmenu-deselect
wyattjoh Jan 12, 2018
6bad3fd
Dotted some sentences.
Jan 12, 2018
0a99ae5
Fixed consistency: “Afgewezen wachtrij” implies that this name is use…
Jan 12, 2018
a53bb66
Fixed SI units.
Jan 12, 2018
56bd304
Fixed consistency: a “bio” has been both named “biografie” and “bio”.…
Jan 12, 2018
8867fd5
Fixed consistency: “Voor-mod” is never used. “Pre-moderatie” would be…
Jan 12, 2018
9333b40
Fixed consistency: Community guidelines are used both with and withou…
Jan 12, 2018
988b39f
Fixed call-to-action: “Kom in gesprek!” sounds a bit weird to me.
Jan 12, 2018
9ce14ac
More syncs
cvle Jan 12, 2018
951f16f
Improved email message: ‘je gebruiker’ is always referred to as ‘je a…
Jan 12, 2018
9762f34
End of line
cvle Jan 12, 2018
34a0e31
After discussion: changed status to shorter “Pre-moderatie”
Jan 12, 2018
ebe6341
Merge pull request #1 from sanoma/feature/MDN-10616_translation_addit…
daan944 Jan 12, 2018
bf77ddc
Merge branch 'master' into master
TBeijen Jan 12, 2018
1ccd36e
prettier
cvle Jan 12, 2018
93bda87
Merge pull request #1153 from coralproject/next
wyattjoh Jan 12, 2018
e256b0d
Adding format to admin comment - CommentFormatter
okbel Jan 12, 2018
86c4d70
Adding changes to the comments on the User Drawer Detail
okbel Jan 12, 2018
77d83e0
Wrong name
okbel Jan 12, 2018
d69b1f9
Merge branch 'master' into action-index
wyattjoh Jan 12, 2018
3606726
Merge branch 'master' into firefox-actionmenu-deselect
wyattjoh Jan 12, 2018
7885b02
Merge pull request #1262 from coralproject/firefox-actionmenu-deselect
wyattjoh Jan 12, 2018
25c178b
Merge branch 'master' into formatting
wyattjoh Jan 13, 2018
ea79982
Merge branch 'master' into action-index
cvle Jan 15, 2018
bfa2f6e
Updates
okbel Jan 15, 2018
1f0e9da
Merge branch 'formatting' of github.com:coralproject/talk into format…
okbel Jan 15, 2018
2684ac4
missing brackets
okbel Jan 15, 2018
6aece16
Add userFlagged subscription
cvle Jan 16, 2018
b1adfe8
Add a little pause in e2e test
cvle Jan 16, 2018
1cf2bda
Merge pull request #1286 from coralproject/e2e-pause
cvle Jan 16, 2018
45d4c79
added reply bug
wyattjoh Jan 16, 2018
9eec280
added time syncing
wyattjoh Jan 16, 2018
13fc91b
Merge pull request #1287 from coralproject/ci-time-sync
cvle Jan 16, 2018
b709cb4
refactored publicCreate
wyattjoh Jan 16, 2018
b11a730
Merge branch 'master' into reply-on-hidden-comment
wyattjoh Jan 16, 2018
af40a85
Merge branch 'master' into master
wyattjoh Jan 16, 2018
66cfd20
Merge branch 'master' into master
wyattjoh Jan 16, 2018
e3cdad1
added asset re-write
wyattjoh Jan 16, 2018
45d6800
added dry mode
wyattjoh Jan 17, 2018
519480c
Fix counts not decreasing on mutations
cvle Jan 17, 2018
ee78f08
Implement live update for reported users
cvle Jan 17, 2018
426d7db
Merge branch 'master' into formatting
kgardnr Jan 17, 2018
f282aa4
Implement dangling
cvle Jan 17, 2018
3c52d58
Cleanup Dangling
cvle Jan 17, 2018
cc320cf
Remove leftover console
cvle Jan 17, 2018
7ca8943
added configuration options for webpack
wyattjoh Jan 17, 2018
68598d3
cleanup for logic
wyattjoh Jan 17, 2018
e048491
Merge pull request #1291 from coralproject/webpack-sourcemaps
wyattjoh Jan 17, 2018
3938b78
introduced some locale fixes
wyattjoh Jan 17, 2018
c612902
fixed styles
wyattjoh Jan 17, 2018
4960b34
fixed deploy script
wyattjoh Jan 17, 2018
08b1cad
Merge pull request #1293 from coralproject/deploy-script
wyattjoh Jan 17, 2018
ac62cbf
added new closeAsset mutation and support in UI
wyattjoh Jan 17, 2018
dbfd0fd
Merge branch 'master' into master
daan944 Jan 18, 2018
5f3da9a
Ignore own updates
cvle Jan 18, 2018
ec9a57b
Merge branch 'master' into formatting
kgardnr Jan 18, 2018
8ea3ab9
Merge pull request #1283 from coralproject/formatting
kgardnr Jan 18, 2018
3255b8d
Merge branch 'master' into close-asset-now
kgardnr Jan 18, 2018
c1ff7e9
Merge branch 'master' into asset-rewrite
kgardnr Jan 18, 2018
f306d54
Merge branch 'master' into action-index
kgardnr Jan 18, 2018
a010302
Merge branch 'master' into reply-on-hidden-comment
kgardnr Jan 18, 2018
56001d7
Merge pull request #1284 from coralproject/action-index
kgardnr Jan 18, 2018
022a574
Merge branch 'master' into reply-on-hidden-comment
kgardnr Jan 18, 2018
c99411b
Merge pull request #1288 from coralproject/reply-on-hidden-comment
kgardnr Jan 18, 2018
df2bce4
Merge branch 'master' into asset-rewrite
kgardnr Jan 18, 2018
2345daf
Merge branch 'master' into locale-local-storage
kgardnr Jan 18, 2018
06f308c
Merge pull request #1290 from coralproject/asset-rewrite
kgardnr Jan 18, 2018
fd5eb7d
Merge branch 'master' into locale-local-storage
kgardnr Jan 18, 2018
317541a
Merge branch 'master' into close-asset-now
kgardnr Jan 18, 2018
fa83ba9
Merge pull request #1292 from coralproject/locale-local-storage
wyattjoh Jan 18, 2018
127f0c1
Merge branch 'master' into close-asset-now
wyattjoh Jan 18, 2018
716a61a
Merge branch 'master' into master
wyattjoh Jan 18, 2018
2a6543b
don't query username count twice
cvle Jan 18, 2018
3c9b4bd
Merge pull request #1294 from coralproject/close-asset-now
kgardnr Jan 18, 2018
6f55189
Merge branch 'master' into master
kgardnr Jan 18, 2018
c1a26d2
Split community queries
cvle Jan 18, 2018
40539bf
Set limit to 10 when searching for people
cvle Jan 18, 2018
7d022ed
Refactor Community
cvle Jan 18, 2018
ddf3816
Better notifications
cvle Jan 18, 2018
544ef08
Add previous username to notification
cvle Jan 18, 2018
7233169
Refactor
cvle Jan 18, 2018
a111439
Only increme once
cvle Jan 18, 2018
8f1d9f0
added encoding for the user data as json with proper encoding/escaping
wyattjoh Jan 18, 2018
844ce5d
fixed json parse error
wyattjoh Jan 18, 2018
14d035a
Merge branch 'master' into user-json
wyattjoh Jan 18, 2018
49d20db
replaced homegrown with package
wyattjoh Jan 18, 2018
4bbd561
fix to cli
wyattjoh Jan 18, 2018
7258c3d
added performance updates to webpack build
wyattjoh Jan 19, 2018
b2cf5ef
Merge pull request #1297 from coralproject/webpack-performance
wyattjoh Jan 19, 2018
02ca596
Merge branch 'master' into master
daan944 Jan 19, 2018
319bca3
Refactor indicator
cvle Jan 19, 2018
e2a3612
show notification on errors
cvle Jan 19, 2018
5d26f23
Prevent simulaneouse mutations (of the same one)
cvle Jan 19, 2018
e653a5f
Merge branch 'master' into live-reported
cvle Jan 19, 2018
25dd979
Naming
cvle Jan 19, 2018
669eb36
Merge branch 'live-reported' of ssh://github.com/coralproject/talk in…
cvle Jan 19, 2018
a402817
Merge branch 'master' into user-json
wyattjoh Jan 19, 2018
bf752a5
Don't decrease count twice
cvle Jan 19, 2018
a9be049
Merge pull request #1296 from coralproject/user-json
wyattjoh Jan 19, 2018
392c551
Fix modqueue counts
cvle Jan 19, 2018
bb2ea77
Merge branch 'master' into fix-modqueue-counts
cvle Jan 19, 2018
65588f2
Merge branch 'master' into live-reported
cvle Jan 19, 2018
d827ebe
Merge branch 'master' into sanoma-master
Jan 22, 2018
468a168
Small lintin fix.
Jan 22, 2018
ca653fd
Added missing translations, added since start of nl translations.
Jan 22, 2018
15d0ecb
Don't show spinner on fetchMore
cvle Jan 22, 2018
d98a762
Merge pull request #1280 from sanoma/master
kgardnr Jan 22, 2018
66202d1
Merge branch 'master' into fix-false-spinner
kgardnr Jan 22, 2018
4be19fd
Merge pull request #1300 from coralproject/fix-false-spinner
kgardnr Jan 22, 2018
bdd2075
Merge branch 'master' into fix-modqueue-counts
kgardnr Jan 22, 2018
0528106
Merge branch 'master' into live-reported
cvle Jan 22, 2018
30dddf3
Merge pull request #1299 from coralproject/fix-modqueue-counts
kgardnr Jan 22, 2018
60c62e4
Merge branch 'master' into live-reported
cvle Jan 22, 2018
1e34af6
Fixes for report dialog
cvle Jan 22, 2018
26c109e
Removed cwd in place of __dirname
wyattjoh Jan 22, 2018
0f6cc20
Update error message
kgardnr Jan 22, 2018
3fe8a8f
Merge pull request #1301 from coralproject/fix-report-bugs
kgardnr Jan 22, 2018
81d049e
Merge branch 'master' into live-reported
kgardnr Jan 22, 2018
852b21e
Merge branch 'master' into plugin-directory
cvle Jan 22, 2018
8e84587
Merge pull request #1302 from coralproject/plugin-directory
wyattjoh Jan 22, 2018
12652d5
Merge branch 'master' into live-reported
cvle Jan 22, 2018
d101989
Merge pull request #1298 from coralproject/live-reported
wyattjoh Jan 22, 2018
97b6573
Merge remote-tracking branch 'upstream/master' into 4.0
cperryk Jan 23, 2018
057440f
Remove client/* deviations from upstream/master
cperryk Jan 23, 2018
8e2d212
Fix linting errors, restore healthcheck
cperryk Jan 24, 2018
f5dbb09
Remove e2e tests from circle build
cperryk Jan 25, 2018
192c439
Add NYM aws
Jan 25, 2018
36ce65c
Stop auto-start and skip validation
Jan 29, 2018
2d5e84b
Add temp file for release
cperryk Jan 30, 2018
f3c2e29
Use new two process talk setup
Feb 28, 2018
e69cb75
handle other envs
Feb 28, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ plugins/*
!plugins/talk-plugin-deep-reply-count
!plugins/talk-plugin-subscriber
!plugins/talk-plugin-flag-details

public
node_modules
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ client/coral-framework/graphql/introspection.json
.idea/
*.swp
*.DS_STORE
.prettierrc.json

coverage/
test/e2e/reports/
Expand Down Expand Up @@ -53,3 +54,4 @@ plugins/*
!plugins/nymag-auth

**/node_modules/*
yarn-error.log
8 changes: 7 additions & 1 deletion .nodemon.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"exec": "npm-run-all --parallel generate-introspection start:development",
"verbose": true,
"ignore": ["test/*", "client/*", "dist/*", "plugins/*/client"],
"ext": "js,json,graphql"
"ext": "js,json,graphql,yml",
"watch": [
".",
"bin/cli",
"bin/cli-serve"
]
}
1 change: 1 addition & 0 deletions Dockerfile.onbuild
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ONBUILD ARG TALK_THREADING_LEVEL=3
ONBUILD ARG TALK_DEFAULT_STREAM_TAB=all
ONBUILD ARG TALK_DEFAULT_LANG=en
ONBUILD ARG TALK_PLUGINS_JSON
ONBUILD ARG TALK_WEBPACK_SOURCE_MAP

# Bundle app source
ONBUILD COPY . /usr/src/app
Expand Down
58 changes: 38 additions & 20 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ const merge = require('lodash/merge');
const helmet = require('helmet');
const plugins = require('./services/plugins');
const compression = require('compression');
const {HELMET_CONFIGURATION} = require('./config');
const {MOUNT_PATH} = require('./url');
const { HELMET_CONFIGURATION } = require('./config');
const { MOUNT_PATH } = require('./url');
const routes = require('./routes');
const debug = require('debug')('talk:app');
const { ENABLE_TRACING, APOLLO_ENGINE_KEY, PORT } = require('./config');
const healthCheck = require('@nymdev/health-check');

const app = express();
Expand All @@ -26,7 +27,7 @@ app.use((req, res, next) => {
//==============================================================================

// Inject server route plugins.
plugins.get('server', 'app').forEach(({plugin, app: callback}) => {
plugins.get('server', 'app').forEach(({ plugin, app: callback }) => {
debug(`added plugin '${plugin.name}'`);

// Pass the app to the plugin to mount it's routes.
Expand All @@ -42,15 +43,35 @@ if (process.env.NODE_ENV !== 'test') {
app.use(morgan('dev'));
}

if (ENABLE_TRACING && APOLLO_ENGINE_KEY) {
const { Engine } = require('apollo-engine');

const engine = new Engine({
engineConfig: {
apiKey: APOLLO_ENGINE_KEY,
},
graphqlPort: PORT,
endpoint: `${MOUNT_PATH}api/v1/graph/ql`,
});

engine.start();

app.use(engine.expressMiddleware());
}

// Trust the first proxy in front of us, this will enable us to trust the fact
// that SSL was terminated correctly.
app.set('trust proxy', 1);

// Enable a suite of security good practices through helmet. We disable
// frameguard to allow crossdomain injection of the embed.
app.use(helmet(merge(HELMET_CONFIGURATION, {
frameguard: false,
})));
app.use(
helmet(
merge(HELMET_CONFIGURATION, {
frameguard: false,
})
)
);

// Compress the responses if appropriate.
app.use(compression());
Expand All @@ -69,20 +90,17 @@ app.set('view engine', 'ejs');
debug(`mounting routes on the ${MOUNT_PATH} path`);

// add health check
app.use(healthCheck({
env: [
'TALK_MONGO_URL',
'TALK_REDIS_URL',
'TALK_ROOT_URL',
'TALK_PORT'
],
required: [
'TALK_MONGO_URL',
'TALK_REDIS_URL',
'TALK_ROOT_URL',
'TALK_PORT'
]
}));
app.use(
healthCheck({
env: ['TALK_MONGO_URL', 'TALK_REDIS_URL', 'TALK_ROOT_URL', 'TALK_PORT'],
required: [
'TALK_MONGO_URL',
'TALK_REDIS_URL',
'TALK_ROOT_URL',
'TALK_PORT',
],
})
);

// Actually apply the routes.
app.use(MOUNT_PATH, routes);
Expand Down
6 changes: 3 additions & 3 deletions appspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ hooks:
- location: ./scripts/aws/AfterInstall.sh
ApplicationStart:
- location: ./scripts/aws/ApplicationStart.sh
ValidateService:
- location: ./scripts/aws/ValidateService.sh
timeout: 300
# ValidateService:
# - location: ./scripts/aws/ValidateService.sh
# timeout: 300
53 changes: 28 additions & 25 deletions bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* Module dependencies.
*/

const program = require('./commander');
const {head, map} = require('lodash');
require('./util');
const program = require('commander');
const { head, map } = require('lodash');
const Matcher = require('did-you-mean');

program
Expand All @@ -25,33 +26,35 @@ program
.parse(process.argv);

// If the command wasn't found, output help.
const cmds = map(program.commands, '_name');
const cmd = head(program.args);
if (!cmds.includes(cmd)) {
const m = new Matcher(cmds);
const similarCMDs = m.list(cmd);
const commands = map(program.commands, '_name');
const command = head(program.args);
if (!commands.includes(command)) {
const m = new Matcher(commands);
const similarCommands = m.list(command);

console.error(`cli '${cmd}' is not a talk cli command. See 'cli --help'.`);
if (similarCMDs.length > 0) {
const sc = similarCMDs.map(({value}) => `\t${value}\n`).join('');
console.error(
`cli '${command}' is not a talk cli command. See 'cli --help'.`
);
if (similarCommands.length > 0) {
const sc = similarCommands.map(({ value }) => `\t${value}\n`).join('');
console.error(`\nThe most similar commands are\n${sc}`);
}
process.exit(1);
}

/**
* When this provess exists, check to see if we have a running command, if we do
* check to see if it is still running. If it is, then kill it with a SIGINT
* signal. This is for the use case where we want to kill the process that is
* labled with the PID written out by the parent process.
*/
process.once('exit', () => {
if (
// /**
// * When this process exists, check to see if we have a running command, if we do
// * check to see if it is still running. If it is, then kill it with a SIGINT
// * signal. This is for the use case where we want to kill the process that is
// * labeled with the PID written out by the parent process.
// */
// process.once('exit', () => {
// if (

// program.runningCommand &&
program.runningCommand.killed === false &&
program.runningCommand.exitCode === null
) {
program.runningCommand.kill('SIGINT');
}
});
// // program.runningCommand &&
// program.runningCommand.killed === false &&
// program.runningCommand.exitCode === null
// ) {
// program.runningCommand.kill('SIGINT');
// }
// });
Loading