Elections Bulletin Board
The first step needed to setup the connection is to generate an a pair of keys to identify the application against the Bulletin Board. This can be done running the following rake task in your application environment:
bundle exec rake decidim_elections:generate_identification_keys
This task will output the generated private and public keys. You should copy the public key and send it to the Bulletin Board administrator through a secure channel. Together with the key, send your Authority name to the Bulletin Board administrator and store its value on the environment variable
After that, copy the private key and store that value on the environment variable
Ensure that the private key is not lost between deployments and servers reboots and that only can be accessed by the application.
The Bulletin Board administrator will store the received public key in their server and will send you back an API key.
To complete the setup process you should store this API key and the Bulletin Board URL address on the environment variables
The following YAML snippet with all the defined environment variables should be used in the
default block of your application
Maybe this is already done, as it was included in the Decidim applications generator during the development of the Elections module.
bulletin_board: identification_private_key: <%= ENV["BULLETIN_BOARD_IDENTIFICATION_PRIVATE_KEY"] %> server: <%= ENV["BULLETIN_BOARD_SERVER"] %> websocket_url: <%= ENV["BULLETIN_BOARD_WEBSOCKET_URL"] %> api_key: <%= ENV["BULLETIN_BOARD_API_KEY"] %> number_of_trustees: <%= ENV["BULLETIN_BOARD_NUMBER_OF_TRUSTEES"] %> authority_name: <%= ENV["BULLETIN_BOARD_AUTHORITY_NAME"] %> scheme: name: <%= ENV["BULLETIN_BOARD_SCHEME_NAME"] %> parameters: quorum: <%= ENV["BULLETIN_BOARD_SCHEME_QUORUM"] %>
After restarting the Decidim instance, administrator users will be able to create elections on the configured Bulletin Board.
A crontab line must be added to your server to be able to open and close the Ballot Box for the elections automatically. You could use Whenever to manage it directly from the APP. You probably want to schedule a
bundle exec rake decidim_elections:scheduled_tasks every hour.