Using file filters inside configuration to import list of domains for rules #7329
-
Would it be possible to use a file filter to import the list of domains for a given rule in the configuration file? It is annoying to sroll through the config file every time I add a new domain and want to add it to one either the two factor or the one factor rules. How would I set this up? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Please note this response was created using generative AI leveraging previously available information from the repository. This information may be helpful however it is our strong recommendation that you carefully consider the information before blindly applying it. Yes, it is possible to use a file filter to manage the list of domains dynamically in Authelia's configuration file. Authelia supports the use of file filters which can be applied to configuration files to dynamically adjust settings based on external inputs or environment variables. To set this up, you can utilize the "Expand Environment Variable Filter" or the "Go Template Filter" as mentioned in the Authelia documentation. Here’s a general approach on how you might configure this:
Here is a basic example of how you might define this in a configuration file using a Go Template Filter: access_control:
rules:
- domain: "{{ range $index, $domain := .Env.DOMAIN_LIST }}{{ if $index }},{{ end }}{{ $domain }}{{ end }}"
policy: two_factor In this example, Remember, the exact implementation can vary based on your specific setup and requirements. It’s important to test any changes in a development environment before applying them in production. This comment was generated by Glime. |
Beta Was this translation helpful? Give feedback.
-
The env as suggested is probably the best way. We have no way at this stage to import values files like helm does, but we may add it in the future. Sorry for not getting back sooner. |
Beta Was this translation helpful? Give feedback.
The env as suggested is probably the best way. We have no way at this stage to import values files like helm does, but we may add it in the future. Sorry for not getting back sooner.