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

Benchmark 1000 votes #385

Closed
wants to merge 190 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
5b6394c
Cleanup debugging
ineiti Sep 25, 2023
8b1299f
@PascalinDe's comments
ineiti Sep 25, 2023
71b08e7
@Pierluca's comments
ineiti Sep 27, 2023
7bfd8b5
feat: improve on debug/production deployments
PascalinDe Sep 22, 2023
81846b7
Merge pull request #1 from c4dt/docker-on-macos-windows
PascalinDe Sep 27, 2023
1b32705
Merge pull request #3 from c4dt/cleanup_debugging
lanterno Sep 27, 2023
3cb508b
chore: add Docker image building to CI
PascalinDe Sep 27, 2023
40742e9
Fixing voting
ineiti Sep 28, 2023
e84aa4b
Adds local login and script for testing
ineiti Sep 25, 2023
da31220
@pierluca's comments
ineiti Sep 27, 2023
ca3ce8d
Modify scripts for login, creating a form, and voting
ineiti Sep 26, 2023
24b4566
Merge pull request #5 from c4dt/docker-ci
PascalinDe Sep 28, 2023
94148dd
Merge pull request #6 from c4dt/fix_votes
ineiti Sep 28, 2023
9843f66
Merge pull request #4 from c4dt/local_login
ineiti Sep 28, 2023
3e7eeca
Merge pull request #2 from c4dt/run_voting_tests
ineiti Sep 28, 2023
571a94f
Fixing scripts to correctly handle the proxy database
ineiti Sep 28, 2023
ad74a7d
Yarn lockfile update for Mac
ineiti Sep 28, 2023
e97f0da
Merge pull request #10 from c4dt/yarn_lock
ineiti Sep 29, 2023
5cfa5c1
Pointing to c4dt forks of dela, dela-apps, and d-voting
ineiti Sep 29, 2023
724bf85
Merge pull request #9 from c4dt/fix_proxies
ineiti Sep 29, 2023
636d9aa
Merge pull request #8 from c4dt/move_fork
PascalinDe Sep 29, 2023
f2ac57a
Cleaning up
ineiti Sep 29, 2023
be954a9
Changes necessary for noTLS
ineiti Sep 29, 2023
19e4089
fix: removes buggy check on form ballot size.
Oct 3, 2023
2f27c4f
Merge pull request #12 from c4dt/for_notls
ineiti Oct 3, 2023
a73ff85
Merge pull request #14 from c4dt/fix/removes-check-on-ballot-size
lanterno Oct 3, 2023
68cdb33
Adding logging variables and cleaning up a throw within a catch
ineiti Oct 4, 2023
76acfb0
Only allowing dev login if REACT_APP_DEV_LOGIN === 'true'
ineiti Oct 4, 2023
6fc65fc
Merge pull request #18 from c4dt/cleanup_frontend
ineiti Oct 4, 2023
05b3556
ops: makes it easier to override app default startup commmand
Oct 2, 2023
f8ef7a1
ops: enables auto server reload for local development
Oct 2, 2023
d85c9bb
ops: adds profiles and unifies settings for all compose services
Oct 2, 2023
ecb4cd2
feat: add PR template
PascalinDe Oct 4, 2023
c2129c4
Merge branch 'dedis:main' into main
lanterno Oct 4, 2023
0c23aaa
Merge pull request #19 from c4dt/pr-template
PascalinDe Oct 4, 2023
7b4ad26
ops: disables https on the react client and standardizes start commands
Oct 4, 2023
ac41443
Merge pull request #11 from c4dt/devops/adjusts-docker-configurations…
lanterno Oct 4, 2023
2a77850
Fixing always failing test
ineiti Oct 4, 2023
948b17a
Adding a CHANGELOG.md - please use it
ineiti Oct 4, 2023
0d90cd6
Formatting and errors in comments
ineiti Oct 4, 2023
86c7c5e
Nicefying vote comments
ineiti Oct 4, 2023
61d7ac9
@Pierluca's comments
ineiti Oct 4, 2023
6149677
Merge pull request #20 from c4dt/more_cleanups
ineiti Oct 4, 2023
6d147ae
Updating to point to latest dela
ineiti Oct 4, 2023
071c9e4
Merge pull request #22 from c4dt/update_gomod
ineiti Oct 4, 2023
05b4b46
Using new package.json actions
ineiti Oct 4, 2023
2e1ff9e
refactor: remove unused build stage 'debug'
PascalinDe Oct 4, 2023
95cbebf
fix: set log level back to 'debug'
PascalinDe Oct 4, 2023
b80f59b
fix: aligned docker-compose.yml and docker-compose.debug.yml
PascalinDe Oct 4, 2023
079cdcc
Making some tests run again
ineiti Oct 4, 2023
7c789c8
feat: use --noTLS by default for production deployment (TLS terminati…
PascalinDe Oct 4, 2023
4d69872
fix: remove profiles from preproduction deployment file
PascalinDe Oct 4, 2023
6b6ddc4
Merge pull request #16 from c4dt/noTLS-docker
ineiti Oct 5, 2023
956fb29
chore: fix Docker image build CI
PascalinDe Oct 5, 2023
739a78b
Merge pull request #25 from c4dt/fix-docker-ci
PascalinDe Oct 5, 2023
28e48be
Merge pull request #23 from c4dt/follow_updates
ineiti Oct 5, 2023
7ccf3c5
If no form found, redirect to '/form/index'. Better show error from b…
ineiti Oct 4, 2023
dfe3a32
Replacing DELA_NODE_URL with the more correct DELA_PROXY_URL
ineiti Oct 5, 2023
3214f9b
Correctly call endpoints only once in case of updates to the react form
ineiti Oct 5, 2023
fd36415
Correctly add/modify/delete a proxy without returning an error
ineiti Oct 5, 2023
09e25f5
Adding possible GRPC debug levels
ineiti Oct 5, 2023
c1c3623
Some cleaning of language initialisation
ineiti Oct 6, 2023
0f321ff
Adding docker images with the name of the branch
ineiti Oct 6, 2023
92921ba
Merge pull request #24 from c4dt/cleanups_2
ineiti Oct 6, 2023
fdd96d3
Adding voters to form
ineiti Oct 6, 2023
1ac5023
Allow userId change in dev mode
ineiti Oct 6, 2023
27a1c2e
Only show voting button when user has voting rights
ineiti Oct 6, 2023
4baccdf
Merge pull request #40 from c4dt/docker_in_pr
ineiti Oct 10, 2023
275862a
Merge pull request #34 from c4dt/add_voters
ineiti Oct 10, 2023
685689a
feat: add script to setup Docker and some auxilary functions
PascalinDe Oct 10, 2023
3117283
Merge pull request #39 from c4dt/i18n
ineiti Oct 10, 2023
9533280
Change AddVoters icon to nicer document icon
ineiti Oct 10, 2023
04a5f18
Merge pull request #44 from c4dt/add_voters_icon
PascalinDe Oct 10, 2023
0757c3b
Merge pull request #41 from c4dt/local-docker
PascalinDe Oct 10, 2023
09b624c
Moving back to go.dedis.ch/dela
ineiti Nov 21, 2023
a7ea54f
Follow DEDIS/master updates
ineiti Nov 21, 2023
8be8a70
Re-ordering the pull request template
ineiti Nov 21, 2023
345415c
Merge pull request #59 from c4dt/follow_dedis_updates
ineiti Nov 22, 2023
6413da5
Merge pull request #60 from c4dt/pull-request-message
ineiti Nov 22, 2023
187d9b9
Using correct URL
ineiti Nov 22, 2023
ef79320
refactor: use Title object instead of MainTitle, TitleDe and TitleFr
PascalinDe Nov 9, 2023
7a75dcf
refactor: use/clean up Hint object
PascalinDe Nov 21, 2023
5544981
fix: remove internal ChoicesMap from exported JSON
PascalinDe Nov 21, 2023
7f4cd8f
fix: lint mock data
PascalinDe Nov 21, 2023
a197a79
fix: run prettier
PascalinDe Nov 21, 2023
c04242d
fix: fix Go tests
PascalinDe Nov 21, 2023
79f72a4
refactor: use internationalize function
PascalinDe Nov 22, 2023
c08ba79
refactor: remove debugging
PascalinDe Nov 22, 2023
e4285ce
refactor: remove dead code
PascalinDe Nov 22, 2023
dd70671
Fix French lexicon
dragonleman Nov 23, 2023
f632702
fix: updated local_forms script w/ current data format
PascalinDe Nov 23, 2023
97b98be
tests: add German translations
PascalinDe Nov 23, 2023
eef4e35
Merge pull request #61 from c4dt/fix_tests
ineiti Nov 24, 2023
4434db3
Correctly create new keys
ineiti Nov 24, 2023
ca91ba8
Décrypt* -> Déchiffr*
dragonleman Nov 24, 2023
ea49694
Merge pull request #63 from c4dt/fix-fr-language-syntaxes
PascalinDe Nov 24, 2023
7f8c477
Merge pull request #51 from c4dt/316
PascalinDe Nov 24, 2023
e702098
Merge pull request #64 from c4dt/fix_scripts
ineiti Nov 24, 2023
db280d3
Homogeinization of acronyms
dragonleman Nov 27, 2023
9fb741e
Merge pull request #65 from c4dt/fix-languages-homogeneization-acronyms
dragonleman Nov 27, 2023
23d1ad5
test: install and initialize Playwright
PascalinDe Dec 1, 2023
b85f7d8
test: add initalizing i18next
PascalinDe Dec 1, 2023
7cb3d62
test: add login/logout utils
PascalinDe Dec 1, 2023
260175d
fix: add missing import
PascalinDe Dec 1, 2023
24c8f2f
test: add navigation bar tests for authenticated/admin users
PascalinDe Dec 1, 2023
a3f146a
fix: remove duplicate logo
PascalinDe Dec 4, 2023
16a75f3
test: start each test at 'About' page
PascalinDe Dec 4, 2023
b114a4c
test: added test for link to form list
PascalinDe Dec 4, 2023
c718085
docs: added README for automated tests
PascalinDe Dec 4, 2023
c8023cc
fix: do not include SCIPER_ADMIN in filename as it might be different…
PascalinDe Dec 4, 2023
bf17a92
fix: clean up Playwright config
PascalinDe Dec 4, 2023
96ce8a5
fix: use fixed admin sciper for mocks
PascalinDe Dec 4, 2023
d75b181
fix: add missing API mock
PascalinDe Dec 4, 2023
715edbf
docs: updated README w/ installation instructions and required enviro…
PascalinDe Dec 5, 2023
a4b412d
WIP: fix log in/log out mocks
PascalinDe Dec 5, 2023
df1111e
fix: fix log in/log out helper functions
PascalinDe Dec 5, 2023
0e6c079
docs: add mandatory FRONT_END_URL value to READMEs
PascalinDe Dec 5, 2023
b50a584
test: clean up authentication mocks
PascalinDe Dec 7, 2023
8db9f9e
test: clean up HAR file management and authentication mocking
PascalinDe Dec 7, 2023
990cb43
test: add authentication UI tests
PascalinDe Dec 7, 2023
75f5bdd
docs: add updating HAR files to README
PascalinDe Dec 7, 2023
a46a0fb
fix: apply code review suggestions
PascalinDe Dec 8, 2023
a51d8a9
test: do not test WebKit
PascalinDe Dec 8, 2023
9f6222b
test: use hard-coded baseURL instead of local configuration
PascalinDe Dec 8, 2023
a7fe8fb
test: apply review suggestions
PascalinDe Dec 8, 2023
bc582d3
fix: re-add accidentally removed mockPersonalInfo in setUp function
PascalinDe Dec 8, 2023
b251113
fix: use regexp for local configuration
PascalinDe Dec 8, 2023
707f2d6
docs: fix npm command in README
PascalinDe Dec 8, 2023
e9b84b7
docs: fix npx command
PascalinDe Dec 8, 2023
6cfb410
Merge pull request #67 from c4dt/playwright
PascalinDe Dec 11, 2023
8314d64
test: add missing skip instructions
PascalinDe Dec 11, 2023
444d787
Merge pull request #74 from c4dt/playwright
PascalinDe Dec 11, 2023
7200375
fix: remove duplicate hidden element
PascalinDe Dec 5, 2023
976e908
test: move updating mocks toggle to setUp
PascalinDe Dec 11, 2023
fab2989
test: add testid to footer
PascalinDe Dec 11, 2023
9f396ec
feat: render copyright notice in footer internationalisable
PascalinDe Dec 11, 2023
7ab1f0d
feat: remove unused proxy configuration element
PascalinDe Dec 11, 2023
83f4eee
feat: internationalise build/software information and add tests
PascalinDe Dec 11, 2023
fbc6666
Merge pull request #75 from c4dt/69
PascalinDe Dec 12, 2023
945821c
refactor: rename file
PascalinDe Dec 12, 2023
84c7bfc
Revert "test: move updating mocks toggle to setUp"
PascalinDe Dec 12, 2023
7a27a9f
docs: remove deprecated comments
PascalinDe Dec 12, 2023
90c78a6
test: add api/config/proxy mock
PascalinDe Dec 12, 2023
ff8f696
test: add missing await on test result
PascalinDe Dec 12, 2023
844943b
feat: add linting to tests
PascalinDe Dec 12, 2023
20646e2
fix: fix linter
PascalinDe Dec 12, 2023
fddc36b
test: add missing skip instructions to footer tests
PascalinDe Dec 12, 2023
2369d9c
refactor: use 'strict' mode when compiling tests
PascalinDe Dec 13, 2023
0863d1d
Merge pull request #76 from c4dt/playwright
PascalinDe Dec 13, 2023
59eb6d3
test: add evoting API mock
PascalinDe Dec 12, 2023
055c2f3
test: add /form/index route tests for navbar/footer
PascalinDe Dec 13, 2023
be17e64
fix: fix misleading page numbering and add pagination tests
PascalinDe Dec 13, 2023
628cf71
refactor: simplify mocking by removing reliance on HAR files
PascalinDe Dec 14, 2023
d6c136a
fix: fix lint
PascalinDe Dec 14, 2023
d30dbe2
style: add missing type annotations
PascalinDe Dec 15, 2023
a5e99b6
Merge pull request #77 from c4dt/70
PascalinDe Dec 18, 2023
b9909be
style: prettify JSON
PascalinDe Dec 15, 2023
6b8a420
test: add form list display tests
PascalinDe Dec 15, 2023
f660579
test: do not actually load page to check URL
PascalinDe Jan 8, 2024
7c62d80
test: assert unauthenticated form list views are correct
PascalinDe Jan 8, 2024
96dcb5a
test: fix malformatted test data
PascalinDe Jan 11, 2024
380b157
test: admin cannot vote on same form as non-admin
PascalinDe Jan 11, 2024
ee64e2b
test: add form list display tests
PascalinDe Jan 11, 2024
5956f1d
style: fix linting
PascalinDe Jan 11, 2024
1b03a2f
test: apply code review suggestions
PascalinDe Jan 17, 2024
d28bec3
test: disable lint to make code more readable
PascalinDe Jan 17, 2024
c8339fa
Merge pull request #79 from c4dt/playwright
PascalinDe Jan 18, 2024
1cea2f6
Updating cli tools tests to use new dela
ineiti Jan 22, 2024
d59f5e3
Merge pull request #84 from c4dt/update_latest_dela
ineiti Jan 23, 2024
da3dd7b
chore: fix missing command in set up script
PascalinDe Jan 24, 2024
fda3bcd
Merge pull request #88 from c4dt/docker
PascalinDe Jan 24, 2024
28aad92
fix: make sure the pages are properly loaded
PascalinDe Jan 16, 2024
ea18d14
test: add new test data
PascalinDe Jan 16, 2024
97315e3
test: add initial tests for form editing
PascalinDe Jan 16, 2024
345927b
test: move api mocks to separate folders
PascalinDe Jan 16, 2024
56425a2
test: move evoting mocks
PascalinDe Jan 16, 2024
981b74f
test: added 2nd admin user for ownership tests
PascalinDe Jan 18, 2024
6498f8b
test: wait until there's no more network traffic on reload
PascalinDe Jan 22, 2024
e4746f0
fix: do not show 'Add voters' button to non-owner
PascalinDe Jan 25, 2024
107a297
Fix the voting-benchmark test
ineiti Jan 19, 2024
9c1f6ed
Rearranging things
ineiti Jan 19, 2024
9b93346
refactor: applied code review
PascalinDe Jan 25, 2024
cbbb92c
chore: do not run tests in parallel
PascalinDe Jan 25, 2024
7fcd939
fix: fix array index
PascalinDe Jan 25, 2024
8a55e11
Autogenerating .env
ineiti Jan 25, 2024
a2a262a
Merge pull request #89 from c4dt/72
PascalinDe Jan 25, 2024
fa9c0d4
Merge pull request #92 from c4dt/autogenerate_env
ineiti Jan 25, 2024
6ada22a
Merge pull request #82 from c4dt/voting_benchmark
ineiti Jan 25, 2024
f6045da
Merge pull request #83 from c4dt/refactoring
ineiti Jan 25, 2024
b310ea8
Putting ballots in separate memory
ineiti Jan 25, 2024
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
18 changes: 18 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This is an example .env file with default passwords and private keys.
# Do not use this in production or with any public-facing ports!
DELA_PROXY_URL=http://172.19.44.254:8080
DATABASE_USERNAME=dvoting
DATABASE_PASSWORD=Ohw0phoa # choose any PostgreSQL password
DATABASE_HOST=db
DATABASE_PORT=5432
DB_PATH=dvoting # LMDB database path
FRONT_END_URL=http://127.0.0.1:3000 # the automated frontend tests expect this value do not change it
BACKEND_HOST=backend
BACKEND_PORT=5000
SESSION_SECRET=kaibaaF9 # choose any secret
# For public-facing services and production, this key needs to be changed!
PRIVATE_KEY=6aadf480d068ac896330b726802abd0da2a5f3824f791fe8dbd4cd555e80b809
PUBLIC_KEY=3e5fcaed4c5d79a8eccceeb087ee0a13b8f91d917ed62017a9cd28e13b228389
PROXYPORT=8080
NODEPORT=2000 # DELA node port

10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Thank you for opening a pull request with this project, please also:

* [ ] add a brief description of your changes here
* [ ] assign the PR to yourself, or to the person(s) working on it
* [ ] start in `draft` mode and `in progress` pipeline in the project (if applicable)
* [ ] if applicable, add this PR to its related issue by one of the special keywords [Closing keywords](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue)
* once it's ready
* [ ] put it in the `Review` or `Ready4Merge` pipeline in the project (if applicable)
* [ ] remove `draft`
* [ ] assign a reviewer
55 changes: 55 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build docker

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
build-docker:
name: Build D-Voting Docker images
runs-on: ubuntu-22.04
if: '! github.event.pull_request.draft'
env:
DockerTag: ${{ (github.ref == 'refs/heads/main') && 'latest' || github.head_ref }}

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Frontend
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfiles/Dockerfile.frontend
platforms: linux/amd64
push: true
tags: ghcr.io/c4dt/d-voting-frontend:${{ env.DockerTag }}
- name: Build Backend
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfiles/Dockerfile.backend
platforms: linux/amd64
push: true
tags: ghcr.io/c4dt/d-voting-backend:${{ env.DockerTag }}
- name: Build D-Voting
uses: docker/build-push-action@v2
with:
context: .
target: build
file: Dockerfiles/Dockerfile.dela
platforms: linux/amd64
push: true
tags: ghcr.io/c4dt/d-voting-dela:${{ env.DockerTag }}
2 changes: 1 addition & 1 deletion .github/workflows/go_dvoting_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Install crypto util from Dela
run: |
git clone https://github.com/dedis/dela.git
git clone https://github.com/c4dt/dela.git
cd dela
go install ./cli/crypto

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go_scenario_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- name: Install crypto util from Dela
run: |
git clone https://github.com/dedis/dela.git
git clone https://github.com/c4dt/dela.git
cd dela
go install ./cli/crypto

Expand Down
33 changes: 1 addition & 32 deletions .github/workflows/go_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,4 @@ jobs:

- name: Test all, except integration, with coverage
run: |
go test -json -covermode=count -coverprofile=profile.cov $(go list ./... | grep -v /integration) 2>&1 | tee report.json

- name: Sonarcloud scan
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=dedis
-Dsonar.projectKey=dedis_d-voting
-Dsonar.go.tests.reportPaths=report.json
-Dsonar.go.coverage.reportPaths=profile.cov
-Dsonar.coverage.exclusions=**/*_test.go,/internal/**/*
-Dsonar.issue.ignore.multicriteria=e1
-Dsonar.issue.ignore.multicriteria.e1.ruleKey=*Naming*
-Dsonar.issue.ignore.multicriteria.e1.resourceKey=**/*_test.go
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
parallel: true

# notifies that all test jobs are finished.
finish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true
go test $(go list ./... | grep -v /integration)
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ nodedata/

deb-package/dist/**

.env

dela/
bin/
nodes/
cookies.txt
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Latest changes in each category go to the top

## [Unreleased]

### Added
- dev_login can change userId when clicking on the user in the upper right
- admin can now add users as voters
- New debugging variables in [local_vars.sh](./scripts/local_vars.sh)
- Changelog - please use it

### Changed
- for the Dockerfiles and docker-compose.yml, `DELA_NODE_URL` has been replaced with `DELA_PROXY_URL`,
which is the more accurate name.
- the actions in package.json for the frontend changed. Both are somewhat development mode,
as the webserver is not supposed to be used in production.
- `start`: starts in plain mode
- `start-https`: starts in HTTPS mode

### Deprecated
### Removed
### Fixed
- Proxy editing fixed: adding, modifying, deleting now works
- When fetching form and user updates, only do it when showing the activity
- Redirection when form doesn't exist and nicer error message
- File formatting and errors in comments
- Popup when voting and some voting translation fixes
- Fixed return error when voting

### Security
- Use `REACT_APP_RANDOMIZE_VOTE_ID === 'true'` to indicate randomizing vote ids
3 changes: 2 additions & 1 deletion Dockerfiles/Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ FROM node:20-bookworm
WORKDIR /web/backend
COPY ../web/backend .
RUN npm install
ENTRYPOINT ["/bin/bash", "-c", "npm start"]
ENTRYPOINT ["npm"]
CMD ["start"]
12 changes: 7 additions & 5 deletions Dockerfiles/Dockerfile.dela
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
FROM golang:1.20.6-bookworm

FROM golang:1.20.6-bookworm AS base
RUN apt-get update && apt-get install git
# make sure we're using the same head as d-voting
RUN git clone -b fix-bbolt https://github.com/dedis/dela.git
RUN git clone https://github.com/c4dt/dela.git
WORKDIR /go/dela/cli/crypto
RUN go install
WORKDIR /go/d-voting
COPY . .

FROM base AS build
COPY --from=base /go/dela .
COPY --from=base /go/d-voting .
WORKDIR /go/d-voting/cli/dvoting
RUN go build
ENV PATH=/go/dela/cli/crypto:/go/d-voting/cli/dvoting:${PATH}
WORKDIR /go
ENTRYPOINT ["/bin/bash", "-c", "dvoting --config /data/node start --postinstall --proxyaddr :$PROXYPORT --proxykey $PROXYKEY --listen tcp://0.0.0.0:2000 --public http://$HOSTNAME:$NODEPORT --routing tree"]
ENTRYPOINT ["/bin/bash", "-c", "dvoting --config /data/node start --postinstall --proxyaddr :$PROXYPORT --proxykey $PROXYKEY --listen tcp://0.0.0.0:2000 --public $PUBLIC_URL --routing tree --noTLS"]
CMD []
18 changes: 0 additions & 18 deletions Dockerfiles/Dockerfile.dela.debug

This file was deleted.

3 changes: 2 additions & 1 deletion Dockerfiles/Dockerfile.frontend
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ ENV REACT_APP_NOMOCK=on
WORKDIR /web/frontend
COPY ../web/frontend .
RUN npm install
ENTRYPOINT ["npm", "start"]
ENTRYPOINT ["npm"]
CMD ["start"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version=$(shell git describe --abbrev=0 --tags || echo '0.0.0')
versionFlag="github.com/dedis/d-voting.Version=$(version)"
versionFlag="github.com/c4dt/d-voting.Version=$(version)"
versionFile=$(shell echo $(version) | tr . _)
timeFlag="github.com/dedis/d-voting.BuildTime=$(shell date +'%d/%m/%y_%H:%M')"
timeFlag="github.com/c4dt/d-voting.BuildTime=$(shell date +'%d/%m/%y_%H:%M')"

lint:
# Coding style static check.
Expand Down
30 changes: 19 additions & 11 deletions README.docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ when running `docker compose`.
The environment file needs to contain

```
DELA_NODE_URL=http://172.19.44.254:8080
DELA_PROXY_URL=http://172.19.44.254:8080
DATABASE_USERNAME=dvoting
DATABASE_PASSWORD=XXX # choose any PostgreSQL password
DATABASE_HOST=db
DATABASE_PORT=5432
DB_PATH=dvoting # LMDB database path
FRONT_END_URL=http://127.0.0.1:3000
FRONT_END_URL=http://127.0.0.1:3000 # the automated frontend tests expect this value do not change it
BACKEND_HOST=backend
BACKEND_PORT=5000
SESSION_SECRET=XXX # choose any secret
Expand All @@ -31,31 +31,39 @@ PROXYPORT=8080
NODEPORT=2000 # DELA node port
```

For the `PUBLIC_KEY` and `PRIVATE_KEY`, you need to run the following commands:

```bash
cd web/backend
npm ci
npm run keygen
```

And then copy the two lines to the `.env` file.

There are two Docker Compose file you may use:

* `docker-compose/docker-compose.yml` for the currently released version, or
* `docker-compose/docker-compose.yml` for the preprod version, or
* `docker-compose/docker-compose.debug.yml` for the development/debugging version

You can either run
You run

```
export COMPOSE_FILE=<path to Docker Compose file>
```

or pass the `-f/--file <path to Docker Compose file>` argument to choose between
the files.

Using the currently released version will pull the images from the GitHub container registry.

If you instead use the development/debugging version the images will be build locally and you can debug your developments.
The preprod version will create an environment without any debugging tools that's as close as possible to a real environment.
It is meant to be used to test the `main` branch before deploying it to production. Use the development/debugging version
for setting up your local development environment.

Run

```
docker compose build
docker compose up
```

(possibly with the `-f/--file` argument) to set up the environment.
to set up the environment.

/!\ Any subsequent `docker compose` commands must be run with `COMPOSE_FILE` being
set to the Docker Compose file that defines the current environment.
Expand Down
Loading
Loading