-
-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed lighttpd startup/config to return "503 Service unavailable"
status codes if the CCU startup is not yet finished. This should prevent potential runtime issues in case external engines like ioBroker or HomeAssistant are trying to use remoteAPI ports when not all CCU services are properly started. In addition, we now allow only certain query URLs for port 8181/48181 for external queries.
- Loading branch information
Showing
6 changed files
with
331 additions
and
143 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
buildroot-external/overlay/WebUI-raspmatic/www/api/notready.cgi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/tclsh | ||
|
||
puts "Content-Type: text/plain" | ||
puts "Status: 503" | ||
puts "" | ||
puts "CCU not ready yet" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
163 changes: 163 additions & 0 deletions
163
buildroot-external/overlay/base/etc/lighttpd/conf.d/webui_remoteapi.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
#-------------------------------- | ||
# ReGaHss Script (:8181 -> :8183) | ||
#-------------------------------- | ||
else $SERVER["socket"] == ":8181" { | ||
ssl.engine = "disable" | ||
$HTTP["url"] !~ "\.(?:exe|oxml|hssml)" { | ||
$HTTP["remoteip"] !~ "^(127\.0\.0\.1|::ffff:127\.0\.0\.1|::1)$" { | ||
url.access-deny = ( "" ) | ||
} | ||
} | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 8183))) | ||
} | ||
else $SERVER["socket"] == "[::]:8181" { | ||
ssl.engine = "disable" | ||
$HTTP["url"] !~ "\.(?:exe|oxml|hssml)" { | ||
$HTTP["remoteip"] !~ "^(127\.0\.0\.1|::ffff:127\.0\.0\.1|::1)$" { | ||
url.access-deny = ( "" ) | ||
} | ||
} | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 8183))) | ||
} | ||
|
||
#--------------------------------------- | ||
# ReGaHss Script TLS (:48181 -> :8183) | ||
#--------------------------------------- | ||
else $SERVER["socket"] == ":48181" { | ||
ssl.engine = "enable" | ||
$HTTP["url"] !~ "\.(?:exe|oxml|hssml)" { | ||
$HTTP["remoteip"] !~ "^(127\.0\.0\.1|::ffff:127\.0\.0\.1|::1)$" { | ||
url.access-deny = ( "" ) | ||
} | ||
} | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 8183))) | ||
} | ||
else $SERVER["socket"] == "[::]:48181" { | ||
ssl.engine = "enable" | ||
$HTTP["url"] !~ "\.(?:exe|oxml|hssml)" { | ||
$HTTP["remoteip"] !~ "^(127\.0\.0\.1|::ffff:127\.0\.0\.1|::1)$" { | ||
url.access-deny = ( "" ) | ||
} | ||
} | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 8183))) | ||
} | ||
|
||
#--------------------------------- | ||
# ReGaHss XmlRpc (:1999 -> :31999) | ||
#--------------------------------- | ||
else $SERVER["socket"] == ":1999" { | ||
ssl.engine = "disable" | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 31999))) | ||
} | ||
else $SERVER["socket"] == "[::]:1999" { | ||
ssl.engine = "disable" | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 31999))) | ||
} | ||
|
||
#-------------------------------------- | ||
# ReGaHss XmlRpc TLS (:41999 -> :31999) | ||
#-------------------------------------- | ||
else $SERVER["socket"] == ":41999" { | ||
ssl.engine = "enable" | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 31999))) | ||
} | ||
else $SERVER["socket"] == "[::]:41999" { | ||
ssl.engine = "enable" | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 31999))) | ||
} | ||
|
||
#--------------------------------------- | ||
# crRFD Legacy XmlRpc (:2010 -> :32010) | ||
#--------------------------------------- | ||
else $SERVER["socket"] == ":2010" { | ||
ssl.engine = "disable" | ||
proxy.server = ( "" => ( "localhost" => ("host" => "127.0.0.1", "port" => 32010))) | ||
} | ||
else $SERVER["socket"] == "[::]:2010" { | ||
ssl.engine = "disable" | ||
proxy.server = ( "" => ( "localhost" => ("host" => "127.0.0.1", "port" => 32010))) | ||
} | ||
|
||
#------------------------------------------- | ||
# crRFD Legacy XmlRpc TLS (:42010 -> :32010) | ||
#------------------------------------------- | ||
else $SERVER["socket"] == ":42010" { | ||
ssl.engine = "enable" | ||
proxy.server = ( "" => ( "localhost" => ("host" => "127.0.0.1", "port" => 32010))) | ||
} | ||
else $SERVER["socket"] == "[::]:42010" { | ||
ssl.engine = "enable" | ||
proxy.server = ( "" => ( "localhost" => ("host" => "127.0.0.1", "port" => 32010))) | ||
} | ||
|
||
#--------------------------- | ||
# HMServer (:9292 -> :39292) | ||
#--------------------------- | ||
else $SERVER["socket"] == ":9292" { | ||
ssl.engine = "disable" | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 39292))) | ||
} | ||
else $SERVER["socket"] == "[::]:9292" { | ||
ssl.engine = "disable" | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 39292))) | ||
} | ||
|
||
#-------------------------------- | ||
# HMServer TLS (:49292 -> :39292) | ||
#-------------------------------- | ||
else $SERVER["socket"] == ":49292" { | ||
ssl.engine = "enable" | ||
proxy.server = ( "" => ( "localhost" => ("host" => "127.0.0.1", "port" => 39292))) | ||
} | ||
else $SERVER["socket"] == "[::]:49292" { | ||
ssl.engine = "enable" | ||
proxy.server = ( "" => ( "localhost" => ("host" => "127.0.0.1", "port" => 39292))) | ||
} | ||
|
||
#----------------------------- | ||
# RFD XmlRpc (:2001 -> :32001) | ||
#----------------------------- | ||
else $SERVER["socket"] == ":2001" { | ||
ssl.engine = "disable" | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 32001))) | ||
} | ||
else $SERVER["socket"] == "[::]:2001" { | ||
ssl.engine = "disable" | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 32001))) | ||
} | ||
|
||
#---------------------------------- | ||
# RFD XmlRpc TLS (:42001 -> :32001) | ||
#---------------------------------- | ||
else $SERVER["socket"] == ":42001" { | ||
ssl.engine = "enable" | ||
proxy.server = ( "" => ( "localhost" => ("host" => "127.0.0.1", "port" => 32001))) | ||
} | ||
else $SERVER["socket"] == "[::]:42001" { | ||
ssl.engine = "enable" | ||
proxy.server = ( "" => ( "localhost" => ("host" => "127.0.0.1", "port" => 32001))) | ||
} | ||
|
||
#-------------------------------- | ||
# HS485D XmlRpc (:2000 -> :32000) | ||
#-------------------------------- | ||
else $SERVER["socket"] == ":2000" { | ||
ssl.engine = "disable" | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 32000))) | ||
} | ||
else $SERVER["socket"] == "[::]:2000" { | ||
ssl.engine = "disable" | ||
proxy.server = ( "" => ("localhost" => ("host" => "127.0.0.1", "port" => 32000))) | ||
} | ||
|
||
#------------------------------ | ||
# HS485D TLS (:42000 -> :32000) | ||
#------------------------------ | ||
else $SERVER["socket"] == ":42000" { | ||
ssl.engine = "enable" | ||
proxy.server = ( "" => ( "localhost" => ("host" => "127.0.0.1", "port" => 32000))) | ||
} | ||
else $SERVER["socket"] == "[::]:42000" { | ||
ssl.engine = "enable" | ||
proxy.server = ( "" => ( "localhost" => ("host" => "127.0.0.1", "port" => 32000))) | ||
} |
Oops, something went wrong.