CSS Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
applications:society-voting [2025/03/29 12:33] rootapplications:society-voting [2025/05/20 19:10] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Society Voting ====== ====== Society Voting ======
 +
 +The [[https://github.com/CSSUoB/society-voting|society-voting app]] is what we use for elections and referenda at EGMs and AGMs. Members may view available roles or proposed motions, stand for roles, and vote. It is accessible at [[https://vote.cssbham.com]].
 +
 +It is deployed in a single Docker container on [[infrastructure:servers:tex-drug-den|tex-drug-den]].
 +
 +===== Spinning up =====
 +
 +There are two configured versions on [[infrastructure:servers:tex-drug-den|tex-drug-den]], ''staging'' and ''prod''. The rest of this page will detail starting up ''prod'', but is also applicable to ''staging''.
 +
 +Switch to directory ''/root/society-voting/prod''. You will find a directory structure like this:
 +
 +<code>
 +|-- config.yaml
 +|-- docker-compose.yaml
 +|-- restart.sh
 +|-- src
 +`-- voting.sqlite3.db
 +</code> 
 +
 +''src'' is a git repository containing the version of society-voting you want to deploy. The compose file is configured to build the image from that directory. In most cases you want the ''main'' branch; you should verify the version there is the one you want before continuing. If you have upgraded the version in ''src'', you may want to consider also backing up the database.
 +
 +Next, make sure all the values in ''config.yaml'' are correct. Particularly, if this is a new AGM / EGM then you will want to rotate the admin token and session signing token (if set), and update the webhook information.
 +
 +Finally, ''docker compose up --build -d''
 +
 +===== Stuff to know =====
 +
 +Due to an impossible to replicate bug, the Docker image includes a shim which will restart the application after the conclusion of a vote. Don't be alarmed if you cannot immediately see the results, just refresh the page after a few seconds. For that reason, you may want to set the session signing token to a fixed value so users aren't logged out after every vote.
 +
 +On that vein, if the Docker container fails to start with some message that ''prod-shim.sh'' is not executable, ''chmod +x'' the file ''src/deploy/prod-shim.sh'' first and rebuild the image. Sometimes git does not retain the file execute bit for some reason when checking out branches.
 +
 +It is possible the bug is actually fixed now, but I do not want to test it in an actual election (which unfortunately has been the only situation where the bug has presented itself).((Theo claims to have tested this in a real election for another society and it worked just fine so take that as you will))
 +
applications/society-voting.1743251630.txt.gz · Last modified: (external edit)