What are the default dir permissions for Home Assistant?

hAtul

Dabbler
Joined
Nov 28, 2020
Messages
36
I was trying to get permissions to edit ha files for my user. I tried changing a few permissions (own&chmod) and made it worse by not being able to run the app due to invalid permissions (specifically to the template.yml but I changed most of the other file permissions as well).

What are the standard default permissions to `/home/homeassistant/homeassistant` dir? I would be happy if someone could just paste the `ls -la` output.
Bonus question: how to enable editing to the files locally. I use a Mac to open the filesystem (afp), but cannot edit the files. I tried the vscode plugin for ha but this didn't work, I guess that this is due to ha being set on a true as jail and not in the "standard way" (?)
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
Are you using the TrueNAS CORE plugin or TrueNAS SCALE App?

For the CORE plugin, I can help but not till later today, when I'm home from work.

EDIT: Sorry I can't really answer your questions till later (when I'm at my PC) but I if you're using the plugin, you can go to the jail shell and you will see a menu. From there you can install the Hass Configurator which is web based file editor people used before VS Code. It should show up in the Home Assistant side panel after it's installed and Home Assistant is restart for changes to take effect.

More info on the plugin can be found in Home Assistant forum, look for section Install Optional Services

 
Last edited:

hAtul

Dabbler
Joined
Nov 28, 2020
Messages
36
Are you using the TrueNAS CORE plugin or TrueNAS SCALE App?

For the CORE plugin, I can help but not till later today, when I'm home from work.

EDIT: Sorry I can't really answer your questions till later (when I'm at my PC) but I if you're using the plugin, you can go to the jail shell and you will see a menu. From there you can install the Hass Configurator which is web based file editor people used before VS Code. It should show up in the Home Assistant side panel after it's installed and Home Assistant is restart for changes to take effect.

More info on the plugin can be found in Home Assistant forum, look for section Install Optional Services

Hi, thanks for your reply.
Yea, im using CORE.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
Do you find what you needed?
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
Sorry this took so long

What are the standard default permissions to `/home/homeassistant/homeassistant` dir? I would be happy if someone could just paste the `ls -la` output.
Here ya go
Code:
root@hass:~ # ls -al /home/homeassistant/homeassistant/
total 283
drwxrwxr-x  7 homeassistant  homeassistant       21 Feb 23 17:33 .
drwxrwxr-x  4 homeassistant  homeassistant        4 Feb 23 17:26 ..
drwxrwxr-x  2 homeassistant  homeassistant        2 Feb 23 17:31 .cloud
-rw-rw-r--  1 homeassistant  homeassistant        8 Feb 23 17:28 .HA_VERSION
drwxrwxr-x  2 homeassistant  homeassistant       16 Feb 23 18:01 .storage
-rw-rw-r--  1 homeassistant  homeassistant       85 Feb 23 17:25 automations.yaml
drwxrwxr-x  4 homeassistant  homeassistant        4 Feb 23 17:31 blueprints
-rw-rw-r--  1 homeassistant  homeassistant      892 Feb 23 17:25 configuration.yaml
-rw-rw-r--  1 homeassistant  homeassistant       90 Feb 23 17:25 customize.yaml
-rw-rw-r--  1 homeassistant  homeassistant       65 Feb 23 17:25 groups.yaml
-rw-r--r--  1 homeassistant  homeassistant     4096 Feb 23 17:29 home-assistant_v2.db
-rw-r--r--  1 homeassistant  homeassistant    32768 Feb 23 18:05 home-assistant_v2.db-shm
-rw-r--r--  1 homeassistant  homeassistant  1689232 Feb 23 18:05 home-assistant_v2.db-wal
-rw-rw-r--  1 homeassistant  homeassistant        0 Feb 23 17:28 home-assistant.log
-rw-rw-r--  1 homeassistant  homeassistant        0 Feb 23 17:28 home-assistant.log.1
-rw-rw-r--  1 homeassistant  homeassistant        0 Feb 23 17:28 home-assistant.log.fault
drwxrwxr-x  3 homeassistant  homeassistant        3 Feb 23 17:25 packages
-rw-rw-r--  1 homeassistant  homeassistant       66 Feb 23 17:25 scenes.yaml
-rw-rw-r--  1 homeassistant  homeassistant       81 Feb 23 17:25 scripts.yaml
-rw-rw-r--  1 homeassistant  homeassistant     1346 Feb 23 17:25 secrets.yaml
drwxrwxr-x  2 homeassistant  homeassistant        2 Feb 23 17:33 tts


