diff --git a/.github/workflows/auto-versioning.yml b/.github/workflows/auto-versioning.yml index 781e4640..030b62c1 100644 --- a/.github/workflows/auto-versioning.yml +++ b/.github/workflows/auto-versioning.yml @@ -34,11 +34,31 @@ jobs: run: | echo "Next version: ${{ steps.semver.outputs.version }}" - - name: Create annotated tag and push + - id: create_tag + name: Create annotated tag and push if: ${{ steps.semver.outputs.changed }} run: | - git tag -a v${{ steps.semver.outputs.version }} -m "Release v${{ steps.semver.outputs.version }}" - git push origin --tags + # Ensure a committer identity is configured in the runner so git tag works + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + + # Normalize the version: remove any leading 'v' so we don't end up with 'vvX.Y.Z' + RAW="${{ steps.semver.outputs.version }}" + VERSION_NO_V="${RAW#v}" + + TAG="v${VERSION_NO_V}" + echo "TAG=${TAG}" + + # If tag already exists, skip creation to avoid failure + if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null; then + echo "Tag ${TAG} already exists; skipping tag creation" + else + git tag -a "${TAG}" -m "Release ${TAG}" + git push origin "${TAG}" + fi + + # Export the tag for downstream steps + echo "tag=${TAG}" >> $GITHUB_OUTPUT env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -46,8 +66,8 @@ jobs: if: ${{ steps.semver.outputs.changed }} uses: softprops/action-gh-release@v1 with: - tag_name: ${{ steps.semver.outputs.version }} - name: Release ${{ steps.semver.outputs.version }} + tag_name: ${{ steps.create_tag.outputs.tag }} + name: Release ${{ steps.create_tag.outputs.tag }} body: ${{ steps.semver.outputs.release_notes }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index acdcb2a4..2ea3fb99 100644 --- a/.gitignore +++ b/.gitignore @@ -118,4 +118,3 @@ PROJECT_PLANNING.md SECURITY_IMPLEMENTATION_PLAN.md VERSIONING_IMPLEMENTATION.md backend/internal/api/handlers/import_handler.go.bak -docker-compose.local.yml diff --git a/.goreleaser.yaml b/.goreleaser.yaml index b16bbf30..85171bf1 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,4 +1,4 @@ -version: 2 +version: 1 project_name: charon diff --git a/.vscode.backup_1764452251/launch.json b/.vscode.backup_1764452251/launch.json new file mode 100644 index 00000000..90ad73a3 --- /dev/null +++ b/.vscode.backup_1764452251/launch.json @@ -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" + } + ] +} diff --git a/.vscode.backup_1764452251/settings.json b/.vscode.backup_1764452251/settings.json new file mode 100644 index 00000000..80889168 --- /dev/null +++ b/.vscode.backup_1764452251/settings.json @@ -0,0 +1,5 @@ +{ + "githubPullRequests.ignoredPullRequestBranches": [ + "main" + ] +} diff --git a/docker-compose.local.yml b/docker-compose.local.yml new file mode 100644 index 00000000..e9f6ecf3 --- /dev/null +++ b/docker-compose.local.yml @@ -0,0 +1,58 @@ +services: + app: + image: cpmp:local + container_name: cpmp-debug + restart: unless-stopped + ports: + - "80:80" # HTTP (Caddy proxy) + - "443:443" # HTTPS (Caddy proxy) + - "443:443/udp" # HTTP/3 (Caddy proxy) + - "8080:8080" # Management UI (CPM+) + - "2345:2345" # Delve Debugger + environment: + - CPM_ENV=development + - CPMP_DEBUG=1 + - TZ=America/New_York + - CPM_HTTP_PORT=8080 + - CPM_DB_PATH=/app/data/cpm.db + - CPM_FRONTEND_DIR=/app/frontend/dist + - CPM_CADDY_ADMIN_API=http://localhost:2019 + - CPM_CADDY_CONFIG_DIR=/app/data/caddy + - CPM_CADDY_BINARY=caddy + - CPM_IMPORT_CADDYFILE=/import/Caddyfile + - CPM_IMPORT_DIR=/app/data/imports + - CPM_ACME_STAGING=false + extra_hosts: + - "host.docker.internal:host-gateway" + cap_add: + - SYS_PTRACE + security_opt: + - seccomp:unconfined + volumes: + - cpm_data_local:/app/data + - caddy_data_local:/data + - caddy_config_local:/config + - /var/run/docker.sock:/var/run/docker.sock:ro # For local container discovery + - ./backend:/app/backend:ro # Mount source for debugging + # Mount your existing Caddyfile for automatic import (optional) +# - :/import/Caddyfile:ro +# - :/import/sites:ro # If your Caddyfile imports other files + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/api/v1/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + +volumes: + cpm_data_local: + driver: local + caddy_data_local: + driver: local + caddy_config_local: + driver: local + +networks: + default: + name: containers_default + external: true