Closed csobrinho closed 4 weeks ago
I am making some changes to that the HA bashio part of the run script runs if it detects bashio it will execute the bashio code. I'm not sure if I fully understand the non-root request. Would you need the dockerfile to be something like this: Do all the system stuff as root then add the non-root user and run the script as non-root?
apt-get blah blah setup non-root user USER non-root RUN shell script
I also made adjusts to the python script so that polling only happens in a bashio environment.
Take a look at my run.sh script I'm upload to the branch for this issue and let me know your thoughts on everything.
Let me know if you want to keep this open or if the last few releases address most of your issues.
@thor0215 Was there an env var created to address the first point?
Let me know if you want to keep this open or if the last few releases address most of your issues.
Sorry, I've been swamped. I'll test this during the weekend.
@thor0215 Was there an env var created to address the first point?
The Dockerfile still has CMD ["/run.sh" ]. I don't know how to make the Dockerfile only do that for HA Addon setups. If someone has some way to do that, let me know.
The easiest way is to put that logic inside the /run.sh
then just do if hassio do X
, if not do Y
. There might be some sort of env variable that hint to being inside hassio before calling hassio shell scripts.
Another option is to have a new entrypoint.sh
, do the check there then call run_hassio.sh
or run_standalone.sh
but your run.sh
is pretty simple so that might be overkill.
So right now run.sh should only do the HA stuff if it sees the /config/options.json file, but always run the python script. Does that solve request number 1?
I think so, you can also complement with the env. There's should be something there to say I'm HA. Thanks for looking into this!
Hi @thor0215, I'm planning to send you a PR to make the code a little easier to be used by external docker or kubernetes. This would translate into:
MANUAL
orBYPASS
or something else that allows the run.sh to just bypass all HA/bashio
code./config/xfinity.log
log file if it doesn't exist.Example of a kubernetes cronjob: