| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| applications:society-voting [2025/03/29 21:44] – root | applications:society-voting [2025/05/20 19:10] (current) – external edit 127.0.0.1 |
|---|
| ====== Society Voting ====== | ====== Society Voting ====== |
| |
| The [[https://github.com/CSSUoB/society-voting|society-voting app]] is what we use for elections and refernda 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]]. | 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]]. | It is deployed in a single Docker container on [[infrastructure:servers:tex-drug-den|tex-drug-den]]. |
| ===== Spinning up ===== | ===== 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 details starting up ''prod'', but is also applicable to ''staging''. | 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: | Switch to directory ''/root/society-voting/prod''. You will find a directory structure like this: |
| </code> | </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. | ''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. | 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. |
| ===== Stuff to know ===== | ===== Stuff to know ===== |
| |
| Due to an impossible to find 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. | 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. | 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)) |
| |