Skip to content

Setup steps

Irina Borozan edited this page Oct 12, 2020 · 4 revisions

Election Setup Steps 🚀

Setup Backend

Deploy backend app & init DB

Edit appsettings.json

DB credentials

"ConnectionStrings": {
     "DefaultConnection": "ADD_DB_CONNECTION_STRING_HERE"
  },

Refer to connectionstrings.com for standards; make sure it's the same for the domain project Hashing for passwords

"HashOptions": {
  "Salt": "ADD_SALT",
  "ServiceType": ADD "Hash" or "ClearText"
},

make sure you have the same one in the tests project when generating the hashes ;) Mobile security

  • add string for incorrect login error displayed on mobile devices
  • set LockDevice = should users only be allowed to login from a single device?
  "MobileSecurityOptions": {
    "InvalidCredentialsErrorMessage": "{ \"error\": \"ADD_ERROR_TEXT_HERE\" }",
    "LockDevice": ADD true/false
  },

Setup for push notifications

  "FirebaseServiceOptions": {
    "ServerKey": "ADD_URL_TO_FIREBASE_CONFIG_JSON"
  },

Setup for file storage (needed for loading pictures and video to notes)

"FileServiceOptions": {
    "Type": "BlobService"
},
"BlobStorageOptions": {
    "AccountName": "ADD_HERE",
    "AccountKey": "ADD_HERE",
    "Container": "ADD_CONTAINER_NAME",
    "UseHttps": true
}

these are the details of your azure blob storage - you can retrieve these from the Azure portal quite easy: navigate to the storage account -> settings section -> Access Keys. Make sure you have a container set up for that storage Set Application Cache

"ApplicationCacheOptions": {
	"Implementation": "{`NoCache`, `MemoryDistributedCache` or `RedisCache`}",
	"Hours": 0,
	"Minutes": 30,
	"Seconds": 0
}

For RedisCache RedisCacheOptions should be present and properly configured Set Redis Cache

  "RedisCacheOptions": {
    "Configuration": "",
    "InstanceName": ""
  },

in the domain:

{
  "ConnectionStrings": {
    "DefaultConnection": "{sqlServerConnectionString}" // refer to connectionstrings.com for standards;
  }
}

in the tests:

{
  "HashOptions": {
        "Salt": "{salt}" // make sure you have the same one in the api project when generating the hashes ;)
  }
}

Generating passwords

Build the VotingIrregularities.Tests Under the build output folder (probably: monitorizare-vot\private-api\app\test\VotingIrregularities.Tests\bin\Debug\netcoreapp2.1) create conturi.txt file with the format {phoneNumber}\t{desiredPin} on each line. (yes, these are tab separated values, you can export an excel file with that format)

Comment (or remove) the Skip handle from the Fact attribute in the HashTests.cs\SetPasswords test.

The result of the test should be another file called conturi-cu-parole.txt that will also contain the hashes of those PINs as another column.

Reminder: make sure you have the same Salt configured in the appsettings.json file in the tests and the api.

Load DB data

Setup Web App

Setup mobile apps