Elections Bulletin Board

In order to celebrate End-to-end auditable votings using the Elections module, you will need to connect your Decidim instance with an instance of the Decidim Bulletin Board application, preferably run by an independent organization.

Identification pair of keys generation

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 BULLETIN_BOARD_AUTHORITY_NAME.

After that, copy the private key and store that value on the environment variable BULLETIN_BOARD_IDENTIFICATION_PRIVATE_KEY.

Ensure that the private key is not lost between deployments and servers reboots and that only can be accessed by the application.

Configuration of the Bulletin Board 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 BULLETIN_BOARD_API_KEY and BULLETIN_BOARD_SERVER, respectively.

The following YAML snippet with all the defined environment variables should be used in the default block of your application config/secrets.yml file. 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.

Scheduled tasks

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.