3 Commits
v1.3 ... v1.3.2

Author SHA1 Message Date
46177264a1 v1.3.2: Fix GitHub Actions build 2021-03-06 15:15:49 +00:00
ec9e6ca83c Add Docker configuration 2021-03-06 15:11:40 +00:00
e1953f339d Version 1.3.1: [FIX] Allow disabling header 2021-02-19 23:33:19 +00:00
5 changed files with 34 additions and 3 deletions

21
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Build
on:
push:
tags: *
jobs:
build:
name: GitHub Package Registry
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to GitHub Package Registry
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u luketainton --password-stdin
- name: Build image for GitHub Package Registry
run: |
docker build . --file Dockerfile --tag docker.pkg.github.com/luketainton/ipilot/ipilot:latest
docker build . --file Dockerfile --tag docker.pkg.github.com/luketainton/ipilot/ipilot:$GITHUB_REF
- name: Push image to GitHub Package Registry
run: |
docker push docker.pkg.github.com/luketainton/ipilot/ipilot:latest
docker push docker.pkg.github.com/luketainton/ipilot/ipilot:$GITHUB_REF

9
Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM golang:1.16-alpine as build
WORKDIR /go/src/app
COPY . /go/src/app
RUN CGO_ENABLED=0 go build -o /go/bin/app
FROM gcr.io/distroless/base-debian10
LABEL maintainer="Luke Tainton <luke@tainton.uk>"
COPY --from=build /go/bin/app /
CMD ["/app"]

View File

@@ -2,7 +2,6 @@ package main
import (
"fmt"
"os"
"strings"
)
@@ -26,8 +25,6 @@ type IPAddressInfo struct {
func printIPInfo(input string, wantPrefixes bool) {
var IPInfo IPAddressInfo = getIPInfo(input)
fmt.Printf("%+v\n", IPInfo)
os.Exit(200)
var location string = IPInfo.Country + "/" + IPInfo.RegionName + "/" + IPInfo.City
var bgpAS string = strings.Fields(IPInfo.AS)[0]
fmt.Println("IP Address: ", IPInfo.IPAddress)

View File

@@ -17,6 +17,7 @@ func main() {
flag.Usage = func() {
fmt.Printf("Usage of iPilot: \n")
fmt.Printf("Example: iPilot -b=false -i=me -p \n")
fmt.Printf(" -b bool enable/disable header (default true)\n")
fmt.Printf(" -h bool view help\n")
fmt.Printf(" -i string IP address or domain\n")

3
go.mod Normal file
View File

@@ -0,0 +1,3 @@
module github.com/luketainton/iPilot
go 1.16