Add test version of 3DPrinter-OctoPrint
This commit is contained in:
parent
9e53cfdbec
commit
45ddc791b5
0
3dprinter-octoprint/CHANGELOG.md
Normal file
0
3dprinter-octoprint/CHANGELOG.md
Normal file
0
3dprinter-octoprint/DOCS.md
Normal file
0
3dprinter-octoprint/DOCS.md
Normal file
22
3dprinter-octoprint/Dockerfile
Normal file
22
3dprinter-octoprint/Dockerfile
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
ARG BUILD_FROM="ghcr.io/home-assistant/amd64-base-debian:bullseye"
|
||||||
|
FROM ${BUILD_FROM}
|
||||||
|
ARG OCTOPRINT_VERSION="1.8.1"
|
||||||
|
|
||||||
|
ENV OCTOPRINT_VERSION=${OCTOPRINT_VERSION}
|
||||||
|
|
||||||
|
# Setup path for persistent install of Python packages
|
||||||
|
ENV PYTHONPATH=/data/python/octoprint
|
||||||
|
ENV PYTHONUSERBASE=/data/python/octoprint
|
||||||
|
ENV PATH=${PATH}:/data/python/octoprint/bin
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN apt update && \
|
||||||
|
apt install -y \
|
||||||
|
python3-venv \
|
||||||
|
python3-dev \
|
||||||
|
build-essential \
|
||||||
|
&& \
|
||||||
|
apt clean
|
||||||
|
|
||||||
|
# Copy root filesystem
|
||||||
|
COPY rootfs /
|
||||||
0
3dprinter-octoprint/README.md
Normal file
0
3dprinter-octoprint/README.md
Normal file
57
3dprinter-octoprint/apparmor.txt
Normal file
57
3dprinter-octoprint/apparmor.txt
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
#include <tunables/global>
|
||||||
|
|
||||||
|
profile example flags=(attach_disconnected,mediate_deleted) {
|
||||||
|
#include <abstractions/base>
|
||||||
|
|
||||||
|
# Capabilities
|
||||||
|
file,
|
||||||
|
signal (send) set=(kill,term,int,hup,cont),
|
||||||
|
|
||||||
|
# S6-Overlay
|
||||||
|
/init ix,
|
||||||
|
/bin/** ix,
|
||||||
|
/usr/bin/** ix,
|
||||||
|
/run/{s6,s6-rc*,service}/** ix,
|
||||||
|
/package/** ix,
|
||||||
|
/command/** ix,
|
||||||
|
/etc/services.d/** rwix,
|
||||||
|
/etc/cont-init.d/** rwix,
|
||||||
|
/etc/cont-finish.d/** rwix,
|
||||||
|
/run/{,**} rwk,
|
||||||
|
/dev/tty rw,
|
||||||
|
|
||||||
|
# Bashio
|
||||||
|
/usr/lib/bashio/** ix,
|
||||||
|
/tmp/** rwk,
|
||||||
|
|
||||||
|
# Access to options.json and other files within your addon
|
||||||
|
/data/** rw,
|
||||||
|
|
||||||
|
# Start new profile for service
|
||||||
|
# /usr/bin/my_program cx -> my_program,
|
||||||
|
|
||||||
|
profile my_program flags=(attach_disconnected,mediate_deleted) {
|
||||||
|
#include <abstractions/base>
|
||||||
|
|
||||||
|
# Receive signals from S6-Overlay
|
||||||
|
signal (receive) peer=*_example,
|
||||||
|
|
||||||
|
# Access to options.json and other files within your addon
|
||||||
|
/data/** rw,
|
||||||
|
|
||||||
|
# Access to mapped volumes specified in config.json
|
||||||
|
/share/** rw,
|
||||||
|
|
||||||
|
# Access required for service functionality
|
||||||
|
# Note: List was built by doing the following:
|
||||||
|
# 1. Add what is obviously needed based on what is in the script
|
||||||
|
# 2. Add `complain` as a flag to this profile temporarily and run the addon
|
||||||
|
# 3. Review the audit log with `journalctl _TRANSPORT="audit" -g 'apparmor="ALLOWED"'` and add other access as needed
|
||||||
|
# Remember to remove the `complain` flag when you are done
|
||||||
|
# /usr/bin/my_program r,
|
||||||
|
/bin/bash rix,
|
||||||
|
/bin/echo ix,
|
||||||
|
/etc/passwd r,
|
||||||
|
/dev/tty rw,
|
||||||
|
}
|
||||||
|
}
|
||||||
12
3dprinter-octoprint/build.yaml
Normal file
12
3dprinter-octoprint/build.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
build_from:
|
||||||
|
aarch64: ghcr.io/home-assistant/aarch64-base-debian:bullseye
|
||||||
|
amd64: ghcr.io/home-assistant/amd64-base-debian:bullseye
|
||||||
|
armhf: ghcr.io/home-assistant/armhf-base-debian:bullseye
|
||||||
|
armv7: ghcr.io/home-assistant/armv7-base-debian:bullseye
|
||||||
|
i386: ghcr.io/home-assistant/i386-base-debian:bullseye
|
||||||
|
labels:
|
||||||
|
org.opencontainers.image.title: "Home Assistant Add-on: 3DPrinter-OctoPrint add-on"
|
||||||
|
org.opencontainers.image.description: "3DPrinter-OctoPrint addon for Home-Assistant."
|
||||||
|
org.opencontainers.image.source: "https://github.com/fredrikbaberg/home-assistant-addons"
|
||||||
|
args:
|
||||||
|
OCTOPRINT_VERSION: "1.8.1"
|
||||||
20
3dprinter-octoprint/config.yaml
Normal file
20
3dprinter-octoprint/config.yaml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
name: "3DPrinter-OctoPrint"
|
||||||
|
version: "2022.6.010"
|
||||||
|
slug: "3dprinter-octoprint"
|
||||||
|
description: "Instance of OctoPrint"
|
||||||
|
url: "https://github.com/fredrikbaberg/home-assistant-addons/tree/main/3dprinter-octoprint"
|
||||||
|
arch:
|
||||||
|
- aarch64
|
||||||
|
- amd64
|
||||||
|
- armhf
|
||||||
|
- armv7
|
||||||
|
- i386
|
||||||
|
init: false
|
||||||
|
map:
|
||||||
|
- share:rw
|
||||||
|
options:
|
||||||
|
message: "Hello world..."
|
||||||
|
schema:
|
||||||
|
message: "str?"
|
||||||
|
ports:
|
||||||
|
5000/tcp: null
|
||||||
BIN
3dprinter-octoprint/icon.png
Normal file
BIN
3dprinter-octoprint/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
BIN
3dprinter-octoprint/logo.png
Normal file
BIN
3dprinter-octoprint/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
16
3dprinter-octoprint/rootfs/etc/cont-init.d/octoprint.sh
Normal file
16
3dprinter-octoprint/rootfs/etc/cont-init.d/octoprint.sh
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/with-contenv bashio
|
||||||
|
# ==============================================================================
|
||||||
|
# Prepare OctoPrint
|
||||||
|
# s6-overlay docs: https://github.com/just-containers/s6-overlay
|
||||||
|
# ==============================================================================
|
||||||
|
|
||||||
|
{ # Check if OctoPrint is installed
|
||||||
|
octoprint --version
|
||||||
|
} || { # Otherwise install
|
||||||
|
{ # Check if Python is available
|
||||||
|
python --version
|
||||||
|
} || { # Otherwise install
|
||||||
|
python3 -m venv /data/python/octoprint
|
||||||
|
}
|
||||||
|
pip install octoprint==$OCTOPRINT_VERSION
|
||||||
|
}
|
||||||
12
3dprinter-octoprint/rootfs/etc/services.d/octoprint/finish
Normal file
12
3dprinter-octoprint/rootfs/etc/services.d/octoprint/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/octoprint/run
Normal file
8
3dprinter-octoprint/rootfs/etc/services.d/octoprint/run
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/with-contenv bashio
|
||||||
|
# ==============================================================================
|
||||||
|
# Start OctoPrint
|
||||||
|
# s6-overlay docs: https://github.com/just-containers/s6-overlay
|
||||||
|
# ==============================================================================
|
||||||
|
|
||||||
|
## Run your program
|
||||||
|
exec octoprint serve --iknowwhatimdoing --host 0.0.0.0 --port 5000 --basedir /data/config/octoprint
|
||||||
4
3dprinter-octoprint/translations/en.yaml
Normal file
4
3dprinter-octoprint/translations/en.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
configuration:
|
||||||
|
message:
|
||||||
|
name: Message
|
||||||
|
description: The message that will be printed to the log when starting this example add-on.
|
||||||
13
README.md
13
README.md
@ -1,2 +1,15 @@
|
|||||||
# home-assistant-addons
|
# home-assistant-addons
|
||||||
Addons for Home Assistant.
|
Addons for Home Assistant.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
You can use the following button to add the repository to your Home Assistant instance.
|
||||||
|
|
||||||
|
[](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Ffredrikbaberg%2Fhome-assistant-addons)
|
||||||
|
|
||||||
|
|
||||||
|
## Addons
|
||||||
|
|
||||||
|
### 3DPrinter-OctoPrint
|
||||||
|
|
||||||
|
Addon with OctoPrint
|
||||||
3
repository.yaml
Normal file
3
repository.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
name: fredrikbaberg Home-Asssistant addons
|
||||||
|
url: https://github.com/fredrikbaberg/home-assistant-addons
|
||||||
|
maintainer: Fredrik Baberg <fredrik.baberg@gmail.com>
|
||||||
Loading…
Reference in New Issue
Block a user