parent
5d1ab7d912
commit
85efd3e2e3
@ -0,0 +1 @@
|
||||
# Calculate env=install ac_install_merge==on mergepkg(www-servers/nginx)!= append=skip
|
@ -0,0 +1 @@
|
||||
# Calculate append=skip grep(/etc/passwd,#-cut(1,.)-#)==
|
@ -0,0 +1,2 @@
|
||||
# Calculate path=/etc name=#-cut(1,.)-# append=after protected
|
||||
hass-configurator:x:997:
|
@ -0,0 +1,2 @@
|
||||
# Calculate path=/etc name=#-cut(1,.)-# append=after protected
|
||||
hass-configurator:x:997:997:Filesystem-browser and text-editor:/var/calculate/www/hass-configurator:/bin/bash
|
@ -0,0 +1,2 @@
|
||||
# Calculate path=/etc name=#-cut(1,.)-# append=after protected
|
||||
hass-configurator:!:19459:0:99999:7:::
|
@ -0,0 +1 @@
|
||||
# Calculate path=/var/calculate name=hass-configurator chmod=700 chown=hass-configurator:hass-configurator
|
@ -0,0 +1,22 @@
|
||||
# Calculate path=/etc/init.d name=#-cut(1,.)-# chmod=755 comment=# exists(/var/calculate/www/hass-configurator/hass-configurator-live)!=
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
description="Filesystem-browser and text-editor"
|
||||
|
||||
user="hass-configurator"
|
||||
group="hass-configurator"
|
||||
|
||||
command="/var/calculate/www/${RC_SVCNAME}/${RC_SVCNAME}-live/.venv/bin/hass-configurator"
|
||||
directory="/var/calculate/www/${RC_SVCNAME}/${RC_SVCNAME}-live"
|
||||
command_args="/var/calculate/hass-configurator/settings.conf"
|
||||
command_user="${user}:${group}"
|
||||
command_background="yes"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
output_log="/var/log/${RC_SVCNAME}.log"
|
||||
error_log="${output_log}"
|
||||
|
||||
start_pre() {
|
||||
checkpath --file --owner $user --mode 0644 $output_log
|
||||
}
|
@ -0,0 +1 @@
|
||||
# Calculate path=/etc name=#-cut(1,.)-# link=/var/calculate/#-cut(1,.)-# symbolic protected
|
@ -0,0 +1 @@
|
||||
# Calculate path=/etc/runlevels/default name=#-cut(1,.)-# link=/etc/init.d/#-cut(1,.)-# protected symbolic exists(/var/calculate/www/#-cut(1,.)-#/#-cut(1,.)-#-live)!=
|
@ -0,0 +1 @@
|
||||
# Calculate path=/var/calculate
|
@ -0,0 +1 @@
|
||||
# Calculate chmod=700 chown=hass-configurator:hass-configurator
|
@ -1 +1 @@
|
||||
# Calculate chmod=750 chown=homeassistant:homeassistant
|
||||
# Calculate chmod=700 chown=homeassistant:homeassistant
|
||||
|
@ -1,3 +1,4 @@
|
||||
# Calculate format=samba path=/var/calculate name=#-cut(1)-# grep(/var/calculate/ini.env,\[nginx\])== protected
|
||||
[nginx]
|
||||
zigbee2mqtt_subpath = #-rnd(pas,32)-#
|
||||
hass-configurator_subpath = #-rnd(pas,32)-#
|
||||
|
@ -1 +1 @@
|
||||
# Calculate path=/etc/runlevels/default name=#-cut(1,.)-# link=/etc/init.d/#-cut(1,.)-# protected symbolic exists(/var/calculate/www/zigbee2mqtt/zigbee2mqtt-live)!=
|
||||
# Calculate path=/etc/runlevels/default name=#-cut(1,.)-# link=/etc/init.d/#-cut(1,.)-# protected symbolic exists(/var/calculate/www/#-cut(1,.)-#/#-cut(1,.)-#-live)!=
|
||||
|
@ -1 +1 @@
|
||||
# Calculate chmod=750 chown=zigbee2mqtt:zigbee2mqtt
|
||||
# Calculate chmod=700 chown=zigbee2mqtt:zigbee2mqtt
|
||||
|
@ -1,2 +1,2 @@
|
||||
# Calculate format=openrc path=/etc/conf.d name=#-cut(1,.)-#
|
||||
RC_MONITOR_RESTART="zigbee2mqtt homeassistant mosquitto"
|
||||
RC_MONITOR_RESTART="zigbee2mqtt homeassistant mosquitto hass-configurator"
|
||||
|
@ -0,0 +1,71 @@
|
||||
#!/bin/bash
|
||||
# Guide: https://github.com/danielperna84/hass-configurator
|
||||
|
||||
set -ueo pipefail
|
||||
export PATH="/lib/rc/bin:$PATH"
|
||||
|
||||
test -e ~/hass-configurator-live && exit
|
||||
|
||||
SCRIPT=$(readlink -f $0)
|
||||
[[ $UID == 0 ]] && exec su - hass-configurator -c "$SCRIPT"
|
||||
|
||||
. /var/db/repos/container/scripts/functions.sh
|
||||
. /var/db/repos/calculate/scripts/ini.sh
|
||||
|
||||
cd
|
||||
ver=$(curl -s https://api.github.com/repos/danielperna84/hass-configurator/releases/latest | grep tag_name | cut -d '"' -f 4) && echo "Latest hass-configurator version is ${ver}"
|
||||
[[ -z $ver ]] && eerror 'The latest version of hass-configurator is not defined!'
|
||||
|
||||
wget -q https://github.com/danielperna84/hass-configurator/archive/refs/tags/${ver}.zip -O hass-configurator-${ver}.zip
|
||||
einfo 'Extract the archive'
|
||||
unzip -q -d versions hass-configurator-${ver}.zip
|
||||
rm hass-configurator-${ver}.zip
|
||||
ln -sf versions/hass-configurator-${ver} hass-configurator-live
|
||||
|
||||
einfo 'Install python env'
|
||||
python -m venv hass-configurator-live/.venv
|
||||
|
||||
einfo 'Activate environment'
|
||||
. hass-configurator-live/.venv/bin/activate
|
||||
|
||||
einfo 'Upgrade pip and wheel'
|
||||
pip install --upgrade pip wheel
|
||||
|
||||
einfo 'Install HASS Configurator'
|
||||
pip install hass-configurator
|
||||
|
||||
echo '. ~/hass-configurator-live/.venv/bin/activate' >> .bashrc
|
||||
echo '. ~/hass-configurator-live/.venv/bin/activate' >> .bash_profile
|
||||
|
||||
ebegin 'Setup HASS Configurator'
|
||||
if [[ ! -e /etc/hass-configurator/settings.conf ]]; then
|
||||
cat > /etc/hass-configurator/settings.conf << EOF
|
||||
{
|
||||
"LISTENIP": "0.0.0.0",
|
||||
"PORT": 3218,
|
||||
"GIT": false,
|
||||
"BASEPATH": null,
|
||||
"ENFORCE_BASEPATH": false,
|
||||
"SSL_CERTIFICATE": null,
|
||||
"SSL_KEY": null,
|
||||
"IGNORE_SSL": false,
|
||||
"HASS_API": "http://127.0.0.1:8123/api/",
|
||||
"HASS_WS_API": null,
|
||||
"HASS_API_PASSWORD": null,
|
||||
"USERNAME": null,
|
||||
"PASSWORD": null,
|
||||
"ALLOWED_NETWORKS": [],
|
||||
"ALLOWED_DOMAINS": [],
|
||||
"BANNED_IPS": [],
|
||||
"BANLIMIT": 0,
|
||||
"IGNORE_PATTERN": [],
|
||||
"DIRSFIRST": false,
|
||||
"SESAME": null,
|
||||
"SESAME_TOTP_SECRET": null,
|
||||
"VERIFY_HOSTNAME": null,
|
||||
"ENV_PREFIX": "HC_",
|
||||
"NOTIFY_SERVICE": "persistent_notification.create"
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
eend
|
Loading…
Reference in new issue