* Platform information:
"systemInfo": {
"configFolder": "/etc/openhab",
"userdataFolder": "/var/lib/openhab",
"logFolder": "/var/log/openhab",
"javaVersion": "11.0.17",
"javaVendor": "Azul Systems, Inc.",
"javaVendorVersion": "Zulu11.60+19-CA",
"osName": "Linux",
"osVersion": "5.15.76-v8+",
"osArchitecture": "aarch64",
"availableProcessors": 4,
"freeMemory": 29209456,
"totalMemory": 187695104,
"startLevel": 100
}
Running OH 3.3 Release build on Debian Linux:
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
- Issue of the topic: I want to set a default page for the static hosting at /etc/openhab/html
The openHAB platform allows for static hosting of files placed in /etc/openhab/html. This works fine, and files placed there can be accessed easily at http://openhab-ip-address/static/filename.ext.
However, I am trying to place an application in this folder which requires the url to end with /. Jetty allows for configuring a ‘welcome page’ according to Jetty documentation. For example,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC
"-//Mort Bay Consulting//DTD Configure//EN"
"http://www.eclipse.org/jetty/configure_9_3.dtd">
<!--
Configure a custom context for serving javadoc as static resources
-->
<Configure class="org.eclipse.jetty.server.handler.ContextHandler">
<Set name="contextPath">/javadoc</Set>
<Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/javadoc/</Set>
<Set name="handler">
<New class="org.eclipse.jetty.server.handler.ResourceHandler">
<Set name="welcomeFiles">
<Array type="String">
<Item>index.html</Item>
</Array>
</Set>
<Set name="cacheControl">max-age=3600,public</Set>
</New>
</Set>
</Configure>
But I cannot find anywhere that this can be configured. It seems too easy to drop a file like this into the /etc/openhab/html folder and have Jetty pick it up?
So, to restate, in order to access /etc/openhab/html/index.html I must enter an url like http://openhab:8080/static/index.html, where I aim to access that same document via http://openhab:8080/static/.
Has anyone got any experience attempting to configure this, or a better source of documentation on how we can customize it?
Thanks in advance!