Silly question, where is the config for the addons?

So I wanted to take a look at the raw configuration file of my addons but I can’t seem to find where those are located (and I’m feeling pretty silly as I’m sure this is an easy answer).

I’m running the HAOS VM image and I’ve installed the SSH addon. I connect to ssh using the hostname of my HAOS VM and I can login no problem. In my home directory I see an “addons” directory but it appears to be empty.

I can see the HA configuration if I switch to the “config” directory but I can’t seem to find the addons. What am I missing here?

The JSON file that reflects what you’ve entered in the UI config tab isn’t accessible from SSH. But it’s really just exactly what you entered, converted to JSON, so there’s no advantage to seeing the “raw” file.

The “addons” directory is for “local addons” that you install yourself and not from the addon store. It’s rare that you’ll need to put anything there.

1 Like

AddOns in Supervisor are Docker containers. All information is stored in their respective Docker container. :slight_smile:

Ah, so if I wanted to review the config of the add on itself I would need to login to the docker image? Yeah, I’m ok then. No worries.

That’s only partially correct. The application and any supporting script and infrastructure are in the container, but any persistent data is stored outside the container and those files/directories are mounted into the container. That persistent data isn’t directly accessible through SSH, and you’d either need to shell into the container or go in through the console to get to that data.

Docker containers are intended to be disposable and delete/recreated at will, so storing any config info that’s expected to be modified and retained is a bad idea.

1 Like

but if you modify the config of an addon which is currently stopped, you save this config and you restart HA, the configuration is memorized even though it has not yet been injected into the container since the addon is stopped, the config must therefore be saved somewhere other than in the container

Hi, I’d like to bump this thread. I’m using ansible to manage a number of Home Assistant installations and need to edit the config for an addon from the command-line, so using the ha binary or editing a file directly.

I’ve managed to install the addon using ha, but can’t find out where I can edit the configuration other then in the GUI. The addon hasn’t been started yet, and I can edit the options in the GUI and they’re saved (so it’s definitely stored outside of the container), but I can’t find a file or ha option that lets me edit the options.

Can anyone suggest a way to do that?

through the CLI …
login (enter)
cd mnt/data/supervisor//addons/core

Att your own risk

Thanks for the quick reply @boheme61 Unfortunately I don’t quite understand what you mean.

My Home Assistant is running the HA OS on a raspberry pi and I login using the community ssh addon. There’s nothing in /mnt, although I do have a /data folder. It contains an options.json file that seems to contain the options for the ssh addon (e.g. the authorized_keys are stored there), but there are no other options for any other addons.

There are also /addons, /addon_config, /share and /homeassistant directories that are directly mounted, but none of those have the options for the addon I’m working with.

If it’s helpful to understand where I’m at, I installed the addon using the following commands:

ha store add https://github.com/mattlongman/hassio-access-point
ha addons install 30e576d0_hassio-access-point

I now just want to configure it

you need to connect a monitor and keyboard to your pi, to access the CLI

what you see in the terminal , Is for the terminal …You are in the “container” for this particular add-on

I don’t need to connect a keyboard as I can ssh in using the ssh addon.

I can’t access the container for the addon as it hasn’t been started yet so it’s not visible when I run docker ps.

However, the addon page in the web interface shows the amended configuration that I updated, so that tells me home assistant is storing that configuration somewhere and that I should be able to change it.

If I execute the command:

curl -sSL -H "Authorization: Bearer $SUPERVISOR_TOKEN" http://supervisor/addons/30e576d0_hassio-access-point/info

I can see the updated configuration, so where is supervisor getting this information from?

I really don’t have anything further to add, if you read this Topic(which is actually very short), you will get your answers

WRONG Read above

Good luck … with the limited knowledge in HA, you need it ! … make sure to make a full backup, before you proceed

My guess is, it gets it from the “location” created

mnt/data/supervisor//addons/core

Thanks @boheme61

Unfortunately as I’m using ansible and the system is remote, physically logging in isn’t an option.

In case anyone else encounters a similar problem, I was able to solve it using the supervisor API.

Calling:

curl -sSL -H "Authorization: Bearer $SUPERVISOR_TOKEN" http://supervisor/addons/30e576d0_hassio-access-point/info

Returns a json dictionary that has an “options” key containing the current addon options.

Calling:

curl  \
-sSL  \
-H "Authorization: Bearer $SUPERVISOR_TOKEN"  \
-X POST  \
http://supervisor/addons/30e576d0_hassio-access-point/options  \
-d '{"options": {"addon_option1": 1, "addon_option2": 2}'

where “options” is a json dictionary with the addon options sets them.

Both can be called without the addon container having been started.

1 Like

Im curious, what does exactly the " -sSL " option do ? , i’ve never seen that before

-s is --silent so it suppresses the usual output, but the -S is --show-error so you’re not left completely in the dark if it fails.
-L is --location so it follows redirects

ahh ok, it’s a “combo” , thought it was something “new”, to do with --ssl :slight_smile: