Environment configuration
In order to let Minerva to work correctly you'll need to modify some variables in the app.py file located in the main directory of your Python Virtual Environment.
Setting up Minerva
Navigate to Minerva installation directory
cd /mnt/minerva
Open the configuration file by giving the following command.
nano minervaconf.py
After you opened the file you'll see some code like this:
#Minerva Instance Configuration File -- dev
appConf = {
"OAUTH2_CLIENT_ID": "minerva_oauth_client_id",
"OAUTH2_CLIENT_SECRET": "a_long_and_random_password",
"OAUTH2_ISSUER": "https://identity-server-url/realms/your-realm",
"FLASK_SECRET": "a_long_and_random_string",
}
database = {
"DATABASE_CONFIG":"mysql+mysqlconnector://dbuser:[email protected]:3306/minerva_database_name"
}
ai = {
"MINERVA_AI_ENDPOINT":"https://your-assigned-ai-endpoint.poleis.cloud",
"MINERVA_AI_TOKEN":"ADD_HERE_THE_MINERVA_AI_LICENSE_TOKEN_FOR_THE_PAID_VERSION",
"MINERVA_AI_INSTANCE_NAME":"ComuneDiTaormina"
}
1. Filling the appConf section
See the table below that contains useful information on how to fill the first section of the minervaconf.py file.
| Value | Sample data | What is it |
|---|---|---|
| OAUTH2_CLIENT_ID | minerva | The Client ID generated by your Identity and Access Management software, such as Keycloak |
| OAUTH2_CLIENT_SECRET | asdfghjkk10293845867 | The Client Secret, also generated by your Identity and Access Management software |
| OAUTH2_ISSUER | https://id.poleis.cloud/realms/poleis | The public URL for your Identity and Access Management software |
| FLASK_SECRET | knajUSBnbsaj8283Nskabnd | A long string used for securing your Minerva installation (A-Z,a-z,0-9 characters only) |
See how to configure Keycloak to work with Minerva here
2. Configuring the database
We presume that you've already configured the database as specified in the database configuration guide.
Here you'll just have to point the Minerva installation to your new DB server instance.
| Sample URL part | Expected value | Sample data |
|---|---|---|
| mysql+mysqlconnector:// | Nothing to change | mysql+mysqlconnector:// |
| dbuser | Set this to your DB user | alice |
| : | separator | : |
| dbpass | Set this to your DB password | MySuperStrongPassword1111 |
| @ | Nothing to change | @ |
| 10.10.10.10:3306 | Change this to the static IP of your database server. Update the port accordingly. | 172.16.202.100:3306 |
| / | separator | / |
| minerva_database_name | Set this to the value of Minerva database table name. | minerva |
The final database string, for the sample data column will be:
[...]
database = {
"DATABASE_CONFIG":"mysql+mysqlconnector://alice:[email protected]:3306/minerva"
}
[...]
Done!
3. Minerva AI
Minerva AI is a functionality currently (as of August 2024) offered only to a restricted group of beta users, that will be included in the final version of Minerva, under a paid license per-month.
Minerva AI uses OpenAI ChatGPT4o model to process, analyze and add tax disputes automatically, therefore it's a paid service.
Minerva AI server is hosted by Poleis directly, the access to it is granted per-user or per-instance under a monthly fee.
If you bought the Minerva AI plan, you'll receive by our team the values that needs to be set in this file.
The one below is a sample configuration.
ai = {
"MINERVA_AI_ENDPOINT":"https://node00-minerva-ai.poleis.cloud",
"MINERVA_AI_TOKEN":"eyJhbGciOiJIUzI1NiIsInR5cCI6Ik1JTkVSVkEifQ.eyJpbnN0YW5jZV91cmwiOiJtaW5lcnZhLmNvbXVuZW1hY29uZG8ucG9sZWlzLmNsb3VkIiwibGljZW5zZSI6Im1vbnRobHkiLCJwcm9kdWN0a2V5IjoiSlNJVUotQUJGSVVCV0ZXR0lVRS1XR1VHODk1VDlUNUc5VC1IRzlHNTQtOUcifQ.Q1t--k6aaSGzBXkYVqAKCOtXsX46aT3lXSu-g3_glJc",
"MINERVA_AI_INSTANCE_NAME":"ComuneTaormina98039"
}
Finished! 😁
You configured your Minerva instance. Save by giving 'Control + X' and confirm with Y.