Add environment variables to toggle different blocks in Docker container, fix constant typo #37
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "add-docker-envs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
Looks good to me, thank you for your contribution!