Compare commits

..

3 Commits

Author SHA1 Message Date
GitHub Actions
4331c798d9 fix: clean up .gitignore by removing VS Code settings while preserving shared configs 2025-12-14 00:20:27 +00:00
GitHub Actions
c55932c41a fix: simplify Renovate workflow to use GITHUB_TOKEN directly 2025-12-14 00:19:16 +00:00
GitHub Actions
eb16452d8b chore: track VS Code tasks.json and launch.json in git 2025-12-14 00:16:47 +00:00
4 changed files with 277 additions and 22 deletions

View File

@@ -2,7 +2,7 @@ name: Renovate
on:
schedule:
- cron: '0 5 * * *' # daily 05:00 EST
- cron: '0 5 * * *' # daily 05:00 UTC
workflow_dispatch:
permissions:
@@ -18,28 +18,11 @@ jobs:
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
with:
fetch-depth: 1
- name: Choose Renovate Token
run: |
# Prefer explicit tokens (GITHUB_TOKEN > CPMP_TOKEN) if provided; otherwise use the default GITHUB_TOKEN
if [ -n "${{ secrets.GITHUB_TOKEN }}" ]; then
echo "Using GITHUB_TOKEN" >&2
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
else
echo "Using default GITHUB_TOKEN from Actions" >&2
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
fi
- name: Fail-fast if token not set
run: |
if [ -z "${{ env.GITHUB_TOKEN }}" ]; then
echo "ERROR: No Renovate token provided. Set GITHUB_TOKEN, CPMP_TOKEN, or rely on default GITHUB_TOKEN." >&2
exit 1
fi
- name: Run Renovate
uses: renovatebot/github-action@502904f1cefdd70cba026cb1cbd8c53a1443e91b # v44.1.0
with:
configurationFile: .github/renovate.json
token: ${{ env.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
env:
LOG_LEVEL: info

4
.gitignore vendored
View File

@@ -81,9 +81,7 @@ charon.db
*~
.DS_Store
*.xcf
.vscode/
.vscode/launch.json
.vscode.backup*/
# -----------------------------------------------------------------------------
# Logs & Temp Files

22
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,22 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Backend (Docker)",
"type": "go",
"request": "attach",
"mode": "remote",
"substitutePath": [
{
"from": "${workspaceFolder}",
"to": "/app"
}
],
"port": 2345,
"host": "127.0.0.1",
"showLog": true,
"trace": "log",
"logOutput": "rpc"
}
]
}

