dan

joined 3 years ago
[–] dan@upvote.au 7 points 5 days ago* (last edited 5 days ago)

Your comment isn't entirely accurate.

in an overwhelming amount of cases, that host networking will be a "here's a device-local subnet your containers can join to", so no, a Docker container won't by default "get it's own IP address"

With the default NAT network, it gets its own IP in the 172.16.x.x range that Docker decides to use. That IP is accessible from the Docker host. It doesn't matter that it's not on your LAN - it's still a dedicated IP. Port forwarding (or a reverse proxy) to it is a separate thing, and you can map a different port if you want to.

Plenty of Docker containers use the same port (often 80, 3000 or 8000), and the reason you can use multiple of those containers concurrently is because each one is on a separate IP.

The default NAT network isn't commonly used for Home Assistant, though. It usually has a direct network connection to the LAN, since plenty of smart home devices rely on broadcasts for discovery.

Also claiming that "nothing else will use port 80" is a gross over-simplification.

It's true for both the Home Assistant Docker container and for HAOS. In both cases, there's no other web servers running in the container/VM. For the Docker container:

  • If you're using the default Docker NAT network, the port you use to expose it to other devices is completely unrelated to the port used in the container. When you expose a Docker port, you specify the host port and container port separately.

    • Sometimes the port isn't exposed to the LAN at all, for example if you're using a reverse proxy. In that case, you usually use the docker container name as the upstream in your Nginx config or whatever, like proxy_pass http://hass/
  • If you bridge the Docker container to the LAN, it has its own IP on the LAN and no other web servers will be running on that IP.

The actual reason that Docker containers don't use port 80 by default is so they're able to run in rootless mode without any extra capability grants. I don't think Home Assistant supports rootless mode though.

[–] dan@upvote.au 8 points 5 days ago* (last edited 5 days ago)

I generally respect this guy's opinion (I probably use the term "enshitification" multiple times a week

A lot of people don't use it the way he used it though. He used it specifically for two sided markets (eg a service that has both businesses/advertisers and personal users) where the focus shifts to the business customers, but people have started using it to mean anything that used to be good but isn't good any more.

[–] dan@upvote.au 17 points 5 days ago* (last edited 5 days ago) (3 children)

There's two supported ways to run Home Assistant:

  1. Home Assistant OS
  2. Docker container

In both cases, it's running on its own IP address, so nothing else will be using port 80.

With Docker, you'd normally either use its standard NAT network, or bridge it to your LAN using a macvlan or ipvlan network. Bridging is usually better because some devices rely on broadcasts.

You used to be able to run Home Assistant directly on an existing Linux system, but that's been deprecated for over a year and unsupported since December last year.

[–] dan@upvote.au 19 points 5 days ago (14 children)

The Fairphone can run Linux, can't it?

[–] dan@upvote.au 2 points 1 week ago

I use healthchecks + runitor for notifications. Would recommend. I posted another comment about them.

[–] dan@upvote.au 6 points 1 week ago (1 children)

OK, TIL you can just do <foo.txt. I didn't think that worked. Thanks!

[–] dan@upvote.au 3 points 1 week ago* (last edited 1 week ago)

I'd recommend self-hosting healthchecks and using runitor for your cronjobs. Runitor pings healthchecks when the cronjob starts, then pings it again on completion with the status (success or fail) along with the stdout and stderr.

Healthchecks can be configured to expect a ping periodically (once per day, once per hour, whatever) and alert you if it doesn't receive one.

For backups, Borgmatic has a healthchecks integration.

[–] dan@upvote.au 8 points 1 week ago* (last edited 1 week ago) (2 children)

RFC3339 is better than ISO8601 since it doesn't allow some of the esoteric formats, and allows some useful formats that ISO8601 doesn't (like separating date and time by a space instead of by T)

For example, 2026-W32-1 is also a valid ISO8601 date: Monday on the 32nd week of 2026. That format isn't allowed with RFC3339.

https://ijmacd.github.io/rfc3339-iso8601/

[–] dan@upvote.au 25 points 1 week ago* (last edited 1 week ago) (1 children)

RFC3339 is better than ISO8601 since it doesn't allow some of the esoteric formats, and allows some useful formats that ISO8601 doesn't (like separating date and time by a space instead of by T)

For example, 2026-W32-1 is also a valid ISO8601 date: Monday on the 32nd week of 2026. That format isn't allowed with RFC3339.

https://ijmacd.github.io/rfc3339-iso8601/

[–] dan@upvote.au 1 points 1 week ago

Thanks - I didn't know this either!

[–] dan@upvote.au 13 points 1 week ago* (last edited 1 week ago) (3 children)

Admittedly I still use cat for this.

This also works too, but it's more verbose:

echo "$(<foo.txt)"

It's mentioned in the Bash man pages:

The command substitution $(cat file) can be replaced by the equivalent but faster $(< file).

EDIT: I was just informed that simply <foo.txt works too.

[–] dan@upvote.au 8 points 1 week ago (4 children)

It wouldn't be at the end, since you'd still be piping into program

program <file | grep | cut
view more: ‹ prev next ›