Skip to content

Commit 4314719

Browse files
committed
Settle the repo for public GitHub release
Bundle landing the project on github.com/hubzero/botshield: README front page (logo banner + tagline + badges, header cleaned up); GitHub-conventional meta files (SECURITY.md, CONTRIBUTING.md, Dependabot); CI shape for public Actions runs (docroot traversal, fixture restore, a2enmod rewrite, fail- secrets, paths-ignore for docs-only changes); BS_REPO fallback hardened to a clear error.
1 parent fd50566 commit 4314719

14 files changed

Lines changed: 742 additions & 1587 deletions

File tree

.github/dependabot.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Auto-PR dependency updates for the bits of this repo that pin
2+
# external versions. The C module itself has no package manifest —
3+
# it links against system Apache + OpenSSL + libcurl + json-c which
4+
# distros track, so there's nothing for Dependabot to check there.
5+
#
6+
# Schedule is weekly (Monday) so PRs land in batches instead of
7+
# trickling. Open-pull-request limit keeps things manageable.
8+
9+
version: 2
10+
updates:
11+
# GitHub Actions used by .github/workflows/ci.yml — actions/checkout,
12+
# actions/setup-python, actions/cache, actions/upload-artifact.
13+
# CI's deprecation warnings (Node.js 20 -> 24) will land here as
14+
# an update PR when GitHub publishes new majors.
15+
- package-ecosystem: "github-actions"
16+
directory: "/"
17+
schedule:
18+
interval: "weekly"
19+
day: "monday"
20+
open-pull-requests-limit: 5
21+
22+
# Pytest framework + Playwright + Hypothesis + report tooling.
23+
- package-ecosystem: "pip"
24+
directory: "/tests"
25+
schedule:
26+
interval: "weekly"
27+
day: "monday"
28+
open-pull-requests-limit: 5
29+
30+
# Docs renderer (markdown-it-py).
31+
- package-ecosystem: "pip"
32+
directory: "/tools"
33+
schedule:
34+
interval: "weekly"
35+
day: "monday"
36+
open-pull-requests-limit: 3

.github/workflows/ci.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,32 @@ name: CI
1313
# or after a parser change.
1414

1515
on:
16+
# Skip pushes/PRs that only touch docs — repeated `make docs`
17+
# iterations or markdown tweaks shouldn't burn a runner. CI still
18+
# fires the moment a code/test/config file is in the diff
19+
# alongside the docs change. workflow_dispatch is always
20+
# available for manual override.
1621
pull_request:
1722
branches: [ main ]
23+
paths-ignore:
24+
- 'docs/**'
25+
- 'docs-src/**'
26+
- 'site-src/**'
27+
- '**/*.md'
28+
- 'LICENSE'
1829
push:
1930
branches: [ main ]
31+
paths-ignore:
32+
- 'docs/**'
33+
- 'docs-src/**'
34+
- 'site-src/**'
35+
- '**/*.md'
36+
- 'LICENSE'
2037
# Manual trigger only — used to fire the 8h soak and the fuzz
2138
# campaigns (each can spend hours of runner time, so we don't run
22-
# them on a cron). Hit the "Run workflow" button in GitHub Actions
23-
# to invoke.
39+
# them on a cron). Also lets you re-run the whole CI on a docs-only
40+
# commit when you're done iterating and want one final check. Hit
41+
# the "Run workflow" button in GitHub Actions to invoke.
2442
workflow_dispatch:
2543

2644
env:

CONTRIBUTING.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Contributing to mod_botshield
2+
3+
Thanks for your interest. The project is small and the workflow is
4+
deliberately low-ceremony.
5+
6+
## Quick start
7+
8+
```sh
9+
git clone https://github.com/hubzero/botshield.git
10+
cd botshield
11+
sudo tests/setup/provision.sh
12+
tests/run --parallel --mark "not browser"
13+
```
14+
15+
`provision.sh` is idempotent; it installs apt packages, builds and
16+
installs the module, sets up a self-signed-cert HTTPS dev vhost on
17+
`localhost`, generates per-provider dummy captcha secrets, and
18+
creates the test venv at `tests/.venv/`. Re-run it any time you
19+
want to reset the environment.
20+
21+
After that, `tests/run` is the dispatcher — flags + markers are
22+
documented in [`tests/README.md`](tests/README.md).
23+
24+
## Reporting bugs and asking questions
25+
26+
- **Bugs**: open a GitHub issue with reproduction steps. A minimal
27+
Apache config snippet plus a `curl` invocation that triggers the
28+
problem is the gold standard.
29+
- **Security bugs**: do not open public issues. See
30+
[SECURITY.md](SECURITY.md).
31+
- **Questions / feature ideas**: GitHub Discussions is fine for
32+
open-ended things; issues are fine for things you want tracked.
33+
34+
## Submitting a pull request
35+
36+
1. Fork → branch from `main`.
37+
2. Make the change. Keep it focused — one concern per PR is
38+
easier to review than three concerns bundled.
39+
3. **Run the test suite**:
40+
```sh
41+
tests/run --parallel
42+
```
43+
PRs are gated on CI. Locally-green tests + clean CI is the
44+
baseline; flake-on-CI-only happens occasionally and is a
45+
conversation, not an automatic block.
46+
4. **Rebuild the docs** if you touched `docs-src/*.md` or
47+
`site-src/*`:
48+
```sh
49+
make docs
50+
git add docs/
51+
```
52+
The CI `docs-fresh` job will fail your PR if you forget.
53+
5. **Commit messages**: imperative, focused on the *why* when it
54+
isn't obvious from the diff. The git log shows the style; copy
55+
what you see. No "fix typo" PRs are too small to be welcome.
56+
6. **Open the PR**. Describe what changed and what you tested.
57+
Screenshots / log excerpts when relevant.
58+
59+
## Where things live
60+
61+
- `src/` — the C source. 19 modules, each `.c` paired with `.h`.
62+
`DESIGN.md` explains the module split.
63+
- `apache/botshield-dev.conf` — the dev vhost. Path-templated
64+
through `${BS_REPO}` so it works on any developer's checkout.
65+
- `docs-src/` — markdown source for the operator handbook
66+
(rendered to `docs/` by `make docs`).
67+
- `tests/pytests/` — pytest cases. Reusable framework helpers
68+
in `tests/botshield_test/`.
69+
- `tests/fuzz/` — LibFuzzer harnesses for the cookie + robots
70+
parsers.
71+
- `tests/bench/` — wrk + oha benchmark scripts.
72+
- `tools/``build_site.py` (docs renderer) +
73+
`refresh-bot-ranges.sh` (operator cron tool).
74+
75+
`CHANGELOG.md` is date-organized and gets an entry per
76+
notable PR. `DESIGN.md` is current-state architecture; update it
77+
when you change behavior, not just when you ship a feature.
78+
79+
## Code style
80+
81+
- C99. Apache style for indentation (4 spaces, no tabs except
82+
Makefile). `.editorconfig` enforces the basics.
83+
- Function/symbol prefixes: `bs_` / `BS_` for cross-file public
84+
symbols. File-local helpers use `static` and don't need the
85+
prefix.
86+
- Comments explain *why* something is the way it is when the
87+
code itself can't say it. Don't narrate what `if (x > 0)` does;
88+
do explain why we picked `x > 0` over `x >= 0`.
89+
- No regex on the hot path — hand-rolled byte scanners
90+
(`memcmp` / `memchr`). Reserve regex for config-time.
91+
92+
## License
93+
94+
By contributing, you agree your contribution is licensed under the
95+
MIT License (see [LICENSE](LICENSE)).

0 commit comments

Comments
 (0)