Update to OctoPrint, 2022.11.01.

This commit is contained in:
Fredrik Baberg 2022-11-05 16:24:05 +01:00
parent 4f39bc500e
commit 870a831e2e
6 changed files with 35 additions and 10 deletions

View File

@ -1,3 +1,9 @@
- 2022.11.01
- Add reverse proxy config for camera with Ingress (untested).
- Only create OctoPrint user if missing.
- Update documentation.
- Mark mode optional.
- Update OctoPrint to 1.8.6
- Update icon to coloured nozzle.
- Clean-up Caddy config.

View File

@ -1,3 +1,15 @@
# Dev
> image: ghcr.io/fredrikbaberg/addon-3dprinter-octoprint-{arch}
# Addon configuration
## Camera URL
**Note: Currently not working.**
Through setting a camera URL you should be able to access the camera stream even when using Ingress.
## Mode
By specifying a different mode you can instead access recovery and reverse proy test page. Normally this should not be needed.
# Notes etc.
> image: ghcr.io/fredrikbaberg/addon-3dprinter-octoprint-{arch}

View File

@ -1,5 +1,5 @@
# 3DPrinter-OctoPrint
Provides OctoPrint as an addon to Home Assistant.
**Note: Currently not in a ready-to-use state.**
**Note: Currently not in a ready-to-use state.**
Provides OctoPrint as an addon to Home Assistant.

View File

@ -1,5 +1,5 @@
name: "3DPrinter-OctoPrint"
version: "2022.11.0"
version: "2022.11.01"
slug: "3dprinter-octoprint"
description: "OctoPrint as an addon, no additional bells and whistles."
url: "https://github.com/fredrikbaberg/home-assistant-addons/tree/main/3dprinter-octoprint"
@ -28,5 +28,5 @@ options:
mode: normal
schema:
camera_url: "url?"
mode: "list(normal|recovery|reverse_proxy_test)"
mode: "list(normal|recovery|reverse_proxy_test)?"
tmpfs: true

View File

@ -28,12 +28,13 @@ if [ ! -f /data/config/octoprint/config.yaml ]; then
fi
fi
# TODO: Check if user already exists before setting password.
{ # Make sure Ingress user for OctoPrint exists.
bashio::log.notice "Ensure Ingress user (homeassistant) exist."
new_password=$(date +%s | sha256sum | base64 | head -c 32 ; echo)
new_password=homeassistant
octoprint --basedir /data/config/octoprint user add homeassistant --password "$new_password" --group users --group admins # 2> /dev/null
if ! octoprint --basedir /data/config/octoprint user list | grep -q 'homeassistant'; then
new_password=$(date +%s | sha256sum | base64 | head -c 32 ; echo)
new_password=homeassistant
octoprint --basedir /data/config/octoprint user add --password "$new_password" --admin homeassistant # 2> /dev/null
fi
} || { # catch
bashio::log.warning "Failed to ensure Ingress user exists, may not be able to launch."
}

View File

@ -11,6 +11,12 @@
remote_ip 172.30.32.2
}
uri strip_prefix {{ .ingress_entry }}
handle_path /camera/* {
reverse_proxy @ingress {{ .camera_host }} {
}
}
handle {
{{ if eq .mode "recovery" }}
rewrite / /recovery