From 2ea3c9e3da44b2f7dba61028263548dd042aee38 Mon Sep 17 00:00:00 2001 From: sebres Date: Mon, 14 Nov 2016 17:39:32 +0100 Subject: [PATCH] FAQ: 1st shot --- ...ution resp. runtime interpolation works.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 FAQ/Configuration/How fail2ban substitution resp. runtime interpolation works.md diff --git a/FAQ/Configuration/How fail2ban substitution resp. runtime interpolation works.md b/FAQ/Configuration/How fail2ban substitution resp. runtime interpolation works.md new file mode 100644 index 0000000..bcb88bf --- /dev/null +++ b/FAQ/Configuration/How fail2ban substitution resp. runtime interpolation works.md @@ -0,0 +1,34 @@ +For original man-page of fail2ban configuration use `man jail.conf` or e. g. here - https://manned.org/jail.conf.5 +How the default basic interpolation in python config files works you can read in the python documentation (e. g. see https://docs.python.org/3/library/configparser.html#supported-ini-file-structure) + +Our implementation is more complex (allows includes, recursive interlaced substitution, etc.). + +**[Q]** I'm trying to reference some variables in my configuration, but `cftoken = %(cftoken)s` doesn't work + +**[A]** +This case `cftoken = %(cftoken)s` is not allowed, because it will produce endless cycle (always substitute itself, again and again). + +As well as following is not allowed also (for the same reason): +``` +A = %(B)s +B = %(C)s +C = %(A)s +``` +Since we support an extensions called "known" with syntax `%(known/option)s`, after some fix (introduced somewhere 0.9.3 or 0.9.4, but some features possible first in 0.10), it allows to use the same last known option... + +So try your luck with `cftoken = %(known/cftoken)s` + +If you will set resp. deliver some init parameter from jail to filter or action, you can currently use another interpolation extension of us with another syntax `