mirror of
https://github.com/Mesteriis/hassio-addons-avm.git
synced 2026-01-09 23:11:02 +01:00
update repository references and improve script handling
This commit is contained in:
3
proxy/CHANGELOG.md
Executable file
3
proxy/CHANGELOG.md
Executable file
@@ -0,0 +1,3 @@
|
||||
# 1.0.0
|
||||
|
||||
- initial release
|
||||
23
proxy/Dockerfile
Executable file
23
proxy/Dockerfile
Executable file
@@ -0,0 +1,23 @@
|
||||
ARG BUILD_ARCH
|
||||
# hadolint ignore=DL3006
|
||||
FROM ghcr.io/hassio-addons/debian-base/${BUILD_ARCH}:5.1.1
|
||||
|
||||
# Set shell
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# Setup base
|
||||
# hadolint ignore=DL3003
|
||||
RUN apt-get -qq update \
|
||||
&& apt-get -qq install --no-install-recommends -y nginx \
|
||||
&& (apt-get autoremove -y; apt-get autoclean -y)
|
||||
|
||||
# Copy root filesystem
|
||||
COPY rootfs /
|
||||
|
||||
ARG BUILD_ARCH
|
||||
ARG BUILD_DATE
|
||||
ARG BUILD_DESCRIPTION
|
||||
ARG BUILD_NAME
|
||||
ARG BUILD_REF
|
||||
ARG BUILD_REPOSITORY
|
||||
ARG BUILD_VERSION
|
||||
21
proxy/README.md
Executable file
21
proxy/README.md
Executable file
@@ -0,0 +1,21 @@
|
||||
[](https://github.com/jakowenko/double-take) [](https://github.com/jakowenko/double-take/stargazers) [](https://hub.docker.com/r/jakowenko/double-take) [](https://discord.gg/3pumsskdN5)
|
||||
|
||||
![amd64][amd64-shield] ![armv7][armv7-shield] ![aarch64][aarch64-shield] ![armhf][armhf-shield] ![i386][i386-shield]
|
||||
|
||||
# Double Take
|
||||
|
||||
Unified UI and API for processing and training images for facial recognition.
|
||||
|
||||
[Documentation](https://github.com/jakowenko/double-take/tree/beta#readme)
|
||||
|
||||
---
|
||||
|
||||
This add-on creates a proxy to a Double Take instance running separately from Home Assistant.
|
||||
|
||||
_Note: this add-on does not run Double Take itself._
|
||||
|
||||
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
|
||||
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
|
||||
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg
|
||||
[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg
|
||||
[i386-shield]: https://img.shields.io/badge/i386-yes-green.svg
|
||||
20
proxy/config.json
Executable file
20
proxy/config.json
Executable file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "Double Take Proxy",
|
||||
"version": "1.0.0",
|
||||
"url": "https://github.com/jakowenko/double-take",
|
||||
"panel_icon": "mdi:face-recognition",
|
||||
"slug": "double-take-proxy",
|
||||
"description": "Unified UI and API for processing and training images for facial recognition",
|
||||
"arch": ["aarch64", "amd64", "armhf", "armv7", "i386"],
|
||||
"startup": "application",
|
||||
"boot": "auto",
|
||||
"ingress": true,
|
||||
"ingress_port": 3000,
|
||||
"panel_admin": false,
|
||||
"options": {
|
||||
"server": "double-take.local:3000"
|
||||
},
|
||||
"schema": {
|
||||
"server": "match(^.+:\\d+$)"
|
||||
}
|
||||
}
|
||||
BIN
proxy/icon.png
Executable file
BIN
proxy/icon.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
18
proxy/rootfs/etc/cont-init.d/nginx.sh
Executable file
18
proxy/rootfs/etc/cont-init.d/nginx.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Configures NGINX for use with this add-on.
|
||||
# ==============================================================================
|
||||
declare server
|
||||
|
||||
bashio::var.json \
|
||||
entry "$(bashio::addon.ingress_entry)" \
|
||||
| tempio \
|
||||
-template /etc/nginx/templates/ingress.gtpl \
|
||||
-out /etc/nginx/servers/ingress.conf
|
||||
|
||||
server=$(bashio::config 'server')
|
||||
|
||||
echo '{"server":"'"$server"'"}' \
|
||||
| tempio \
|
||||
-template /etc/nginx/templates/upstream.gtpl \
|
||||
-out /etc/nginx/includes/upstream.conf
|
||||
96
proxy/rootfs/etc/nginx/includes/mime.types
Executable file
96
proxy/rootfs/etc/nginx/includes/mime.types
Executable file
@@ -0,0 +1,96 @@
|
||||
types {
|
||||
text/html html htm shtml;
|
||||
text/css css;
|
||||
text/xml xml;
|
||||
image/gif gif;
|
||||
image/jpeg jpeg jpg;
|
||||
application/javascript js;
|
||||
application/atom+xml atom;
|
||||
application/rss+xml rss;
|
||||
|
||||
text/mathml mml;
|
||||
text/plain txt;
|
||||
text/vnd.sun.j2me.app-descriptor jad;
|
||||
text/vnd.wap.wml wml;
|
||||
text/x-component htc;
|
||||
|
||||
image/png png;
|
||||
image/svg+xml svg svgz;
|
||||
image/tiff tif tiff;
|
||||
image/vnd.wap.wbmp wbmp;
|
||||
image/webp webp;
|
||||
image/x-icon ico;
|
||||
image/x-jng jng;
|
||||
image/x-ms-bmp bmp;
|
||||
|
||||
font/woff woff;
|
||||
font/woff2 woff2;
|
||||
|
||||
application/java-archive jar war ear;
|
||||
application/json json;
|
||||
application/mac-binhex40 hqx;
|
||||
application/msword doc;
|
||||
application/pdf pdf;
|
||||
application/postscript ps eps ai;
|
||||
application/rtf rtf;
|
||||
application/vnd.apple.mpegurl m3u8;
|
||||
application/vnd.google-earth.kml+xml kml;
|
||||
application/vnd.google-earth.kmz kmz;
|
||||
application/vnd.ms-excel xls;
|
||||
application/vnd.ms-fontobject eot;
|
||||
application/vnd.ms-powerpoint ppt;
|
||||
application/vnd.oasis.opendocument.graphics odg;
|
||||
application/vnd.oasis.opendocument.presentation odp;
|
||||
application/vnd.oasis.opendocument.spreadsheet ods;
|
||||
application/vnd.oasis.opendocument.text odt;
|
||||
application/vnd.openxmlformats-officedocument.presentationml.presentation
|
||||
pptx;
|
||||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||
xlsx;
|
||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
||||
docx;
|
||||
application/vnd.wap.wmlc wmlc;
|
||||
application/x-7z-compressed 7z;
|
||||
application/x-cocoa cco;
|
||||
application/x-java-archive-diff jardiff;
|
||||
application/x-java-jnlp-file jnlp;
|
||||
application/x-makeself run;
|
||||
application/x-perl pl pm;
|
||||
application/x-pilot prc pdb;
|
||||
application/x-rar-compressed rar;
|
||||
application/x-redhat-package-manager rpm;
|
||||
application/x-sea sea;
|
||||
application/x-shockwave-flash swf;
|
||||
application/x-stuffit sit;
|
||||
application/x-tcl tcl tk;
|
||||
application/x-x509-ca-cert der pem crt;
|
||||
application/x-xpinstall xpi;
|
||||
application/xhtml+xml xhtml;
|
||||
application/xspf+xml xspf;
|
||||
application/zip zip;
|
||||
|
||||
application/octet-stream bin exe dll;
|
||||
application/octet-stream deb;
|
||||
application/octet-stream dmg;
|
||||
application/octet-stream iso img;
|
||||
application/octet-stream msi msp msm;
|
||||
|
||||
audio/midi mid midi kar;
|
||||
audio/mpeg mp3;
|
||||
audio/ogg ogg;
|
||||
audio/x-m4a m4a;
|
||||
audio/x-realaudio ra;
|
||||
|
||||
video/3gpp 3gpp 3gp;
|
||||
video/mp2t ts;
|
||||
video/mp4 mp4;
|
||||
video/mpeg mpeg mpg;
|
||||
video/quicktime mov;
|
||||
video/webm webm;
|
||||
video/x-flv flv;
|
||||
video/x-m4v m4v;
|
||||
video/x-mng mng;
|
||||
video/x-ms-asf asx asf;
|
||||
video/x-ms-wmv wmv;
|
||||
video/x-msvideo avi;
|
||||
}
|
||||
17
proxy/rootfs/etc/nginx/includes/proxy_params.conf
Executable file
17
proxy/rootfs/etc/nginx/includes/proxy_params.conf
Executable file
@@ -0,0 +1,17 @@
|
||||
proxy_http_version 1.1;
|
||||
proxy_ignore_client_abort off;
|
||||
proxy_read_timeout 86400s;
|
||||
proxy_redirect off;
|
||||
proxy_send_timeout 86400s;
|
||||
proxy_max_temp_file_size 0;
|
||||
|
||||
proxy_set_header Accept-Encoding "";
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-NginX-Proxy true;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
|
||||
6
proxy/rootfs/etc/nginx/includes/server_params.conf
Executable file
6
proxy/rootfs/etc/nginx/includes/server_params.conf
Executable file
@@ -0,0 +1,6 @@
|
||||
root /dev/null;
|
||||
server_name $hostname;
|
||||
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
add_header X-Robots-Tag none;
|
||||
8
proxy/rootfs/etc/nginx/includes/ssl_params.conf
Executable file
8
proxy/rootfs/etc/nginx/includes/ssl_params.conf
Executable file
@@ -0,0 +1,8 @@
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_prefer_server_ciphers off;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
|
||||
ssl_session_timeout 10m;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_tickets off;
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
44
proxy/rootfs/etc/nginx/nginx.conf
Executable file
44
proxy/rootfs/etc/nginx/nginx.conf
Executable file
@@ -0,0 +1,44 @@
|
||||
# Run nginx in foreground.
|
||||
daemon off;
|
||||
|
||||
# This is run inside Docker.
|
||||
user root;
|
||||
|
||||
# Pid storage location.
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
# Set number of worker processes.
|
||||
worker_processes 1;
|
||||
|
||||
# Enables the use of JIT for regular expressions to speed-up their processing.
|
||||
pcre_jit on;
|
||||
|
||||
# Write error log to the add-on log.
|
||||
error_log /proc/1/fd/1 error;
|
||||
|
||||
# Max num of simultaneous connections by a worker process.
|
||||
events {
|
||||
worker_connections 512;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/includes/mime.types;
|
||||
|
||||
access_log off;
|
||||
client_max_body_size 4G;
|
||||
default_type application/octet-stream;
|
||||
gzip on;
|
||||
keepalive_timeout 65;
|
||||
sendfile on;
|
||||
server_tokens off;
|
||||
tcp_nodelay on;
|
||||
tcp_nopush on;
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
include /etc/nginx/includes/upstream.conf;
|
||||
include /etc/nginx/servers/*.conf;
|
||||
}
|
||||
1
proxy/rootfs/etc/nginx/servers/.gitkeep
Executable file
1
proxy/rootfs/etc/nginx/servers/.gitkeep
Executable file
@@ -0,0 +1 @@
|
||||
Without requirements or design, programming is the art of adding bugs to an empty text file. (Louis Srygley)
|
||||
14
proxy/rootfs/etc/nginx/templates/ingress.gtpl
Executable file
14
proxy/rootfs/etc/nginx/templates/ingress.gtpl
Executable file
@@ -0,0 +1,14 @@
|
||||
server {
|
||||
listen 3000 default_server;
|
||||
|
||||
include /etc/nginx/includes/server_params.conf;
|
||||
|
||||
location / {
|
||||
allow 172.30.32.2;
|
||||
deny all;
|
||||
|
||||
proxy_pass http://backend;
|
||||
proxy_set_header X-Ingress-Path {{ .entry }};
|
||||
include /etc/nginx/includes/proxy_params.conf;
|
||||
}
|
||||
}
|
||||
3
proxy/rootfs/etc/nginx/templates/upstream.gtpl
Executable file
3
proxy/rootfs/etc/nginx/templates/upstream.gtpl
Executable file
@@ -0,0 +1,3 @@
|
||||
upstream backend {
|
||||
server {{ .server }};
|
||||
}
|
||||
8
proxy/rootfs/etc/services.d/nginx/finish
Executable file
8
proxy/rootfs/etc/services.d/nginx/finish
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/execlineb -S0
|
||||
# ==============================================================================
|
||||
# Take down the S6 supervision tree when NGINX fails
|
||||
# ==============================================================================
|
||||
if -n { s6-test $# -ne 0 }
|
||||
if -n { s6-test ${1} -eq 256 }
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
||||
7
proxy/rootfs/etc/services.d/nginx/run
Executable file
7
proxy/rootfs/etc/services.d/nginx/run
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Runs the NGINX daemon
|
||||
# ==============================================================================
|
||||
|
||||
bashio::log.info "Starting NGINX..."
|
||||
exec nginx
|
||||
Reference in New Issue
Block a user