chore: add drone build

trunk
Adam Veldhousen 3 years ago
parent 977fd7cb2f
commit ca1c3f2503
Signed by: adam
GPG Key ID: 6DB29003C6DD1E4B

@ -0,0 +1,165 @@
kind: pipeline
type: docker
name: docker build
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
trigger:
event:
- push
steps:
- name: docker build
image: docker:dind
volumes:
- name: dockersock
path: /var/run/docker.sock
commands:
- apk add make git
- docker login -u adamveld12 -p $${DOCKER_PASSWORD}
- make vdhsn/gopherhole
- docker push -a vdhsn/gopherhole
environment:
DOCKER_PASSWORD:
from_secret: DOCKER_PASS
- name: post update
image: plugins/matrix
settings:
homeserver: https://matrix.vdhsn.com
password:
from_secret: MATRIX_PASSWORD
roomid: UwldmBPwrgpoXYozVG:matrix.vdhsn.com
template: "Docker image build and push from {{ build.branch }} {{ build.status }}. See @ [{{ repo.Owner }}/{{ repo.Name }}#{{ truncate build.commit 8 }}]({{ build.link }}). Triggered by {{ build.author }}"
username:
from_secret: MATRIX_USER
failure: ignore
when:
status:
- failure
- success
depends_on:
- docker build
---
kind: pipeline
type: docker
name: terraform-plan
environment:
CONSUL_HTTP_ADDR: http://192.168.1.15:8500
NOMAD_ADDR: http://192.168.1.15:4646
trigger:
branch:
exclude:
- trunk
steps:
- name: terraform plan
image: hashicorp/terraform
commands:
- cd ./terraform/
- terraform init
- terraform providers
- terraform plan -refresh=true -lock-timeout=10s -lock=true -out=./terraform-ci.plan -var=consul_token=$${CONSUL_TOKEN} -var=vault_token=$${VAULT_TOKEN}
environment:
CONSUL_TOKEN:
from_secret: CONSUL_TOKEN
VAULT_TOKEN:
from_secret: VAULT_TOKEN
---
kind: pipeline
type: docker
name: terraform
environment:
CONSUL_HTTP_ADDR: http://192.168.1.15:8500
NOMAD_ADDR: http://192.168.1.15:4646
trigger:
branch:
- trunk
steps:
- name: terraform deploy
image: hashicorp/terraform
commands:
- cd ./terraform/
- terraform init
- terraform providers
- terraform apply -lock=true -auto-approve -input=false -var=consul_token=$${CONSUL_TOKEN} -var=vault_token=$${VAULT_TOKEN}
environment:
CONSUL_TOKEN:
from_secret: CONSUL_TOKEN
VAULT_TOKEN:
from_secret: VAULT_TOKEN
when:
branch:
- trunk
- name: post update
image: plugins/matrix
settings:
homeserver: https://matrix.vdhsn.com
password:
from_secret: MATRIX_PASSWORD
roomid: UwldmBPwrgpoXYozVG:matrix.vdhsn.com
template: "Terraform deploy from {{ build.branch }} {{ build.status }}. See @ [{{ repo.Owner }}/{{ repo.Name }}#{{ truncate build.commit 8 }}]({{ build.link }}). Triggered by {{ build.author }}"
username:
from_secret: MATRIX_USER
failure: ignore
when:
status:
- failure
- success
depends_on:
- terraform deploy
---
kind: pipeline
type: docker
name: nomad
environment:
CONSUL_HTTP_ADDR: http://192.168.1.15:8500
NOMAD_ADDR: http://192.168.1.15:4646
steps:
- name: nomad validate
image: adamveld12/nomad:1.0.4
commands:
- cd ./jobs/
- ./validate.sh
- name: nomad deploy
image: adamveld12/nomad:1.0.4
when:
event:
- push
branch:
- trunk
depends_on:
- nomad validate
commands:
- cd ./jobs/
- ./deploy.sh
- name: post update
image: plugins/matrix
settings:
homeserver: https://matrix.vdhsn.com
password:
from_secret: MATRIX_PASSWORD
roomid: UwldmBPwrgpoXYozVG:matrix.vdhsn.com
template: "Nomad deploy from {{ build.branch }} {{ build.status }}. See @ [{{ repo.Owner }}/{{ repo.Name }}#{{ truncate build.commit 8 }}]({{ build.link }}). Triggered by {{ build.author }}"
username:
from_secret: MATRIX_USER
failure: ignore
when:
status:
- failure
- success
depends_on:
- nomad deploy

