🚑 Fixes SSL support for OTA server

This commit is contained in:
Franck Nijhof 2018-05-23 21:40:40 +02:00
parent efed129ae1
commit df688cbae2
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3

View file

@ -32,5 +32,26 @@ if [[ "$?" -ne 0 ]];
then then
hass.die 'Patching SonWEB SelfUpdate failed' hass.die 'Patching SonWEB SelfUpdate failed'
fi fi
hass.log.debug 'Applied SonWEB SelfUpdate fix' hass.log.debug 'Applied SonWEB SelfUpdate fix'
patch -F2 -R --ignore-whitespace \
/var/www/sonweb/pages/device_update.php << 'PATCH'
--- device_update.php 2018-05-23 21:31:36.000000000 +0200
+++ device_update.php 2018-05-23 21:30:19.000000000 +0200
@@ -5,7 +5,7 @@
$subdir = str_replace( "\\", "/", $subdir );
$subdir = $subdir == "/" ? "" : $subdir;
- $otaServer = $_SERVER['REQUEST_SCHEME'] . "://".$localIP.":".$_SERVER[ "SERVER_PORT" ]._BASEURL_."";
+ $otaServer = "http://".$localIP.":".$_SERVER[ "SERVER_PORT" ]._BASEURL_."";
if ( isset( $_POST[ 'minimal_firmware_path' ] ) && !empty( $_POST[ 'minimal_firmware_path' ] ) ) {
$ota_minimal_firmware_url = $otaServer."data/firmwares/sonoff-minimal.bin";
PATCH
# shellcheck disable=SC2181
if [[ "$?" -ne 0 ]];
then
hass.die 'Patching SonWEB OTA over HTTPS failed'
fi
hass.log.debug 'Applied SonWEB OTA over HTTPS fix'