Skip to content

Commit b2f7ff2

Browse files
committed
Initial commit
0 parents  commit b2f7ff2

28 files changed

+2914
-0
lines changed

.github/workflows/main.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build & Push Image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
env:
8+
IMAGE_NAME: vatdns
9+
10+
jobs:
11+
push:
12+
runs-on: ubuntu-latest
13+
if: github.event_name == 'push'
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Log into registry
17+
run: echo "${{ secrets.DO_REGISTRY_USERNAME }}" | docker login registry.digitalocean.com -u ${{ secrets.DO_REGISTRY_USERNAME }} --password-stdin
18+
- name: Build testing image
19+
run: docker build . --file Dockerfiletesting --tag vatdns
20+
- name: Start dnshaiku
21+
run: docker run -d --name vatdns -e TEST_MODE=true -e DEFAULT_FSD_SERVER=fsd.usa-w.vatsim.net -e DNS_PORT=10053 -e HTTP_DATA_PORT=8080 -p 8080:8080 -p 10053:10053 vatdns /bin/dnshaiku
22+
- name: Logs
23+
run: docker logs vatdns
24+
- name: Test dnshaiku
25+
run: docker exec vatdns go test -json -v ./test/...
26+
- name: Push image
27+
run: |
28+
IMAGE_ID=registry.digitalocean.com/vatsim-containers/$IMAGE_NAME
29+
# Change all uppercase to lowercase
30+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
31+
# Strip git ref prefix from version
32+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
33+
# Strip "v" prefix from tag name
34+
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
35+
# Use Docker `latest` tag convention
36+
[ "$VERSION" == "master" ] && VERSION=latest
37+
echo IMAGE_ID=$IMAGE_ID
38+
echo VERSION=$VERSION
39+
docker tag vatdns $IMAGE_ID:$VERSION
40+
docker push $IMAGE_ID:$VERSION

.gitignore

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
### JetBrains template
2+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
3+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
4+
5+
# User-specific stuff
6+
.idea/**/workspace.xml
7+
.idea/**/tasks.xml
8+
.idea/**/usage.statistics.xml
9+
.idea/**/dictionaries
10+
.idea/**/shelf
11+
12+
# AWS User-specific
13+
.idea/**/aws.xml
14+
15+
# Generated files
16+
.idea/**/contentModel.xml
17+
18+
# Sensitive or high-churn files
19+
.idea/**/dataSources/
20+
.idea/**/dataSources.ids
21+
.idea/**/dataSources.local.xml
22+
.idea/**/sqlDataSources.xml
23+
.idea/**/dynamic.xml
24+
.idea/**/uiDesigner.xml
25+
.idea/**/dbnavigator.xml
26+
27+
# Gradle
28+
.idea/**/gradle.xml
29+
.idea/**/libraries
30+
31+
# Gradle and Maven with auto-import
32+
# When using Gradle or Maven with auto-import, you should exclude module files,
33+
# since they will be recreated, and may cause churn. Uncomment if using
34+
# auto-import.
35+
# .idea/artifacts
36+
# .idea/compiler.xml
37+
# .idea/jarRepositories.xml
38+
# .idea/modules.xml
39+
# .idea/*.iml
40+
# .idea/modules
41+
# *.iml
42+
# *.ipr
43+
44+
# CMake
45+
cmake-build-*/
46+
47+
# Mongo Explorer plugin
48+
.idea/**/mongoSettings.xml
49+
50+
# File-based project format
51+
*.iws
52+
53+
# IntelliJ
54+
out/
55+
56+
# mpeltonen/sbt-idea plugin
57+
.idea_modules/
58+
59+
# JIRA plugin
60+
atlassian-ide-plugin.xml
61+
62+
# Cursive Clojure plugin
63+
.idea/replstate.xml
64+
65+
# SonarLint plugin
66+
.idea/sonarlint/
67+
68+
# Crashlytics plugin (for Android Studio and IntelliJ)
69+
com_crashlytics_export_strings.xml
70+
crashlytics.properties
71+
crashlytics-build.properties
72+
fabric.properties
73+
74+
# Editor-based Rest Client
75+
.idea/httpRequests
76+
77+
# Android studio 3.1+ serialized cache file
78+
.idea/caches/build_file_checksums.ser
79+
80+
### Go template
81+
# If you prefer the allow list template instead of the deny list, see community template:
82+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
83+
#
84+
# Binaries for programs and plugins
85+
*.exe
86+
*.exe~
87+
*.dll
88+
*.so
89+
*.dylib
90+
91+
# Test binary, built with `go test -c`
92+
*.test
93+
94+
# Output of the go coverage tool, specifically when used with LiteIDE
95+
*.out
96+
97+
# Dependency directories (remove the comment below to include it)
98+
# vendor/
99+
100+
# Go workspace file
101+
go.work
102+
103+
.env
104+
dist

Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM golang:1.19-alpine AS build
2+
3+
4+
COPY . /go/src/vatdns
5+
WORKDIR /go/src/vatdns
6+
7+
RUN apk add git
8+
RUN go build -o /bin/dnshaiku cmd/dnshaiku/main.go
9+
RUN go build -o /bin/retardantfoam cmd/retardantfoam/main.go
10+
11+
FROM scratch
12+
COPY --from=build /bin/dnshaiku /bin/dnshaiku
13+
COPY --from=build /bin/retardantfoam /bin/retardantfoam

Dockerfiletesting

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM golang:1.19-alpine AS build
2+
3+
4+
COPY . /usr/local/go/src/vatdns
5+
COPY . /go/src/vatdns
6+
WORKDIR /usr/local/go/src/vatdns
7+
8+
RUN apk add git build-base
9+
RUN go build -o /bin/dnshaiku cmd/dnshaiku/main.go
10+
RUN go build -o /bin/retardantfoam cmd/retardantfoam/main.go
11+
RUN chmod +x /bin/dnshaiku /bin/retardantfoam

GeoLite2-City.mmdb

69.3 MB
Binary file not shown.

0 commit comments

Comments
 (0)