Add environment variables to toggle different blocks in Docker container, fix constant typo #37

Merged
evanebb merged 3 commits from add-docker-envs into main 2023-12-03 22:08:53 +08:00
evanebb commented 2023-12-03 04:41:09 +08:00 (Migrated from github.com)

Related to https://github.com/hybula/lookingglass/issues/35.

This PR allows you to disable the 'Network', 'Looking Glass' and 'Speedtest' blocks through environment variables in the Docker container.
These have to be explicitly passed in order to disable these blocks, contrary to the custom block environment variable, which has to be explicitly passed to enable it. This is 1) to keep forward compatibility so these blocks won't suddenly be gone after someone updates their container without adding these environment variables and 2) most people would probably want to have these blocks enabled, so enabling them by default seems good.

EDIT: I've also added some robuster checking around the custom block constants, namely by only including the files if both the constants are defined and the passed files actually exist.

Related to https://github.com/hybula/lookingglass/issues/35. This PR allows you to disable the 'Network', 'Looking Glass' and 'Speedtest' blocks through environment variables in the Docker container. These have to be explicitly passed in order to disable these blocks, contrary to the custom block environment variable, which has to be explicitly passed to _enable_ it. This is 1) to keep forward compatibility so these blocks won't suddenly be gone after someone updates their container without adding these environment variables and 2) most people would probably want to have these blocks enabled, so enabling them by default seems good. EDIT: I've also added some robuster checking around the custom block constants, namely by only including the files if both the constants are defined _and_ the passed files actually exist.
dqos commented 2023-12-03 22:08:24 +08:00 (Migrated from github.com)

Looks good to me, thank you for your contribution!

Looks good to me, thank you for your contribution!
Sign in to join this conversation.
No description provided.