getumbrel / umbrel-apps

The official app repository of the Umbrel App Store. Submit apps and updates here. Learn how → https://github.com/getumbrel/umbrel-apps#readme
https://apps.umbrel.com
480 stars 357 forks source link

Fixed booleans for umbrelOS 0.5 #1176

Closed sharknoon closed 5 days ago

sharknoon commented 5 days ago

Hello,

Docker Compose V1 does not allow booleans inside the environment, labels or the extra_hosts key.

This PR fixes that issue to get those apps running on umbrelOS 0.5 .

Kind reagards

Sharknoon

nmfretz commented 5 days ago

Wonderful, thanks very much @sharknoon 🙏. I have tested on umbrelOS 0.5 and 1.2.1.

Adding some context for our records:

umbrelOS 0.5 uses Compose V1 (1.29.2 by default if a user doesn't already have it installed or hasn't updated it):

$ docker-compose version
docker-compose version 1.29.2, build unknown

umbrelOS 1.x uses Compose V2. As of umbrelOS 1.2.1 we are using Compose v2.27.1:

$ docker compose version
Docker Compose version v2.27.1

In Compose V1, booleans cannot be used as values for the environment, labels, and extra_hosts keys. Docker Compose 1.7.0 https://docs.docker.com/compose/release-notes/#170:

Booleans are no longer allows as values for mappings in the Compose file (for keys environment, labels and extra_hosts). Previously this was a warning. Boolean values should be quoted so they become string values.

Compose errors out with something like:

services.web.environment.NO_HTTPS contains true, which is an invalid type, it should be a string, number, or a null

So in umbrelOS 0.5, installs/updates that use boolean values for these keys will fail. See https://github.com/getumbrel/umbrel-apps/pull/1170#issuecomment-2187890729 for example.

But Compose V2 handles booleans for these keys, so umbrelOS 1.x app installs/updates won't error out when using boolean values for these keys:

sharknoon commented 5 days ago

You are very welcome 😃