docs: standardize health endpoint; document admin ACL and routes; add staticcheck guidance and target

This commit is contained in:
Benjamin
2025-09-26 22:51:13 +02:00
parent 5e41f14f94
commit 06fb2d5b89
4 changed files with 35 additions and 7 deletions
+5 -1
View File
@@ -83,7 +83,11 @@ vet: ## Run go vet
@echo "Running go vet..."
go vet ./...
lint: fmt vet ## Run all linting tools
lint: fmt vet ## Run basic linting tools
lint-extra: ## Run staticcheck if available (installs if missing)
@command -v staticcheck >/dev/null 2>&1 || { echo "Installing staticcheck..."; go install honnef.co/go/tools/cmd/staticcheck@latest; }
staticcheck ./...
# Development targets
clean: ## Clean build artifacts and test coverage
+16 -2
View File
@@ -99,7 +99,7 @@ cp .env.example .env
docker compose up -d
# Test
curl http://localhost:8080/healthz
curl http://localhost:8080/health # alias: /healthz
```
### Required variables
@@ -302,7 +302,17 @@ ACKIFY_DB_DSN="postgres://user:pass@postgres:5432/ackdb?sslmode=require"
- `GET /embed?doc=<id>` - HTML widget
### Monitoring
- `GET /healthz` - Health check
- `GET /health` - Health check (alias: `/healthz`)
### Admin
- `GET /admin` - Dashboard (restricted)
- `GET /admin/docs/{docID}` - Signatures for a document
- `GET /admin/api/chain-integrity/{docID}` - Chain integrity JSON
Access control: set `ACKIFY_ADMIN_EMAILS` with a comma-separated list of admin emails (exact match, case-insensitive). Example:
```bash
ACKIFY_ADMIN_EMAILS="alice@company.com,bob@company.com"
```
---
@@ -331,6 +341,10 @@ docker build -t ackify-ce:dev .
# Run with local database
docker run -p 8080:8080 --env-file .env ackify-ce:dev
# Optional: static analysis
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck ./...
```
---
+12 -2
View File
@@ -107,7 +107,7 @@ export ACKIFY_ED25519_PRIVATE_KEY=$(openssl rand 64 | base64 -w 0)
docker compose up -d
# Test
curl http://localhost:8080/healthz
curl http://localhost:8080/health # alias: /healthz
```
### Variables obligatoires
@@ -310,7 +310,17 @@ ACKIFY_DB_DSN="postgres://user:pass@postgres:5432/ackdb?sslmode=require"
- `GET /embed?doc=<id>` - Widget HTML
### Supervision
- `GET /healthz` - Health check
- `GET /health` - Health check (alias: `/healthz`)
### Administration
- `GET /admin` - Tableau de bord (restreint)
- `GET /admin/docs/{docID}` - Signataires dun document
- `GET /admin/api/chain-integrity/{docID}` - Intégrité de chaîne (JSON)
Contrôle daccès: définir `ACKIFY_ADMIN_EMAILS` avec des emails admins, séparés par des virgules (correspondance exacte, insensible à la casse). Exemple:
```bash
ACKIFY_ADMIN_EMAILS="alice@entreprise.com,bob@entreprise.com"
```
---
+2 -2
View File
@@ -56,6 +56,6 @@ echo "2. Start Ackify:"
echo " docker compose up -d"
echo ""
echo "3. Check health:"
echo " curl http://localhost:8080/healthz"
echo " curl http://localhost:8080/health # alias: /healthz"
echo ""
echo "📁 Installation directory: $(pwd)"
echo "📁 Installation directory: $(pwd)"