This is an old revision of the document!
Table of Contents
Society Voting
The 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.
It is deployed in a single Docker container on tex-drug-den.
Spinning up
There are two configured versions on tex-drug-den, staging and prod. The rest of this page will details starting up prod, but is also applicable to staging.
Switch to directory /root/society-voting/prod. You will find a directory structure like this:
|-- config.yaml |-- docker-compose.yaml |-- restart.sh |-- src `-- voting.sqlite3.db
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 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.
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.