Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion data/config/apache/000-default.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# openwb-version:6
# openwb-version:7
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
Expand Down Expand Up @@ -40,6 +40,11 @@
# Proxy WebSocket and MQTT connections to Mosquitto
# ToDo: remove /mqtt target once all clients use /ws
ProxyPassMatch "^/(ws|mqtt)(/|$)" "ws://127.0.0.1:9003/"

# Proxy simpleAPI requests to the Python HTTP server in simpleAPI_mqtt.py
# (port from data/config/simpleapi_config.json's "http" section).
ProxyPassMatch "^/openWB/simpleAPI(/|$)" "http://127.0.0.1:8099/"
ProxyPassReverse "/openWB/simpleAPI/" "http://127.0.0.1:8099/"
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
7 changes: 6 additions & 1 deletion data/config/apache/apache-openwb-ssl.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# openwb-version:8
# openwb-version:9
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
Expand Down Expand Up @@ -143,6 +143,11 @@
# ToDo: remove /mqtt target once all clients use /ws
ProxyPassMatch "^/(ws|mqtt)(/|$)" "ws://127.0.0.1:9003/"

# Proxy simpleAPI requests to the Python HTTP server in simpleAPI_mqtt.py
# (port from data/config/simpleapi_config.json's "http" section).
ProxyPassMatch "^/openWB/simpleAPI(/|$)" "http://127.0.0.1:8099/"
ProxyPassReverse "/openWB/simpleAPI/" "http://127.0.0.1:8099/"

</VirtualHost>
</IfModule>

Expand Down
7 changes: 6 additions & 1 deletion data/config/apache/localhost.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# openwb-version:2
# openwb-version:3
Listen 127.0.0.1:81

<VirtualHost *:81>
Expand Down Expand Up @@ -42,6 +42,11 @@ Listen 127.0.0.1:81
# Proxy WebSocket and MQTT connections to Mosquitto
# ToDo: remove /mqtt target once all clients use /ws
ProxyPassMatch "^/(ws|mqtt)(/|$)" "ws://127.0.0.1:9003/"

# Proxy simpleAPI requests to the Python HTTP server in simpleAPI_mqtt.py
# (port from data/config/simpleapi_config.json's "http" section).
ProxyPassMatch "^/openWB/simpleAPI(/|$)" "http://127.0.0.1:8099/"
ProxyPassReverse "/openWB/simpleAPI/" "http://127.0.0.1:8099/"
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
2 changes: 1 addition & 1 deletion data/config/openwb-simpleAPI.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ After=mosquitto.service
[Service]
User=openwb
WorkingDirectory=/var/www/html/openWB
ExecStart=/var/www/html/openWB/simpleAPI/simpleAPI_mqtt.py
ExecStart=/var/www/html/openWB/simpleAPI/simpleapi.py
Restart=always
# extend timeout to 15min for long running atreboot
TimeoutStartSec=900
Expand Down
12 changes: 0 additions & 12 deletions data/config/simpleAPI_mqtt_config.json

This file was deleted.

26 changes: 26 additions & 0 deletions data/config/simpleapi_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"host": "localhost",
"port": 1884,
"username": null,
"password": null,
"use_tls": false,
"validate_cert": false,
"qos": 0,
"retain": true,
"reconnect_delay": 10,
"log_level": "INFO",
"http": {
"host": "127.0.0.1",
"port": 8099
},
"api": {
"cors_enabled": true
},
"auth": {
"enabled": false,
"require_https": false,
"tokens": [],
"users": {}
},
"debug": false
}
6 changes: 4 additions & 2 deletions runs/setup_apache2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ echo "checking required apache modules..."
enableModule headers
enableModule ssl
enableModule proxy_wstunnel
# needed for the simpleAPI ProxyPass(Match) to the local Python HTTP server
# (previously only enabled for the Pro+ branch below, which proxies to a
# remote Pro+ device over the same module)
enableModule proxy_http

# default site (http and https)
echo "apache default site..."
Expand Down Expand Up @@ -138,12 +142,10 @@ if lsusb | grep -Eq 'RTL8153|AX88179'; then
echo "second network for pro plus detected"
# enable pro+ specific configurations
enableSite apache-proplus
enableModule proxy_http
else
echo "no second network for pro plus detected"
# disable all pro+ specific configurations
disableSite apache-proplus
disableModule proxy_http
fi

# restart apache if required
Expand Down
39 changes: 0 additions & 39 deletions simpleAPI/config/config.php

This file was deleted.

Loading
Loading