mirror of
https://github.com/aljazceru/addons.git
synced 2026-01-31 10:45:52 +01:00
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Let's Encrypt",
|
||||
"version": "0.10",
|
||||
"version": "1.0",
|
||||
"slug": "letsencrypt",
|
||||
"description": "Manage Let's Encrypt certificate",
|
||||
"url": "https://home-assistant.io/addons/lets_encrypt/",
|
||||
@@ -12,12 +12,14 @@
|
||||
},
|
||||
"map": ["ssl:rw"],
|
||||
"options": {
|
||||
"challenge": "https",
|
||||
"email": null,
|
||||
"domains": [null],
|
||||
"certfile": "fullchain.pem",
|
||||
"keyfile": "privkey.pem"
|
||||
},
|
||||
"schema": {
|
||||
"challenge": "str",
|
||||
"email": "email",
|
||||
"domains": ["str"],
|
||||
"certfile": "str",
|
||||
|
||||
@@ -5,6 +5,7 @@ CERT_DIR=/data/letsencrypt
|
||||
WORK_DIR=/data/workdir
|
||||
CONFIG_PATH=/data/options.json
|
||||
|
||||
CHALLENGE=$(jq --raw-output ".email" $CONFIG_PATH)
|
||||
EMAIL=$(jq --raw-output ".email" $CONFIG_PATH)
|
||||
DOMAINS=$(jq --raw-output ".domains[]" $CONFIG_PATH)
|
||||
KEYFILE=$(jq --raw-output ".keyfile" $CONFIG_PATH)
|
||||
@@ -12,6 +13,13 @@ CERTFILE=$(jq --raw-output ".certfile" $CONFIG_PATH)
|
||||
|
||||
mkdir -p "$CERT_DIR"
|
||||
|
||||
# Select challenge
|
||||
if [ "$CHALLENGE" == "http" ]; then
|
||||
CERTBOT_CHALLENGE="http-01"
|
||||
else
|
||||
CERTBOT_CHALLENGE="tls-sni-01"
|
||||
fi
|
||||
|
||||
# Generate new certs
|
||||
if [ ! -d "$CERT_DIR/live" ]; then
|
||||
DOMAIN_ARR=()
|
||||
@@ -20,11 +28,11 @@ if [ ! -d "$CERT_DIR/live" ]; then
|
||||
done
|
||||
|
||||
echo "$DOMAINS" > /data/domains.gen
|
||||
certbot certonly --non-interactive --standalone --email "$EMAIL" --agree-tos --config-dir "$CERT_DIR" --work-dir "$WORK_DIR" "${DOMAIN_ARR[@]}"
|
||||
certbot certonly --non-interactive --standalone --email "$EMAIL" --agree-tos --config-dir "$CERT_DIR" --work-dir "$WORK_DIR" --preferred-challenges "$CERTBOT_CHALLENGE" "${DOMAIN_ARR[@]}"
|
||||
|
||||
# Renew certs
|
||||
else
|
||||
certbot renew --non-interactive --config-dir "$CERT_DIR" --work-dir "$WORK_DIR"
|
||||
certbot renew --non-interactive --config-dir "$CERT_DIR" --work-dir "$WORK_DIR" --preferred-challenges "$CERTBOT_CHALLENGE"
|
||||
fi
|
||||
|
||||
# copy certs to store
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Mosquitto broker",
|
||||
"version": "0.7",
|
||||
"version": "0.8",
|
||||
"slug": "mosquitto",
|
||||
"description": "An Open Source MQTT broker",
|
||||
"url": "https://home-assistant.io/addons/mosquitto/",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Nginx HomeAssistant SSL proxy",
|
||||
"version": "0.4",
|
||||
"version": "0.5",
|
||||
"slug": "nginx_proxy",
|
||||
"description": "Use nginx as SSL proxy to HomeAssistant instance",
|
||||
"url": "https://home-assistant.io/addons/nginx_proxy/",
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
{
|
||||
"name": "Samba share",
|
||||
"version": "0.9",
|
||||
"version": "1.0",
|
||||
"slug": "samba",
|
||||
"description": "Expose HassIO folders with Samba",
|
||||
"url": "https://home-assistant.io/addons/samba/",
|
||||
"startup": "before",
|
||||
"boot": "auto",
|
||||
"ports": {
|
||||
"445/tcp": 445
|
||||
"445/tcp": 445,
|
||||
"137/udp": 137,
|
||||
"138/udp": 138,
|
||||
"139/tcp": 139
|
||||
},
|
||||
"map": ["config:rw", "ssl:rw", "addons:rw", "share:rw", "backup:rw"],
|
||||
"options": {
|
||||
"workgroup": "WORKGROUP",
|
||||
"name": "hassio",
|
||||
"guest": true,
|
||||
"map_config": true,
|
||||
"map_addons": true,
|
||||
@@ -23,6 +27,7 @@
|
||||
},
|
||||
"schema": {
|
||||
"workgroup": "str",
|
||||
"name": "str",
|
||||
"guest": "bool",
|
||||
"map_config": "bool",
|
||||
"map_addons": "bool",
|
||||
|
||||
@@ -4,6 +4,7 @@ set -e
|
||||
CONFIG_PATH=/data/options.json
|
||||
|
||||
WORKGROUP=$(jq --raw-output '.workgroup' $CONFIG_PATH)
|
||||
NAME=$(jq --raw-output '.name' $CONFIG_PATH)
|
||||
GUEST=$(jq --raw-output '.guest' $CONFIG_PATH)
|
||||
USERNAME=$(jq --raw-output '.username // empty' $CONFIG_PATH)
|
||||
PASSWORD=$(jq --raw-output '.password // empty' $CONFIG_PATH)
|
||||
@@ -32,6 +33,7 @@ function write_config() {
|
||||
}
|
||||
|
||||
sed -i "s/%%WORKGROUP%%/$WORKGROUP/g" /etc/smb.conf
|
||||
sed -i "s/%%NAME%%/$NAME/g" /etc/smb.conf
|
||||
|
||||
##
|
||||
# Write shares to config
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
[global]
|
||||
netbios name = %%NAME%%
|
||||
workgroup = %%WORKGROUP%%
|
||||
server string = Samba HomeAssistant config share
|
||||
security: user
|
||||
@@ -9,4 +10,4 @@
|
||||
log level = 2
|
||||
|
||||
#guest account = root
|
||||
#map to guest = Bad User
|
||||
#map to guest = Bad Password
|
||||
|
||||
Reference in New Issue
Block a user