- Add Hook interface (filter + execute contract) in server/hooks/hook.h
- Add HookRunner in server/hooks/hook_runner.h: spawns a detached thread
per matching hook, with try/catch protection against crashes
- Add DnsUpdaterHook in server/hooks/dns_updater_hook.{h,cpp}:
triggers on server name changes, logs in to Technitium, deletes the
old A record (ignores 404), and adds the new A record
Config via env vars: TECHNITIUM_HOST/PORT/USER/PASS/ZONE, DNS_TTL
- Add Database::get_nics_for_server() to resolve a server's IPv4 address
- Wire HookRunner into InventoryServer; cmd_edit_server now fires hooks
with before/after Server snapshots
- Update CMakeLists.txt to include dns_updater_hook.cpp
- Document env vars in Dockerfile
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
11 lines
288 B
Docker
11 lines
288 B
Docker
FROM golang:1.22-alpine AS builder
|
|
WORKDIR /src
|
|
COPY main.go .
|
|
RUN go mod init inventory-web-ui && \
|
|
go build -o inventory-web-ui .
|
|
|
|
FROM alpine:3.19
|
|
RUN apk add --no-cache ca-certificates
|
|
COPY --from=builder /src/inventory-web-ui /usr/local/bin/
|
|
EXPOSE 8080
|
|
CMD ["inventory-web-ui"]
|