Skip to content

Commit

Permalink
Story 11250 - fix(dev-tools): upgrade mongo version (#1540)
Browse files Browse the repository at this point in the history
* fix(dev-tools): upgrade mongo version

* make api gateway disabled in dev env by default

---------

Co-authored-by: Daniel Radeau <daniel.radeau.ext@culture.gouv.fr>
Co-authored-by: Benaissa BENARBIA <ben.benarbia@gmail.com>
  • Loading branch information
3 people authored Nov 15, 2023
1 parent 34ae91a commit 35761b7
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ spring:
on-profile: gateway

gateway:
enabled: true
enabled: false
server:
ssl:
client-auth: want
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ spring:
on-profile: gateway

gateway:
enabled: true
enabled: false
server:
ssl:
client-auth: want
Expand Down
26 changes: 14 additions & 12 deletions tools/docker/mongo/mongo_cluster.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
version: '3'
version: "3"

services:
mongo-dev:
image: mongo:4.0.6
container_name: vitamui-mongo
image: mongo:7.0.2
container_name:
vitamui-mongo
# environment:
# provide your credentials here
# - MONGO_INITDB_ROOT_USERNAME=root
Expand All @@ -24,8 +25,9 @@ services:
command: mongod --replSet "rs0" --port=27018

mongo-dev2:
image: mongo:4.0.6
container_name: vitamui-mongo2
image: mongo:7.0.2
container_name:
vitamui-mongo2
# environment:
# provide your credentials here
# - MONGO_INITDB_ROOT_USERNAME=root
Expand All @@ -37,28 +39,28 @@ services:
ports:
- "27019:27019"
volumes:
# if you wish to setup additional user accounts specific per DB or with different roles you can use following entry point
# if you wish to setup additional user accounts specific per DB or with different roles you can use following entry point
- "$PWD/mongo-entrypoint/:/scripts/mongo/data"
- "$PWD/replica-set/:/scripts/mongo/replica-set"

# no --auth is needed here as presence of username and password add this option automatically
command: mongod --replSet "rs0" --port=27019

mongo-dev3:
image: mongo:4.0.6
image: mongo:7.0.2
container_name: vitamui-mongo3
# environment:
# provide your credentials here
# - MONGO_INITDB_ROOT_USERNAME=root
# - MONGO_INITDB_ROOT_PASSWORD=rootpwd
# environment:
# provide your credentials here
# - MONGO_INITDB_ROOT_USERNAME=root
# - MONGO_INITDB_ROOT_PASSWORD=rootpwd

networks:
- mongo-cluster

ports:
- "27020:27020"
volumes:
# if you wish to setup additional user accounts specific per DB or with different roles you can use following entry point
# if you wish to setup additional user accounts specific per DB or with different roles you can use following entry point
- "$PWD/mongo-entrypoint/:/scripts/mongo/data"
- "$PWD/replica-set/:/scripts/mongo/replica-set"

Expand Down
4 changes: 2 additions & 2 deletions tools/docker/mongo/mongo_dev.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: '3.5'
version: "3.5"

services:
mongo-dev:
image: mongo:4.0.6
image: mongo:7.0.2
container_name: vitamui-mongo
hostname: vitamui-mongo
# environment:
Expand Down
2 changes: 1 addition & 1 deletion tools/docker/mongo/mongo_vars_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pki_dir: "{{lookup('env','PWD')}}/../../../dev-deployment/environments/certs"
# Overwrite vitamui defaults in order to perform transparent execution of deployment scripts.

gateway:
enabled: true
enabled: false

vitamui_defaults:
folder:
Expand Down
20 changes: 10 additions & 10 deletions tools/docker/mongo/replica-set/000_replicaset_dev.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
rs.initiate({
"_id" : "rs0",
"members" : [
{
"_id" : 0,
"host" : "vitamui-mongo:27018",
"priority": 1,
"slaveDelay" : NumberLong(0),
"votes" : 1
}
]
_id: "rs0",
members: [
{
_id: 0,
host: "vitamui-mongo:27018",
priority: 1,
secondaryDelaySecs: NumberLong(0),
votes: 1,
},
],
});
2 changes: 1 addition & 1 deletion tools/docker/mongo/start_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ docker-compose -f ./mongo_dev.yml up -d
sleep 2

# Create replica set and wait a few before execution other init scripts
docker exec -it vitamui-mongo /bin/bash -c "mongo --port=27018 < /scripts/mongo/replica-set/000_replicaset_dev.js;sleep 5;mongo --port=27018 < /scripts/mongo/replica-set/00_check_replicaset.js"
docker exec -it vitamui-mongo /bin/bash -c "mongosh --port=27018 -f /scripts/mongo/replica-set/000_replicaset_dev.js;sleep 5;mongosh --port=27018 -f /scripts/mongo/replica-set/00_check_replicaset.js"

#########################

Expand Down
2 changes: 1 addition & 1 deletion tools/docker/mongo/start_docker_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ docker-compose -f ./mongo_cluster.yml up -d
sleep 2

# Create replica set and wait a few before execution other init scripts
docker exec -it vitamui-mongo /bin/bash -c "mongo --port=27018 < /scripts/mongo/replica-set/000_replicaset_dev.js;sleep 5;mongo --port=27018 < /scripts/mongo/replica-set/00_check_replicaset.js"
docker exec -it vitamui-mongo /bin/bash -c "mongosh --port=27018 -f /scripts/mongo/replica-set/000_replicaset_dev.js;sleep 5;mongosh --port=27018 -f /scripts/mongo/replica-set/00_check_replicaset.js"

#########################

Expand Down
6 changes: 4 additions & 2 deletions ui/ui-frontend/projects/identity/src/assets/config-dev.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"GATEWAY_ENABLED": true,
"GATEWAY_ENABLED": false,
"REFERENTIAL_URL": "https://dev.vitamui.com:4202",
"VERSION_RELEASE": "6.4",
"PLATFORM_NAME": "VITAM-UI",
Expand All @@ -17,7 +17,9 @@
"UI_URL": "https://dev.vitamui.com:4201",
"ARCHIVES_SEARCH_URL": null,
"PORTAL_URL": "https://dev.vitamui.com:4200",
"ALLOWED_URLS": ["/identity-api"],
"ALLOWED_URLS": [
"/identity-api"
],
"OIDC_CONFIG": {
"issuer": "https://dev.vitamui.com:8080/cas/oidc",
"redirectUri": "?",
Expand Down
6 changes: 4 additions & 2 deletions ui/ui-frontend/projects/portal/src/assets/config-dev.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"GATEWAY_ENABLED": true,
"GATEWAY_ENABLED": false,
"REFERENTIAL_URL": "https://dev.vitamui.com:4202/referential",
"VERSION_RELEASE": "6.4",
"PLATFORM_NAME": "VITAM-UI",
Expand All @@ -16,7 +16,9 @@
"UI_URL": "https://dev.vitamui.com:4200",
"ARCHIVES_SEARCH_URL": "https://dev.vitamui.com:4209/archive-search",
"PORTAL_URL": "https://dev.vitamui.com:4200",
"ALLOWED_URLS": ["/portal-api"],
"ALLOWED_URLS": [
"/portal-api"
],
"OIDC_CONFIG": {
"issuer": "https://dev.vitamui.com:8080/cas/oidc",
"redirectUri": "?",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"GATEWAY_ENABLED": true,
"GATEWAY_ENABLED": false,
"REFERENTIAL_URL": "https://dev.vitamui.com:4202/referential",
"VERSION_RELEASE": "6.4",
"PLATFORM_NAME": "VITAM-UI",
Expand All @@ -16,7 +16,9 @@
"UI_URL": "https://dev.vitamui.com:4202",
"ARCHIVES_SEARCH_URL": null,
"PORTAL_URL": "https://dev.vitamui.com:4200",
"ALLOWED_URLS": ["/referential-api"],
"ALLOWED_URLS": [
"/referential-api"
],
"OIDC_CONFIG": {
"issuer": "https://dev.vitamui.com:8080/cas/oidc",
"redirectUri": "?",
Expand Down

0 comments on commit 35761b7

Please sign in to comment.