Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(src/server): add hacked patches for https and lower mongodb version #1

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/server/src/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
let http = require('http')
let fs = require('fs');
let https = require('https')

if (process.env.NODE_ENV === 'production') {
require('@google-cloud/trace-agent').start();
Expand Down Expand Up @@ -206,12 +207,16 @@ async.series([
console.log('! '.yellow + err)
}


console.log(`${'\n✓ '.bold.green}bootstrapped for ${app.get('env')}, app listening on ${config.server.http.host}:${config.server.localport}`.bold)
log.info(`✓ bootstrapped for ${app.get('env')}!!! App listening on ${config.server.http.host}:${config.server.http.port}`)
// eslint-disable-next-line no-console
console.log('App is initialized')
let server = http.createServer(app)

let privateKey = fs.readFileSync(path.join(__dirname, '..', '..', '..', 'star_pingcap.net.key'), 'utf8');
let certificate = fs.readFileSync(path.join(__dirname, '..', '..', '..', 'STAR_pingcap_net.chain.crt'), 'utf8');
let credentials = { key: privateKey, cert: certificate };
let server = https.createServer(credentials, app)

// eslint-disable-next-line no-console
console.log('Server is created')
const listener = server.listen(config.server.localport, function () {
Expand Down
7 changes: 5 additions & 2 deletions src/server/src/documents/cla.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ const CLA = mongoose.model('CLA', CLASchema)
}
}) */

// add a full wildcard index for better indexing
CLA.collection.createIndex({ '$**' : 1 })
Object.keys(CLASchema.obj).forEach(function (field) {
console.log({ [field]: 1 })
CLA.collection.createIndex({ [field]: 1 })
})

module.exports = {
CLA: CLA
}