Chapter 3. Configuration of HawtIO HawtIO consists of two main components: The server runtime and client console. The server runtime is the Java backend that runs on the server side, and the client console is the JavaScript frontend that is deployed and runs on the browser. Therefore, two types of configuration are provided for HawtIO: HawtIO and its plugins can configure their behaviours through System properties. Configuration properties - The server runtime configuration hawtconfig.json - The client console configuration 3.1. Configuration properties The HawtIO server runtime and its plugins can configure their behaviours through System properties. The following table lists the configuration properties for the HawtIO core system and various plugins. Note For the configuration properties related to security and authentication, refer to Security . System Default Description hawtio.disableProxy false With this property set to true, ProxyServlet (/hawtio/proxy/*) can be disabled. This makes the Connect plugin unavailable, which means HawtIO can no longer connect to remote JVMs, but sometimes users might want to do so because of security if the Connect plugin is not used. hawtio.localAddressProbing true Whether local address probing for proxy allowlist is enabled or not upon startup. Set this property to false to disable it. hawtio.proxyAllowlist localhost, 127.0.0.1 Comma-separated allowlist for target hosts that Connect plugin can connect to via ProxyServlet. All hosts not listed in this allowlist are denied to connect for security reasons. This option can be set to * to allow all hosts. Prefixing an element of the list with "r:" allows to define a regex (example: localhost,r:myserver[0-9]+.mydomain.com) hawtio.redirect.scheme The scheme is to redirect the URL to the login page when authentication is required. hawtio.sessionTimeout The maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. If this option is not configured, then HawtIO uses the default session timeout of the servlet container. 3.2. Quarkus For Quarkus, all those properties are configurable in application.properties or application.yaml with the quarkus.hawtio prefix. For example: quarkus.hawtio.disableProxy = true 3.3. Spring Boot For Spring Boot, all those properties are configurable in application.properties or application.yaml as is. For example: hawtio.disableProxy = true 3.4. Configuring Jolokia through system properties The Jolokia agent is deployed automatically with io.hawt.web.JolokiaConfiguredAgentServlet that extends Jolokia native org.jolokia.http.AgentServlet class, defined in hawtio-war/WEB-INF/web.xml . If you want to customize the Jolokia Servlet with the configuration parameters that are defined in the Jolokia documentation , you can pass them as System properties prefixed with jolokia . For example: jolokia.policyLocation = file:///opt/hawtio/my-jolokia-access.xml 3.5. Custom branding configuration of HawtIO The hawtconfig.json is the entrypoint JSON file for configuring the frontend console of HawtIO. It can be used to customise the various parts of the console: the branding, styles and basic UI parts such as the login page and about modal, as well as the console-specific behaviours of some of the HawtIO plugins. Here is an example file of hawtconfig.json : Example hawtconfig.json : { "branding": { "appName": "HawtIO Management Console", "showAppName": false, "appLogoUrl": "hawtio-logo.svg", "companyLogoUrl": "hawtio-logo.svg", "css": "", "favicon": "favicon.ico" }, "login": { "description": "Login page for HawtIO Management Console.", "links": [ { "url": "#terms", "text": "

Commands:
quarkus.hawtio.disableProxy = true
hawtio.disableProxy = true
jolokia.policyLocation = file:///opt/hawtio/my-jolokia-access.xml
{ "branding": { "appName": "HawtIO Management Console", "showAppName": false, "appLogoUrl": "hawtio-logo.svg", "companyLogoUrl": "hawtio-logo.svg", "css": "", "favicon": "favicon.ico" }, "login": { "description": "Login page for HawtIO Management Console.", "links": [ { "url": "#terms", "text": "Terms of Use" }, { "url": "#help", "text": "Help" }, { "url": "#privacy", "text": "Privacy Policy" } ] }, "about": { "title": "HawtIO Management Console", "description": "A HawtIO reimplementation based on TypeScript + React.", "imgSrc": "hawtio-logo.svg", "productInfo": [ { "name": "ABC", "value": "1.2.3" }, { "name": "XYZ", "value": "7.8.9" } ], "copyright": "(c) HawtIO project" }, "disabledRoutes": [ "/disabled" ] }
"branding": { "appName": "HawtIO Management Console", "showAppName": false, "appLogoUrl": "hawtio-logo.svg", "companyLogoUrl": "hawtio-logo.svg", "css": "", "favicon": "favicon.ico" }
"login": { "description": "Login page for HawtIO Management Console.", "links": [ { "url": "#terms", "text": "Terms of Use" }, { "url": "#help", "text": "Help" }, { "url": "#privacy", "text": "Privacy Policy" } ] }
"about": { "title": "HawtIO Management Console", "description": "A HawtIO reimplementation based on TypeScript + React.", "imgSrc": "hawtio-logo.svg", "productInfo": [ { "name": "ABC", "value": "1.2.3" }, { "name": "XYZ", "value": "7.8.9" } ], "copyright": "(c) HawtIO project" }
"disabledRoutes": [ "/disabled" ]
<domain>/<prop1>=<value1>,<prop2>=<value2>,
"jmx": { "workspace": [ "hawtio", "java.lang/type=Memory", "org.apache.camel", "no.such.domain" ] }
"online": { "projectSelector": "myproject", "consoleLink": { "text": "HawtIO Management Console", "section": "HawtIO", "imageRelativePath": "/online/img/favicon.ico" } }
import { HawtIOPlugin, configManager } from '@hawtio/react' /** * The entry function of your plugin. */ export const plugin: HawtIOPlugin = () => { } // Register the custom plugin version to HawtIO // See package.json "replace-version" script for how to replace the version placeholder with a real version configManager.addProductInfo('HawtIO Sample Plugin', '__PACKAGE_VERSION_PLACEHOLDER__') /* * This example also demonstrates how branding and styles can be customised from a WAR plugin. * * The Plugin API `configManager` provides `configure(configurer: (config: Hawtconfig) => void)` method * and you can customise the `Hawtconfig` by invoking it from the plugin's `index.ts`. */ configManager.configure(config => { // Branding & styles config.branding = { appName: 'HawtIO Sample WAR Plugin', showAppName: true, appLogoUrl: '/sample-plugin/branding/Logo-RedHat-A-Reverse-RGB.png', css: '/sample-plugin/branding/app.css', favicon: '/sample-plugin/branding/favicon.ico', } // Login page config.login = { description: 'Login page for HawtIO Sample WAR Plugin application.', links: [ { url: '#terms', text: 'Terms of use' }, { url: '#help', text: 'Help' }, { url: '#privacy', text: 'Privacy policy' }, ], } // About modal if (!config.about) { config.about = {} } config.about.title = 'HawtIO Sample WAR Plugin' config.about.description = 'About page for HawtIO Sample WAR Plugin application.' config.about.imgSrc = '/sample-plugin/branding/Logo-RedHat-A-Reverse-RGB.png' if (!config.about.productInfo) { config.about.productInfo = [] } config.about.productInfo.push( { name: 'HawtIO Sample Plugin - simple-plugin', value: '1.0.0' }, { name: 'HawtIO Sample Plugin - custom-tree', value: '1.0.0' }, ) // If you want to disable specific plugins, you can specify the paths to disable them. //config.disabledRoutes = ['/simple-plugin'] })