mirror of
https://github.com/esphome/esphome.git
synced 2025-09-05 12:52:19 +01:00
Fix host network (#280)
* Fix Add-On host network mode * Split up esphomeyaml tests * Fix perms * Fix * Add esphomeyaml_version option * Revert change to travis.yml
This commit is contained in:
@@ -8,6 +8,7 @@ source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
declare certfile
|
||||
declare keyfile
|
||||
declare port
|
||||
|
||||
mkdir -p /var/log/nginx
|
||||
|
||||
@@ -22,3 +23,6 @@ if hass.config.true 'ssl'; then
|
||||
sed -i "s/%%certfile%%/${certfile}/g" /etc/nginx/nginx.conf
|
||||
sed -i "s/%%keyfile%%/${keyfile}/g" /etc/nginx/nginx.conf
|
||||
fi
|
||||
|
||||
port=$(hass.config.get 'port')
|
||||
sed -i "s/%%port%%/${port}/g" /etc/nginx/nginx.conf
|
||||
|
14
esphomeyaml-edge/rootfs/etc/cont-init.d/30-esphomeyaml.sh
Normal file
14
esphomeyaml-edge/rootfs/etc/cont-init.d/30-esphomeyaml.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: esphomeyaml
|
||||
# This files installs the user esphomeyaml version if specified
|
||||
# ==============================================================================
|
||||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
declare esphomeyaml_version
|
||||
|
||||
if hass.config.has_value 'esphomeyaml_version'; then
|
||||
esphomeyaml_version=$(hass.config.get 'esphomeyaml_version')
|
||||
pip2 install --no-cache-dir --no-binary :all: "https://github.com/OttoWinter/esphomeyaml/archive/${esphomeyaml_version}.zip"
|
||||
end
|
@@ -15,7 +15,7 @@ http {
|
||||
|
||||
upstream esphomeyaml {
|
||||
ip_hash;
|
||||
server 127.0.0.1:80;
|
||||
server unix:/var/run/esphomeyaml.sock;
|
||||
}
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
@@ -24,7 +24,7 @@ http {
|
||||
|
||||
server {
|
||||
server_name hassio.local;
|
||||
listen 6052 default_server ssl;
|
||||
listen %%port%% default_server ssl;
|
||||
root /dev/null;
|
||||
|
||||
ssl_certificate /ssl/%%certfile%%;
|
||||
|
@@ -15,7 +15,7 @@ http {
|
||||
|
||||
upstream esphomeyaml {
|
||||
ip_hash;
|
||||
server 127.0.0.1:80;
|
||||
server unix:/var/run/esphomeyaml.sock;
|
||||
}
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
@@ -24,7 +24,7 @@ http {
|
||||
|
||||
server {
|
||||
server_name hassio.local;
|
||||
listen 6052 default_server;
|
||||
listen %%port%% default_server;
|
||||
root /dev/null;
|
||||
|
||||
location / {
|
||||
|
@@ -11,4 +11,4 @@ if hass.config.true 'leave_front_door_open'; then
|
||||
fi
|
||||
|
||||
hass.log.info "Starting esphomeyaml dashboard..."
|
||||
exec esphomeyaml /config/esphomeyaml dashboard --port 80 --hassio
|
||||
exec esphomeyaml /config/esphomeyaml dashboard --socket /var/run/esphomeyaml.sock --hassio
|
||||
|
Reference in New Issue
Block a user