Go to file
Evan Chen e63496a6b6 feat: #8, #9; fix: #10 2021-10-17 02:22:55 +08:00
basic 0.1.5-rc1 (#6) 2021-10-16 16:52:31 +00:00
cmd feat: #8, #9; fix: #10 2021-10-17 02:22:55 +08:00
.dockerignore 0.1.1-rc1 2021-10-16 00:58:49 +08:00
.gitignore 0.1.1-rc1 2021-10-16 00:58:49 +08:00
CHANGELOG.md feat: #8, #9; fix: #10 2021-10-17 02:22:55 +08:00
Dockerfile feat: #8, #9; fix: #10 2021-10-17 02:22:55 +08:00
Makefile build: update makefile 2021-10-17 01:00:27 +08:00
README.md feat: #8, #9; fix: #10 2021-10-17 02:22:55 +08:00
go.mod feat: #8, #9; fix: #10 2021-10-17 02:22:55 +08:00
go.sum feat: #8, #9; fix: #10 2021-10-17 02:22:55 +08:00
main.go feat: #8, #9; fix: #10 2021-10-17 02:22:55 +08:00

README.md

Myip

a tool that can get your public ip

myip is a easy way to get public ip of current system.

Usage:
  myip [flags]
  myip [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  help        Help about any command
  local       short hand for `myip -altc --no-pub`
  serve       Simple server that returns the resolved IP.
  version     version

Flags:
  -a, --all           show local ip
      --cron          run as cron service
  -h, --help          help for myip
  -u, --host string   hostname to connect (default "kumoly.io")
  -l, --list          show list
  -n, --name string   tell the server who you are
      --no-pub        disable PublicIP
  -p, --port string   server port to connect (default "5080")
  -c, --pretty        show table cell, must used with --list
      --secure        use https
  -s, --spec string   hostname to connect (default "0 */5 * * * *")
  -t, --title         show title, used with --list
  -v, --version       version for myip

Use "myip [command] --help" for more information about a command.

Docker

Server

docker pull hub.kumoly.io/tools/myip:latest
docker run --name myip-server -d -p 5080:5080 --restart=always hub.kumoly.io/tools/myip

Or you can use docker-compose.yaml

services:
  myip:
    image: hub.kumoly.io/tools/myip
    container_name: myip-server
    restart: always
    ports:
      - 5080:5080
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./log:/var/log

Client

docker pull hub.kumoly.io/tools/myip:latest
docker run --name myip -d --restart=always hub.kumoly.io/tools/myip myip --cron --spec "@hourly"

Cron

ield name   | Mandatory? | Allowed values  | Allowed special characters
----------   | ---------- | --------------  | --------------------------
Seconds      | Yes        | 0-59            | * / , -
Minutes      | Yes        | 0-59            | * / , -
Hours        | Yes        | 0-23            | * / , -
Day of month | Yes        | 1-31            | * / , - ?
Month        | Yes        | 1-12 or JAN-DEC | * / , -
Day of week  | Yes        | 0-6 or SUN-SAT  | * / , - ?

Entry                  | Description                                | Equivalent To
-----                  | -----------                                | -------------
@yearly (or @annually) | Run once a year, midnight, Jan. 1st        | 0 0 0 1 1 *
@monthly               | Run once a month, midnight, first of month | 0 0 0 1 * *
@weekly                | Run once a week, midnight between Sat/Sun  | 0 0 0 * * 0
@daily (or @midnight)  | Run once a day, midnight                   | 0 0 0 * * *
@hourly                | Run once an hour, beginning of hour        | 0 0 * * * *

@every <duration>

Duration: myip -altc --cron --spec "@every 5m"