Skip to content
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

[Feature] Added a possibility to use a private IP instead of a public IP #839

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

primez
Copy link

@primez primez commented Oct 12, 2024

Hello,

First of all, thank you for such a great tool!

I decided to implement support for using private IPs because I needed this feature and noticed that the related feature request at #809 has been open for a month with no replies. I assumed it might not be a priority or not planned at all.

Disclosure: I am a .NET developer, and my knowledge of Golang is limited. I relied heavily on ChatGPT to help me write this code. However, I have verified its functionality in a container and a Linux environment, and it works as expected, binding a private IP to a domain name.

To make this work, I added a new value to the environment variables:

 environment:
      - PUBLICIP_FETCHERS=privateip

@MRDGH2821
Copy link

MRDGH2821 commented Oct 12, 2024

If run in bare metal, is the private IP in 192.168.X.Y ?

If run inside container, does it give the same private IP as bare metal?

I haven't run the code, but I'll check it out soon & see if both match or not.

(Bare metal means directly installing on host system)

BTW, thanks for this PR!
I hope it will get accepted!

@primez
Copy link
Author

primez commented Oct 12, 2024

A bare metal installation will give you an IP in the range of 192.168..., as well as a VM installation.
In a container, well, I think it depends on a network. I haven't tested this extensively, but in the simplest case, it will give the IP of a container, not the host system.
So, I installed it as a Linux service that starts with the host OS.

@qdm12 qdm12 force-pushed the master branch 2 times, most recently from 126315b to 691ed32 Compare October 20, 2024 13:15
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.

2 participants