Hi,
I would like to have an if else statement based on environment variables and files.
Caddy version 2 on Docker (alpine)
So the code I’d like to be something like this:
if {env.CADDY_CONFIG_FILE} is "something1" {
http://, https://
tls internal {
on_demand
}
} elif {env.CADDY_CONFIG_FILE} is "something2" {
http://
} elif {env.CADDY_CONFIG_FILE} is "somethinge" {
{{if eq . "f1.key"}} [how can an add an and here ... as i'd like to test if f1.pem file exists as well]
https://
tls f1.key f1.pem
{{else}}
http://, https://
tls internal {
on_demand
}
{{end}}
}
Is this possible?
How can I add an if "1" AND "2" then as I'd like to check if f1 pem and key exists?
Regards,
NOTE: I know I answered that in past as well, but I don’t find any library for this type of thing. Can someone please direct me?