Skip to content

Feat/parametrized postupdown #202

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

Closed

Conversation

dddpaul
Copy link

@dddpaul dddpaul commented Oct 22, 2022

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Add POST_UP and POST_DOWN variables to specify corresponding scripts.

Benefits of this PR and context:

There ara may scenarios for customized postup/postdown scripts can be helpful. For example, if I want to setup my wireguard server as an entrypoint for some services running on other wireguard peers.

For example:
iptables -t nat -A PREROUTING -p tcp --dport 12345 -j DNAT --to-destination 10.13.13.2:12345;
iptables -t nat -A POSTROUTING -p tcp -d 10.13.13.0/24 -j MASQUERADE;

This makes all traffic to external wg server address and port 12345 being NATed and routed to "internal" peer and port 12345.

These rules can be very long and complicated to edit them manually.

Issues

#201

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this pull request! Be sure to follow the pull request template!

@drizuid
Copy link
Member

drizuid commented Oct 31, 2022

@aptalca will be the final decision on this, but the new vars should be optional vars, not mandatory. Personally, I think adding this will be a support nightmare when users start bombing it because they don't understand iptables.

@aptalca
Copy link
Member

aptalca commented Oct 31, 2022

Thanks for the PR, but I'm not in favor of this for a few reasons:

  • It's not crucial for setup, and can be set via templates we provide
  • It's not just PostUp and PostDown, there are also PreUp and PreDown
  • Every env var we list/advertise gets edited incorrectly and unnecessarily by a sizeable percentage of the users, leading to a substantial increase in support requests

Thses arguments are better left as template config that can be used by advanced users as needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants