Skip to content

Repo cleanup + CI/CD pipeline#1

Merged
bfritzinger merged 8 commits intomainfrom
chore/cleanup-and-ci
May 5, 2026
Merged

Repo cleanup + CI/CD pipeline#1
bfritzinger merged 8 commits intomainfrom
chore/cleanup-and-ci

Conversation

@bfritzinger
Copy link
Copy Markdown
Owner

Summary

  • Sync repo housekeeping with reality: README tree/script-table fixes, normalized shebangs (#!/usr/bin/env bash), executable bits set on all 21 scripts in the index, CRLF→LF on alias-dist/alias-dist.sh, tightened .gitignore.
  • Tidy the only non-script component: commit cloudflare-ip-logger/go.sum, drop the RUN go mod tidy from the Dockerfile (would silently mutate go.sum at build time), add --no-install-recommends, document the cmd/logparser companion binary in its README.
  • Apply ruff auto-fixes to the four Python scripts (whitespace/EOF newlines, dead f"", unused import) and add ruff.toml. Bare except: blocks left intact (intentional, ignored in config).
  • Add a GitHub Actions CI pipeline (.github/workflows/ci.yml) covering shellcheck, ruff + py_compile, go vet/build/test, hadolint, docker buildx smoke build, and yamllint.
  • Add a release pipeline (.github/workflows/release.yml) that publishes a multi-arch (amd64+arm64) cf-ip-logger image to ghcr.io on cf-ip-logger-vX.Y.Z tags.
  • Add .github/dependabot.yml for weekly Go module / Docker base-image / GH Actions updates.
  • Commit CLAUDE.md documenting repo conventions for Claude Code.

Commits

  1. d8e3b71 Sync top-level README with actual repo layout
  2. 2665c90 Normalize bash scripts: shebangs, exec bits, line endings
  3. e7006fc Normalize Python scripts and add ruff config
  4. 5f2d67a Tidy cloudflare-ip-logger: commit go.sum, clean Dockerfile, document logparser
  5. 53a1990 Add CI/CD pipeline, Dependabot, and lint configs
  6. 32735c7 Add CLAUDE.md with repo conventions for Claude Code

Test plan

  • CI workflow runs green on this PR (six jobs: shellcheck, python, go, hadolint, docker-build, yaml)
  • After merge, tag a release like cf-ip-logger-v0.1.0 and verify release.yml publishes the multi-arch image to ghcr.io/bfritzinger/cf-ip-logger
  • Confirm the CI badge in the README renders once main has a workflow run
  • Spot-check that scripts still execute on a clean clone (exec bits stick after git clone)

🤖 Generated with Claude Code

bfritzinger and others added 8 commits May 5, 2026 15:42
Fix the script-table label "Chowned Thottled" -> "Chown Throttled" and
rewrite the Repository Structure tree, which had drifted significantly
(typos like pwr-tmp-monitor, Dokerfile, HUng Connections, Health Check,
Dir Sync, plus stale dotfiles entries that no longer exist on disk).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Switch 12 scripts from #!/bin/bash to the preferred #!/usr/bin/env bash
  (per CLAUDE.md style)
- Mark all .sh files executable in the index (were committed at 644)
- Convert alias-dist/alias-dist.sh from CRLF to LF; without this,
  shellcheck flags every line as SC1017
- Tighten .gitignore: __pycache__/, *.pyc/*.pyo, and the cloudflare-ip-logger
  build artifacts (cf-ip-logger, cf-log-parser)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add #!/usr/bin/env python3 shebangs to the 2 scripts that lacked them
- Mark all .py files executable in the index (were 644)
- Apply ruff auto-fixes for trivial issues: trailing whitespace on blank
  lines (W293), missing trailing newline (W292), f-strings without
  placeholders (F541), unused import (F401)
- Add ruff.toml selecting E/F/W/B with E722 and B007 ignored (the bare
  excepts in github-stars.py and the 'best-effort cleanup' loop in
  hung_connection_killer.py are intentional)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…logparser

- Add go.sum so the build is reproducible (Dockerfile already expected
  it via 'COPY go.mod go.sum* ./' but the file was never committed)
- Drop 'RUN go mod tidy' from the Dockerfile -- it would silently mutate
  go.sum at build time, defeating the point of pinning deps
- Add --no-install-recommends and apt-list cleanup to the builder stage
  (DL3015) and tighten the COPY of go.mod/go.sum
- Document cmd/logparser in the cloudflare-ip-logger README, including
  the cf-log-parser.service systemd unit and run-with-logging.sh wrapper

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ci.yml runs on every push/PR and covers the whole repo:
  - shellcheck (errors) on all .sh files
  - py_compile + ruff on all .py files
  - go vet, gofmt, go build, go test for cloudflare-ip-logger (both the
    proxy and the cmd/logparser binary)
  - hadolint for the Dockerfile (config in cloudflare-ip-logger/.hadolint.yaml)
  - docker buildx smoke build of the cf-ip-logger image
  - yamllint for all YAML (config in .yamllint.yml)

release.yml fires on cf-ip-logger-vX.Y.Z tags (or manual dispatch),
builds a multi-arch (amd64 + arm64) image with QEMU/buildx, and
publishes to ghcr.io/<owner>/cf-ip-logger:<version> + :latest.
Auth uses the built-in GITHUB_TOKEN -- no secrets to configure.

dependabot.yml watches Go modules, the Dockerfile base image, and
GitHub Actions versions on a weekly cadence.

Add CI status badge and pipeline overview to the top-level README.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Documents the shape of the repo (collection of independent scripts, no
shared library or test suite), per-language conventions (bash shebang
style, stdlib-only Python), and the cloudflare-ip-logger architecture
so Claude Code has accurate context when assisting on this codebase.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- gofmt -w on cloudflare-ip-logger/main.go and cmd/logparser/main.go
  (struct field alignment)
- Add `# shellcheck shell=bash` to dotfiles/.bashrc and .bash_aliases
  so SC2148 stops firing on these sourced (no-shebang) files
- Disable SC2142 on the localip alias — `$1` is awk's, not a shell
  positional

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bfritzinger bfritzinger merged commit 5dbba88 into main May 5, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant