Fast and lightweight DNS proxy as ad-blocker for local network with many features
Go to file
Kwitsch 804ba0570c
Rueidis base (#1008)
* updated Deprecated comments

* moved redis config t seperate file

* added more ruedis options

* fmt,lint&test

* init ruedis

* ruedis init

* ruedis rework

* go mod tidy

* redis unit test 1

* changed redis config validation

* go generate

* unshadow

* removed all redis unit tests

* fix e2e tests

* removed one e2e test as it fails(even when a similar setup works in my test environment)

* e2e timing problem

* build(deps): bump github.com/docker/docker

Bumps [github.com/docker/docker](https://github.com/docker/docker) from 23.0.1+incompatible to 23.0.3+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v23.0.1...v23.0.3)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump gorm.io/gorm

Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.24.7-0.20230306060331-85eaf9eeda11 to 1.25.0.
- [Release notes](https://github.com/go-gorm/gorm/releases)
- [Commits](https://github.com/go-gorm/gorm/commits/v1.25.0)

---
updated-dependencies:
- dependency-name: gorm.io/gorm
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump github.com/prometheus/client_golang

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.14.0 to 1.15.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.14.0...v1.15.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump gorm.io/driver/sqlite from 1.4.4 to 1.5.0

Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.4.4 to 1.5.0.
- [Release notes](https://github.com/go-gorm/sqlite/releases)
- [Commits](https://github.com/go-gorm/sqlite/compare/v1.4.4...v1.5.0)

---
updated-dependencies:
- dependency-name: gorm.io/driver/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump gorm.io/driver/mysql from 1.4.7 to 1.5.0

Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.4.7 to 1.5.0.
- [Release notes](https://github.com/go-gorm/mysql/releases)
- [Commits](https://github.com/go-gorm/mysql/compare/v1.4.7...v1.5.0)

---
updated-dependencies:
- dependency-name: gorm.io/driver/mysql
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump github.com/swaggo/swag from 1.8.12 to 1.16.1

Bumps [github.com/swaggo/swag](https://github.com/swaggo/swag) from 1.8.12 to 1.16.1.
- [Release notes](https://github.com/swaggo/swag/releases)
- [Changelog](https://github.com/swaggo/swag/blob/master/.goreleaser.yml)
- [Commits](https://github.com/swaggo/swag/compare/v1.8.12...v1.16.1)

---
updated-dependencies:
- dependency-name: github.com/swaggo/swag
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump github.com/alicebob/miniredis/v2 from 2.30.1 to 2.30.2

Bumps [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis) from 2.30.1 to 2.30.2.
- [Release notes](https://github.com/alicebob/miniredis/releases)
- [Changelog](https://github.com/alicebob/miniredis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alicebob/miniredis/compare/v2.30.1...v2.30.2)

---
updated-dependencies:
- dependency-name: github.com/alicebob/miniredis/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Goreleaser fix (#1003)

* use zig for goreleaser

* added test workflow

* Revert "added test workflow"

This reverts commit 9c55c5fd9e.

* added goreleaser test

* autorun goreleaser tests

* add pseudo tag for goreleaser

* added test

* added arm test

* arch test

* missing qemu setup?

* test alternate run

* test rework

* path fix?

* 18 won't run

* another test

* permission fix

* amd64 matrix

* added macos

* added windows test

* consolidate unix tests

* fix path

* fix path2

* matrix consolidation

* +x fails on macos

* fix runner

* windows fix

* Update .github/workflows/goreleaser-test.yml

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>

* Update .github/workflows/goreleaser-test.yml

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>

* Update .github/workflows/goreleaser-test.yml

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>

* Update .github/workflows/goreleaser-test.yml

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>

* auto test binaries on release

---------

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>

* build(deps): bump github.com/avast/retry-go/v4 from 4.3.3 to 4.3.4

Bumps [github.com/avast/retry-go/v4](https://github.com/avast/retry-go) from 4.3.3 to 4.3.4.
- [Release notes](https://github.com/avast/retry-go/releases)
- [Commits](https://github.com/avast/retry-go/compare/4.3.3...4.3.4)

---
updated-dependencies:
- dependency-name: github.com/avast/retry-go/v4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* go mod tidy

* don't store context in client

* Update redis/redis.go

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>

* Update redis/redis.go

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>

* moved ClientOptions getter to config package

* moved validation functions

* linter fix

* log warnings about config ignore

* log fetch error

* %w is not supported

* build(deps): bump github.com/prometheus/client_golang

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.0 to 1.15.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.15.0...v1.15.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* retry.Do implementation

* log redis config if enabled

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>
2023-05-05 23:16:24 +02:00
.github Rueidis base (#1008) 2023-05-05 23:16:24 +02:00
api chore(build): update golangci-lint (#931) 2023-03-16 07:49:09 +01:00
cache chore(build): Automation workflows (#972) 2023-04-03 16:33:16 +02:00
cmd feat(bootstrap): support multiple upstreams 2023-01-18 18:57:55 +01:00
config Rueidis base (#1008) 2023-05-05 23:16:24 +02:00
docs Add homebrew link to the installation docs (#995) 2023-04-15 23:56:29 +02:00
e2e Rueidis base (#1008) 2023-05-05 23:16:24 +02:00
evt chore(build): add additional linters (#774) 2022-11-29 21:58:26 +01:00
helpertest Test refactoring (#798) 2022-12-29 14:58:25 +01:00
lists Rueidis base (#1008) 2023-05-05 23:16:24 +02:00
log Rueidis base (#1008) 2023-05-05 23:16:24 +02:00
metrics refactor: configuration rework (usage and printing) (#920) 2023-03-12 22:14:10 +01:00
model Rueidis base (#1008) 2023-05-05 23:16:24 +02:00
querylog Added gofumpt (#805) 2022-12-26 22:11:45 +01:00
redis Rueidis base (#1008) 2023-05-05 23:16:24 +02:00
resolver Rueidis base (#1008) 2023-05-05 23:16:24 +02:00
server Rueidis base (#1008) 2023-05-05 23:16:24 +02:00
util chore(build): Automation workflows (#972) 2023-04-03 16:33:16 +02:00
web chore: update golangci-lint (#631) 2022-08-19 22:04:35 +02:00
.dockerignore build(tests): e2e integration tests with docker and testcontainers (#753) 2022-11-24 21:54:52 +01:00
.gitignore build(tests): e2e integration tests with docker and testcontainers (#753) 2022-11-24 21:54:52 +01:00
.golangci.yml chore: update testcontainers version (#821) 2023-01-05 10:30:53 +01:00
.goreleaser.yml Rueidis base (#1008) 2023-05-05 23:16:24 +02:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2021-03-05 10:58:39 +01:00
Dockerfile build(tests): e2e integration tests with docker and testcontainers (#753) 2022-11-24 21:54:52 +01:00
LICENSE added license text 2020-01-13 21:57:57 +01:00
Makefile chore(build): add format with gofumpt to build (#974) 2023-04-04 09:25:45 +02:00
README.md chore: change branch name to "main" (#744) 2023-03-07 17:25:04 +01:00
codecov.yml chore(test): exclude mocks from code coverage report 2023-03-15 16:46:51 +01:00
go.mod Rueidis base (#1008) 2023-05-05 23:16:24 +02:00
go.sum Rueidis base (#1008) 2023-05-05 23:16:24 +02:00
main.go use full-qualified name as module 2021-08-27 13:41:36 +02:00
main_static.go added setLocaltime 2022-11-12 21:37:01 +01:00
mkdocs.yml chore: mirror git repo to codeberg 2023-03-13 14:04:18 +01:00
tools.go chore(build): add format with gofumpt to build (#974) 2023-04-04 09:25:45 +02:00

README.md

GitHub Workflow Status GitHub Workflow Status GitHub latest version GitHub Release Date GitHub go.mod Go version Docker pulls Docker Image Size (latest) Codecov Codacy grade Go Report Card Donation

Blocky

Blocky is a DNS proxy and ad-blocker for the local network written in Go with following features:

Features

  • Blocking - Blocking of DNS queries with external lists (Ad-block, malware) and whitelisting

    • Definition of black and white lists per client group (Kids, Smart home devices, etc.)
    • Periodical reload of external black and white lists
    • Regex support
    • Blocking of request domain, response CNAME (deep CNAME inspection) and response IP addresses (against IP lists)
  • Advanced DNS configuration - not just an ad-blocker

    • Custom DNS resolution for certain domain names
    • Conditional forwarding to external DNS server
    • Upstream resolvers can be defined per client group
  • Performance - Improves speed and performance in your network

    • Customizable caching of DNS answers for queries -> improves DNS resolution speed and reduces amount of external DNS queries
    • Prefetching and caching of often used queries
    • Using multiple external resolver simultaneously
    • Low memory footprint
  • Various Protocols - Supports modern DNS protocols

    • DNS over UDP and TCP
    • DNS over HTTPS (aka DoH)
    • DNS over TLS (aka DoT)
  • Security and Privacy - Secure communication

    • Supports modern DNS extensions: DNSSEC, eDNS, ...
    • Free configurable blocking lists - no hidden filtering etc.
    • Provides DoH Endpoint
    • Uses random upstream resolvers from the configuration - increases your privacy through the distribution of your DNS traffic over multiple provider
    • Blocky does NOT collect any user data, telemetry, statistics etc.
  • Integration - various integration

    • Prometheus metrics
    • Prepared Grafana dashboards (Prometheus and database)
    • Logging of DNS queries per day / per client in CSV format or MySQL/MariaDB/PostgreSQL database - easy to analyze
    • Various REST API endpoints
    • CLI tool
  • Simple configuration - single or multiple configuration files in YAML format

    • Simple to maintain
    • Simple to backup
  • Simple installation/configuration - blocky was designed for simple installation

    • Stateless (no database, no temporary files)
    • Docker image with Multi-arch support
    • Single binary
    • Supports x86-64 and ARM architectures -> runs fine on Raspberry PI
    • Community supported Helm chart for k8s deployment

Quick start

You can jump to Installation chapter in the documentation.

Full documentation

You can find full documentation and configuration examples at: https://0xERR0R.github.io/blocky/

Contribution

Issues, feature suggestions and pull requests are welcome!

ko-fi