mirror of
https://github.com/hassio-addons/addon-home-panel.git
synced 2025-05-04 19:01:21 +00:00
🔨 reorder init files
This commit is contained in:
parent
4e7933306e
commit
03415433e3
1 changed files with 38 additions and 0 deletions
38
home-panel/rootfs/etc/cont-init.d/40-nginx.sh
Normal file
38
home-panel/rootfs/etc/cont-init.d/40-nginx.sh
Normal file
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
# ==============================================================================
|
||||
# Timmo Hass.io Add-ons: Home Panel
|
||||
# This copies the nginx configs to their respective locations
|
||||
# ==============================================================================
|
||||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
certfile="/ssl/$(hass.config.get 'certfile')"
|
||||
keyfile="/ssl/$(hass.config.get 'keyfile')"
|
||||
|
||||
if hass.config.true 'ssl'; then
|
||||
hass.log.info "Copy enabled SSL nginx config"
|
||||
echo "server {
|
||||
listen 8234 ssl http2 default_server;
|
||||
listen [::]:8234 ssl http2 default_server;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
server_name 172.0.0.1;
|
||||
ssl_certificate ${certfile};
|
||||
ssl_certificate_key ${keyfile};
|
||||
location / {
|
||||
try_files \$uri /index.html;
|
||||
}
|
||||
}" > /etc/nginx/conf.d/default.conf;
|
||||
else
|
||||
hass.log.info "Copy disabled SSL nginx config"
|
||||
echo "server {
|
||||
listen 8234 default_server;
|
||||
listen [::]:8234 default_server;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
server_name 172.0.0.1;
|
||||
location / {
|
||||
try_files \$uri /index.html;
|
||||
}
|
||||
}" > /etc/nginx/conf.d/default.conf;
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue