Files
internet_use_control/Makefile
Sam Rolfe 7c88d3f52b Phase 2: device registry, dashboard cards, manual lock/unlock, audit
- Device registry: add/edit name, child and platform, persisted in devices.
- Stable per-device topic derived from name + id, unchanged by renames.
- Desired state persisted in state; timed locks expire and are audited.
- Dashboard cards: name, child, platform, status dot, state and time left.
- Manual lock/unlock forms with CSRF; every change appends to audit (FR-15).
- Append-only activity list on the dashboard. No hard deletes (rule 10).
- Store and handler tests; version bumped to 0.2.0-phase2.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-13 14:18:02 +11:00

50 lines
1.4 KiB
Makefile

IMAGE ?= webrestrict/control:0.2.0-phase2
BUILD_VERSION ?= 0.2.0-phase2
.PHONY: help test vet build up down restart logs ps hash-password fmt
help:
@echo "make test run go test ./... in golang:1.25-alpine"
@echo "make vet run go vet ./... in golang:1.25-alpine"
@echo "make build build the container image ($(IMAGE))"
@echo "make up docker compose up -d --build"
@echo "make down docker compose down"
@echo "make logs follow container logs"
@echo "make hash-password generate a bcrypt hash (PASSWORD=...)"
test:
docker run --rm --network host \
-v "$$PWD":/src -w /src \
-v webrestrict-go-mod:/go/pkg/mod \
-v webrestrict-go-build:/root/.cache/go-build \
golang:1.25-alpine sh -c 'go test ./...'
vet:
docker run --rm --network host \
-v "$$PWD":/src -w /src \
-v webrestrict-go-mod:/go/pkg/mod \
-v webrestrict-go-build:/root/.cache/go-build \
golang:1.25-alpine sh -c 'go vet ./...'
build:
docker build --build-arg VERSION=$(BUILD_VERSION) -t $(IMAGE) .
up:
docker compose up -d --build
down:
docker compose down
restart:
docker compose restart control
logs:
docker compose logs -f control
ps:
docker compose ps
hash-password:
@test -n "$(PASSWORD)" || (echo "usage: make hash-password PASSWORD=secret"; exit 2)
docker run --rm --entrypoint /app/control $(IMAGE) hash-password '$(PASSWORD)'