mirror of
https://github.com/YunoHost-Apps/homeassistant_ynh.git
synced 2024-09-03 19:26:16 +02:00
Fix
This commit is contained in:
parent
4eaae0532f
commit
04f69bc521
5 changed files with 13 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
||||||
homeassistant:
|
homeassistant:
|
||||||
auth_providers:
|
auth_providers:
|
||||||
- type: command_line
|
- type: command_line
|
||||||
command: __DATA_PATH__/.__APP__/bin/ynh_ldap-auth.sh
|
command: __DATAPATH__/.__APP__/bin/ynh_ldap-auth.sh
|
||||||
meta: true
|
meta: true
|
||||||
|
|
||||||
http:
|
http:
|
||||||
|
@ -19,5 +19,5 @@ switch:
|
||||||
- platform: command_line
|
- platform: command_line
|
||||||
switches:
|
switches:
|
||||||
upgrade_homeassistant:
|
upgrade_homeassistant:
|
||||||
command_on: "nohup bash -c __DATA_PATH__/.__APP__/bin/upgrade_homeassistant.sh $1 > /dev/null 2>&1 &"
|
command_on: "nohup bash -c __DATAPATH__/.__APP__/bin/upgrade_homeassistant.sh $1 > /dev/null 2>&1 &"
|
||||||
friendly_name: Upgrade Home Assistant
|
friendly_name: Upgrade Home Assistant
|
||||||
|
|
|
@ -5,10 +5,10 @@ After=network.target
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
WorkingDirectory=__PATH__
|
WorkingDirectory=__DATAPATH__/.__APP__
|
||||||
ExecStart=/opt/yunohost/__APP__/bin/hass --config "__DATA_PATH__/.__APP__" --log-file "/var/log/__APP__/__APP__.log" --verbose
|
ExecStart=__FINALPATH__/bin/hass --config "__DATAPATH__/.__APP__" --log-file "__LOGFILE__" --verbose
|
||||||
|
|
||||||
# Sandboxing options to harden security
|
# Sandboxing options to harden security__DATA_PATH__
|
||||||
# Depending on specificities of your service/app, you may need to tweak these
|
# Depending on specificities of your service/app, you may need to tweak these
|
||||||
# .. but this should be a good baseline
|
# .. but this should be a good baseline
|
||||||
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
|
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
|
||||||
|
|
|
@ -73,14 +73,15 @@ ynh_exec_fully_quiet myynh_install_homeassistant --path="$data_path"
|
||||||
ynh_script_progression --message="Configuring the installation..."
|
ynh_script_progression --message="Configuring the installation..."
|
||||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/homeassistant_conf_files/configuration.yaml"
|
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/homeassistant_conf_files/configuration.yaml"
|
||||||
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/homeassistant_conf_files/configuration.yaml"
|
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/homeassistant_conf_files/configuration.yaml"
|
||||||
ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$data_path" --target_file="../conf/homeassistant_conf_files/configuration.yaml"
|
ynh_replace_string --match_string="__DATAPATH__" --replace_string="$data_path" --target_file="../conf/homeassistant_conf_files/configuration.yaml"
|
||||||
cp -r "../conf/homeassistant_conf_files/." "$data_path/.$app/"
|
cp -r "../conf/homeassistant_conf_files/." "$data_path/.$app/"
|
||||||
chown -R $app: "$data_path/.$app"
|
chown -R $app: "$data_path/.$app"
|
||||||
chmod -R +x "$data_path/.$app/bin/"
|
chmod -R +x "$data_path/.$app/bin/"
|
||||||
|
|
||||||
# setup up systemd service
|
# setup up systemd service
|
||||||
ynh_script_progression --message="Adding the dedicated service..."
|
ynh_script_progression --message="Adding the dedicated service..."
|
||||||
ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$data_path" --target_file="../conf/systemd.service"
|
ynh_replace_string --match_string="__DATAPATH__" --replace_string="$data_path" --target_file="../conf/systemd.service"
|
||||||
|
ynh_replace_string --match_string="__LOGFILE__" --replace_string="$log_file" --target_file="../conf/systemd.service"
|
||||||
ynh_add_systemd_config --service="$app"
|
ynh_add_systemd_config --service="$app"
|
||||||
|
|
||||||
## add service in admin panel
|
## add service in admin panel
|
||||||
|
|
|
@ -82,6 +82,9 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
# restore nginx
|
# restore nginx
|
||||||
ynh_script_progression --message="Restoring nginx web server..."
|
ynh_script_progression --message="Restoring nginx web server..."
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
|
sleep 10s #Only necessary for CI test otherwise curl failed to nginx page
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
sleep 10s #Only necessary for CI test otherwise curl failed to nginx page
|
sleep 10s #Only necessary for CI test otherwise curl failed to nginx page
|
||||||
|
|
|
@ -88,7 +88,8 @@ chmod -R +x "$data_path/.$app/bin/"
|
||||||
|
|
||||||
# setup up systemd service
|
# setup up systemd service
|
||||||
ynh_script_progression --message="Adding the dedicated service..."
|
ynh_script_progression --message="Adding the dedicated service..."
|
||||||
ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$data_path" --target_file="../conf/systemd.service"
|
ynh_replace_string --match_string="__DATAPATH__" --replace_string="$data_path" --target_file="../conf/systemd.service"
|
||||||
|
ynh_replace_string --match_string="__LOGFILE__" --replace_string="$log_file" --target_file="../conf/systemd.service"
|
||||||
ynh_add_systemd_config --service="$app"
|
ynh_add_systemd_config --service="$app"
|
||||||
|
|
||||||
# add service in admin panel
|
# add service in admin panel
|
||||||
|
|
Loading…
Add table
Reference in a new issue