[WIP] A simple wake-on-lan service

docker image changes + build and push image on commit + 89 yolos (did nothing)

this took me. So Long. AAAAAAAAAAAAAA
on push to main use `kaniko` to build and push
- atcr.io/vielle.dev/wol:latest
- atcr.io/vielle.dev/wol:$TANGLED_REF_NAME

vielle.dev 5ed422b0 8f64f5e8

verified
+116 -6
+1
.dockerignore
··· 1 + .gitignore
+2 -1
.gitignore
··· 1 1 /target 2 2 /web/dist 3 - /wol.toml 3 + /.wol.toml 4 4 /favicon.* 5 + !/favicon.ico 5 6 6 7 # Logs 7 8 /web/logs
+32
.tangled/workflows/atcr.io.yml
··· 1 + when: 2 + - event: ["push"] 3 + branch: ["main"] 4 + 5 + engine: nixery 6 + 7 + dependencies: 8 + nixpkgs: ["kaniko"] 9 + 10 + environment: 11 + DOCKER_CONFIG: "/kaniko/.docker" 12 + IMAGE_NAME: atcr.io/vielle.dev/wol 13 + 14 + steps: 15 + - name: Kaniko auth 16 + command: | 17 + mkdir -p /kaniko/.docker/ 18 + echo "{ 19 + \"auths\": { 20 + \"https://atcr.io/v1\":{ 21 + \"auth\": \"$ATCR_CREDENTIALS\" 22 + } 23 + } 24 + }" > /kaniko/.docker/config.json 25 + 26 + - name: Build image 27 + command: | 28 + executor \ 29 + --context=$(pwd) \ 30 + --dockerfile=$(pwd)/Dockerfile \ 31 + --destination="$IMAGE_NAME:latest" \ 32 + --destination="$IMAGE_NAME:$TANGLED_REF_NAME"
+34 -4
Dockerfile
··· 1 - FROM rust:1.93.1-alpine3.22 1 + ARG NODE_IMAGE=node:25.8-alpine3.22 2 + ARG RUST_IMAGE=rust:1.93.1-alpine3.22 3 + ARG ALPINE_IMAGE=alpine:3.22 4 + ARG PNPM_VERSION=^10.32.1 5 + 6 + # files bc kaniko is fucky 7 + FROM scratch AS files 8 + WORKDIR /ctx/ 9 + COPY ./ /ctx/ 10 + 11 + # front end 12 + FROM ${NODE_IMAGE} AS web 13 + 14 + RUN npm install -g pnpm@${PNPM_VERSION} 15 + WORKDIR /web 16 + COPY --from=files /ctx/web /web 17 + RUN pnpm install 18 + RUN pnpm run build 19 + 20 + # binary 21 + FROM ${RUST_IMAGE} AS build 2 22 3 23 WORKDIR /app 4 - COPY . . 24 + COPY --from=files /ctx/ /app 25 + COPY --from=web /web/dist /app/web/dist 26 + RUN cargo build --release 27 + 28 + # release container 29 + FROM scratch as release 30 + LABEL org.opencontainers.image.source=https://tangled.org/vielle.dev/wol 31 + 32 + WORKDIR /app 33 + COPY --from=files /ctx/favicon.ico /app 34 + COPY --from=files /ctx/wol.toml /app 35 + COPY --from=build /app/target/release/wol /app 5 36 6 - RUN cargo install --path . 7 - CMD ["wol"] 37 + CMD ["/app/target/release/wol"]
+1 -1
README.md
··· 51 51 # compose.yaml 52 52 services: 53 53 wol: 54 - build: https://tangled.org/vielle.dev/wol.git 54 + build: atcr.io/vielle.dev/wol:latest 55 55 ports: ["3000:3000"] 56 56 volumes: 57 57 - "./wol.toml:/app/wol.toml"
+3
build.rs
··· 237 237 238 238 // dont build the web project if the env var PROXY is set 239 239 // if PROXY is set it builds a reverse proxy instead 240 + // also dont build for release builds 241 + // in release builds we expect ./web/dist to be prebuilt 242 + #[cfg(debug_assertions)] 240 243 if std::env::var("PROXY").is_err() { 241 244 build()?; 242 245 }
favicon.ico

This is a binary file and will not be displayed.

+3
push.sh
··· 1 + docker login atcr.io 2 + docker build -t atcr.io/vielle.dev/wol:latest . 3 + docker push atcr.io/vielle.dev/wol:latest
+40
wol.toml
··· 1 + # default config: 2 + binding = "0.0.0.0:3000" 3 + # target names to pin to the top of the list, others may be out of order 4 + pinned = [] 5 + 6 + [targets] 7 + # name = mac 8 + 9 + # OR 10 + # name.mac = mac # required, for wol 11 + # name.url = url # optional, for display 12 + # name.ip = ip # optional, for ping 13 + 14 + [info] 15 + title = "Wake on Lan" 16 + icon = "./favicon.ico" 17 + 18 + # info.links can also be [name, url][] if you need duplicate names 19 + [info.links] 20 + "vielle.dev/wol" = "https://tangled.org/vielle.dev/wol/" 21 + 22 + [theme] # catppuccin frappe 23 + background = [48, 52, 70] 24 + background_main = [35, 38, 52] 25 + background_server = [65, 69, 89] 26 + background_button = [81, 87, 109] 27 + 28 + text = [198, 208, 245] 29 + text_secondary = [165, 173, 206] 30 + 31 + accent_success = [166, 209, 137] 32 + accent_fail = [231, 130, 132] 33 + 34 + link = [140, 170, 238] 35 + link_visited = [202, 158, 230] 36 + 37 + highlight = [148, 156, 187] 38 + highlight_opacity = 25 # out of 100 39 + 40 + fonts = ["system-ui"]