Skip to content

Commit

Permalink
feat: support amnezia clients
Browse files Browse the repository at this point in the history
  • Loading branch information
Arian8j2 committed Sep 6, 2024
1 parent 61073d3 commit c7d60e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ WORKDIR /app
COPY . .
RUN cargo build --release --target x86_64-unknown-linux-musl

# amnezia
FROM ghcr.io/arian8j2/wireguard:amnezia as amnezia

# runner
FROM alpine:3.19.2
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/uptime-reporter /bin/uptime-reporter
COPY --from=amnezia /bin/wg-quick /bin/wg /bin/wireguard-go /bin

RUN apk add --no-cache curl iputils-ping wireguard-tools
RUN apk add --no-cache curl iputils-ping bash

VOLUME /app
WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion src/wireguard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub async fn create_interface(name: &str) -> anyhow::Result<()> {
.await
.with_context(|| format!("couldn't read config file at {config_file_path}"))?;

utils::run_command("ip", &["link", "add", name, "type", "wireguard"]).await?;
utils::run_command("wireguard-go", &[name]).await?;

// stripped version of common config is needed because `wg setconf` doesn't accept many usual
// attributes like `MTU`, `DNS`, `Address` and ...
Expand Down

0 comments on commit c7d60e1

Please sign in to comment.