Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
9378a1e1d2 | |||
1ef68230de | |||
b112c2640e | |||
90425015d5 |
@ -32,6 +32,8 @@
|
||||
"gochecknoinits",
|
||||
"gomnd",
|
||||
"wsl",
|
||||
"goerr113",
|
||||
"testpackage",
|
||||
]
|
||||
|
||||
[issues]
|
||||
|
1
LICENSE
1
LICENSE
@ -187,6 +187,7 @@
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [2015-2018] [Containous]
|
||||
Copyright [2020] [Traefik Labs]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
4
Makefile
4
Makefile
@ -11,10 +11,10 @@ build:
|
||||
CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags="-s" -o whoami
|
||||
|
||||
image:
|
||||
docker build -t containous/whoami .
|
||||
docker build -t traefik/whoami .
|
||||
|
||||
check:
|
||||
golangci-lint run
|
||||
|
||||
publish-images:
|
||||
seihon publish -v "$(TAG_NAME)" -v "latest" --image-name containous/whoami --dry-run=false
|
||||
seihon publish -v "$(TAG_NAME)" -v "latest" --image-name traefik/whoami --dry-run=false
|
||||
|
@ -1,7 +1,7 @@
|
||||
# whoami
|
||||
|
||||
[](https://hub.docker.com/r/containous/whoami/)
|
||||
[](https://travis-ci.com/containous/whoami)
|
||||
[](https://hub.docker.com/r/traefik/whoami/)
|
||||
[](https://travis-ci.com/traefik/whoami)
|
||||
|
||||
Tiny Go webserver that prints os information and HTTP request to output
|
||||
|
||||
@ -28,7 +28,7 @@ Tiny Go webserver that prints os information and HTTP request to output
|
||||
## Examples
|
||||
|
||||
```console
|
||||
$ docker run -d -P --name iamfoo containous/whoami
|
||||
$ docker run -d -P --name iamfoo traefik/whoami
|
||||
|
||||
$ docker inspect --format '{{ .NetworkSettings.Ports }}' iamfoo
|
||||
map[80/tcp:[{0.0.0.0 32769}]]
|
||||
@ -66,5 +66,5 @@ $ curl -v http://localhost:80/health
|
||||
```
|
||||
|
||||
```console
|
||||
docker run -d -P -v ./certs:/certs --name iamfoo containous/whoami --cert /certs/cert.cer --key /certs/key.key
|
||||
docker run -d -P -v ./certs:/certs --name iamfoo traefik/whoami --cert /certs/cert.cer --key /certs/key.key
|
||||
```
|
||||
|
4
app.go
4
app.go
@ -19,7 +19,7 @@ import (
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
|
||||
// Units
|
||||
// Units.
|
||||
const (
|
||||
_ = iota
|
||||
KB int64 = 1 << (10 * iota)
|
||||
@ -191,6 +191,7 @@ func apiHandler(w http.ResponseWriter, req *http.Request) {
|
||||
URL string `json:"url,omitempty"`
|
||||
Host string `json:"host,omitempty"`
|
||||
Method string `json:"method,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
}{
|
||||
Hostname: hostname,
|
||||
IP: []string{},
|
||||
@ -198,6 +199,7 @@ func apiHandler(w http.ResponseWriter, req *http.Request) {
|
||||
URL: req.URL.RequestURI(),
|
||||
Host: req.Host,
|
||||
Method: req.Method,
|
||||
Name: name,
|
||||
}
|
||||
|
||||
ifaces, _ := net.Interfaces()
|
||||
|
4
go.mod
4
go.mod
@ -1,5 +1,5 @@
|
||||
module github.com/containous/whoami
|
||||
module github.com/traefik/whoami
|
||||
|
||||
go 1.13
|
||||
|
||||
require github.com/gorilla/websocket v1.4.1
|
||||
require github.com/gorilla/websocket v1.4.2
|
||||
|
4
go.sum
4
go.sum
@ -1,2 +1,2 @@
|
||||
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
|
||||
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
|
Reference in New Issue
Block a user