intial build

This commit is contained in:
Alexandre
2021-10-06 16:33:50 +02:00
parent cfeeb9d3d3
commit 1c8491b84c
8 changed files with 272 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
:%%port%% {
@proxied path /api/* /docs /openapi.json
@static {
file
path *.ico *.css *.js *.gif *.jpg *.jpeg *.png *.svg *.woff *.woff2 *.webp
}
encode gzip zstd
# Handles Recipe Images / Assets
handle_path /api/media/recipes/* {
header Access-Control-Allow-Origin *
header X-Content-Type-Options nosniff
header X-Robots-Tag none
header -X-Frame-Options
header Accept-Encoding ""
header Connection $connection_upgrade
header Upgrade $http_upgrade
header Host $http_host
header X-Forwarded-For $proxy_add_x_forwarded_for
header X-Forwarded-Proto $scheme
header X-NginX-Proxy true
header X-External-Path $http_x_ingress_path
header X-Real-IP $remote_addr
header @static Cache-Control max-age=31536000
root * /app/data/recipes/
file_server
}
handle @proxied {
header Access-Control-Allow-Origin *
header X-Content-Type-Options nosniff
header X-Robots-Tag none
header -X-Frame-Options
header Accept-Encoding ""
header Connection $connection_upgrade
header Upgrade $http_upgrade
header Host $http_host
header X-Forwarded-For $proxy_add_x_forwarded_for
header X-Forwarded-Proto $scheme
header X-NginX-Proxy true
header X-Real-IP $remote_addr
header X-External-Path $http_x_ingress_path;
rewrite * {Referer}{uri}
reverse_proxy http://127.0.0.1:9000
}
handle {
header Access-Control-Allow-Origin *
header X-Content-Type-Options nosniff
header X-Robots-Tag none
header -X-Frame-Options
header Accept-Encoding ""
header Connection $connection_upgrade
header Upgrade $http_upgrade
header Host $http_host
header X-Forwarded-For $proxy_add_x_forwarded_for
header X-Forwarded-Proto $scheme
header X-NginX-Proxy true
header X-Real-IP $remote_addr
header X-External-Path $http_x_ingress_path;
header @static Cache-Control max-age=31536000
root * /app/dist
try_files {path}.html {path} /
file_server
}
}

59
teamspeak/rootfs/run.txt Normal file
View File

@@ -0,0 +1,59 @@
#!/usr/bin/env bashio
##########
# BANNER #
##########
if bashio::supervisor.ping; then
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on: $(bashio::addon.name)"
bashio::log.blue " $(bashio::addon.description)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on version: $(bashio::addon.version)"
if bashio::var.true "$(bashio::addon.update_available)"; then
bashio::log.magenta ' There is an update available for this add-on!'
bashio::log.magenta \
" Latest add-on version: $(bashio::addon.version_latest)"
bashio::log.magenta ' Please consider upgrading as soon as possible.'
else
bashio::log.green ' You are running the latest version of this add-on.'
fi
bashio::log.blue " System: $(bashio::info.operating_system)" \
" ($(bashio::info.arch) / $(bashio::info.machine))"
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue \
' Please, share the above information when looking for help'
bashio::log.blue \
' or support in, e.g., GitHub, forums or the Discord chat.'
bashio::log.green \
' https://github.com/alexbelgium/hassio-addons'
bashio::log.blue \
'-----------------------------------------------------------'
fi
################
# MODIFY IMAGE #
################
#Sets caddyfile to 9925 as default port
sed -i "s/80/9925/g" /app/Caddyfile
#######
# SSL #
#######
bashio::config.require.ssl
if bashio::config.true 'ssl'; then
bashio::log.info "Configuring ssl"
CERTFILE=$(bashio::config 'certfile')
KEYFILE=$(bashio::config 'keyfile')
sed -i "7 i tls /ssl/$CERTFILE /ssl/$KEYFILE" /app/Caddyfile
fi