forked from lolcat/4get
1
0
Fork 0

fix instances passed through env

This commit is contained in:
throwaway 2024-02-17 15:10:52 -08:00
parent d20f0fcf88
commit 2e4a14cf16
2 changed files with 8 additions and 3 deletions

View File

@ -177,6 +177,8 @@ any environment variables prefixed with `FOURGET_` will be added to the generate
the entrypoint will automatically set the `CAPTCHA_DATASET` value for you based on directory names and number of files in each
to set `INSTANCES` pass a comma separated string of urls (FOURGET_INSTANCES = "https://4get.ca,https://domain.tld")
```
version: "3.7"

View File

@ -52,7 +52,7 @@ function detect_captcha_dirs() {
}
$special_keys = ["CAPTCHA_DATASET"];
$special_keys = ["CAPTCHA_DATASET", "INSTANCES"];
$output = "<?php\n // This file was generated by docker/gen_config.php\n";
@ -67,6 +67,9 @@ continue;
if($key === "CAPTCHA_DATASET") {
$output = $output . "\tconst " . $key . " = " . type_to_string(detect_captcha_dirs()) . ";\n";
}
if($key === "INSTANCES") {
$output = $output . "\tconst " . $key . " = " . type_to_string(explode(',', $val)) . ";\n";
}
}