mirror of
https://github.com/hassio-addons/addon-home-panel.git
synced 2025-05-05 03:11:24 +00:00
⬆️ 🔨 Upgrade to Home Panel v0.8.0
This commit is contained in:
parent
e16e808969
commit
78183ccdac
8 changed files with 54 additions and 197 deletions
11
README.md
11
README.md
|
@ -72,8 +72,7 @@ Example add-on configuration:
|
||||||
"log_level": "info",
|
"log_level": "info",
|
||||||
"ssl": true,
|
"ssl": true,
|
||||||
"certfile": "fullchain.pem",
|
"certfile": "fullchain.pem",
|
||||||
"keyfile": "privkey.pem",
|
"keyfile": "privkey.pem"
|
||||||
"config_file": "home-panel-config.json"
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -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_
|
**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
|
## Changelog & Releases
|
||||||
|
|
||||||
This repository keeps a change log using [GitHub's releases][releases]
|
This repository keeps a change log using [GitHub's releases][releases]
|
||||||
|
|
|
@ -2,25 +2,33 @@ ARG BUILD_FROM=hassioaddons/base:3.0.1
|
||||||
# hadolint ignore=DL3006
|
# hadolint ignore=DL3006
|
||||||
FROM ${BUILD_FROM}
|
FROM ${BUILD_FROM}
|
||||||
|
|
||||||
|
# Copy root filesystem
|
||||||
|
COPY rootfs /
|
||||||
|
|
||||||
# Install packages
|
# Install packages
|
||||||
# hadolint ignore=DL3003
|
# hadolint ignore=DL3003
|
||||||
RUN \
|
RUN \
|
||||||
apk add --no-cache --virtual .build-dependencies \
|
apk add --no-cache --virtual .build-dependencies \
|
||||||
yarn=1.12.3-r0 \
|
|
||||||
git=2.20.1-r0 \
|
git=2.20.1-r0 \
|
||||||
|
openssl=1.1.1b-r1 \
|
||||||
|
yarn=1.12.3-r0 \
|
||||||
\
|
\
|
||||||
&& apk add --no-cache \
|
&& apk add --no-cache \
|
||||||
nginx=1.14.2-r0 \
|
nginx=1.14.2-r0 \
|
||||||
nodejs-current=11.3.0-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 \
|
&& 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 \
|
&& unzip -d /tmp /tmp/panel.zip \
|
||||||
&& mv /tmp/build /opt/panel \
|
&& 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 \
|
&& cd /opt/api \
|
||||||
&& yarn install \
|
&& yarn install \
|
||||||
\
|
\
|
||||||
|
@ -28,9 +36,6 @@ RUN \
|
||||||
&& apk del --purge .build-dependencies \
|
&& apk del --purge .build-dependencies \
|
||||||
&& rm -fr /tmp/*
|
&& rm -fr /tmp/*
|
||||||
|
|
||||||
# Copy root filesystem
|
|
||||||
COPY rootfs /
|
|
||||||
|
|
||||||
# Build arguments
|
# Build arguments
|
||||||
ARG BUILD_ARCH
|
ARG BUILD_ARCH
|
||||||
ARG BUILD_DATE
|
ARG BUILD_DATE
|
||||||
|
|
|
@ -30,15 +30,13 @@
|
||||||
"log_level": "info",
|
"log_level": "info",
|
||||||
"ssl": true,
|
"ssl": true,
|
||||||
"certfile": "fullchain.pem",
|
"certfile": "fullchain.pem",
|
||||||
"keyfile": "privkey.pem",
|
"keyfile": "privkey.pem"
|
||||||
"config_file": "home-panel-config.json"
|
|
||||||
},
|
},
|
||||||
"schema": {
|
"schema": {
|
||||||
"log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)",
|
"log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)",
|
||||||
"ssl": "bool",
|
"ssl": "bool",
|
||||||
"certfile": "str",
|
"certfile": "str",
|
||||||
"keyfile": "str",
|
"keyfile": "str"
|
||||||
"config_file": "str"
|
|
||||||
},
|
},
|
||||||
"environment": {
|
"environment": {
|
||||||
"LOG_FORMAT": "{LEVEL}: {MESSAGE}"
|
"LOG_FORMAT": "{LEVEL}: {MESSAGE}"
|
||||||
|
|
|
@ -5,10 +5,3 @@
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Check SSL settings
|
# Check SSL settings
|
||||||
bashio::config.require.ssl
|
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
|
|
||||||
|
|
|
@ -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
|
|
37
home-panel/rootfs/etc/home-panel/default.json
Normal file
37
home-panel/rootfs/etc/home-panel/default.json
Normal 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"
|
||||||
|
}
|
|
@ -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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -9,8 +9,6 @@ cd /opt/api \
|
||||||
|| bashio::exit.nok "Could not change into API directory"
|
|| bashio::exit.nok "Could not change into API directory"
|
||||||
|
|
||||||
LOG_LEVEL=$(bashio::config 'log_level')
|
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
|
if bashio::config.true 'ssl'; then
|
||||||
SSL_PATH_CERT="/ssl/$(bashio::config 'certfile')"
|
SSL_PATH_CERT="/ssl/$(bashio::config 'certfile')"
|
||||||
|
@ -18,9 +16,7 @@ if bashio::config.true 'ssl'; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LOG_LEVEL
|
export LOG_LEVEL
|
||||||
export DB_PATH
|
|
||||||
export CONFIG_PATH
|
|
||||||
export SSL_PATH_CERT
|
export SSL_PATH_CERT
|
||||||
export SSL_PATH_KEY
|
export SSL_PATH_KEY
|
||||||
|
|
||||||
exec node index.js
|
exec node src/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue