- web/ts/login.ts: small vanilla TS module toggling the password input's type between 'password'/'text' via a 'Show/Hide' button, so users can rule out typos before submitting. Compiled to web/static/login.js (ES module) via tsc (web/tsconfig.json, new 'make web-ts'/'web-assets' Makefile targets) and loaded via <script type="module">. Compiled JS is committed/embedded the same way as the compiled CSS — no Node.js needed at runtime. - Verified end-to-end against the live proxied server (https://local.unqr.dev/web/login): POST /web/login correctly returns 303 + Set-Cookie, and the session then authorizes GET /web/ — the server-side login flow is confirmed working correctly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
62 lines
1.6 KiB
Makefile
62 lines
1.6 KiB
Makefile
.PHONY: build run test tidy lint docker hash-password nidusctl web-deps web-css web-ts web-assets templ-generate
|
|
|
|
## build: compile the binary
|
|
build:
|
|
go build -o bin/davserver ./cmd/server
|
|
go build -o bin/nidusctl ./tools/nidusctl
|
|
|
|
## run: run the server locally
|
|
run: build
|
|
./bin/davserver -config config.yaml
|
|
|
|
## test: run all tests
|
|
test:
|
|
go test ./... -v -race
|
|
|
|
## tidy: tidy go modules
|
|
tidy:
|
|
go mod tidy
|
|
|
|
## lint: run golangci-lint
|
|
lint:
|
|
golangci-lint run ./...
|
|
|
|
## docker: build Docker image
|
|
docker:
|
|
docker build -t davserver:latest .
|
|
|
|
## compose: start with Docker Compose
|
|
compose:
|
|
docker compose up --build
|
|
|
|
## hash-password: generate bcrypt hash for a password
|
|
## Usage: make hash-password PWD=mysecret
|
|
hash-password:
|
|
@go run -v ./tools/hashpwd $(PWD)
|
|
|
|
## nidusctl: build and run the sharing-grant admin CLI
|
|
## Usage: make nidusctl ARGS="calendar share alice work bob write"
|
|
nidusctl: build
|
|
./bin/nidusctl -config config.yaml $(ARGS)
|
|
|
|
## templ-generate: regenerate *_templ.go files from internal/web/templates/*.templ
|
|
templ-generate:
|
|
templ generate
|
|
|
|
## web-deps: install the Tailwind CLI + TypeScript compiler (needed once, or after web/package.json changes)
|
|
web-deps:
|
|
cd web && npm install
|
|
|
|
## web-css: rebuild the compiled/embedded Tailwind CSS (web/static/app.css)
|
|
## Run this after editing any .templ file or web/input.css.
|
|
web-css: templ-generate
|
|
cd web && npx @tailwindcss/cli -i ./input.css -o ./static/app.css --minify
|
|
|
|
## web-ts: compile web/ts/*.ts to web/static/*.js
|
|
## Run this after editing any .ts file.
|
|
web-ts:
|
|
cd web && npx tsc -p tsconfig.json
|
|
|
|
## web-assets: rebuild everything under web/static/ (CSS + JS)
|
|
web-assets: web-css web-ts
|