⬆️ 🔨 Upgrade to Home Panel v0.8.0

This commit is contained in:
Timmo 2019-03-29 22:14:19 +00:00
parent e16e808969
commit 78183ccdac
8 changed files with 54 additions and 197 deletions

View file

@ -72,8 +72,7 @@ Example add-on configuration:
"log_level": "info",
"ssl": true,
"certfile": "fullchain.pem",
"keyfile": "privkey.pem",
"config_file": "home-panel-config.json"
"keyfile": "privkey.pem"
}
```
@ -112,14 +111,6 @@ The private key file to use for SSL.
**Note**: _The file MUST be stored in `/ssl/`, which is default for Hass.io_
### Option: `config_file`
The location of your config.json in `/config/`. More information on
configuration [here][config]. You can edit the config file while the
addon is running. Just refresh the app's page.
**Note**: _The file MUST be stored in `/config/`._
## Changelog & Releases
This repository keeps a change log using [GitHub's releases][releases]

View file

@ -2,25 +2,33 @@ ARG BUILD_FROM=hassioaddons/base:3.0.1
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
# Copy root filesystem
COPY rootfs /
# Install packages
# hadolint ignore=DL3003
RUN \
apk add --no-cache --virtual .build-dependencies \
yarn=1.12.3-r0 \
git=2.20.1-r0 \
openssl=1.1.1b-r1 \
yarn=1.12.3-r0 \
\
&& apk add --no-cache \
nginx=1.14.2-r0 \
nodejs-current=11.3.0-r0 \
\
&& git clone --branch "v0.5.0" --depth=1 \
"https://github.com/timmo001/home-panel-api.git" /opt/api \
\
&& curl -J -L -o /tmp/panel.zip \
"https://github.com/timmo001/home-panel/releases/download/v0.7.0/home-panel-built.zip" \
"https://github.com/timmo001/home-panel/releases/download/v0.8.0/home-panel-built.zip" \
&& unzip -d /tmp /tmp/panel.zip \
&& mv /tmp/build /opt/panel \
\
&& git clone --branch "v0.8.0" --depth=1 \
"https://github.com/timmo001/home-panel.git" /tmp/panel \
&& mv /tmp/panel/api /opt/api \
\
&& mv /etc/home-panel/default.json /opt/api/config \
&& sed -i "s/API_AUTH_SECRET/$(openssl rand -base64 32)/g" /opt/api/config/default.json \
\
&& cd /opt/api \
&& yarn install \
\
@ -28,9 +36,6 @@ RUN \
&& apk del --purge .build-dependencies \
&& rm -fr /tmp/*
# Copy root filesystem
COPY rootfs /
# Build arguments
ARG BUILD_ARCH
ARG BUILD_DATE

View file

@ -30,15 +30,13 @@
"log_level": "info",
"ssl": true,
"certfile": "fullchain.pem",
"keyfile": "privkey.pem",
"config_file": "home-panel-config.json"
"keyfile": "privkey.pem"
},
"schema": {
"log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)",
"ssl": "bool",
"certfile": "str",
"keyfile": "str",
"config_file": "str"
"keyfile": "str"
},
"environment": {
"LOG_FORMAT": "{LEVEL}: {MESSAGE}"

View file

@ -5,10 +5,3 @@
# ==============================================================================
# Check SSL settings
bashio::config.require.ssl
if ! bashio::config.has_value 'config_file'; then
bashio::log.fatal ''
bashio::log.fatal 'No configuration filename was specified.'
bashio::log.fatal 'This is required for the add-on to function.'
bashio::exit.nok
fi

View file

@ -1,14 +0,0 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Community Hass.io Add-ons: Home Panel
# This copies the configs to their respective locations
# ==============================================================================
declare config_file
config_file="/config/$(bashio::config 'config_file')"
if ! bashio::fs.file_exists "${config_file}"; then
bashio::log.info "Config file does not exist. Creating.."
cp /etc/home-panel/home-panel-config.default.json "${config_file}"
bashio::log.info "Created. You should now edit this file at '${config_file}'"
fi

View file

@ -0,0 +1,37 @@
{
"host": "localhost",
"port": 3234,
"public": "../public/",
"paginate": {
"default": 10,
"max": 50
},
"authentication": {
"secret": "API_AUTH_SECRET",
"strategies": ["jwt", "local"],
"path": "/authentication",
"service": "users",
"jwt": {
"header": {
"typ": "access"
},
"audience": "https://timmo.dev/home-panel",
"subject": "anonymous",
"issuer": "feathers",
"algorithm": "HS256",
"expiresIn": "1d"
},
"local": {
"entity": "user",
"usernameField": "username",
"passwordField": "password"
},
"cookie": {
"enabled": true,
"name": "feathers-jwt",
"httpOnly": false,
"secure": false
}
},
"nedb": "/data"
}

View file

@ -1,149 +0,0 @@
{
"theme": {
"custom": [
{
"name": "Midnight",
"base": "dark",
"overrides": {
"primary": "pink",
"backgrounds": {
"main": "#383c45",
"default": "#383c45",
"card": {
"on": "pink[600]",
"off": "#434954",
"disabled": "#7f848e",
"alarm": {
"home": "pink[600]",
"away": "pink[600]"
}
}
},
"text": {
"light": "grey[50]",
"main": "grey[100]"
},
"secondary": "pink"
}
},
{
"name": "Forest",
"base": "light",
"overrides": {
"backgrounds": {
"main": "url(https://images.pexels.com/photos/4827/nature-forest-trees-fog.jpeg) no-repeat fixed center",
"card": {
"on": "lightGreen[700]",
"off": "rgba(160, 200, 160, 0.6)",
"alarm": {
"home": "lightGreen[700]",
"away": "lightGreen[700]"
}
}
}
}
}
]
},
"header": {
"left_outdoor_weather": {
"dark_sky_icon": "sensor.dark_sky_icon",
"condition": "sensor.pws_weather",
"data": [
{
"entity_id": "sensor.pws_temp_c",
"unit_of_measurement": "°C"
},
{
"entity_id": "sensor.pws_relative_humidity",
"unit_of_measurement": "%"
}
]
},
"right_indoor": [
{
"label": "Living Room",
"data": [
{
"entity_id": "sensor.dht22_01_temperature",
"unit_of_measurement": "°C"
},
{
"entity_id": "sensor.dht22_01_humidity",
"unit_of_measurement": "%"
}
]
}
]
},
"pages": [
{
"name": "Home",
"icon": "home"
},
{
"name": "Weather",
"icon": "weather-partlycloudy"
}
],
"items": [
{
"name": "Living Room",
"cards": [
{
"entity_id": "light.tv_light",
"name": "TV",
"icon": "lightbulb"
}
],
"page": 1,
"width": 2
},
{
"name": "Dining Room",
"cards": [
{
"entity_id": "light.table_light",
"icon": "ceiling-light",
"name": "Table Light"
}
],
"page": 1,
"width": 2
},
{
"name": "Weather",
"page": 2,
"width": 8,
"cards": [
{
"type": "hass",
"name": "",
"entity_id": "weather.dark_sky",
"icon": "",
"width": 3,
"height": 2,
"size": {
"name": "",
"state": "",
"icon": ""
}
},
{
"type": "iframe",
"name": "",
"entity_id": "",
"icon": "",
"width": 4,
"height": 4,
"size": {
"name": "",
"state": "",
"icon": ""
},
"url": "https://embed.windy.com/embed2.html"
}
]
}
]
}

View file

@ -9,8 +9,6 @@ cd /opt/api \
|| bashio::exit.nok "Could not change into API directory"
LOG_LEVEL=$(bashio::config 'log_level')
DB_PATH=/config/home-panel.db
CONFIG_PATH=/config/$(bashio::config 'config_file')
if bashio::config.true 'ssl'; then
SSL_PATH_CERT="/ssl/$(bashio::config 'certfile')"
@ -18,9 +16,7 @@ if bashio::config.true 'ssl'; then
fi
export LOG_LEVEL
export DB_PATH
export CONFIG_PATH
export SSL_PATH_CERT
export SSL_PATH_KEY
exec node index.js
exec node src/