@ -1,11 +1,11 @@
# Gopherhole
[![GoDoc Reference](https://godoc.org/github.com/adamveld12/gopherhole?status.svg)](http://godoc.org/github.com/adamveld12/gopherhole)
[![GitHub Actions](https://github.com/adamveld12/gopherhole/workflows/Go/badge.svg)](https://github.com/adamveld12/gopherhole/actions?query=workflow%3AGo)
[![Go Report Card](https://goreportcard.com/badge/github.com/adamveld12/gopherhole)](https://goreportcard.com/report/github.com/adamveld12/gopherhole)
[![GitHub Actions](https://github.com/adamveld12/gopherhole/workflows/Go/badge.svg)](https://github.com/adamveld12/gopherhole/actions?query=workflow%3AGo)
Fully customizable DNS server.
Fully customizable DNS server.
- HTTP API to configure on the fly
- Supports Redis/local in memory caching
@ -16,4 +16,4 @@ Compatible with pihole block lists: https://firebog.net/
## LICENSE
MIT
MIT

@ -1,131 +0,0 @@
{
"database": ".",
"cache": "in-memory",
"http-addr": "localhost:8000",
"dns-addr": "localhost:5353",
"recursors": ["192.168.1.15:8600", "1.1.1.1", "8.8.8.8"],
"rules": [
{
"name": "internal veldhousen.ninja",
"value": "veldhousen.(ninja|internal)",
"answer": { "type": "A", "value": "192.168.1.15" },
"ttl": 300
}
],
"rule-lists": [
{
"name": "Polish Filters Team KADhosts",
"url": "https://raw.githubusercontent.com/PolishFiltersTeam/KADhosts/master/KADhosts.txt"
},
{
"name": "FadeMind hosts",
"url": "https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Spam/hosts"
},
{
"name": "W3kbl",
"url": "https://v.firebog.net/hosts/static/w3kbl.txt"
},
{ "name": "Adaway", "url": "https://adaway.org/hosts.txt" },
{
"name": "AdguardDNS",
"url": "https://v.firebog.net/hosts/AdguardDNS.txt"
},
{ "name": "Admiral", "url": "https://v.firebog.net/hosts/Admiral.txt" },
{
"name": "anudeepnd blacklist",
"url": "https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt"
},
{
"name": "lists.disconnect.me simple ad",
"url": "https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt"
},
{
"name": "EasyList",
"url": "https://v.firebog.net/hosts/Easylist.txt"
},
{
"name": "yoyo.org adservers",
"url": "https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext"
},
{
"name": "FadeMind UncheckyAds",
"url": "https://raw.githubusercontent.com/FadeMind/hosts.extras/master/UncheckyAds/hosts"
},
{
"name": "hostsVN",
"url": "https://raw.githubusercontent.com/bigdargon/hostsVN/master/hosts"
},
{
"name": "EasyPrivacy",
"url": "https://v.firebog.net/hosts/Easyprivacy.txt"
},
{
"name": "Prigent-Ads",
"url": "https://v.firebog.net/hosts/Prigent-Ads.txt"
},
{
"name": "FadeMind add.207Net",
"url": "https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.2o7Net/hosts"
},
{
"name": "WindowsSpyBlocker",
"url": "https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt"
},
{
"name": "Frogeye firstparty trackers",
"url": "https://hostfiles.frogeye.fr/firstparty-trackers-hosts.txt"
},
{
"name": "W3C Annual TOP EU US Ads Trackers",
"url": "https://raw.githubusercontent.com/Kees1958/W3C_annual_most_used_survey_blocklist/master/TOP_EU_US_Ads_Trackers_HOST"
},
{
"name": "DandelionSprout adlift",
"url": "https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Alternate%20versions%20Anti-Malware%20List/AntiMalwareHosts.txt"
},
{
"name": "Threat Intel latest domains",
"url": "https://osint.digitalside.it/Threat-Intel/lists/latestdomains.txt"
},
{
"name": "Disconnect.me simple malvertising",
"url": "https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt"
},
{
"name": "Prigent Crypto",
"url": "https://v.firebog.net/hosts/Prigent-Crypto.txt"
},
{
"name": "Mandiant APT1 Report Appendix D.",
"url": "https://bitbucket.org/ethanr/dns-blacklists/raw/8575c9f96e5b4a1308f2f12394abd86d0927a4a0/bad_lists/Mandiant_APT1_Report_Appendix_D.txt"
},
{
"name": "phishing army blocklist ext",
"url": "https://phishing.army/download/phishing_army_blocklist_extended.txt"
},
{
"name": "notrack malware",
"url": "https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-malware.txt"
},
{
"name": "Shalla-mal",
"url": "https://v.firebog.net/hosts/Shalla-mal.txt"
},
{
"name": "Spam404 main-blacklist",
"url": "https://raw.githubusercontent.com/Spam404/lists/master/main-blacklist.txt"
},
{
"name": "FadeMind Risky",
"url": "https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Risk/hosts"
},
{
"name": "urlhaus abuse",
"url": "https://urlhaus.abuse.ch/downloads/hostfile/"
},
{
"name": "Coin Blocker Lists",
"url": "https://zerodot1.gitlab.io/CoinBlockerLists/hosts_browser"
}
]
}

@ -1,8 +0,0 @@
SELECT
domain,
ROUND(AVG(totalTimeMs), 3) as averageTotalTime,
COUNT(*) as requests,
strftime('%s', started)/(5*60) as "timeWindow"
FROM log
GROUP BY domain, strftime('%s', started) / (5 * 60)
ORDER BY started desc;

@ -1,5 +1,6 @@
LINTBIN := $(shell go env GOPATH)/bin/golangci-lint
COMMIT_SHA := $(shell git rev-parse HEAD | cut -c 1-11)
BUILD_DATE := $(shell date +'%FT%T%:z')
COMMIT_SHA := $(shell git rev-parse --short=11 HEAD)
build: clobber .bin/client/public .bin/gopherhole
@ -24,12 +25,14 @@ clobber: clean
vdhsn/gopherhole:
docker build \
--label="org.opencontainers.image.created=$(shell date +'%FT%T%:z')" \
--label="org.opencontainers.image.created=$(BUILD_DATE)" \
--label="org.opencontainers.image.source=https://github.com/adamveld12/gopherhole.git" \
--label="org.opencontainers.image.url=https://github.com/adamveld12/gopherhole" \
--label="org.opencontainers.image.revision=$(COMMIT_SHA)" \
--label="org.opencontainers.image.licenses=MIT" \
--label="org.opencontainers.image.authors=Adam Veldhousen <adam@vdhsn.com>" \
-t vdhsn/gopherhole:$(COMMIT_SHA) \
-t vdhsn/gopherhole:$(BUILD_DATE) \
-t vdhsn/gopherhole:latest .
test:

Loading…
Cancel
Save