Update nginx
This commit is contained in:
parent
cded609a02
commit
4982f00eb8
@ -22,6 +22,9 @@ RUN apt update && \
|
|||||||
&& \
|
&& \
|
||||||
apt clean
|
apt clean
|
||||||
|
|
||||||
|
# Remove nginx default site.
|
||||||
|
RUN rm /etc/nginx/sites-enabled/default
|
||||||
|
|
||||||
# Copy root filesystem
|
# Copy root filesystem
|
||||||
COPY rootfs /
|
COPY rootfs /
|
||||||
RUN chmod +x /etc/cont-init.d/*.sh
|
RUN chmod +x /etc/cont-init.d/*.sh
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: "3DPrinter-OctoPrint"
|
name: "3DPrinter-OctoPrint"
|
||||||
version: "2022.6.020"
|
version: "2022.6.022"
|
||||||
slug: "3dprinter-octoprint"
|
slug: "3dprinter-octoprint"
|
||||||
description: "New instance of OctoPrint"
|
description: "New instance of OctoPrint"
|
||||||
url: "https://github.com/fredrikbaberg/home-assistant-addons/tree/main/3dprinter-octoprint"
|
url: "https://github.com/fredrikbaberg/home-assistant-addons/tree/main/3dprinter-octoprint"
|
||||||
@ -13,9 +13,7 @@ init: false
|
|||||||
map:
|
map:
|
||||||
- share:rw
|
- share:rw
|
||||||
options:
|
options:
|
||||||
message: "Hello world..."
|
|
||||||
schema:
|
schema:
|
||||||
message: "str?"
|
|
||||||
ports:
|
ports:
|
||||||
5000/tcp: null
|
5000/tcp: 5000
|
||||||
ingress: true
|
ingress: true
|
||||||
|
|||||||
@ -1,15 +1,22 @@
|
|||||||
#!/usr/bin/with-contenv bashio
|
#!/usr/bin/with-contenv bashio
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Prepare proxy
|
# Prepare nginx proxy
|
||||||
# s6-overlay docs: https://github.com/just-containers/s6-overlay
|
# s6-overlay docs: https://github.com/just-containers/s6-overlay
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|
||||||
bashio::log.info "Proxy cont-init.d"
|
bashio::log.info "nginx cont-init.d"
|
||||||
|
|
||||||
ingress_entry=$(bashio::addon.ingress_entry)
|
ingress_entry=$(bashio::addon.ingress_entry)
|
||||||
export ingress_entry=${ingress_entry}
|
export ingress_entry=${ingress_entry}
|
||||||
|
|
||||||
|
|
||||||
tempio \
|
tempio \
|
||||||
-conf /data/options.json \
|
-conf /data/options.json \
|
||||||
-template /usr/share/tempio/ingress.conf \
|
-template /usr/share/tempio/ingress.conf \
|
||||||
-out /etc/nginx/sites-enabled/ingress.conf
|
-out /etc/nginx/sites-enabled/ingress.conf
|
||||||
|
|
||||||
|
|
||||||
|
tempio \
|
||||||
|
-conf /data/options.json \
|
||||||
|
-template /usr/share/tempio/webui.conf \
|
||||||
|
-out /etc/nginx/sites-enabled/webui.conf
|
||||||
12
3dprinter-octoprint/rootfs/etc/services.d/nginx/finish
Normal file
12
3dprinter-octoprint/rootfs/etc/services.d/nginx/finish
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bashio
|
||||||
|
# ==============================================================================
|
||||||
|
# Take down the S6 supervision tree when example fails
|
||||||
|
# s6-overlay docs: https://github.com/just-containers/s6-overlay
|
||||||
|
# ==============================================================================
|
||||||
|
|
||||||
|
if [[ "$1" -ne 0 ]] && [[ "$1" -ne 256 ]]; then
|
||||||
|
bashio::log.warning "Halt add-on"
|
||||||
|
exec /run/s6/basedir/bin/halt
|
||||||
|
fi
|
||||||
|
|
||||||
|
bashio::log.info "Service restart after closing"
|
||||||
8
3dprinter-octoprint/rootfs/etc/services.d/nginx/run
Normal file
8
3dprinter-octoprint/rootfs/etc/services.d/nginx/run
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/with-contenv bashio
|
||||||
|
# ==============================================================================
|
||||||
|
# Start nginx proxy
|
||||||
|
# s6-overlay docs: https://github.com/just-containers/s6-overlay
|
||||||
|
# ==============================================================================
|
||||||
|
|
||||||
|
bashio::log.info "Starting NGinx..."
|
||||||
|
exec nginx
|
||||||
@ -4,9 +4,11 @@
|
|||||||
# s6-overlay docs: https://github.com/just-containers/s6-overlay
|
# s6-overlay docs: https://github.com/just-containers/s6-overlay
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|
||||||
if [[ "$1" -ne 0 ]] && [[ "$1" -ne 256 ]]; then
|
# if [[ "$1" -ne 0 ]] && [[ "$1" -ne 256 ]]; then
|
||||||
bashio::log.warning "Halt add-on"
|
# bashio::log.warning "Halt add-on"
|
||||||
exec /run/s6/basedir/bin/halt
|
# exec /run/s6/basedir/bin/halt
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
bashio::log.info "Service restart after closing"
|
# bashio::log.info "Service restart after closing"
|
||||||
|
|
||||||
|
bashio::log.notice "Finish up OctoPrint..."
|
||||||
@ -5,4 +5,4 @@
|
|||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|
||||||
## Run your program
|
## Run your program
|
||||||
exec octoprint serve --iknowwhatimdoing --host 0.0.0.0 --port 5000 --basedir /data/config/octoprint
|
exec octoprint serve --iknowwhatimdoing --host 0.0.0.0 --port 80 --basedir /data/config/octoprint
|
||||||
|
|||||||
@ -1,54 +1,29 @@
|
|||||||
events {
|
server {
|
||||||
worker_connections 1024;
|
listen 8099;
|
||||||
}
|
|
||||||
|
|
||||||
http {
|
allow 172.30.32.2;
|
||||||
include mime.types;
|
deny all;
|
||||||
default_type application/octet-stream;
|
|
||||||
sendfile on;
|
|
||||||
keepalive_timeout 65;
|
|
||||||
|
|
||||||
map $http_upgrade $connection_upgrade {
|
server_name _;
|
||||||
default upgrade;
|
access_log /dev/stdout combined;
|
||||||
'' close;
|
|
||||||
|
location {{ env "ingress_entry" }}/ {
|
||||||
|
proxy_pass http://127.0.0.1:80/; # make sure to add trailing slash here!
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Scheme $scheme;
|
||||||
|
proxy_set_header X-Script-Name {{ env "ingress_entry" }};
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
|
||||||
|
client_max_body_size 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
upstream "octoprint" {
|
# redirect server error pages to the static page /50x.html
|
||||||
server 127.0.0.1:5000;
|
error_page 500 502 503 504 /50x.html;
|
||||||
}
|
location = /50x.html {
|
||||||
|
root html;
|
||||||
upstream "mjpg-streamer" {
|
|
||||||
server 127.0.0.1:8080;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 8099;
|
|
||||||
server_name localhost;
|
|
||||||
|
|
||||||
location /octoprint/ {
|
|
||||||
proxy_pass http://octoprint/; # make sure to add trailing slash here!
|
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Scheme $scheme;
|
|
||||||
proxy_set_header X-Script-Name {{ env "ingress_entry" }};
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
|
|
||||||
client_max_body_size 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /webcam/ {
|
|
||||||
proxy_pass http://mjpg-streamer/;
|
|
||||||
}
|
|
||||||
|
|
||||||
# redirect server error pages to the static page /50x.html
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
|
||||||
location = /50x.html {
|
|
||||||
root html;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
23
3dprinter-octoprint/rootfs/usr/share/tempio/webui.conf
Normal file
23
3dprinter-octoprint/rootfs/usr/share/tempio/webui.conf
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
server {
|
||||||
|
listen 5000;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:5000/; # make sure to add trailing slash here!
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Scheme $scheme;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
|
||||||
|
client_max_body_size 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
# redirect server error pages to the static page /50x.html
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
root html;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user