3.2.5 Import set up files
- 1.To begin with, OpenCRVS Core must be running, but it is not necessary for your country configuration server to be running. Ensure that OpenCRVS Core is running following the steps in 3.1.3 Starting and stopping OpenCRVS.
- 2.Open a new Terminal window when OpenCRVS Core is running and cd inside your country configuration repo directory. E.G:
- 3.Ensure that node_modules are installed by running
- 4.To clear any existing data, such as our Farajaland default data run this command inside the country configuration repo directory:
- 7.When running OpenCRVS locally, login for the first time will fail an SSL certificate security check as we are using self signed certs locally of course, follow the instructions in the error message and click the blue link.
- 8.In the Chrome message click "Advanced", then "Proceed to localhost (unsafe)". There is nothing to worry about as this is just accepting the locally signed SSL cert. You will see some JSON like this:
- 9.You can now go back to this link, login and set a new password for OpenHIM. Ensure that you set a strong password using a service such as 1Password . You MUST store the OpenHIM password safely as you will need it to login when monitoring OpenCRVS and when deploying the site to a server in step 3.3.3 Create Docker Secrets...
- 11.A modal will open displaying the channels that will be imported in a modal titled "Resolve Metadata Conflicts". These are the routing configs for OpenCRVS in OpenHIM. Scroll to the bottom and click 'Import changes'.
- 12.The Page will refresh and you will see this. OpenHIM is now configured for your country:
- 13.Return to the Terminal window inside your country configuration repo directory
- 14.The next step is run once depending on if you are setting up test employees for quality assurance on a local, development or QA environment, or if you are setting up production users for a live environment. You cannot switch between a development and production base installation. To switch from development to production, you must start again from step 1 at the very beginning of this page and create a new import for your needs. To populate reference data for your country requirements, by default, you run the
yarn db:populatecommand with 3 parameters depending on whether or not you are setting up OpenCRVS with test employees or production employees. Once again, if you encounter an error, or if you want to change your set up from development employees to production employees, you must start the import process from step 1 at the very beginning of this page. The first parameter will be the password that you wish to set for your test employees in local development only. Any test users will use this password to login to OpenCRVS. The second parameter determines if the users you are about to import are for testing or production. The parameter is an environment code that must be set to either "development" or "production". The third parameter must be the Alpha 3 country code in uppercase for your country. E.G. for Jamaica this would be JAM. A list of Alpha 3 country codes are here. We use this parameter to convert your test user mobile phone numbers to an MSISDN number containing the correct country code. Therefore for test users in development the command might look like this for Jamaica, where all test users will use the password "rumpunch"
yarn db:populate rumpunch development JAMFor production users the command might look like this for Jamaica. Dont be concerned that the password "rumpunch" is entered. You must enter a second parameter, but this test password is ignored and instead strong passwords are automatically generated and displayed to you.
yarn db:populate rumpunch production JAMSo now you must choose to perform 14A (development) or 14B (production). 14A. (development) . Run the command substituting the parameters as required:
yarn db:populate <test user password> development <alpha 3 country code>Provided this command runs successfully, you will see output like this.If you do not see similar output, something has gone wrong and you must start again from the beginning. Perhaps your CSV files have a formatting problem. You may see an error message that may help you debug. Test users must NEVER be deployed to a production server as they all use the same password and bypass 2FA. You have been warned about this. 14B. (production) . Run the command substituting the parameters as required: Once again, dont be concerned that the test password is supplied. You must enter a second parameter, but this test password is ignored and instead strong passwords are automatically generated and displayed to you
yarn db:populate <test user password> production <alpha 3 country code>Provided this command runs successfully, you will see output like this.Note that the test password "rumpunch" has been ignored. Instead the National System Administrator has been generated a strong password:USERNAME: jonathan.campbell & PASSWORD: subscripted-septicemia-distinguishing-graduateThe strong passwords are created using niceware and these usernames and passwords along with contact details for the users are save into a file: "login-details.json" in this folder. You can then contact the users and tell them their production password which they can change to something else strong and memorable to them when they login WARNING: The niceware wordlist has not been rigorously checked for offensive words. Use at your own risk. You may need to login as one of these users and change a password if it is deemed offensive.