Open bitrate16 opened 4 months ago
I had the same problem and I also have a lot of iptables commands. In my opinion, the cleanest solution is to outsource the commands to a script. The script is then executed via PostUp or PostDown
PostUp = /etc/wireguard/ifscript.sh up PostDown = /etc/wireguard/ifscript.sh down
if [ "$1" = "up" ]; then .... your PostUp Commands elif [ "$1" = "down" ]; then .... your PostDown Commands fi
When setting very long command for PostUp, PostDown or PreDown, or command containing shell variables reference, after applying config, command is truncated.
Example:
After reapplying config it becomes (shown in web ui):
Example 2:
After reapplying config it becomes (shown in web ui):
which makes absolutely unuseful specifying long custom configuration for iptables.
I've checked wg0.conf after first apply - command matches original. After opening settings in web ui, command is truncated in settings and truncated after second config apply.
I'm using portainer and don't know how to add external files in it unlike in standalone docker on host, so it's important to use long command for custom forwarding rules (preferrable with shell functions to make them shorter), but I can't.
UPD: When settting same config without quotes, everything works