diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-09 21:51:52 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-09 21:51:52 +0000 |
| commit | 5570b9631e03c077faa95fbf1f068a4360d25bd7 (patch) | |
| tree | e1ece058586e84e2b98b1de1188b4ff3cb5acdd6 | |
| parent | 6a8346441ea605248e09858d0e6b9096a1c87259 (diff) | |
Fix production-sync-testing.md guide and sanitize-logs.sh script
- Fix shebang in sanitize-logs.sh from #!/bin/bash to #!/usr/bin/env bash for NixOS compatibility
- Update sanitizer defaults from 100/20 to 200/100 chars for better log readability
- Fix CLI argument names in guide: --sync-bootstrap-relay -> --sync-bootstrap-relay-url
- Fix CLI argument names in guide: --git-path -> --git-data-path
These issues were discovered during first-time testing of the production sync testing guide.
| -rw-r--r-- | docs/how-to/production-sync-testing.md | 18 | ||||
| -rwxr-xr-x | scripts/sanitize-logs.sh | 10 |
2 files changed, 14 insertions, 14 deletions
diff --git a/docs/how-to/production-sync-testing.md b/docs/how-to/production-sync-testing.md index dfff20d..a55e9ea 100644 --- a/docs/how-to/production-sync-testing.md +++ b/docs/how-to/production-sync-testing.md | |||
| @@ -38,7 +38,7 @@ This domain has few repo announcements listing it, so sync stays manageable. | |||
| 38 | The bootstrap relay provides the initial set of announcements to discover repos: | 38 | The bootstrap relay provides the initial set of announcements to discover repos: |
| 39 | 39 | ||
| 40 | ```bash | 40 | ```bash |
| 41 | --sync-bootstrap-relay wss://git.shakespeare.diy | 41 | --sync-bootstrap-relay-url wss://git.shakespeare.diy |
| 42 | ``` | 42 | ``` |
| 43 | 43 | ||
| 44 | ### 3. Run with Time Limit | 44 | ### 3. Run with Time Limit |
| @@ -51,9 +51,9 @@ rm -rf /tmp/ngit-test-* | |||
| 51 | 51 | ||
| 52 | # Run for 30 seconds with sanitized output | 52 | # Run for 30 seconds with sanitized output |
| 53 | timeout 30s cargo run -- \ | 53 | timeout 30s cargo run -- \ |
| 54 | --sync-bootstrap-relay wss://git.shakespeare.diy \ | 54 | --sync-bootstrap-relay-url wss://git.shakespeare.diy \ |
| 55 | --domain ngit.danconwaydev.com \ | 55 | --domain ngit.danconwaydev.com \ |
| 56 | --git-path /tmp/ngit-test-git \ | 56 | --git-data-path /tmp/ngit-test-git \ |
| 57 | --relay-data-path /tmp/ngit-test-relay \ | 57 | --relay-data-path /tmp/ngit-test-relay \ |
| 58 | 2>&1 | ./scripts/sanitize-logs.sh | tee sync-test.log | 58 | 2>&1 | ./scripts/sanitize-logs.sh | tee sync-test.log |
| 59 | ``` | 59 | ``` |
| @@ -72,8 +72,8 @@ cargo run -- [args] 2>&1 | ./scripts/sanitize-logs.sh | |||
| 72 | ``` | 72 | ``` |
| 73 | 73 | ||
| 74 | **Options:** | 74 | **Options:** |
| 75 | - `--head-chars N` - First N characters to show (default: 100) | 75 | - `--head-chars N` - First N characters to show (default: 200) |
| 76 | - `--tail-chars N` - Last N characters to show (default: 20) | 76 | - `--tail-chars N` - Last N characters to show (default: 100) |
| 77 | 77 | ||
| 78 | Example output: | 78 | Example output: |
| 79 | ``` | 79 | ``` |
| @@ -245,9 +245,9 @@ tracing::trace!("Per-event detail that's too noisy"); | |||
| 245 | 245 | ||
| 246 | ```bash | 246 | ```bash |
| 247 | timeout 30s cargo run -- \ | 247 | timeout 30s cargo run -- \ |
| 248 | --sync-bootstrap-relay wss://git.shakespeare.diy \ | 248 | --sync-bootstrap-relay-url wss://git.shakespeare.diy \ |
| 249 | --domain ngit.danconwaydev.com \ | 249 | --domain ngit.danconwaydev.com \ |
| 250 | --git-path /tmp/ngit-test-git \ | 250 | --git-data-path /tmp/ngit-test-git \ |
| 251 | --relay-data-path /tmp/ngit-test-relay \ | 251 | --relay-data-path /tmp/ngit-test-relay \ |
| 252 | 2>&1 | ./scripts/sanitize-logs.sh | 252 | 2>&1 | ./scripts/sanitize-logs.sh |
| 253 | ``` | 253 | ``` |
| @@ -256,9 +256,9 @@ timeout 30s cargo run -- \ | |||
| 256 | 256 | ||
| 257 | ```bash | 257 | ```bash |
| 258 | timeout 30s cargo run -- \ | 258 | timeout 30s cargo run -- \ |
| 259 | --sync-bootstrap-relay wss://git.shakespeare.diy \ | 259 | --sync-bootstrap-relay-url wss://git.shakespeare.diy \ |
| 260 | --domain ngit.danconwaydev.com \ | 260 | --domain ngit.danconwaydev.com \ |
| 261 | --git-path /tmp/ngit-test-git \ | 261 | --git-data-path /tmp/ngit-test-git \ |
| 262 | --relay-data-path /tmp/ngit-test-relay \ | 262 | --relay-data-path /tmp/ngit-test-relay \ |
| 263 | --metrics-address 127.0.0.1:9090 \ | 263 | --metrics-address 127.0.0.1:9090 \ |
| 264 | 2>&1 | ./scripts/sanitize-logs.sh | 264 | 2>&1 | ./scripts/sanitize-logs.sh |
diff --git a/scripts/sanitize-logs.sh b/scripts/sanitize-logs.sh index 123e72c..7225fe4 100755 --- a/scripts/sanitize-logs.sh +++ b/scripts/sanitize-logs.sh | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | #!/bin/bash | 1 | #!/usr/bin/env bash |
| 2 | # sanitize-logs.sh - Truncates verbose log lines for LLM analysis | 2 | # sanitize-logs.sh - Truncates verbose log lines for LLM analysis |
| 3 | # | 3 | # |
| 4 | # Usage: | 4 | # Usage: |
| @@ -9,8 +9,8 @@ | |||
| 9 | set -euo pipefail | 9 | set -euo pipefail |
| 10 | 10 | ||
| 11 | # Default settings | 11 | # Default settings |
| 12 | HEAD_CHARS=100 | 12 | HEAD_CHARS=200 |
| 13 | TAIL_CHARS=20 | 13 | TAIL_CHARS=100 |
| 14 | MAX_LINE_LENGTH=$((HEAD_CHARS + TAIL_CHARS + 20)) # buffer for the ellipsis marker | 14 | MAX_LINE_LENGTH=$((HEAD_CHARS + TAIL_CHARS + 20)) # buffer for the ellipsis marker |
| 15 | 15 | ||
| 16 | # Parse arguments | 16 | # Parse arguments |
| @@ -35,8 +35,8 @@ while [[ $# -gt 0 ]]; do | |||
| 35 | echo "Reads from stdin, writes to stdout." | 35 | echo "Reads from stdin, writes to stdout." |
| 36 | echo "" | 36 | echo "" |
| 37 | echo "Options:" | 37 | echo "Options:" |
| 38 | echo " --head-chars N Show first N chars of long lines (default: 100)" | 38 | echo " --head-chars N Show first N chars of long lines (default: 200)" |
| 39 | echo " --tail-chars N Show last N chars of long lines (default: 20)" | 39 | echo " --tail-chars N Show last N chars of long lines (default: 100)" |
| 40 | echo " --max-line N Lines shorter than this are unchanged (default: head+tail+20)" | 40 | echo " --max-line N Lines shorter than this are unchanged (default: head+tail+20)" |
| 41 | echo " -h, --help Show this help" | 41 | echo " -h, --help Show this help" |
| 42 | echo "" | 42 | echo "" |