Properties set in sonar.properties are not shown in the UI

478 views
Skip to first unread message

deva...@gmail.com

unread,
May 23, 2016, 6:03:44 PM5/23/16
to SonarQube, jerard.de...@soprasteria.com
Hi,

When you set some properties in the $SONAR_HOME/conf/sonar.properties, the value is not shown in the UI and taken into account depending on the key.
My goal is to build a docker container with pre-set email notification configuration.

Steps to reproduce :

- Put in sonar.properties :
email.smtp_host.secured=smtp.foo.com
email
.smtp_port.secured=25
email
.smtp_secure_connection.secured=false
email
.smtp_username.secured=bar
email
.smtp_password.secured=password
email
.from=bar@foo.com
sonar
.core.serverBaseURL=http://myserver:8080

- Start sonar web server
- Connect with admin and go to Settings > General Settings > General > General
-> Server Base URL is empty
- go to Settings > General Settings > General > Email
-> Every thing is empty
- Hit the email notification test button
-> Email is send and successfully received because SMTP configuration set in sonar.properties is taken into account
-> Server URL is incorrect in the email body because not taken into account

My guess here is that the values are not shown because EmailConfigurationController only rely on the database but EmailNotificationChannel loads the properties in proper order which is DB / sonar.properties / environment variables / system properties.

It is kind of confusing that the properties are not shown in the UI and sometime taken into account or not.
Maybe the fields should be filled with the values set in sonar.properties and overridden by DB insert if the admin changes it, or the fields set to read-only.

stephan...@gmail.com

unread,
Feb 15, 2018, 6:03:55 AM2/15/18
to SonarQube
Did you have any success in making this work, or some feedback from the SonarQube team?
Reply all
Reply to author
Forward
0 new messages