diff --git a/profiles/templates/homeassistant/check-crashed/.calculate_directory b/profiles/templates/homeassistant/check-crashed/.calculate_directory index ae03782..f24ab3f 100644 --- a/profiles/templates/homeassistant/check-crashed/.calculate_directory +++ b/profiles/templates/homeassistant/check-crashed/.calculate_directory @@ -1 +1 @@ -# Calculate env=install ac_install_merge==on mergepkg(www-servers/nginx)!= append=skip +# Calculate env=install ac_install_merge==on mergepkg(www-servers/nginx)!= append=skip exists(/etc/runlevels/default/homeassistant)!=||exists(/etc/runlevels/default/zigbee2mqtt)!= diff --git a/profiles/templates/homeassistant/homeassistant/ini.env b/profiles/templates/homeassistant/homeassistant/ini.env index 896c1af..7284716 100644 --- a/profiles/templates/homeassistant/homeassistant/ini.env +++ b/profiles/templates/homeassistant/homeassistant/ini.env @@ -1,4 +1,4 @@ -# Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,homeassistant_sites_domain)== protected +# Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,[homeassistant])== protected [homeassistant] protocol = http domain = #-ip()-# diff --git a/profiles/templates/homeassistant/nginx/ssl/create-ssl b/profiles/templates/homeassistant/nginx/ssl/create-ssl index 9e6b9b1..4f3c161 100644 --- a/profiles/templates/homeassistant/nginx/ssl/create-ssl +++ b/profiles/templates/homeassistant/nginx/ssl/create-ssl @@ -1,6 +1,6 @@ # Calculate run=/bin/bash cd /var/calculate/ssl -openssl req -new -x509 -nodes -subj "/CN=calculate.root" -newkey rsa:2048 -keyout ca.key -out ca.crt -reqexts v3_req -extensions v3_ca &>/dev/null -openssl req -new -nodes -sha256 -newkey rsa:2048 -config /var/calculate/ini.env -out domain.csr -keyout privkey.pem &>/dev/null -openssl x509 -req -in domain.csr -CA ca.crt -CAkey ca.key -CAcreateserial -days 500 -sha256 -extfile /var/calculate/ini.env -extensions req_ext -out fullchain.pem &>/dev/null +openssl req -new -x509 -nodes -subj "/CN=calculate.root" -newkey rsa:2048 -keyout ca.key -out ca.crt -reqexts v3_req -extensions v3_ca +openssl req -new -nodes -sha256 -newkey rsa:2048 -config /var/db/repos/container/profiles/ini.env -out domain.csr -keyout privkey.pem +openssl x509 -req -in domain.csr -CA ca.crt -CAkey ca.key -CAcreateserial -days 500 -sha256 -extfile /var/db/repos/container/profiles/ini.env -extensions req_ext -out fullchain.pem diff --git a/profiles/templates/homeassistant/zigbee2mqtt/ini.env b/profiles/templates/homeassistant/zigbee2mqtt/ini.env index 0a65e06..1d93766 100644 --- a/profiles/templates/homeassistant/zigbee2mqtt/ini.env +++ b/profiles/templates/homeassistant/zigbee2mqtt/ini.env @@ -1,8 +1,14 @@ -# Calculate format=samba path=/var/calculate chmod=600 grep(/var/calculate/ini.env,zigbee2mqtt)== protected +# Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,[zigbee2mqtt])== protected [zigbee2mqtt] -#?exists(/dev/ttyUSB0)-# +#?exists(/dev/ttyUSB0)!=# dev = /dev/ttyUSB0 #exists# -#?exists(/dev/ttyACM0)-# +#?exists(/dev/ttyUSB1)!=# +dev = /dev/ttyUSB1 +#exists# +#?exists(/dev/ttyACM0)!=# dev = /dev/ttyACM0 #exists# +#?exists(/dev/ttyACM1)!=# +dev = /dev/ttyACM1 +#exists# diff --git a/profiles/templates/mastodon/mastodon/ini.env b/profiles/templates/mastodon/mastodon/ini.env index a6ceda0..d484c33 100644 --- a/profiles/templates/mastodon/mastodon/ini.env +++ b/profiles/templates/mastodon/mastodon/ini.env @@ -1,4 +1,4 @@ -# Calculate format=samba path=/var/calculate chmod=600 chown=mastodon:mastodon grep(/var/calculate/ini.env,local_domain)== protected +# Calculate format=samba path=/var/calculate chmod=600 chown=mastodon:mastodon grep(/var/calculate/ini.env,[mastodon])== protected [mastodon] local_domain=calculate.social diff --git a/profiles/templates/mastodon/postgresql/ini.env b/profiles/templates/mastodon/postgresql/ini.env index 5c1994e..99eda48 100644 --- a/profiles/templates/mastodon/postgresql/ini.env +++ b/profiles/templates/mastodon/postgresql/ini.env @@ -1,4 +1,4 @@ -# Calculate format=samba chown=mastodon:mastodon path=/var/calculate grep(/var/calculate/ini.env,postgresql)== comment=# protected +# Calculate format=samba chown=mastodon:mastodon path=/var/calculate grep(/var/calculate/ini.env,[postgresql])== comment=# protected [postgresql] postgres_password = #-rnd(pas,12)-# mastodon_user = mastodon diff --git a/profiles/templates/taiga/postgresql/ini.env b/profiles/templates/taiga/postgresql/ini.env index 1ecf65e..eee6eab 100644 --- a/profiles/templates/taiga/postgresql/ini.env +++ b/profiles/templates/taiga/postgresql/ini.env @@ -1,4 +1,4 @@ -# Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,postgresql)== protected +# Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,[postgresql])== protected [postgresql] postgres_password = #-rnd(pas,12)-# taiga_password = #-rnd(pas,12)-# diff --git a/profiles/templates/taiga/rabbitmq-server/ini.env b/profiles/templates/taiga/rabbitmq-server/ini.env index fffc908..30a8882 100644 --- a/profiles/templates/taiga/rabbitmq-server/ini.env +++ b/profiles/templates/taiga/rabbitmq-server/ini.env @@ -1,3 +1,3 @@ -# Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,rabbitmq)== protected +# Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,[rabbitmq])== protected [rabbitmq] taiga_password = #-rnd(pas,12)-# diff --git a/profiles/templates/taiga/taiga/ini.env b/profiles/templates/taiga/taiga/ini.env index dfb0964..4af5976 100644 --- a/profiles/templates/taiga/taiga/ini.env +++ b/profiles/templates/taiga/taiga/ini.env @@ -1,7 +1,7 @@ -# Calculate format=samba path=/var/calculate chmod=600 chown=taiga:taiga grep(/var/calculate/ini.env,taiga_sites_domain)== protected +# Calculate format=samba path=/var/calculate chmod=600 chown=taiga:taiga grep(/var/calculate/ini.env,[taiga])== protected [taiga] protocol = http -taiga_sites_domain = taiga.example.org +taiga_sites_domain = #-ip()-# from_email = taiga@example.org smtp_host = smtp.example.org smtp_port = 25 diff --git a/profiles/templates/taiga/taiga/x-ini.env b/profiles/templates/taiga/taiga/x-ini.env deleted file mode 100644 index ac5698b..0000000 --- a/profiles/templates/taiga/taiga/x-ini.env +++ /dev/null @@ -1,10 +0,0 @@ -# Calculate run=/bin/bash grep(/var/calculate/ini.env,taiga\.example.org)!= - -# Подставим IP eth0, пока у шаблонов нет необходимой функции -interface=$(ip route | grep -m 1 'default via' | awk '{print $5}') -if [[ -z $interface ]] -then - interface=eth0 -fi -IP=$(ifconfig $interface 2>/dev/null | grep 'inet ' | awk '{print $2}') -sed -i -E "s/(taiga_sites_domain =).*/\1 $IP/g" /var/calculate/ini.env