Skip to content

Small docker container which allows getting the public IP of the container via HTTP request secured by a static password.

Notifications You must be signed in to change notification settings

Guillembonet/public-ip-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

public-ip-server

Docker Version Docker Pulls

This code has been almost fully generated by Chat GPT (conversation here).

Description

Small docker container which allows getting the public IP of the container via HTTP request secured by a static password.

Usage

Just run the container and optionally specify flags:

  -cacheDuration duration
        duration of the cache response (default 20m0s)
  -httpClientTimeout duration
        timeout for the http client which calls the external API (default 10s)
  -listenAddr string
        address to listen (for example: :8080 or 0.0.0.0:80 (default ":8080")
  -password string
        password which will be required by Authorization header (default "password")

Get the container's public IP with:

curl -H "Authorization: <password>" http://localhost:8080

About

Small docker container which allows getting the public IP of the container via HTTP request secured by a static password.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published