Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9235661
chore: initialize Go module and build configuration
bgruszka Dec 31, 2025
ab4efe6
feat: add HeaderPropagationPolicy CRD definitions
bgruszka Dec 31, 2025
97ce5da
feat: implement operator with sidecar injection webhook
bgruszka Dec 31, 2025
3e43284
feat: implement HTTP proxy for header propagation
bgruszka Dec 31, 2025
98d8392
feat: add Kubernetes manifests for operator deployment
bgruszka Dec 31, 2025
556be23
build: add Docker configuration for operator and proxy
bgruszka Dec 31, 2025
c295b4d
feat: add Helm chart for ContextForge installation
bgruszka Dec 31, 2025
b8302d1
test: add e2e tests for header propagation
bgruszka Dec 31, 2025
c5b620f
ci: add GitHub Actions workflows
bgruszka Dec 31, 2025
08535a2
docs: add documentation and website
bgruszka Dec 31, 2025
65f1f30
chore: add development environment configuration
bgruszka Dec 31, 2025
5cd5964
ci: remove duplicate workflow files
bgruszka Dec 31, 2025
dafd7a9
ci: update golangci-lint action to v6 for v2 config support
bgruszka Dec 31, 2025
f1af05e
ci: update golangci-lint action to v7 for v2 support
bgruszka Dec 31, 2025
7c25e04
fix: resolve golangci-lint issues
bgruszka Dec 31, 2025
1498e0c
fix: update webhook tests for injectSidecar signature change
bgruszka Dec 31, 2025
ab4ce1b
fix: add required propagationRules to controller test
bgruszka Dec 31, 2025
c07b8fa
ci: use make test to setup envtest binaries
bgruszka Dec 31, 2025
6cd8566
fix: Add cert-manager Certificate template and fix E2E workflow
bgruszka Dec 31, 2025
1cac392
fix: Add --create-namespace flag to Helm install in E2E workflow
bgruszka Dec 31, 2025
2a9a199
fix: Disable chart namespace creation to avoid conflict with --create…
bgruszka Dec 31, 2025
2113204
fix: Remove unsupported --webhook-port flag from operator deployment
bgruszka Dec 31, 2025
94cd22f
fix: Remove objectSelector from webhook to allow annotation-based inj…
bgruszka Dec 31, 2025
84e4f73
feat: Add Prometheus metrics package (#10)
bgruszka Dec 31, 2025
3237837
feat: Add rate limiting middleware (#24)
bgruszka Dec 31, 2025
8477868
feat: Implement controller reconcile loop (#17)
bgruszka Dec 31, 2025
493fef5
fix: Update Alpine base image to 3.21 (#23)
bgruszka Dec 31, 2025
9979e62
fix: Improve webhook security and resource allocation (#18, #19, #20,…
bgruszka Dec 31, 2025
0a606dd
ci: Add Trivy vulnerability scanning (#12)
bgruszka Dec 31, 2025
3e5ef37
feat: Add PodDisruptionBudget and improve Helm values (#11, #18, #22,…
bgruszka Dec 31, 2025
0d8ff42
feat: Add configurable timeouts and integrate rate limiting (#16, #24…
bgruszka Dec 31, 2025
2acc203
refactor: Improve error handling and add metrics recording (#21, #10)
bgruszka Dec 31, 2025
dece371
docs: Add comprehensive documentation and upgrade guide (#13, #14)
bgruszka Dec 31, 2025
3f46232
fix: Address golangci-lint issues
bgruszka Dec 31, 2025
1262170
chore: Add Pod RBAC permissions for controller (#17)
bgruszka Dec 31, 2025
c21fdfa
fix: Correct API group in RBAC template
bgruszka Dec 31, 2025
1f7670c
fix: Address critical code review findings (#3, #16, #22, #26)
bgruszka Jan 1, 2026
42ea966
feat: Add header generation, path/method filtering, and documentation
bgruszka Jan 1, 2026
4118a1d
feat: Add ctxforge.io/header-rules annotation support in webhook
bgruszka Jan 1, 2026
68fab3c
docs: Add ctxforge.io/header-rules annotation documentation
bgruszka Jan 1, 2026
12db349
fix: Route e2e test services through proxy port (9090)
bgruszka Jan 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "Kubebuilder DevContainer",
"image": "golang:1.24",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git:1": {}
},

"runArgs": ["--network=host"],

"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"ms-kubernetes-tools.vscode-kubernetes-tools",
"ms-azuretools.vscode-docker"
]
}
},

"onCreateCommand": "bash .devcontainer/post-install.sh"
}

23 changes: 23 additions & 0 deletions .devcontainer/post-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -x

curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-$(go env GOARCH)
chmod +x ./kind
mv ./kind /usr/local/bin/kind

curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/linux/$(go env GOARCH)
chmod +x kubebuilder
mv kubebuilder /usr/local/bin/

KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
curl -LO "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/$(go env GOARCH)/kubectl"
chmod +x kubectl
mv kubectl /usr/local/bin/kubectl

docker network create -d=bridge --subnet=172.19.0.0/24 kind

kind version
kubebuilder version
docker --version
go version
kubectl version --client
44 changes: 44 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
# Ignore everything by default and re-include only needed files
**

# Re-include Go source files (but not *_test.go)
!**/*.go
**/*_test.go

# Re-include Go module files
!go.mod
!go.sum

# Explicitly exclude (even if matched above)
.git/
.github/
.devcontainer/
.vscode/
.idea/

# Build artifacts
bin/
proxy
kubebuilder

# Kubernetes configs (not needed for binary build)
config/
deploy/

# Documentation
website/
*.md
LICENSE

# Tests
tests/
test/

# Misc
*.backup
.env
.DS_Store
Makefile*
*.yaml
*.yml
41 changes: 41 additions & 0 deletions .github/cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# git-cliff configuration for changelog generation

[changelog]
header = """
# Changelog\n
"""
body = """
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {{ commit.message | upper_first }} ({{ commit.id | truncate(length=7, end="") }})\
{% endfor %}
{% endfor %}\n
"""
footer = ""
trim = true

[git]
conventional_commits = true
filter_unconventional = true
split_commits = false
commit_parsers = [
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^doc", group = "Documentation" },
{ message = "^perf", group = "Performance" },
{ message = "^refactor", group = "Refactoring" },
{ message = "^style", group = "Style" },
{ message = "^test", group = "Testing" },
{ message = "^chore\\(release\\)", skip = true },
{ message = "^chore\\(deps\\)", skip = true },
{ message = "^chore", group = "Miscellaneous" },
{ message = "^ci", group = "CI/CD" },
]
protect_breaking_commits = false
filter_commits = false
tag_pattern = "v[0-9].*"
skip_tags = ""
ignore_tags = ""
topo_order = false
sort_commits = "oldest"
161 changes: 161 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: CI

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

env:
GO_VERSION: '1.24'

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: golangci-lint
uses: golangci/golangci-lint-action@v7
with:
version: v2.5.0

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Run tests
run: make test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./cover.out
fail_ci_if_error: false

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Build proxy
run: go build -v ./cmd/proxy

- name: Build manager
run: go build -v ./cmd/main.go

docker:
name: Docker Build
runs-on: ubuntu-latest
needs: [lint, test, build]
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build proxy image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.proxy
push: false
tags: contextforge-proxy:test
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build operator image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.operator
push: false
tags: contextforge-operator:test
cache-from: type=gha
cache-to: type=gha,mode=max

helm:
name: Helm Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.13.0

- name: Lint chart
run: helm lint deploy/helm/contextforge

security:
name: Security Scan
runs-on: ubuntu-latest
needs: [docker]
steps:
- uses: actions/checkout@v4

- name: Run Trivy vulnerability scanner (filesystem)
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
severity: 'CRITICAL,HIGH'
exit-code: '1'
ignore-unfixed: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build proxy image for scanning
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.proxy
push: false
load: true
tags: contextforge-proxy:scan

- name: Run Trivy vulnerability scanner (proxy image)
uses: aquasecurity/trivy-action@master
with:
image-ref: 'contextforge-proxy:scan'
severity: 'CRITICAL,HIGH'
exit-code: '1'
ignore-unfixed: true

- name: Build operator image for scanning
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.operator
push: false
load: true
tags: contextforge-operator:scan

- name: Run Trivy vulnerability scanner (operator image)
uses: aquasecurity/trivy-action@master
with:
image-ref: 'contextforge-operator:scan'
severity: 'CRITICAL,HIGH'
exit-code: '1'
ignore-unfixed: true
74 changes: 74 additions & 0 deletions .github/workflows/deploy-website.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Deploy Website

on:
push:
branches: [main, master]
paths:
- 'website/**'
- '.github/workflows/deploy-website.yaml'
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
extended: true

- name: Build website
working-directory: website
run: |
hugo mod get -u
hugo --minify --baseURL "https://ctxforge.io/"

- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages-existing
continue-on-error: true

- name: Preserve Helm chart files
run: |
# Copy Helm chart repository files to Hugo output if they exist
if [ -d "gh-pages-existing" ]; then
# Copy index.yaml (Helm repo index)
cp gh-pages-existing/index.yaml website/public/ 2>/dev/null || true
# Copy chart tarballs
cp gh-pages-existing/*.tgz website/public/ 2>/dev/null || true
echo "Preserved existing Helm chart files"
else
echo "No existing gh-pages branch found, skipping preservation"
fi

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/public
cname: ctxforge.io
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Deploy website'
Loading