Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure: preparing 0.3.0 #38

Merged
merged 45 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c6a440f
restructure: add reloader service to the config file. todo: add reloa…
junkurihara Aug 28, 2023
e94d097
Merge branch 'develop' into restructure/0.3.0
junkurihara Sep 14, 2023
1889c8b
deps
junkurihara Oct 5, 2023
0e46b63
migrating to the new framework
junkurihara Oct 5, 2023
c295030
add note
junkurihara Oct 5, 2023
e78d507
refactor: config loader
junkurihara Oct 6, 2023
9c56f9f
feat: implementing authenticator from scratch
junkurihara Oct 20, 2023
a22961b
chore: refactor
junkurihara Oct 20, 2023
410afd0
chore: considering to implement auth client lib in rust-token-server …
junkurihara Oct 23, 2023
858190c
chore: refactor
junkurihara Oct 23, 2023
856aef2
Merge branch 'restructure/0.3.0' of github.com:junkurihara/doh-auth-p…
junkurihara Oct 23, 2023
e9c2ddf
feat: remove auth lib and call external rust-token-server-client crate
junkurihara Oct 23, 2023
7b3a2c4
feat: add stub for auth reloader service
junkurihara Oct 23, 2023
612d54b
feat: auth client periodic watch service
junkurihara Oct 24, 2023
ebc1ca3
feat: wip http_client
junkurihara Oct 24, 2023
faea387
feat: implement udp and tcp proxies
junkurihara Oct 25, 2023
2c8f2b2
fix: fix bug of listen addresses
junkurihara Oct 25, 2023
80c9ae3
chore: refactor
junkurihara Oct 25, 2023
eba3516
feat: implement endpoint ip resolution service
junkurihara Oct 25, 2023
f3944a0
chore: comment
junkurihara Oct 25, 2023
1ede9fb
chore: fix commit
junkurihara Oct 25, 2023
2fba7f1
chore: add stub and refactor
junkurihara Oct 25, 2023
b1e39a8
feat: path manager (wip)
junkurihara Oct 26, 2023
771b3ef
feat: wip: all possible paths
junkurihara Oct 26, 2023
e427200
feat: wip: path manager
junkurihara Oct 27, 2023
15e48c7
feat: wip: path manager
junkurihara Oct 27, 2023
8a87d35
feat: odoh config watch service
junkurihara Oct 27, 2023
352d69c
chore: trust-dns is now hickory-dns
junkurihara Oct 27, 2023
62089ff
feat: impl standard doh client
junkurihara Oct 27, 2023
7710172
feat: implement odoh client
junkurihara Oct 27, 2023
c297fbc
feat: endpoint ip update service with doh resolver itself
junkurihara Oct 27, 2023
135a0e3
chore: add comments
junkurihara Oct 27, 2023
a5f3d79
feat: wip healthcheck service for paths
junkurihara Oct 27, 2023
da3135e
feat: wip healthcheck service. done framework.
junkurihara Oct 30, 2023
1b4af7d
feat: refactor doh_client_main for calling from healthcheck
junkurihara Oct 30, 2023
72e98e5
feat: implement health check service
junkurihara Oct 30, 2023
89dd335
feat: wip implementation plugin reloader
junkurihara Oct 31, 2023
0350fba
feat: implement domain override manipulator
junkurihara Oct 31, 2023
98a4e77
feat: implement domain block manipulator
junkurihara Oct 31, 2023
1aecbbd
feat: implement manipulrators as trait objects, which should be chang…
junkurihara Nov 1, 2023
cf88b85
feat: impl plugins
junkurihara Nov 1, 2023
aa19284
Merge pull request #37 from junkurihara/feat/impl-plugins
junkurihara Nov 1, 2023
5e1727f
chore: deps
junkurihara Nov 2, 2023
dae76aa
feat: update release action
junkurihara Nov 2, 2023
d54c13a
chore: fix bugs in dockerfile
junkurihara Nov 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,30 @@ version: 2
updates:
# Enable version updates for cargo
- package-ecosystem: "cargo"
# Look for `Cargo.toml` and `lock` files in the `root` directory
directory: "/"
# Check the crates.io for updates every day (weekdays)
schedule:
interval: "daily"
- package-ecosystem: "cargo"
directory: "/dap-bin"
schedule:
interval: "daily"
- package-ecosystem: "cargo"
directory: "/dap-lib"
schedule:
interval: "daily"
- package-ecosystem: "cargo"
directory: "/legacy"
schedule:
interval: "daily"

# Enable version updates for Docker
- package-ecosystem: "docker"
# Look for a `Dockerfile` in the `root` directory
directory: "/"
# Check for updates everyday
directory: "/docker"
schedule:
interval: "daily"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates everyday
interval: "daily"
49 changes: 0 additions & 49 deletions .github/workflows/docker_build_push.yml

This file was deleted.

113 changes: 113 additions & 0 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Nightly and release build

on:
push:
branches:
- "develop"
pull_request:
types: [closed]
branches:
- main

env:
GHCR: ghcr.io
GHCR_IMAGE_NAME: ${{ github.repository }}
DH_REGISTRY_NAME: jqtype/doh-auth-proxy

jobs:
docker_build_and_push:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }} || ${{ github.event_name == 'pull_request' && github.event.pull_request.merged == true }}
strategy:
fail-fast: false

steps:
- name: checkout
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.GHCR }}/${{ env.GHCR_IMAGE_NAME }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.GHCR }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Release Build and push x86_64
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'develop' && github.event.pull_request.base.ref == 'main' && github.event.pull_request.merged == true }}
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.GHCR }}/${{ env.GHCR_IMAGE_NAME }}:latest
${{ env.DH_REGISTRY_NAME }}:latest
file: ./docker/Dockerfile
cache-from: type=gha,scope=doh-auth-proxy-latest
cache-to: type=gha,mode=max,scope=doh-auth-proxy-latest
labels: ${{ steps.meta.outputs.labels }}

- name: Nightly build and push x86_64
if: ${{ (github.ref_name == 'develop') && (github.event_name == 'push') }}
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.GHCR }}/${{ env.GHCR_IMAGE_NAME }}:nightly
${{ env.DH_REGISTRY_NAME }}:nightly
file: ./docker/Dockerfile
cache-from: type=gha,scope=doh-auth-proxy-nightly
cache-to: type=gha,mode=max,scope=doh-auth-proxy-nightly
labels: ${{ steps.meta.outputs.labels }}

dispatch_release:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'develop' && github.event.pull_request.base.ref == 'main' && github.event.pull_request.merged == true }}
needs: docker_build_and_push
steps:
- name: check pull_request title
uses: kaisugi/[email protected]
id: regex-match
with:
text: ${{ github.event.pull_request.title }}
regex: "^(\\d+\\.\\d+\\.\\d+)$"

- name: checkout
if: ${{ steps.regex-match.outputs.match != '' }}
uses: actions/checkout@v4

- name: build release binary
if: ${{ steps.regex-match.outputs.match != '' }}
id: "build"
run: |
cargo build --release --package doh-auth-proxy
cp ./target/release/doh-auth-proxy /tmp/doh-auth-proxy
cd /tmp
tar zcvf doh-auth-proxy-x86_64-unknown-linux-gnu.tar.gz doh-auth-proxy

- name: release
if: ${{ steps.regex-match.outputs.match != ''}}
uses: softprops/action-gh-release@v1
with:
files: /tmp/assets/*.tar.gz
name: ${{ github.event.pull_request.title }}
tag_name: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
draft: true
prerelease: false
generate_release_notes: true
15 changes: 7 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
name: Unit test for some mods in doh-auth-proxy
name: Unit tests

on:
push:
branches: [ main, develop ]
branches: [main, develop]
pull_request:
branches: [ main, develop ]
branches: [main, develop]

env:
CARGO_TERM_COLOR: always

jobs:
test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Run unit tests
run: |
cargo test --verbose
- uses: actions/checkout@v4
- name: Run unit tests
run: |
cargo test --verbose
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.vscode
log
plugins
!src/plugins
!**/src/plugins

# Generated by Cargo
# will have compiled files and executables
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@
You should also include the user name that made the change.
-->

## 0.1.6 (unreleased)
## 0.3.0 (Unreleased)

### Improvements

- Totally restructured and reimplemented all components
- Support multiple bootstrap resolvers.
- Periodic health check of all path candidates.
- Periodic nexthop IP address resolution via the proxy itself, bootstrap resolver is only used at the first time and fall-back.
- Periodic fetching of access token with refresh token.
- Hot reloading of configuration files, including block and override files.

## 0.2.0

### Improvements

Expand All @@ -22,6 +33,7 @@ You should also include the user name that made the change.
- Change inner structure of proxy's supplemental services other than UDP/TCP acceptors.

## 0.1.5 (Jun. 6, 2022)

### Improvements

- Update override-list format to use individual lines for representing multiple matching for a name, i.e., (name, IPv4) and (name, IPv6).
Expand Down
83 changes: 4 additions & 79 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,83 +1,8 @@
[package]
name = "doh-auth-proxy"
description = "DNS Proxy for DoH, ODoH and Mutualized ODoH with Authorization"
version = "0.2.0"
authors = ["Jun Kurihara"]
homepage = "https://github.com/junkurihara/doh-auth-proxy"
repository = "https://github.com/junkurihara/doh-auth-proxy"
license = "MIT"
readme = "README.md"
categories = [
"asynchronous",
"network-programming",
"command-line-utilities",
"web-programming::http-client",
]
keywords = [
"dns",
"https",
"dns-over-https",
"doh",
"oblivious-dns-over-https",
"odoh",
"mutualized-odoh",
"proxy",
"authorization",
]
edition = "2021"
[workspace]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
data-encoding = "2.4.0"
clap = { version = "4.4.3", default-features = false, features = [
"std",
"cargo",
"wrap_help",
] }
tokio = { version = "1.32.0", features = [
"net",
"rt-multi-thread",
"time",
"sync",
"macros",
] }
futures = { version = "0.3.28", default-features = false }
reqwest = { version = "0.11.20", default-features = false, features = [
"default",
"trust-dns",
"json",
] }
url = "2.4.1"
trust-dns-proto = { version = "0.23.0", default-features = false }
trust-dns-resolver = { version = "0.23.0", default-features = false, features = [
"tokio-runtime",
] }
anyhow = "1.0.75"
dotenv = "0.15.0"
serde_json = "1.0.107"
jwt-simple = "0.11.6"
p256 = { version = "0.13.2", features = ["jwk", "pem"] }
chrono = "0.4.30"
odoh-rs = { git = "https://github.com/junkurihara/odoh-rs.git" }
rand = "0.8.5"
bytes = "1.5.0"
urlencoding = "2.1.3"
toml = { version = "0.8", default-features = false, features = ["parse"] }
serde = "1.0.188"
hashlink = "0.8.4"
cedarwood = "0.4.6"
regex = "1.9.5"
rustc-hash = "1.1.0"
mimalloc = { version = "*", default-features = false }


# logging
tracing = { version = "0.1.37" }
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }

[dev-dependencies]
trust-dns-client = "0.23.0"
members = ["dap-bin", "dap-lib", "legacy"]
exclude = ["legacy"]
resolver = "2"

[profile.release]
codegen-units = 1
Expand Down
Loading