Skip to content

Commit

Permalink
build: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
LEXUGE committed Jun 22, 2022
1 parent 0eda104 commit 8c24d1f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 22 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,42 @@

![Automated build](https://github.com/LEXUGE/dcompass/workflows/Build%20dcompass%20on%20various%20targets/badge.svg)
[![Join telegram channel](https://badges.aleen42.com/src/telegram.svg)](https://t.me/dcompass_channel)
A high-performance DNS server with flexible routing scheme and customized plugins.
A high-performance programmable DNS server.
[中文版](README-CN.md)

Below is an example of using GeoIP to mitigate DNS pollution

```yaml
table:
start:
- query: domestic
- check_secure
check_secure:
if: "!geoip(codes: [\"CN\"])"
then:
- query: secure
- end
script:
init: |
let geoip = new_geoip_from_path("../data/full.mmdb").seal();
route: |
let resp = upstreams.send("domestic", query);
try {
let ans = resp.answer[0];
return switch ans.rtype.to_string() {
"A" if !geoip.contains(ans.to_a().ip, "CN") => { upstreams.send("secure", query) }
"AAAA" if !geoip.contains(ans.to_aaaa().ip, "CN") => { upstreams.send("secure", query) }
_ => resp
};
} catch(err) {
print(err);
return resp;
}
```
# Features
- Fast (~50000 qps in wild where upstream perf is about the same)
- Flexible routing rules that are easy to compose and maintain
- Built-in plugins to manipulate your DNS queries and responses (you can also add or tailor them to your need)
- Rust-like scripting with rhai
- Fearless hot switch between network environments
- DNS over HTTPS support
- Written in pure Rust
# Notice
**[2022-06-22] All-new script engine**
You are now in full control of every bit of your DNS server. With the new script engine, you can now access every bitflag, every record, and every section of every DNS message. You can literally program dcompass into whatever you want!
**[2021-9-16] Expression Engine and breaking changes**
dcompass is now equipped with an expression engine which let you easily and freely compose logical expressions with existing matchers. This enables us to greatly improve config readablity and versatility. However, all existing config files involving if rule block are no longer working. Please see examples to migrate.
Expand Down
2 changes: 1 addition & 1 deletion droute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ compact_str = { version = "^0.3", features = ["serde"]}
pest = "^2"
ron = "^0.7"
pest_derive = "^2"
cidr-utils = { version = "^0.5", git = "https://github.com/compassd/cidr-utils" }
cidr-utils = { version = "^0.5", git = "https://github.com/compassd/cidr-utils", rev = "c5f5c2ef167b4de9856764fd6b3b84e784b98db2" }
once_cell = "^1.7"
dmatcher = {version = "^0.1", path = "../dmatcher"}
log = "^0.4"
Expand Down
8 changes: 7 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@
name = "dcompass-${strings.removePrefix "geoip-" v}";
version = "git";
src = lib.cleanSource ./.;
cargoLock = { lockFile = ./Cargo.lock; };
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"cidr-utils-0.5.7" =
"sha256-Kyvq1R5o7csR2BGWj9oZ6J+96fSqNBXBB2m/79HjGbM=";
};
};
cargoBuildFlags = [ "--features ${v}" ];
# Used by tokio-console
# nativeBuildInputs = [ protobuf ];
Expand Down

0 comments on commit 8c24d1f

Please sign in to comment.