Make different blocks toggleable in Docker container through env variables

This commit is contained in:
evanebb 2023-12-02 21:34:43 +01:00
parent 308c84f423
commit 2de4d97a2d
No known key found for this signature in database
2 changed files with 9 additions and 6 deletions

View File

@ -25,6 +25,10 @@ services:
IPV4_ADDRESS: 127.0.0.1 IPV4_ADDRESS: 127.0.0.1
IPV6_ADDRESS: ::1 IPV6_ADDRESS: ::1
MAPS_QUERY: Amsterdam MAPS_QUERY: Amsterdam
# Pass these variables with any arbitrary value to disable the respective block.
# DISABLE_BLOCK_NETWORK: 'true'
# DISABLE_BLOCK_LOOKINGGLASS: 'true'
# DISABLE_BLOCK_SPEEDTEST: 'true'
# Uncomment to enable the custom block, which you can use to add something custom to the LG. # Uncomment to enable the custom block, which you can use to add something custom to the LG.
# ENABLE_CUSTOM_BLOCK: 'true' # ENABLE_CUSTOM_BLOCK: 'true'
# Uncomment if you require visitors to accept the Terms of Use; the value should be a link to the terms. # Uncomment if you require visitors to accept the Terms of Use; the value should be a link to the terms.

View File

@ -22,13 +22,12 @@ const LG_CSS_OVERRIDES = false;
// Define <head> content, this could be JS, CSS or meta tags; // Define <head> content, this could be JS, CSS or meta tags;
const LG_CUSTOM_HEAD = false; const LG_CUSTOM_HEAD = false;
// Enable or disable blocks/parts of the LG, set false to hide a part; // Enable or disable blocks/parts of the LG, pass these environment variables with any value to disable them;
const LG_BLOCK_NETWORK = true; define('LG_BLOCK_NETWORK', !isset($_ENV['DISABLE_BLOCK_NETWORK']));
const LG_BLOCK_LOOKINGGLAS = true; define('LG_BLOCK_LOOKINGGLASS', !isset($_ENV['DISABLE_BLOCK_LOOKINGGLASS']));
const LG_BLOCK_SPEEDTEST = true; define('LG_BLOCK_SPEEDTEST', !isset($_ENV['DISABLE_BLOCK_SPEEDTEST']));
const LG_BLOCK_LOOKINGGLASS = true;
// This enables the custom block, which you can use to add something custom to the LG; // This enables the custom block, which you can use to add something custom to the LG;
define('LG_BLOCK_CUSTOM', getenv('ENABLE_CUSTOM_BLOCK') !== false); define('LG_BLOCK_CUSTOM', isset($_ENV['ENABLE_CUSTOM_BLOCK']));
// Define a file here which will be used to display the custom block, can be PHP too which outputs HTML; // Define a file here which will be used to display the custom block, can be PHP too which outputs HTML;
const LG_CUSTOM_HTML = __DIR__.'/custom.html.php'; const LG_CUSTOM_HTML = __DIR__.'/custom.html.php';