252
.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,252 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build: Local Docker Image",
"type": "shell",
"command": "docker build -t charon:local .",
"group": "build",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Build: Backend",
"type": "shell",
"command": "cd backend && go build ./...",
"group": "build",
"problemMatcher": ["$go"]
},
{
"label": "Build: Frontend",
"type": "shell",
"command": "cd frontend && npm run build",
"group": "build",
"problemMatcher": []
},
{
"label": "Build: All",
"type": "shell",
"dependsOn": ["Build: Backend", "Build: Frontend"],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "Test: Backend Unit Tests",
"type": "shell",
"command": "cd backend && go test ./...",
"group": "test",
"problemMatcher": ["$go"]
},
{
"label": "Test: Backend with Coverage",
"type": "shell",
"command": "scripts/go-test-coverage.sh",
"group": "test",
"problemMatcher": []
},
{
"label": "Test: Frontend",
"type": "shell",
"command": "cd frontend && npm run test",
"group": "test",
"problemMatcher": []
},
{
"label": "Test: Frontend with Coverage",
"type": "shell",
"command": "scripts/frontend-test-coverage.sh",
"group": "test",
"problemMatcher": []
},
{
"label": "Lint: Pre-commit (All Files)",
"type": "shell",
"command": "source .venv/bin/activate && pre-commit run --all-files",
"group": "test",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "shared"
}
},
{
"label": "Lint: Go Vet",
"type": "shell",
"command": "cd backend && go vet ./...",
"group": "test",
"problemMatcher": ["$go"]
},
{
"label": "Lint: GolangCI-Lint (Docker)",
"type": "shell",
"command": "cd backend && docker run --rm -v $(pwd):/app:ro -w /app golangci/golangci-lint:latest golangci-lint run -v",
"group": "test",
"problemMatcher": []
},
{
"label": "Lint: Frontend",
"type": "shell",
"command": "cd frontend && npm run lint",
"group": "test",
"problemMatcher": []
},
{
"label": "Lint: Frontend (Fix)",
"type": "shell",
"command": "cd frontend && npm run lint -- --fix",
"group": "test",
"problemMatcher": []
},
{
"label": "Lint: TypeScript Check",
"type": "shell",
"command": "cd frontend && npm run type-check",
"group": "test",
"problemMatcher": []
},
{
"label": "Lint: Markdownlint",
"type": "shell",
"command": "npx markdownlint '**/*.md' --ignore node_modules --ignore .venv --ignore test-results --ignore codeql-db --ignore codeql-agent-results",
"group": "test",
"problemMatcher": []
},
{
"label": "Lint: Markdownlint (Fix)",
"type": "shell",
"command": "npx markdownlint '**/*.md' --fix --ignore node_modules --ignore .venv --ignore test-results --ignore codeql-db --ignore codeql-agent-results",
"group": "test",
"problemMatcher": []
},
{
"label": "Lint: Hadolint Dockerfile",
"type": "shell",
"command": "docker run --rm -i hadolint/hadolint < Dockerfile",
"group": "test",
"problemMatcher": []
},
{
"label": "Security: Trivy Scan",
"type": "shell",
"command": "docker run --rm -v $(pwd):/app aquasec/trivy:latest fs --scanners vuln,secret,misconfig /app",
"group": "test",
"problemMatcher": []
},
{
"label": "Security: Go Vulnerability Check",
"type": "shell",
"command": "cd backend && go run golang.org/x/vuln/cmd/govulncheck@latest ./...",
"group": "test",
"problemMatcher": []
},
{
"label": "Docker: Start Dev Environment",
"type": "shell",
"command": "docker compose -f docker-compose.dev.yml up -d",
"group": "none",
"problemMatcher": []
},
{
"label": "Docker: Stop Dev Environment",
"type": "shell",
"command": "docker compose -f docker-compose.dev.yml down",
"group": "none",
"problemMatcher": []
},
{
"label": "Docker: Start Local Environment",
"type": "shell",
"command": "docker compose -f docker-compose.local.yml up -d",
"group": "none",
"problemMatcher": []
},
{
"label": "Docker: Stop Local Environment",
"type": "shell",
"command": "docker compose -f docker-compose.local.yml down",
"group": "none",
"problemMatcher": []
},
{
"label": "Docker: View Logs",
"type": "shell",
"command": "docker compose logs -f",
"group": "none",
"problemMatcher": [],
"isBackground": true
},
{
"label": "Docker: Prune Unused Resources",
"type": "shell",
"command": "docker system prune -f",
"group": "none",
"problemMatcher": []
},
{
"label": "Integration: Run All",
"type": "shell",
"command": "scripts/integration-test.sh",
"group": "test",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Integration: Coraza WAF",
"type": "shell",
"command": "scripts/coraza_integration.sh",
"group": "test",
"problemMatcher": []
},
{
"label": "Integration: CrowdSec",
"type": "shell",
"command": "scripts/crowdsec_integration.sh",
"group": "test",
"problemMatcher": []
},
{
"label": "Integration: CrowdSec Decisions",
"type": "shell",
"command": "scripts/crowdsec_decision_integration.sh",
"group": "test",
"problemMatcher": []
},
{
"label": "Integration: CrowdSec Startup",
"type": "shell",
"command": "scripts/crowdsec_startup_test.sh",
"group": "test",
"problemMatcher": []
},
{
"label": "Utility: Check Version Match Tag",
"type": "shell",
"command": "scripts/check-version-match-tag.sh",
"group": "none",
"problemMatcher": []
},
{
"label": "Utility: Clear Go Cache",
"type": "shell",
"command": "scripts/clear-go-cache.sh",
"group": "none",
"problemMatcher": []
},
{
"label": "Utility: Bump Beta Version",
"type": "shell",
"command": "scripts/bump_beta.sh",
"group": "none",
"problemMatcher": []
}
]
}