Whitelist_external_dirs path in docker

Whats your config? the error is quite self explanatory no?

Hi guys. Have the same problem with access to www. Donā€™t understand anything about the white list directory and where to configure it.

It is now called:

allowlist_external_dirs:
    - /usr/var/dumping-ground
    - /tmp

When using docker, even the www directory seems to be external and you need to explicitly allow it to write there.

1 Like

Is this config still working? I am not able to make this work with my HA docker. I get the error not a directory @ data['allowlist_external_dirs'][0]. I want to save some camera snapshots to host file system /home//camera. When I try to add this directory to the allowed_dir in config, I get the same error as above but when the dir address is /home/ ,then there is no error but snapshot saving to that folder is not working.

/home//camera

I am guessing the double slash in your path is a typo.

If you are running the standard docker container, the only mapped volume that the docker container can see and access is your /config folder. If you want to save files somewhere else, you need to map that directory as a volume in the docker file when you set up the container.

As an example, I want to access my sqldata folder which is outside the config folder, so I have added

-v /home/user/mysql_data:/mysql_data

to my docker run command. The docker container and HA can now access this folder as /mysql_data.

2 Likes

Hi All,

Iā€™m utterly lost in trying to set up externally accessible directories, and hoping someone can help me figure out what Iā€™m doing wrong (or confirm Iā€™m not). I apologize if the following is hard to read, and Iā€™m sure itā€™s too long.

Iā€™m running HA in a Docker Container on Synology, Iā€™ve set up the following ā€œVolumesā€ in the Docker container to allow access to the file system as the stated mounts:
image

In my config.yaml Iā€™ve set the following allowlists (dirs and external URLs) - hopefully I donā€™t need these but was putting them all there for testing:
image

My HA instance is reachable from the Internet and internally via DNS redirect as the URL:

https://server.domain.com:8123

I have an SSL Certificate that is valid from Letā€™s Encrypt.

When I try to play an .mp3 using the media_player.play_media service with the following:

entity_id: media_player.master_bedroom_speaker
media_content_id: 'https://server.domain.com:8123/media/testmusic.mp3'
media_content_type: music

My Google Mini makes a sound like itā€™s been called, but the music never plays and I get the error in the log:

Failed to cast media https://server.domain.com:8123/media/testmusic.mp3 from internal_url (https://server.domain.com:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

Itā€™s the same when I change the URL from /media to /www or /www/media

Iā€™m pretty sure this is not a ā€œWhitelistā€ problem but rather issues with trying to use Google devices (Iā€™ve also tried through Google_Cast as well and get similar errors), but trying to push media to my Samsung TV I get an ā€œunsupported media errorā€ (which is promising and suggests it is working) and to my Denon Receiver I didnā€™t get an error, but also didnā€™t seem to play (also implying it is working).

If I change to an .mp4 file (video output from my Synology Surveillance Station) with the following:

entity_id: media_player.samsung_un65hu8550
media_content_id: 'https://server.domain.com:8123/www/media/camera.mp4'
media_content_type: video 

I still get the unsupported media type on the Samsung, and my Google Displays chime, shows ā€œPlaying Default Media Receiverā€, but never plays anything and gives the error:

Failed to cast media https://server.domain.com:8123/media/camera.mp4 from internal_url (https://server.domain.com:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

10:35:21 PM ā€“ Google Cast (ERROR)

Again implying this is a Google Casting problem not a whitelist issue, right? Iā€™ve looked at a few threads on that and will likely cross post there.

Iā€™ve tried to access the www, www/media, and media folders from my phone on cellular data (so external to my network), on my phone using WiFi and on my desktop at https://server.domain.com:8123/www, etc. but get a 404 error is all cases.

Since my real problem is likely Google Cast related, I guess my questions here are:

  • How do I know this is actually working - what other devices could I try to play mp3 and mp4 to in order to test?
  • And if it is working, any suggestions on which of the dirs and URLs in the allowlists are correct, and which I can remove?

Thanks.