Linking the portal to your Sonar instance - SonarSoftware/customer_portal GitHub Wiki
The Sonar customer portal is built on top of a variety of pieces of third party software. One piece of software used is a Sonar-produced library called the Customer Portal Framework. This framework exists to allow you to easily build your own customer portal - if you want to build one from scratch, go check it out!
We need to configure this library to connect it to your Sonar instance, so that the portal will function properly. To do this, first type cp /usr/share/portal/vendor/sonarsoftware/customer_portal_framework/src/.env.example /usr/share/portal/vendor/sonarsoftware/customer_portal_framework/src/.env
and then nano /usr/share/portal/vendor/sonarsoftware/customer_portal_framework/src/.env
. This file is very much like the .env file we edited earlier in configuration, except there are only three settings here.
- API_USERNAME - Set this to the username of a user in your Sonar instance with account create, read, update, and delete permissions, ticket create, read, and update permissions, and financial read permissions. You should create a new user with only these permissions to use for the portal - do not use your administrative account!
- API_PASSWORD - This is the password for the user account above. Make sure it is wrapped in double quotes (
"
). - SONAR_URL - The full URL to your Sonar instance (e.g. https://myisp.sonar.software)
Once you are done, press CTRL+X
to exit, answer y
to save and press enter.
Please note that if you have enabled the application firewall in your Sonar instance, you will need to add the IP address of your customer portal to the firewall allow list or the portal will not be able to connect. In fact, this is a great security measure - if you enable the firewall, and only allow the IP of the customer portal to access your instance (along with your other secure IPs that you use to access the instance) then it is a great additional level of security!
Once this is done, log in to your Sonar instance and navigate to System > Configuration > Customer Portal. Input the required information, and enable the customer portal. This will ensure that when billing emails go out, they contain links to the customer portal rather than to the online bill pay system. This will also redirect users attempting to access old online bill pay links to the customer portal.
The next step is to setup an SSL certificate for your portal.