-
Notifications
You must be signed in to change notification settings - Fork 229
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
Steps to build and host it internally #55
Comments
Hello, I'll make the following assumptions:
First, there is one problem, this package isn't a module, and thus, trying to build it will fail. You will need to disable module detection, but I don't recommend this. Go 1.17 will ignore the environment variable you need to use, which is set like this. $ export GO111MODULE="off" You will then clone the git repository, which is outlined in the readme. Once cloned, you should be able to build it. $ go build You can also disable go module detection and build with one command. $ GO111MODULE="off" go build Presuming this succeeds, you can then start the program, but choosing a custom port isn't documented or in command line flags. Here is the command you will use, presuming you've had success in building the application. $ PORT="8080" ./ipify-api This will run the binary on port 8080, and should be useable immediately. Depending on what web server you are using, you will need to proxy the request to the application, which should be easy enough to find on the internet. When you proxy, remember to set the If anyone is interested, I am maintaining and working on a forked copy of this project in my own repository here. I have made several changes, including merging some pull requests here, cleaning up the code to pass go lint errors, removing various things that are no longer needed with module support, upgrade to work with go 1.11 and beyond, and updated the dependencies to their latest versions. I'm also planning to add a systemd service for it, along with a make file to install the binary and system service for easy building and use on Linux. When I'm ready, I'll release an archived binary on my repository. Good luck with your build. Let me know if you have any further questions or difficulty, and I'll see what I can do to help you. |
@shannonantony and others, Good luck, let me know if you have any questions. If you do, please open an issue on my repository to avoid spamming this one with unneeded issues unrelated to this particular repository. |
Tnx @tech10 . Your implementation allowed me to get running this service. To everyone who can interested, I built a thin-size docker image (4mb) of ipify. |
As of today,
|
Try this, after you have cloned the GitHub repository. Don't explicitly set any go environment variables, these commands worked for me. $ go mod init github.com/rdegges/ipify-api
$ go mod tidy
$ go mod vendor
$ go build Good luck. |
Hey @pedrolucasoliva pedro, i downloaded your image, just a question, how to get api6 and api64? Or this just work with the api (v4) version? |
Hi @rdegges , Can you please some guidance on how to host this ipify-api internally on a webserver?
Appreciate your help
thanks
Jay
The text was updated successfully, but these errors were encountered: