./scripts/rotate-db-password.sh
./deploy/aws/scripts/rotate-grafana-passwords.shAutomated password rotation for PostgreSQL. Works in both local and AWS environments.
- Generates secure 32-character password
- Updates
shadowcheck/configin AWS Secrets Manager (no secrets on disk) - Updates the PostgreSQL role password with
ALTER USER - Can also rotate
db_admin_passwordwith--rotate-admin - Restarts the running API container when present
- See
deploy/aws/docs/PASSWORD_ROTATION.mdfor details
Grafana rotation script:
- Generates
grafana_admin_passwordandgrafana_reader_password - Updates
shadowcheck/configin AWS Secrets Manager - Syncs the
grafana_readerPostgreSQL role password/grants - Recreates
shadowcheck_grafanawith runtime-only env vars
AWS_PROFILE=shadowcheck-sso \
AWS_REGION=us-east-1 \
SHADOWCHECK_AWS_SECRET=shadowcheck/config \
bash ./scripts/start-local-grafana.shStarts local Grafana for the proxied app URL at http://localhost:8080/grafana/,
keeps the upstream listener on http://127.0.0.1:3002/, pulls
grafana_admin_password and grafana_reader_password from shadowcheck/config,
and syncs the local grafana_reader PostgreSQL role.
./scripts/backup-shadowcheck.shCreates timestamped PostgreSQL backup with optional S3 upload.
BITWARDENCLI_APPDATA_DIR=/tmp/bwcli \
node ./scripts/backup-sm-to-bitwarden.jsBacks up the raw AWS Secrets Manager SecretString from shadowcheck/config
into a Bitwarden secure note without writing secret values to disk.
- Requires
awsCLI access to the target secret - Requires
bwCLI with an authenticated, unlocked vault - Stores the exact AWS JSON blob in the Bitwarden note body for restore-friendly backups
- Supports
--secret-id,--region,--profile,--item-name,--folder-id, and--organization-id
./deploy/aws/scripts/launch-shadowcheck-spot.shLaunches ShadowCheck Spot instance with persistent data volume.
- See
deploy/aws/README.mdfor AWS deployment details
# Canonical SQLite import
npx tsx etl/load/sqlite-import.ts <file.sqlite> [source_tag]
# Canonical JSON import
npx tsx etl/load/json-import.ts <file.json>
# Legacy wrapper entrypoints remain temporarily for backwards compatibility,
# but new operational docs should use the ETL paths above.# Batch geocoding
npx tsx scripts/geocoding/geocode-batch.ts
# Reverse geocoding
npx tsx scripts/geocoding/reverse-geocode-smart.ts
# Import geocoded data
npx tsx scripts/geocoding/import-geocodes.ts# Multi-source enrichment
npx tsx scripts/enrichment/enrich-multi-source.ts
# Business names
npx tsx scripts/enrichment/enrich-business-names.ts
# Monitor progress
npx tsx scripts/enrichment/monitor-enrichment.tsnpx tsx scripts/ml/ml-trainer.tsTrains threat detection model on tagged networks.
./scripts/db-connect.shOpens psql connection to PostgreSQL.
./scripts/shell/run-migration.sh <migration.sql>Applies SQL migration with error handling.
./scripts/refresh_api_network.sh # Full refresh
./scripts/refresh_api_network_delta.sh # Delta refreshnpx tsx scripts/rebuild-networks-precision.tsRecalculates network location precision from observations.
./scripts/shell/start-server.shStarts development server with hot reload.
./scripts/docker-manage.sh [up|down|restart|logs]Manages Docker Compose services.
./scripts/test-endpoints.shValidates API endpoint responses.
bash scripts/test-dashboard-filters.sh http://localhost:3001Validates dashboard filter behavior against /api/dashboard-metrics:
- Baseline vs filtered parity checks
filtersAppliedbehavior- Neutral all-radio selection behavior
If the target API requires authentication, create a cookie jar first:
bash scripts/login-admin-from-aws-sm.sh http://localhost:3001 /tmp/sc.cookies
COOKIE_JAR=/tmp/sc.cookies bash scripts/test-dashboard-filters.sh http://localhost:3001
COOKIE_JAR=/tmp/sc.cookies bash scripts/test-all-filters.sh localhost:3001npx tsx scripts/set-home.ts <lat> <lon>Sets home location for distance calculations.
npx tsx scripts/generate-sitemap.tsGenerates sitemap.xml for SEO.
npx tsx scripts/write-robots.tsGenerates robots.txt (respects ROBOTS_ALLOW_INDEXING env var).
- Security:
rotate-db-password.sh,backup-shadowcheck.sh - AWS:
launch-shadowcheck-spot.sh - Import:
scripts/import/*.ts - Geocoding:
scripts/geocoding/*.ts - Enrichment:
scripts/enrichment/*.ts - ML:
scripts/ml/*.ts - Database:
db-*.sh,refresh-*.sh,rebuild-*.ts - Development:
shell/*.sh,docker-manage.sh - Utilities:
set-home.ts,generate-sitemap.ts,write-robots.ts
All .ts scripts should be run with npx tsx:
npx tsx scripts/path/to/script.ts [args]All .sh scripts should be executable:
chmod +x scripts/script-name.sh
./scripts/script-name.sh [args]