feat(home-assistant): add ingress add-on
CI / backend (pytest + alembic) (push) Has been cancelled
CI / frontend (build) (push) Has been cancelled

This commit is contained in:
2026-06-28 13:42:15 -07:00
parent a8debbe96a
commit 18d7300b57
4 changed files with 69 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
FROM nginx:1.27-alpine
RUN apk add --no-cache jq
COPY run.sh /run.sh
RUN chmod a+x /run.sh
EXPOSE 8099
CMD ["/run.sh"]
+19
View File
@@ -0,0 +1,19 @@
name: MealPlanner Ingress
version: "0.1.0"
slug: mealplanner_ingress
description: Home Assistant Ingress proxy for an existing MealPlanner deployment.
arch:
- amd64
- aarch64
- armv7
startup: application
boot: auto
init: false
ingress: true
ingress_port: 8099
panel_icon: mdi:food-fork-drink
panel_title: MealPlanner
options:
upstream_url: "http://192.168.1.54:8082"
schema:
upstream_url: str
+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env sh
set -eu
OPTIONS_FILE=/data/options.json
UPSTREAM_URL=$(jq -r '.upstream_url // empty' "$OPTIONS_FILE")
case "$UPSTREAM_URL" in
http://*|https://*) ;;
*)
echo "upstream_url must start with http:// or https://" >&2
exit 1
;;
esac
UPSTREAM_URL=${UPSTREAM_URL%/}
cat > /etc/nginx/conf.d/default.conf <<EOF
server {
listen 8099;
server_name _;
location / {
proxy_pass ${UPSTREAM_URL};
proxy_http_version 1.1;
proxy_set_header Host \$proxy_host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host \$host;
proxy_set_header X-Forwarded-Proto \$scheme;
proxy_set_header X-Ingress-Path \$http_x_ingress_path;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
}
}
EOF
exec nginx -g 'daemon off;'
+3
View File
@@ -0,0 +1,3 @@
name: MealPlanner add-ons
url: https://git.research.bike/admin/Meal-Planner
maintainer: Peter