The following will reset everything to "defaults"
Code:
chown -R homeassistant:homeassistant /home/homeassistant/homeassistant
find /home/homeassistant/homeassistant -type d -exec chmod 775 "{}" +
find /home/homeassistant/homeassistant -type f -exec chmod 664 "{}" +


how to enable editing to the files locally. I use a Mac to open the filesystem (afp), but cannot edit the files.

I'm not familiar with Mac or afp but if it's possible for you to use samba, I have some wiki pages in the plugin's repository that should help. Following these guides in order should also help you get setup with correct permissions by creating a homeassistant user/group on TrueNAS and adding your user to the homeassistant group. With this approach, there is no need to edit permissions inside the jail.

1. Move configuration to an external dataset
2. Edit configuration using samba share

I tried the vscode plugin for ha but this didn't work

This does work, but not how you might expect. Basically you need to use vscode with HA plugin installed on your Mac. For the HA plugin to work like this, files need to be available locally (remote connection to FreeBSD will not work). You can achieve this by "mounting" the samba share with HA configuration to your Mac.

Hope that helps!
 

hAtul

Dabbler
Joined
Nov 28, 2020
Messages
36
Sorry this took so long


Here ya go
Code:
root@hass:~ # ls -al /home/homeassistant/homeassistant/
total 283
drwxrwxr-x  7 homeassistant  homeassistant       21 Feb 23 17:33 .
drwxrwxr-x  4 homeassistant  homeassistant        4 Feb 23 17:26 ..
drwxrwxr-x  2 homeassistant  homeassistant        2 Feb 23 17:31 .cloud
-rw-rw-r--  1 homeassistant  homeassistant        8 Feb 23 17:28 .HA_VERSION
drwxrwxr-x  2 homeassistant  homeassistant       16 Feb 23 18:01 .storage
-rw-rw-r--  1 homeassistant  homeassistant       85 Feb 23 17:25 automations.yaml
drwxrwxr-x  4 homeassistant  homeassistant        4 Feb 23 17:31 blueprints
-rw-rw-r--  1 homeassistant  homeassistant      892 Feb 23 17:25 configuration.yaml
-rw-rw-r--  1 homeassistant  homeassistant       90 Feb 23 17:25 customize.yaml
-rw-rw-r--  1 homeassistant  homeassistant       65 Feb 23 17:25 groups.yaml
-rw-r--r--  1 homeassistant  homeassistant     4096 Feb 23 17:29 home-assistant_v2.db
-rw-r--r--  1 homeassistant  homeassistant    32768 Feb 23 18:05 home-assistant_v2.db-shm
-rw-r--r--  1 homeassistant  homeassistant  1689232 Feb 23 18:05 home-assistant_v2.db-wal
-rw-rw-r--  1 homeassistant  homeassistant        0 Feb 23 17:28 home-assistant.log
-rw-rw-r--  1 homeassistant  homeassistant        0 Feb 23 17:28 home-assistant.log.1
-rw-rw-r--  1 homeassistant  homeassistant        0 Feb 23 17:28 home-assistant.log.fault
drwxrwxr-x  3 homeassistant  homeassistant        3 Feb 23 17:25 packages
-rw-rw-r--  1 homeassistant  homeassistant       66 Feb 23 17:25 scenes.yaml
-rw-rw-r--  1 homeassistant  homeassistant       81 Feb 23 17:25 scripts.yaml
-rw-rw-r--  1 homeassistant  homeassistant     1346 Feb 23 17:25 secrets.yaml
drwxrwxr-x  2 homeassistant  homeassistant        2 Feb 23 17:33 tts


The following will reset everything to "defaults"
Code:
chown -R homeassistant:homeassistant /home/homeassistant/homeassistant
find /home/homeassistant/homeassistant -type d -exec chmod 775 "{}" +
find /home/homeassistant/homeassistant -type f -exec chmod 664 "{}" +




I'm not familiar with Mac or afp but if it's possible for you to use samba, I have some wiki pages in the plugin's repository that should help. Following these guides in order should also help you get setup with correct permissions by creating a homeassistant user/group on TrueNAS and adding your user to the homeassistant group. With this approach, there is no need to edit permissions inside the jail.

1. Move configuration to an external dataset
2. Edit configuration using samba share



This does work, but not how you might expect. Basically you need to use vscode with HA plugin installed on your Mac. For the HA plugin to work like this, files need to be available locally (remote connection to FreeBSD will not work). You can achieve this by "mounting" the samba share with HA configuration to your Mac.

Hope that helps!
oh wow
I didn't expect such an in depth reply.
Thank you so much! This works.
 
Top