From 6846b2ab9178b2b5646707b4dfe87f63d590554f Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Wed, 17 Nov 2021 23:32:40 +0100 Subject: [PATCH 1/2] Add vote service to OS4 setup Integrate vote service, makes according changes to configuration Updates the client to integrate the vote service Updates the backend to integrate the vote service --- .gitmodules | 4 +++ Makefile | 5 ++++ docker/build.sh | 1 + docker/docker-compose.dev.yml | 24 ++++++++++++++++ docker/services.env | 8 ++++++ openslides-backend | 2 +- openslides-client | 2 +- openslides-vote-service | 1 + proxy/caddy_base.json | 54 +++++++++++++++++------------------ proxy/entrypoint | 1 + 10 files changed, 72 insertions(+), 30 deletions(-) create mode 160000 openslides-vote-service diff --git a/.gitmodules b/.gitmodules index ee68e6aee..161fe2271 100644 --- a/.gitmodules +++ b/.gitmodules @@ -30,3 +30,7 @@ path = openslides-icc-service url = https://github.com/OpenSlides/openslides-icc-service.git branch = main +[submodule "openslides-vote-service"] + path = openslides-vote-service + url = https://github.com/OpenSlides/openslides-vote-service.git + branch = main \ No newline at end of file diff --git a/Makefile b/Makefile index 09d9c87fa..8acb01b2d 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,11 @@ services-to-master: # [1] ...or main, or whatever branch the OS4 one is. See .gitmodules. git submodule foreach -q --recursive 'git checkout $(git config -f $$toplevel/.gitmodules submodule.$$name.branch || echo master); git pull upstream $$(git config -f $$toplevel/.gitmodules submodule.$$name.branch || echo master)' +submodules-origin-to-upstream: + # You may only use this one time after cloning this repository. + # Will set the upstream remote to "origin" + git submodule foreach -q --recursive 'git remote rename origin upstream' + cypress-open: cd integration; npm run cypress:open diff --git a/docker/build.sh b/docker/build.sh index 79d752bc6..1da4d254c 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -14,6 +14,7 @@ TARGETS=( [datastore-reader]="$HOME/../openslides-datastore-service/reader" [datastore-writer]="$HOME/../openslides-datastore-service/writer" [media]="$HOME/../openslides-media-service/" + [vote]="$HOME/../openslides-vote-service/" #[pgbouncer]="https://github.com/OpenSlides/openslides-docker-compose.git#:pgbouncer" #[postfix]="https://github.com/OpenSlides/openslides-docker-compose.git#:postfix" #[repmgr]="https://github.com/OpenSlides/openslides-docker-compose.git#:repmgr" diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 7799b780f..c305944bd 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -151,3 +151,27 @@ services: driver: "none" # disable saving logs ports: - "8025:8025" # web ui to check mails manually + + vote: + image: openslides-vote-dev + depends_on: + - auth + - message-bus + - datastore-reader + - postgres + environment: + - OPENSLIDES_DEVELOPMENT=true + - VOTE_HOST=vote + - VOTE_PORT=9013 + - DATASTORE_READER_HOST=datastore-reader + - MESSAGING=redis + - MESSAGE_BUS_HOST=message-bus + - VOTE_REDIS_HOST=cache + - VOTE_DATABASE_HOST=postgres + - VOTE_DATABASE_USER=openslides + - VOTE_DATABASE_PASSWORD=openslides + - VOTE_DATABASE_NAME=openslides + - AUTH=ticket + - AUTH_HOST=auth + ports: + - "9013:9013" diff --git a/docker/services.env b/docker/services.env index 1755ac55d..8d83dfa98 100644 --- a/docker/services.env +++ b/docker/services.env @@ -32,3 +32,11 @@ MEDIA_DATABASE_NAME=openslides MANAGE_HOST=manage MANAGE_PORT=9008 + +VOTE_HOST=vote +VOTE_PORT=9013 +VOTE_REDIS_HOST=cache +VOTE_DATABASE_HOST=postgres +VOTE_DATABASE_USER=openslides +VOTE_DATABASE_PASSWORD=openslides +VOTE_DATABASE_NAME=openslides \ No newline at end of file diff --git a/openslides-backend b/openslides-backend index 98055f773..7ff8bdbde 160000 --- a/openslides-backend +++ b/openslides-backend @@ -1 +1 @@ -Subproject commit 98055f773558121a11f5e0a5cd358fe8dc4a69c4 +Subproject commit 7ff8bdbde45f0d816dd9e471fe1bb650e8937cd0 diff --git a/openslides-client b/openslides-client index b9aa7037f..7db47d666 160000 --- a/openslides-client +++ b/openslides-client @@ -1 +1 @@ -Subproject commit b9aa7037fbc723a65674a636c665c69a9966c0d4 +Subproject commit 7db47d666ac1ef4289f427d1007c3fd23776c9df diff --git a/openslides-vote-service b/openslides-vote-service new file mode 160000 index 000000000..b0a9acaff --- /dev/null +++ b/openslides-vote-service @@ -0,0 +1 @@ +Subproject commit b0a9acaff79c76e7defcd5cec8b9e9ba4b7de48a diff --git a/proxy/caddy_base.json b/proxy/caddy_base.json index e1712b7df..b1fcb6be9 100644 --- a/proxy/caddy_base.json +++ b/proxy/caddy_base.json @@ -21,9 +21,7 @@ "http": { "servers": { "srv0": { - "listen": [ - ":8000" - ], + "listen": [":8000"], "allow_h2c": true, "routes": [ { @@ -40,9 +38,7 @@ ], "match": [ { - "path": [ - "/system/autoupdate*" - ] + "path": ["/system/autoupdate*"] } ] }, @@ -59,9 +55,7 @@ ], "match": [ { - "path": [ - "/system/presenter*" - ] + "path": ["/system/presenter*"] } ] }, @@ -78,9 +72,7 @@ ], "match": [ { - "path": [ - "/system/action*" - ] + "path": ["/system/action*"] } ] }, @@ -97,9 +89,7 @@ ], "match": [ { - "path": [ - "/system/media*" - ] + "path": ["/system/media*"] } ] }, @@ -116,9 +106,7 @@ ], "match": [ { - "path": [ - "/system/auth*" - ] + "path": ["/system/auth*"] } ] }, @@ -136,9 +124,7 @@ ], "match": [ { - "path": [ - "/system/icc*" - ] + "path": ["/system/icc*"] } ] }, @@ -149,10 +135,7 @@ "flush_interval": -1, "transport": { "protocol": "http", - "versions": [ - "2", - "h2c" - ] + "versions": ["2", "h2c"] }, "upstreams": [ { @@ -164,13 +147,28 @@ "match": [ { "header": { - "Content-Type": [ - "application/grpc" - ] + "Content-Type": ["application/grpc"] } } ] }, + { + "handle": [ + { + "handler": "reverse_proxy", + "upstreams": [ + { + "dial": "$VOTE_HOST:$VOTE_PORT" + } + ] + } + ], + "match": [ + { + "path": ["/system/vote*"] + } + ] + }, { "handle": [ { diff --git a/proxy/entrypoint b/proxy/entrypoint index 55ec66ee2..9d31956df 100755 --- a/proxy/entrypoint +++ b/proxy/entrypoint @@ -16,6 +16,7 @@ AUTH_HOST="${AUTH_HOST:-auth}" AUTH_PORT="${AUTH_PORT:-9004}" \ MEDIA_HOST="${MEDIA_HOST:-media}" MEDIA_PORT="${MEDIA_PORT:-9006}" \ MANAGE_HOST="${MANAGE_HOST:-manage}" MANAGE_PORT="${MANAGE_PORT:-9008}" \ CLIENT_HOST="${CLIENT_HOST:-client}" CLIENT_PORT="${CLIENT_PORT:-9001}" \ +VOTE_HOST="${VOTE_HOST:-vote}" VOTE_PORT="${VOTE_PORT:-9013}" \ envsubst < "$base" > "$base.out" && mv -f "$base.out" "$base" jq_write() { From df08720d0ea37fcec3d00e0570d636daab2fda5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Thu, 18 Nov 2021 17:53:59 +0100 Subject: [PATCH 2/2] Updated services --- openslides-autoupdate-service | 2 +- openslides-backend | 2 +- openslides-client | 2 +- openslides-datastore-service | 2 +- openslides-icc-service | 2 +- openslides-manage-service | 2 +- openslides-media-service | 2 +- openslides-vote-service | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openslides-autoupdate-service b/openslides-autoupdate-service index b4e2222a9..b9c287c7c 160000 --- a/openslides-autoupdate-service +++ b/openslides-autoupdate-service @@ -1 +1 @@ -Subproject commit b4e2222a9c68e7e954e37eab262ed77669086585 +Subproject commit b9c287c7c2697cafe2f648e7438c9953c6001111 diff --git a/openslides-backend b/openslides-backend index 7ff8bdbde..e1f83b680 160000 --- a/openslides-backend +++ b/openslides-backend @@ -1 +1 @@ -Subproject commit 7ff8bdbde45f0d816dd9e471fe1bb650e8937cd0 +Subproject commit e1f83b6807027ffac64134ee30740b8b4558443e diff --git a/openslides-client b/openslides-client index 7db47d666..d28b41b77 160000 --- a/openslides-client +++ b/openslides-client @@ -1 +1 @@ -Subproject commit 7db47d666ac1ef4289f427d1007c3fd23776c9df +Subproject commit d28b41b7737f0e7a2f90dd9fae511f82c808b24e diff --git a/openslides-datastore-service b/openslides-datastore-service index b71dcc30b..ba874ee19 160000 --- a/openslides-datastore-service +++ b/openslides-datastore-service @@ -1 +1 @@ -Subproject commit b71dcc30b9696606da4cf9ff9e4e446bb5251ec3 +Subproject commit ba874ee191ada0d0287437a038f390fbf22a5d80 diff --git a/openslides-icc-service b/openslides-icc-service index af457125e..9f9362e51 160000 --- a/openslides-icc-service +++ b/openslides-icc-service @@ -1 +1 @@ -Subproject commit af457125e7d0276de7361f197a3d97732dabebd7 +Subproject commit 9f9362e517a012e40b738d5a5c4f3ada36449879 diff --git a/openslides-manage-service b/openslides-manage-service index 30157498c..278ce4523 160000 --- a/openslides-manage-service +++ b/openslides-manage-service @@ -1 +1 @@ -Subproject commit 30157498c40d994996c1b5bd19ef0701b45b9ad2 +Subproject commit 278ce452358643bafa3c341ddf8ade688cbf5579 diff --git a/openslides-media-service b/openslides-media-service index 08c1d557b..27e2f3e10 160000 --- a/openslides-media-service +++ b/openslides-media-service @@ -1 +1 @@ -Subproject commit 08c1d557b37386ed9168b8ca73e2bb351db4234e +Subproject commit 27e2f3e1064a14bd13311731f5fbda0bd4e9a706 diff --git a/openslides-vote-service b/openslides-vote-service index b0a9acaff..955f08da0 160000 --- a/openslides-vote-service +++ b/openslides-vote-service @@ -1 +1 @@ -Subproject commit b0a9acaff79c76e7defcd5cec8b9e9ba4b7de48a +Subproject commit 955f08da0ababd821f5b0ee138b1c463e0eac924