feat: web-console — HTML UI + source viewer + trigger toggle

- operator: GET /v1/namespaces/{ns}/functions/{name}/source
  reads build context tar.gz from S3, strips Dockerfile, returns JSON files
- funcs-service v0.2.0:
  - Accept: text/html → dark-themed HTML console with accordion cards
  - GET /funcs/{ns}/source/{fn} → proxy to operator (service token auth)
  - PATCH /funcs/{ns}/triggers/{name} → proxy enable/disable (only enabled field)
  - curl (no text/html Accept) → plain text as before (backward compat)
- highlight.js syntax highlighting per file extension
- operator v0.1.34, funcs-service v0.2.0
This commit is contained in:
Naeel
2026-03-18 17:24:43 +03:00
parent a3528ff4fe
commit bf9f07385e
5 changed files with 954 additions and 142 deletions
+2 -3
View File
@@ -1,11 +1,10 @@
# 2026-03-18
# 2026-04-25 (добавлен index.html — встраивается через go:embed)
# Dockerfile для sless-funcs-service.
# Многоэтапная сборка: Go → alpine (минимальный образ).
# Сервис не нуждается во внешних зависимостях — только stdlib.
FROM golang:1.23-alpine AS builder
WORKDIR /build
COPY go.mod main.go ./
COPY go.mod main.go index.html ./
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o funcs-service .
FROM alpine:3.20