Hi,
I recently added building Keycloak as a Jenkins job that runs on a Windows build machine.
I noticed that each time a build is done, we get four Firewall popups requesting to grant
access to something related to mongo embedded plugin. I did not see this on my MacBook Pro
local build so its a Windows only issue. The problem is it creates a new application name
each time it is run so simply adding the access restriction to Windows firewall once
doesn't do the trick.
I tracked it down to pom files that reference the embedmongo-maven-plugin needing to add a
<bindIp>127.0.0.1</bindIp> to the plugin configuration.
There are four pom files that need to be modified:
audit/mongo/pom.xml
export-import/export-import-impl/pom.xml
model/mongo/pom.xml
testsuite/integration/pom.xml
There is a very simple pattern. In each pom there is a properties section for
keycloak.model.mongo.*
I added a property for bindIp as follows:
<properties>
<keycloak.model.mongo.host>localhost</keycloak.model.mongo.host>
<keycloak.model.mongo.port>27018</keycloak.model.mongo.port>
<keycloak.model.mongo.db>keycloak</keycloak.model.mongo.db>
<keycloak.model.mongo.clearOnStartup>true</keycloak.model.mongo.clearOnStartup>
<keycloak.model.mongo.bindIp>127.0.0.1</keycloak.model.mongo.bindIp>
</properties>
Then for surefire I added a system property variable as follows:
<systemPropertyVariables>
<keycloak.model.mongo.host>${keycloak.model.mongo.host}</keycloak.model.mongo.host>
<keycloak.model.mongo.port>${keycloak.model.mongo.port}</keycloak.model.mongo.port>
<keycloak.model.mongo.db>${keycloak.model.mongo.db}</keycloak.model.mongo.db>
<keycloak.model.mongo.clearOnStartup>${keycloak.model.mongo.clearOnStartup}</keycloak.model.mongo.clearOnStartup>
<keycloak.model.mongo.bindIp>${keycloak.model.mongo.bindIp}</keycloak.model.mongo.bindIp>
</systemPropertyVariables>
And lastly for the embedmongo-maven-plugin modify the configration as follows:
<configuration>
<port>${keycloak.model.mongo.port}</port>
<logging>file</logging>
<logFile>${project.build.directory}/mongodb.log</logFile>
<bindIp>${keycloak.model.mongo.bindIp}</bindIp>
</configuration>
For the audit file replace model with audit.
I'm able to build on Windows now without any popups.
This will be greatly appreciated if it can be done!
Patrick Madden
Principal Design Engineer
Tom Sawyer Software
1997 El Dorado Avenue
Berkeley, CA 94707
E-mail: pmadden@
tomsawyer.com