danielperna84 / hass-configurator

Configuration UI for Home Assistant
MIT License
306 stars 168 forks source link

Can't set BASEPATH #220

Closed timothybuchanan closed 2 years ago

timothybuchanan commented 2 years ago

I pulled configurator using this command:

sudo docker run -d \
--name configurator \
--restart always \
-v /~/homeassistant/.config/ \
-v /docker/configurator:/config -p 3218:3218 causticlab/hass-configurator-docker:arm

In /config/settings.conf (inside the container) I placed this:

BASEPATH: "/~/homeassistant/.config/"
ENFORCE_BASEPATH: False

In /usr/lib/python3.5/site-packages/hass_configurator/configurator.py I put this on lines 35 and 38:

BASEPATH: "/~/homeassistant/.config/"
ENFORCE_BASEPATH: False

In a terminal window ls -a confirms the path to my yaml files for HA is good. but when I restart configurator, it creates ~/homeassistant/.config/ inside the docker container instead of using the HA folder. I cannot find anything I've done wrong.

danielperna84 commented 2 years ago

Don't use ~. Provide the complete path. See if that helps.

timothybuchanan commented 2 years ago

Thank you for the prompt reply. The tilde is not used here as a shortcut to my home directory. The full path is /~/homeassistant/.config and that is what shows in the Bash command line. It is not ~/ but /~/. I don’t think I can expand it.

From: Daniel Perna @. Sent: Sunday, May 29, 2022 14:07 To: danielperna84/hass-configurator @.> Cc: timothybuchanan @.>; Author @.> Subject: Re: [danielperna84/hass-configurator] Can't set BASEPATH (Issue #220)

Don't use ~. Provide the complete path. See if that helps.

— Reply to this email directly, view it on GitHub https://github.com/danielperna84/hass-configurator/issues/220#issuecomment-1140516582 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2PH477JQ5Z7LGH4YHSDNTVMPE63ANCNFSM5XIJYZMA . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AG2PH42CUXCNK2GAJXOY6FLVMPE63A5CNFSM5XIJYZMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIP5ONZQ.gif Message ID: @. @.> >

timothybuchanan commented 2 years ago

I used portainer to remove configurator container and image then prune –a command. I then removed the HA container and built new pointing to /home/voice/homeassistant/.config for my yaml and other config files. Testing showed that HA is working properly and using that folder for my files.

I then pulled and built configurator using this in terminal:

sudo docker run -d \

--name configurator \

--restart always \

-v /home/voice/homeassistant/.config/ \

-v /docker/configurator:/config -p 3218:3218 causticlab/hass-configurator-docker:arm

As you see, I used the same path as I used in building HA: /home/voice/homeassistant/.config/. I also changed configurator.py BASEPATH to point to that folder, and I inserted a file settings.conf in the /Config folder which also points to that folder. I restarted both HA and configurator several times.

None of that worked. Configurator still points to its root folder. It did build home/voice/homeassistant/.config in its root folder, but that directory is empty. I can create a file there, but cannot get to my yaml files for HA.

Is there anything else I can try, or should I conclude this just won’t work for me?

From: Daniel Perna @. Sent: Sunday, May 29, 2022 14:07 To: danielperna84/hass-configurator @.> Cc: timothybuchanan @.>; Author @.> Subject: Re: [danielperna84/hass-configurator] Can't set BASEPATH (Issue #220)

Don't use ~. Provide the complete path. See if that helps.

— Reply to this email directly, view it on GitHub https://github.com/danielperna84/hass-configurator/issues/220#issuecomment-1140516582 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2PH477JQ5Z7LGH4YHSDNTVMPE63ANCNFSM5XIJYZMA . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AG2PH42CUXCNK2GAJXOY6FLVMPE63A5CNFSM5XIJYZMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIP5ONZQ.gif Message ID: < @.> @.>

danielperna84 commented 2 years ago

Do NOT modify the configurator.py file. The sole purpose of the separate config file is that it is not necessary to modify any code files. ☝

That being said, I don't know what the problem is, as I don't use Docker myself. I'm assuming you're passing incorrect paths when starting the container. I don't know however what the correct values would be. If you haven't figured it out yet, please ask in this repository, as it's the one that's actually handling the Docker stuff.