Auto change IP address in env file

Hello. I have hardcoded my IP address in env file. Problem is that its dynamic IP :slight_smile: so I have to change it every time. Any idea how to make it according to my current IP address? Is it possible to update file via webhooks?

Hi Mike7400!

Do you mean the outbound IP address of your project or another one you are trying to reach?

It’s possible to manipulate the .env file from application code, so you could write you own request handler to do this and act as a webhook, if I’m understanding what you’re looking for correctly.

That’s a little risky though and I wouldn’t recommend it. You might consider storing the IP address in a different plain text file that the application can read and write. You’d have to load the data from it manually rather than get that “for free” as an environment variable though.

Hope this helps. Let us know if this remains a problem.

Daniel