Skip to content

feat(scripts): add scripts area with per-script docs and TLS cert tool#13

Open
behobu wants to merge 5 commits into
mainfrom
feat/scripts-area
Open

feat(scripts): add scripts area with per-script docs and TLS cert tool#13
behobu wants to merge 5 commits into
mainfrom
feat/scripts-area

Conversation

@behobu
Copy link
Copy Markdown
Contributor

@behobu behobu commented Jun 3, 2026

What

Establishes a home for scripts that interact with Monad via its API, with the convention that every script ships usage and limitations documentation.

Structure

  • scripts/ — one directory per script (scripts/<slug>/), each with a required README.md.
  • scripts/README.md — catalog table with a Category column (flat scripts/<slug>/ layout for now).
  • scripts/_template/ — copy-to-start scaffold: a per-script doc template (with a mandatory Limitations & caveats section) and a script stub showing the API-key / curl --config conventions.
  • CONTRIBUTING.md — how to add a script + a PR checklist that requires the Limitations section, forbids committed secrets, and asks for a dry-run on state-changing scripts.
  • LICENSE — MIT.
  • README.md — fixes the stale clone URL (monad-community/monad-communitymonad-inc/community) and adds a Scripts section.

First script

  • scripts/tls-cert-to-syslog-input/monad-tls-cert-to-pipeline.sh: probes devices over TLS (or bulk-loads precomputed hashes) and registers their certificate SHA-256 fingerprints on a pipeline's Syslog input (settings.cert_fingerprints) so SNI-less sources route correctly. Ships a full usage + limitations README.

Why

The repo advertised a "Code Snippets / scripts" category but had no home for it. This makes "add a script → add its usage and limitations" the default path rather than an afterthought.

Notes

  • Flat scripts/<slug>/ with a Category column (vs. category subfolders) chosen for now; easy to reorganize later.
  • Both shell scripts pass bash -n.

🤖 Generated with Claude Code

behobu and others added 2 commits June 3, 2026 15:47
Establish a home for scripts that interact with Monad via its API, with a
convention that every script ships usage and limitations documentation.

- scripts/: one directory per script, each with a required README; a catalog
  table (with a Category column) in scripts/README.md; a copy-to-start
  _template/ (doc template + script stub with API-key/curl-config conventions).
- CONTRIBUTING.md: how to add a script + PR checklist (Limitations section
  required; no committed secrets; dry-run for state-changing scripts).
- LICENSE: add MIT.
- README.md: fix stale clone URL (monad-community/monad-community ->
  monad-inc/community) and add a Scripts section.
- First script: tls-cert-to-syslog-input (registers device TLS cert SHA-256
  fingerprints on a pipeline's Syslog input for SNI-less routing) with full
  usage + limitations README.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rename monad-tls-cert-to-pipeline.sh to tls-cert-to-syslog-input.sh so the
script file name matches its directory slug, and update the in-script header,
usage, and examples plus the README references accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
behobu and others added 3 commits June 5, 2026 11:09
Replace the MIT license added in this PR with the Apache License 2.0,
retaining the Monad, Inc. copyright notice.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the standard Apache 2.0 source header to the script template and
the TLS cert fingerprint script, and bump the usage() sed anchor so
--help output skips the header and stays unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The previous usage() implementation was doubly broken: it anchored the
doc block at a hard-coded line number (which silently breaks when the
header grows or shrinks), and it ended at the FIRST '# ----' divider,
which sits before the Usage section — so --help never actually printed
the usage and options text.

Anchor on structure instead: print from the first blank line (end of
the license header) up to the first line of code. --help output now
includes the full Usage, options, and examples sections.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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