add bentopdf

This commit is contained in:
ToledoEM
2026-03-16 12:15:36 +00:00
parent 08b3c313d9
commit 5d68d92afa
19 changed files with 482 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
# Generate a self-signed TLS certificate for HTTPS access on LAN.
# The cert is stored under /config/bentopdf/ssl/ so it persists across restarts.
SSL_DIR=/config/bentopdf/ssl
CERT="${SSL_DIR}/cert.pem"
KEY="${SSL_DIR}/key.pem"
if [ ! -f "${CERT}" ] || [ ! -f "${KEY}" ]; then
echo "[50-ssl] Generating self-signed TLS certificate..."
mkdir -p "${SSL_DIR}"
openssl req -x509 -nodes -newkey rsa:2048 \
-keyout "${KEY}" \
-out "${CERT}" \
-days 3650 \
-subj "/CN=homeassistant.local" \
-addext "subjectAltName=DNS:homeassistant.local,DNS:localhost,IP:127.0.0.1"
echo "[50-ssl] Certificate generated at ${CERT}"
else
echo "[50-ssl] TLS certificate already exists, skipping generation."
fi