Skip to content

Commit 28a6f62

Browse files
authored
Merge pull request #1365 from CVEProject/no-tls-mongo-update
No tls mongo update
2 parents 1200fd8 + cbb8b12 commit 28a6f62

File tree

12 files changed

+4790
-5266
lines changed

12 files changed

+4790
-5266
lines changed

.github/workflows/test-integration.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,21 @@ jobs:
1717
docker compose --file docker/docker-compose.yml build
1818
docker compose --file docker/docker-compose.yml up -d
1919
- name: Sleep
20-
run: bash -c "while ! docker compose --file docker/docker-compose.yml logs --tail=10 cveawg | grep -q 'Serving on port'; do sleep 1; done"
20+
run: |
21+
dockercompose="docker compose --file docker/docker-compose.yml"
22+
attempts=60
23+
while ! $dockercompose logs cveawg | grep -q 'Serving on port'; do
24+
attempts=$(expr $attempts - 1)
25+
if [ $($dockercompose ps --status running -q | wc -l) -eq 2 ] && [ $attempts -gt 0 ]; then
26+
sleep 1
27+
$dockercompose logs || true
28+
continue
29+
fi
30+
$dockercompose ps || true
31+
$dockercompose logs || true
32+
echo "==== COULD NOT FIND 'Serving on port' in cveawg output OR one of the services died ====" 1>&2
33+
exit 1
34+
done
2135
- name: Run Tests
2236
run: docker compose -f docker/docker-compose.yml exec -T cveawg npm run test:integration
2337
continue-on-error: false

docker/docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
version: '3'
21
services:
32
docdb:
43
# use a mongo image that most closely matches the DocumentDB API
5-
image: mongo:3.6.20-xenial
4+
image: mongo:5.0
65
container_name: mongo
76
env_file: .docker-env
87
networks: ["cve-services"]

package-lock.json

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

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
2727
"standard": "^16.0.3"
2828
},
2929
"dependencies": {
30+
"bson": "^6.10.1",
3031
"ajv": "^8.6.2",
3132
"ajv-formats": "^2.1.1",
32-
"argon2": "^0.29",
33+
"argon2": "^0.41.1",
3334
"config": "^3.3.6",
3435
"cors": "^2.8.5",
3536
"crypto-random-string": "^3.3.1",
@@ -45,7 +46,7 @@
4546
"lodash": "^4.17.21",
4647
"luxon": "^3.4.4",
4748
"mongo-cursor-pagination": "^8.1.3",
48-
"mongoose": "^5.13.20",
49+
"mongoose": "^8.8.3",
4950
"mongoose-aggregate-paginate-v2": "1.0.6",
5051
"morgan": "^1.9.1",
5152
"node-dev": "^7.4.3",
@@ -59,6 +60,7 @@
5960
"winston": "^3.2.1",
6061
"yamljs": "^0.3.0"
6162
},
63+
"overrides": { "mongo-cursor-pagination": { "bson": "^6.10.1" } },
6264
"apidoc": {
6365
"name": "CVE-Services",
6466
"version": "0.0.0",

src/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ app.use((req, res, next) => {
4949
// Connect to MongoDB database
5050
const dbConnectionStr = dbUtils.getMongoConnectionString()
5151
mongoose.connect(dbConnectionStr, {
52-
useNewUrlParser: true,
53-
useUnifiedTopology: true,
54-
useFindAndModify: false,
55-
useCreateIndex: true
52+
tls: false
5653
})
5754

5855
// database connection

src/scripts/populate-cve.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ global.mongoose = mongoose
2525
const dbConnectionStr = dbUtils.getMongoConnectionString()
2626
mongoose.connect(dbConnectionStr, {
2727
useNewUrlParser: true,
28-
useUnifiedTopology: false,
29-
useFindAndModify: false
28+
useUnifiedTopology: false
3029
})
3130

3231
// database connection

src/scripts/populate.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const dbConnectionStr = dbUtils.getMongoConnectionString()
4545
mongoose.connect(dbConnectionStr, {
4646
useNewUrlParser: true,
4747
useUnifiedTopology: false,
48-
useFindAndModify: false,
4948
autoIndex: false
5049
})
5150

src/scripts/templateScript.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ const error = new errors.IDRError()
1818
const dbConnectionStr = dbUtils.getMongoConnectionString()
1919
mongoose.connect(dbConnectionStr, {
2020
useNewUrlParser: true,
21-
useUnifiedTopology: false,
22-
useFindAndModify: false
21+
useUnifiedTopology: false
2322
})
2423

2524
const db = mongoose.connection

test-http/docker/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3'
21
services:
32
demon:
43
container_name: demon

test/integration-tests/cve/cursorPaginationTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ describe('Testing Get cve_cursor endpoint', () => {
156156
// Request page 2
157157
await requester.get('/api/cve_cursor?limit=2&next_page=' + next + '&time_modified.lt=' + currentDate)
158158
.set(constants.headers)
159-
.then((res, err) => {
159+
.then(async (res, err) => {
160160
expect(err).to.be.undefined
161161
expect(res).to.have.status(200)
162162

0 commit comments

Comments
 (0)