Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 2246c46

Browse files
author
tensorflow
committed
UI updates for project management
1 parent c933f53 commit 2246c46

22 files changed

+212
-40
lines changed

._README.md

4 KB
Binary file not shown.

.eslintrc

100644100755
File mode changed.

.gitignore

100644100755
File mode changed.

app.js

100644100755
File mode changed.

bin/www

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ const server = http.createServer(app);
3434
/**
3535
* Listen on provided port, on all network interfaces.
3636
*/
37-
server.listen(port);
3837

38+
server.listen(port, '192.168.1.100');
39+
//console.error(server.address());
3940

4041
const onError = (error) => {
4142
if (error.syscall !== 'listen') {
@@ -69,7 +70,7 @@ const onListening = () => {
6970
const bind = _.isString(addr)
7071
? `pipe ${addr}`
7172
: `port ${addr.port}`;
72-
debug(`Listening on ${bind}`);
73+
console.error(`Listening on ${bind}`);
7374
};
7475

7576
server.on('error', onError);

config/default.js

100644100755
Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,13 @@ const fs = require('fs');
1414
*/
1515

1616
module.exports = {
17-
PORT: process.env.PORT || 3000, // eslint-disable-line no-magic-numbers
17+
PORT: process.env.PORT || 3002, // eslint-disable-line no-magic-numbers
1818
LOG_LEVEL: process.env.LOG_LEVEL || 'info',
19-
TOPIC: process.env.TOPIC || 'events_topic',
20-
GITHUB_SECRET_TOKEN: process.env.GITHUB_SECRET_TOKEN || '',
21-
GITLAB_SECRET_TOKEN: process.env.GITLAB_SECRET_TOKEN || '',
22-
WATCH_REPOS: process.env.WATCH_REPOS ? process.env.WATCH_REPOS.split(',') : [
23-
'https://github.com/cwdcwd/challengeFetcher'
24-
],
19+
TOPIC: process.env.TOPIC || 'tc-x-events',
20+
GITHUB_SECRET_TOKEN: process.env.GITHUB_SECRET_TOKEN || 'ghostar',
21+
GITLAB_SECRET_TOKEN: process.env.GITLAB_SECRET_TOKEN || 'ghostar',
2522
KAFKA_OPTIONS: {
26-
kafkaHost: process.env.KAFKA_HOST || 'localhost:9092',
27-
sslOptions: {
28-
cert: process.env.KAFKA_CLIENT_CERT || fs.readFileSync('./kafka_client.cer'),
29-
key: process.env.KAFKA_CLIENT_CERT_KEY || fs.readFileSync('./kafka_client.key')
30-
}
31-
}
23+
kafkaHost: process.env.KAFKA_HOST || 'localhost:9092'
24+
},
25+
MONGODB_URL: process.env.MONGODB_URI || 'mongodb://heroku_mx614sjn:[email protected]:41464/heroku_mx614sjn'
3226
};

config/sample-local.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

models/Challenge.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2018 TopCoder, Inc. All rights reserved.
3+
*/
4+
5+
/**
6+
* This module contains the schema of the Challenge.
7+
*
8+
* @author TCSCODER
9+
* @version 1.0
10+
*/
11+
'use strict';
12+
13+
const mongoose = require('mongoose');
14+
15+
const schema = new mongoose.Schema({
16+
title: {type: String, required: true},
17+
tcDirectId: {type: Number, required: true},
18+
repoUrl: {type: String, required: true},
19+
rocketChatWebhook: {type: String, required: true},
20+
rocketChatChannelName: {type: String, required: true},
21+
archieved: {type: String, required: true},
22+
username: {type: String, required: true}
23+
});
24+
module.exports = schema;

models/IssueCreatedEvent.js

100644100755
File mode changed.

models/IssueUpdatedEvent.js

100644100755
File mode changed.

models/PullRequestClosedEvent.js

100644100755
File mode changed.

models/PullRequestCreatedEvent.js

100644100755
File mode changed.

models/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
*/
1111
'use strict';
1212

13+
const config = require('config');
14+
const mongoose = require('mongoose');
15+
mongoose.Promise = global.Promise;
16+
const connection = mongoose.createConnection(config.MONGODB_URL);
1317
const IssueCreatedEvent = require('./IssueCreatedEvent');
1418
const IssueUpdatedEvent = require('./IssueUpdatedEvent');
1519
const CommentCreatedEvent = require('./CommentCreatedEvent');
@@ -29,5 +33,6 @@ module.exports = {
2933
UserUnassignedEvent,
3034
PullRequestCreatedEvent,
3135
PullRequestClosedEvent,
32-
LabelUpdatedEvent
36+
LabelUpdatedEvent,
37+
Challenge: connection.model('Challenge', require('./Challenge')),
3338
};

package-lock.json

100644100755
Lines changed: 166 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"joi": "^11.0.2",
1919
"kafka-node": "^2.2.3",
2020
"morgan": "~1.8.1",
21+
"mongoose": "^4.12.3",
2122
"winston": "^2.3.1"
2223
},
2324
"devDependencies": {

routes/middlewares/AsyncWrapper.js

100644100755
File mode changed.

0 commit comments

Comments
 (0)