Шаблоны настройки homeassistant

master 80
parent 6e68867037
commit 9b4963b10e

@ -0,0 +1 @@
# Calculate os_linux_shortname==homeassistant cl_name==calculate-core append=skip

@ -0,0 +1 @@
# Calculate env=install ac_install_merge==on mergepkg(www-servers/nginx)!= append=skip

@ -0,0 +1,2 @@
# Calculate append=after path=/etc name=#-cut(2,.)-# grep(/etc/#-cut(2,.)-#,#-cut(1,.)-#)== protected
homeassistant:x:999:

@ -0,0 +1,2 @@
# Calculate append=after path=/etc name=#-cut(2,.)-# grep(/etc/#-cut(2,.)-#,#-cut(1,.)-#)== protected
homeassistant:x:999:999::/var/calculate/www/homeassistant:/bin/bash

@ -0,0 +1,2 @@
# Calculate append=after path=/etc name=#-cut(2,.)-# grep(/etc/#-cut(2,.)-#,#-cut(1,.)-#)== protected
homeassistant:!:19443::::::

@ -0,0 +1,4 @@
# Calculate format=samba path=/var/calculate chmod=600 chown=homeassistant:homeassistant comment=# grep(/var/calculate/ini.env,homeassistant)== protected
[homeassistant]
protocol = http
domain = home.example.org

@ -0,0 +1,36 @@
# Calculate path=/etc/init.d name=#-cut(1,.)-# chmod=755 comment=# exists(/var/calculate/www/homeassistant/.venv)!=
#!/sbin/openrc-run
description="Open-source home automation platform"
user="homeassistant:homeassistant"
stdoutlog="/var/log/homeassistant/stdout.log"
serverlog="/var/log/homeassistant/server.log"
warningslog="/var/log/homeassistant/warnings.log"
retry="20"
command=/var/calculate/www/homeassistant/.venv/bin/hass
directory=/var/calculate/www/homeassistant
start_stop_daemon_args="--user $user --stdout $stdoutlog --stderr $serverlog --wait 10"
command_args="
--log-file $warningslog
--log-rotate-days 9
${HASS_OPTS}
"
command_background=yes
pidfile=/run/homeassistant.pid
depend() {
need net postgresql
# need net nginx postgresql
}
start_pre() {
checkpath --file --owner $user --mode 0644 $stdoutlog
checkpath --file --owner $user --mode 0644 $serverlog
checkpath --file --owner $user --mode 0644 $warningslog
}

@ -0,0 +1 @@
# Calculate path=/usr/sbin name=#-cut(1,.)-# link=/var/db/repos/container/scripts/homeassistant/setup.sh symbolic protected

@ -0,0 +1 @@
# Calculate path=/var/log name=homeassistant chown=homeassistant:homeassistant

@ -0,0 +1 @@
# Calculate path=/etc/runlevels/default name=#-cut(1,.)-# link=/etc/init.d/#-cut(1,.)-# protected symbolic exists(/var/calculate/www/homeassistant/.venv)!=

@ -0,0 +1,10 @@
# Calculate run=/bin/bash grep(/var/calculate/ini.env,home\.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/^(domain =).*/\1 $IP/g" /var/calculate/ini.env

@ -0,0 +1 @@
# Calculate env=install ac_install_merge==on mergepkg(www-servers/nginx)!= append=skip

@ -0,0 +1,50 @@
# Calculate path=/etc/nginx/sites-enabled exists(/etc/nginx/sites-enabled/#-cut()-#)== comment=#
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
# These shouldn't need to be changed
listen 80 default_server;
#return 301 https://$host$request_uri;
}
server {
# Update this line to be your domain
#server_name home.example.org;
access_log /var/log/nginx/homeassistant.access_log main;
error_log /var/log/nginx/homeassistant.error_log info;
# Ensure these lines point to your SSL certificate and key
ssl_certificate /etc/nginx/ssl/homeassistant/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/homeassistant/privkey.pem;
# Ensure this line points to your dhparams file
# ssl_dhparam /etc/nginx/ssl/dhparams.pem;
# These shouldn't need to be changed
# listen [::]:443 ssl default_server ipv6only=off; # if your nginx version is >= 1.9.5 you can also add the "http2" flag here
listen 443 ssl default_server; # if your nginx version is >= 1.9.5 you can also add the "http2" flag here
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
ssl_protocols TLSv1.2;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
proxy_buffering off;
location / {
proxy_pass http://127.0.0.1:8123;
proxy_set_header Host localhost;
#proxy_set_header Host $host;
proxy_redirect http:// https://;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}

@ -0,0 +1 @@
# Calculate path=/etc/nginx/ssl name=#-cut(1,.)-# link=/var/calculate/ssl symbolic protected

@ -0,0 +1 @@
# Calculate env=install ac_install_merge==on mergepkg(dev-db/postgresql)!= append=skip

@ -0,0 +1,5 @@
# Calculate run=/bin/bash
ver=$(ls -d /var/db/pkg/dev-db/postgresql-*)
ver=${ver#*postgresql-}
echo ${ver%%.*} > /tmp/pgsqlver

@ -0,0 +1 @@
# Calculate path=/var/calculate name=postgresql chmod=700 chown=postgres:postgres

@ -0,0 +1 @@
# Calculate path=/etc name=postgresql-#-load(char,/tmp/pgsqlver)-#

@ -0,0 +1,10 @@
# Calculate chmod=600 comment=# chown=postgres:postgres
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all password
# IPv4 local connections:
host all all 127.0.0.1/32 password
# IPv6 local connections:
host all all ::1/128 password

@ -0,0 +1 @@
# Calculate chmod=600 comment=# chown=postgres:postgres

@ -0,0 +1,22 @@
# Calculate chmod=600 comment=# chown=postgres:postgres
max_connections = 100 # (change requires restart)
shared_buffers = 128MB # min 128kB
dynamic_shared_memory_type = posix # the default is the first option
max_wal_size = 1GB
min_wal_size = 80MB
log_timezone = 'W-SU'
datestyle = 'iso, dmy'
timezone = 'W-SU'
lc_messages = '#-os_install_locale_lang-#.UTF-8'
lc_monetary = '#-os_install_locale_lang-#.UTF-8'
lc_numeric = 'C'
lc_time = '#-os_install_locale_lang-#.UTF-8'
#?os_locale_language==ru#
default_text_search_config = 'pg_catalog.russian'
#!os_locale_language#
default_text_search_config = 'pg_catalog.english'
#os_locale_language#
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
listen_addresses = '127.0.0.1'

@ -0,0 +1,4 @@
# Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,postgresql)== comment=# protected
[postgresql]
postgres_password = #-rnd(pas,12)-#
homeassistant_password = #-rnd(pas,12)-#

@ -0,0 +1 @@
# Calculate path=/var/lib name=postgresql link=/var/calculate/postgresql symbolic protected

@ -0,0 +1,3 @@
# Calculate path=/root name=.pgpass chmod=600 comment=# protected
localhost:*:*:postgres:#-ini(postgresql.postgres_password)-#
localhost:*:*:homeassistant:#-ini(postgresql.homeassistant_password)-#

@ -0,0 +1,7 @@
# Calculate env=update ac_update_sync==on path=/var/lib/portage cl_update_world==merge||cl_update_world==rebuild format=world
app-admin/syslog-ng
app-text/tree
dev-db/postgresql
#media-video/ffmpeg
sys-process/cronie
www-servers/nginx
Loading…
Cancel
Save