2023-11-13 18:04:39 -05:00
|
|
|
#+title: IpMe
|
2023-11-13 15:34:50 -05:00
|
|
|
|
|
|
|
* About
|
|
|
|
|
2023-11-13 18:31:54 -05:00
|
|
|
A self-hosted API for obtaining your public IP address.
|
2023-11-13 15:34:50 -05:00
|
|
|
|
2023-11-14 21:05:52 -05:00
|
|
|
* Self-hosting
|
|
|
|
|
|
|
|
** Requirements
|
|
|
|
|
|
|
|
- [[https://podman.io/][Podman]] or [[https://www.docker.com/][Docker]] installed
|
|
|
|
- Ports 80 and 443 opened
|
|
|
|
- A domain name pointing to the server
|
|
|
|
|
|
|
|
For reliable IP address identification, the instance should be hosted on an external server outside of your home or local network.
|
|
|
|
|
|
|
|
** Compose setup
|
|
|
|
|
|
|
|
The following =compose.yaml= can be used as reference:
|
|
|
|
|
|
|
|
#+begin_src yaml
|
|
|
|
version: "3.9"
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
caddy-data:
|
|
|
|
external: true
|
|
|
|
caddy-config:
|
|
|
|
external: true
|
|
|
|
|
|
|
|
networks:
|
|
|
|
proxy-tier:
|
|
|
|
driver: bridge
|
|
|
|
|
|
|
|
services:
|
|
|
|
ipme:
|
2025-01-20 12:40:23 -05:00
|
|
|
image: code.hangdaan.com/foster/ipme:latest
|
2023-11-14 21:05:52 -05:00
|
|
|
container_name: ipme
|
|
|
|
restart: unless-stopped
|
|
|
|
env_file: .env.ipme
|
|
|
|
networks:
|
|
|
|
- proxy-tier
|
|
|
|
caddy:
|
|
|
|
image: docker.io/library/caddy:2-alpine
|
|
|
|
container_name: caddy
|
|
|
|
restart: unless-stopped
|
|
|
|
ports:
|
|
|
|
- "80:80"
|
|
|
|
- "443:443"
|
|
|
|
volumes:
|
|
|
|
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
|
|
|
- caddy-data:/data
|
|
|
|
- caddy-config:/config
|
|
|
|
networks:
|
|
|
|
- proxy-tier
|
|
|
|
#+end_src
|
|
|
|
|
2023-11-14 21:22:35 -05:00
|
|
|
=.env.ipme=:
|
2023-11-14 21:05:52 -05:00
|
|
|
|
|
|
|
#+begin_src env
|
|
|
|
RUN_MODE=prod
|
|
|
|
#+end_src
|
|
|
|
|
2023-11-14 21:22:35 -05:00
|
|
|
=Caddyfile=:
|
2023-11-14 21:05:52 -05:00
|
|
|
|
|
|
|
#+begin_src Caddyfile
|
|
|
|
# Replace this domain with your own
|
|
|
|
https://ipme.mydomain.com {
|
|
|
|
reverse_proxy ipme:8000
|
|
|
|
}
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
** Run the services
|
|
|
|
|
|
|
|
Run ~podman-compose up~ to start the services.
|
|
|
|
|
|
|
|
The API should be available at the domain you selected. For example: =https://ipme.mydomain.com=.
|
|
|
|
|
2024-08-18 14:01:01 -04:00
|
|
|
** Examples using ~curl~
|
|
|
|
|
|
|
|
To get your public IP address in plain text:
|
|
|
|
|
|
|
|
#+begin_src shell
|
|
|
|
curl --silent https://ipme.mydomain.com
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
For a response in =json= format:
|
|
|
|
|
|
|
|
#+begin_src shell
|
|
|
|
curl --silent https://ipme.mydomain.com?format=json
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
2023-11-13 15:34:50 -05:00
|
|
|
* Contributing
|
|
|
|
|
2023-11-14 21:05:52 -05:00
|
|
|
Please send patches and bug reports by email to one of the maintainers. See the *Core maintainers* section for a list of contacts.
|
2023-11-13 15:34:50 -05:00
|
|
|
|
|
|
|
Refer to [[https://git-send-email.io][this guide]] if you are not familiar with sending Git patches over email.
|
|
|
|
|
2023-11-14 21:05:52 -05:00
|
|
|
* Core maintainers
|
2023-11-13 15:34:50 -05:00
|
|
|
|
|
|
|
- *Foster Hangdaan*
|
2025-01-20 12:40:23 -05:00
|
|
|
- Website: [[https://www.foster.hangdaan.com][foster.hangdaan.com]]
|
2023-11-13 15:34:50 -05:00
|
|
|
- Email: [[mailto:foster@hangdaan.email][foster@hangdaan.email]]
|
2025-01-20 12:40:23 -05:00
|
|
|
- GPG Public Key: [[https://s3.hangdaan.com/public/foster-pubkey.asc][DBD3 8E38 4B9E 1F4F 19F9 5BAE E48D 7F49 A852 F112]]
|
|
|
|
- OpenAlias: =pay.foster.hangdaan.com=
|
2023-11-13 15:34:50 -05:00
|
|
|
|
|
|
|
* License
|
|
|
|
|
|
|
|
#+attr_html: :width 200px
|
2025-01-20 12:40:23 -05:00
|
|
|
[[https://s3.hangdaan.com/public/images/logos/licenses/agplv3.svg]]
|
2023-11-13 15:34:50 -05:00
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2023-11-14 21:05:52 -05:00
|
|
|
|
|
|
|
* Copyright
|
|
|
|
|
|
|
|
Copyright \copy 2023 Foster Hangdaan
|