-
-
Notifications
You must be signed in to change notification settings - Fork 564
PostUp, PostDown, PreDown truncated #549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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
|
An alternate solution is to base64 encode your script and decode as part of executing. The backend DB is JSON and so the unescaped shell code corrupts or truncates as part of storing in the DB. Just be careful to not use JSON double quotes ( |
* Escaping HTML in several places. * Adds PreUp config when one didn't exist. * Adds environment variable support for PreUp and PreDown. closes ngoduykhanh#549 closes ngoduykhanh#655 closes ngoduykhanh#656 See also -------- - samrocketman/addons-homeassistant#9 Co-authored-by: Robert Willert <[email protected]>
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
The text was updated successfully, but these errors were encountered: