Skip to content

Commit

Permalink
chore: fix bugs in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
junkurihara committed Nov 2, 2023
1 parent dae76aa commit d54c13a
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 21 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
target/
log/
plugins/
legacy/
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
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ If you run without `--config` option, i.e., simply hit `$ ./doh-auth-proxy`, the

```:toml:config.toml
listen_addresses = ['127.0.0.1:50053', '[::1]:50053']
bootstrap_dns = "1.1.1.1:53"
reboot_period = 3 # mins
bootstrap_dns = ["1.1.1.1"]
endpoint_resolution_period = 60 # mins
healthcheck_period = 10 # mins
max_cache_size = 16384
target_urls = ["https://dns.google/dns-query"]
```
Expand All @@ -77,7 +78,7 @@ where we assume that `config.toml` is configured as follows.

```toml:config.toml
listen_addresses = ['127.0.0.1:50053', '[::1]:50053']
bootstrap_dns = "8.8.8.8:53"
bootstrap_dns = ["8.8.8.8"]

target_urls = ["https://odoh.cloudflare-dns.com/dns-query"]

Expand Down Expand Up @@ -159,10 +160,14 @@ OPTIONS:
listen_addresses = ['127.0.0.1:50053', '[::1]:50053']

## DNS (Do53) resolver address for bootstrap
bootstrap_dns = "8.8.8.8:53"
bootstrap_dns = ['8.8.8.8']

## Minutes to re-resolve the IP addr of the nexthop and authentication endpoint url
## Ip addresses are first resolved by bootstrap DNS, after that, they will be resolved by (MO)DoH resolver itself.
# endpoint_resolution_period = 60

## Minutes to re-fetch the IP addr of the target url host via the bootstrap DNS
reboot_period = 3
## Health check period in minitus. Check health of all path candidates and purge DNS cache.
# healthcheck_period = 10

## Cache entry size (Default 16384)
max_cache_size = 16384
Expand Down Expand Up @@ -240,7 +245,7 @@ odoh_relay_randomization = true

You can run this proxy as a docker container, where the docker image is hosted at [Docker Hub](https://hub.docker.com/r/jqtype/doh-auth-proxy). You can run the docker container by appropriately configure env vers or an env file imported by the container.

See the [`./docker/](./docker) directory and [`./docker/README.md`](./docker/README.md) for the detailed configuration for the docker container.
See the [`./docker`](./docker) directory and [`./docker/README.md`](./docker/README.md) for the detailed configuration for the docker container.

## Authentication at the next hop node (DoH target or ODoH relay)

Expand Down
2 changes: 0 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
<https://datatracker.ietf.org/doc/html/rfc7830>
<https://datatracker.ietf.org/doc/html/rfc8467>
- `crates.io`
- Sophistication of mu-ODNS based on ODoH, such as loop detection
- Docker container packaged with token server (server-side)
- Override with command line options over TOML configuration
- Tweaks for anonymization
- Override user-agent for DoH/ODoH/MODoH by specifying one in `config.toml`
- Refactor
- More sophisticated url building for query. Currently there exist cases of 'loop'.
2 changes: 1 addition & 1 deletion dap-bin/src/config/target_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl TryInto<ProxyConfig> for &TargetConfig {

/////////////////////////////
// endpoint re-resolution period
if let Some(val) = self.config_toml.endoint_resolution_period {
if let Some(val) = self.config_toml.endpoint_resolution_period {
proxy_config.endpoint_resolution_period_sec = Duration::from_secs((val as u64) * 60);
}
info!(
Expand Down
2 changes: 1 addition & 1 deletion dap-bin/src/config/toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::fs;
pub struct ConfigToml {
pub listen_addresses: Option<Vec<String>>,
pub bootstrap_dns: Option<Vec<String>>,
pub endoint_resolution_period: Option<usize>,
pub endpoint_resolution_period: Option<usize>,
pub healthcheck_period: Option<usize>,
pub max_cache_size: Option<usize>,
pub target_urls: Option<Vec<String>>,
Expand Down
3 changes: 1 addition & 2 deletions docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
# TARGET_URLS=https://dns.google/dns-query
TARGET_URLS=https://odoh.cloudflare-dns.com/dns-query
TARGET_RANDOMIZATION=true
BOOTSTRAP_DNS_ADDR=1.1.1.1
BOOTSTRAP_DNS_PORT=53
BOOTSTRAP_DNS=1.1.1.1

## ODoH
## If specified, ODoH is enabled.
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -qy --no-install-recommends $BUILD_DEPS &&
curl -sSf https://sh.rustup.rs | bash -s -- -y --default-toolchain stable && \
export PATH="$HOME/.cargo/bin:$PATH" && \
echo "Building DoH Auth Proxy from source" && \
cargo build --release --no-default-features && \
cargo build --release --no-default-features --package doh-auth-proxy && \
mkdir -p /opt/doh-auth-proxy/sbin && \
strip --strip-all /tmp/target/release/doh-auth-proxy

Expand Down
7 changes: 3 additions & 4 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
CONFIG_FILE=/modoh/doh-auth-proxy.toml
DEFAULT_LOG_LEVEL="info"
DEFAULT_TARGET_URLS="https://dns.google/dns-query"
DEFAULT_BOOTSTRAP_DNS_ADDR="8.8.8.8"
DEFAULT_BOOTSTRAP_DNS_PORT="53"
DEFAULT_BOOTSTRAP_DNS="8.8.8.8"

# bootstrap DNS
echo "Bootstrap DNS: ${BOOTSTRAP_DNS_ADDR:-${DEFAULT_BOOTSTRAP_DNS_ADDR}}:${BOOTSTRAP_DNS_PORT:-${DEFAULT_BOOTSTRAP_DNS_PORT}}"
echo "Bootstrap DNS: ${BOOTSTRAP_DNS:-${DEFAULT_BOOTSTRAP_DNS}}"

##########################
# authentication and authorization
Expand Down Expand Up @@ -89,7 +88,7 @@ fi
# export as a config toml file
cat > ${CONFIG_FILE} << EOF
listen_addresses = ["0.0.0.0:53"]
bootstrap_dns = "${BOOTSTRAP_DNS_ADDR:-${DEFAULT_BOOTSTRAP_DNS_ADDR}}:${BOOTSTRAP_DNS_PORT:-${DEFAULT_BOOTSTRAP_DNS_PORT}}"
bootstrap_dns = ["${BOOTSTRAP_DNS:-${DEFAULT_BOOTSTRAP_DNS}}"]
${TARGET_URL_STRING}
${TARGET_RAND_STRING}
Expand Down
2 changes: 1 addition & 1 deletion doh-auth-proxy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ bootstrap_dns = ["8.8.8.8", "1.1.1.1"]
## Minutes to re-resolve the IP addr of the nexthop and authentication endpoint url
## Ip addresses are first resolved by bootstrap DNS, after that, they will be resolved by (MO)DoH resolver itself.
## default is 60 minutes
# endoint_resolution_period = 60
# endpoint_resolution_period = 60

## Health check period in minitus. Check health of all path candidates and purge DNS cache.
## Default is 10 minutes.
Expand Down

0 comments on commit d54c13a

Please sign in to comment.