Skip to content

Commit 674f360

Browse files
committed
Initial commit
1 parent 4a22c8a commit 674f360

7 files changed

Lines changed: 57 additions & 14 deletions

File tree

.github/workflows/main.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Extract version from tag
18+
id: get_version
19+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
20+
21+
- name: Login to Docker Hub
22+
uses: docker/login-action@v3
23+
with:
24+
username: ${{ secrets.DOCKERHUB_USERNAME }}
25+
password: ${{ secrets.DOCKERHUB_TOKEN }}
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
with:
30+
install: true
31+
32+
- name: Create Docker Buildx builder
33+
run: docker buildx create --use --name mybuilder
34+
35+
- name: Build and push image
36+
uses: docker/build-push-action@v5
37+
with:
38+
context: .
39+
push: true
40+
tags: |
41+
${{ secrets.DOCKERHUB_USERNAME }}/whois:latest
42+
${{ secrets.DOCKERHUB_USERNAME }}/whois:${{ env.VERSION }}
43+
platforms: linux/amd64

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM golang:alpine AS build
44

55
WORKDIR /ws
66

7-
COPY obmp-whois/ /ws
7+
COPY . /ws
88

99
ENV GO111MODULE=on
1010
ENV GCGO_ENABLED=0
@@ -15,26 +15,26 @@ RUN apk add --no-cache bash git
1515
RUN cd /ws && go mod tidy
1616

1717
# Build the app
18-
RUN cd /ws && go build -o obmp-whoisd .
18+
RUN cd /ws && go build -o whoisd .
1919

2020
FROM alpine
2121

22-
COPY --from=build /ws/obmp-whoisd /usr/local/bin/
22+
COPY --from=build /ws/whoisd /usr/local/bin/
2323

2424
WORKDIR /tmp
2525

2626
# Environment defaults
2727
ENV DB_MAX_THREADS=10
2828
ENV WHOIS_PORT=43
2929

30-
ENV PGHOST=obmp-psql
31-
ENV PGDATABASE=openbmp
32-
ENV PGUSER=openbmp
33-
ENV PGPASSWORD=openbmp
30+
ENV PGHOST=aggregator
31+
ENV PGDATABASE=bgpdata
32+
ENV PGUSER=bgpdata
33+
ENV PGPASSWORD=bgpdata
3434
ENV PGPORT=5432
3535

3636
EXPOSE 43
3737

3838
RUN apk add --no-cache bash
3939

40-
ENTRYPOINT /usr/local/bin/obmp-whoisd --logfile /dev/stdout -p $WHOIS_PORT -t $DB_MAX_THREADS
40+
ENTRYPOINT /usr/local/bin/whoisd --logfile /dev/stdout -p $WHOIS_PORT -t $DB_MAX_THREADS

cmd/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ package cmd
44
import (
55
"fmt"
66
homedir "github.com/mitchellh/go-homedir"
7-
"github.com/openbmp/obmp-whois/config"
8-
whois "github.com/openbmp/obmp-whois/pkg/whois"
7+
"github.com/bgpdata/whois/config"
8+
whois "github.com/obgpdata/whois/pkg/whois"
99
log "github.com/sirupsen/logrus"
1010
"github.com/spf13/cobra"
1111
"github.com/spf13/viper"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/openbmp/obmp-whois
1+
module github.com/bgpdata/whois
22

33
go 1.17
44

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
package main
33

44
import (
5-
"github.com/openbmp/obmp-whois/cmd"
5+
"github.com/bgpdata/whois/cmd"
66
)
77

88
func main() {

pkg/whois/handler_prefix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package whois
44
import (
55
"database/sql"
66
"fmt"
7-
"github.com/openbmp/obmp-whois/config"
7+
"github.com/bgpdata/whois/config"
88
log "github.com/sirupsen/logrus"
99
"strings"
1010
"time"

pkg/whois/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package whois
44
import (
55
"bufio"
66
"database/sql"
7-
"github.com/openbmp/obmp-whois/config"
7+
"github.com/bgpdata/whois/config"
88
log "github.com/sirupsen/logrus"
99
"net"
1010
"os"

0 commit comments

Comments
 (0)