Commit Graph

59 Commits

Author SHA1 Message Date
e43575ea26 Merge pull request 'chore: consolidate documentation — delete status/fix/progress cruft' (#2) from devin/1776538357-chore-doc-consolidation into master 2026-04-18 19:35:29 +00:00
2c8d3d222e Merge pull request 'chore: remove committed binaries and scratch dirs; tighten .gitignore' (#1) from devin/1776538258-chore-gitignore-and-artifacts into master 2026-04-18 19:34:57 +00:00
d4849da50d Merge pull request 'chore(ci): align Go to 1.23.x, add staticcheck/govulncheck/gitleaks gates' (#5) from devin/1776539160-chore-ci-go-version-and-scanners into master 2026-04-18 19:34:37 +00:00
c16a7855d5 Merge pull request 'fix(security): fail-fast on missing JWT_SECRET, harden CSP, strip hardcoded passwords' (#3) from devin/1776538631-fix-jwt-and-csp-hardening into master 2026-04-18 19:34:29 +00:00
f4e235edc6 chore(ci): align Go to 1.23.x, add staticcheck/govulncheck/gitleaks gates
.github/workflows/ci.yml:
- Go version: 1.22 -> 1.23.4 (matches go.mod's 'go 1.23.0' declaration).
- Split into four jobs with explicit names:
    * test-backend: go vet + go build + go test
    * scan-backend: staticcheck + govulncheck (installed from pinned tags)
    * test-frontend: npm ci + eslint + tsc --noEmit + next build
    * gitleaks: full-history secret scan on every PR
- Branches triggered: master + main + develop (master is the repo
  default; the previous workflow only triggered on main/develop and
  would never have run on the repo's actual PRs).
- actions/checkout@v4, actions/setup-go@v5, actions/setup-node@v4.
- Concurrency group cancels stale runs on the same ref.
- Node and Go caches enabled for faster CI.

.gitleaks.toml (new):
- Extends gitleaks defaults.
- Custom rule 'explorer-legacy-db-password-L@ker' keeps the historical
  password pattern L@kers?\$?2010 wedged in the detection set even
  after rotation, so any re-introduction (via copy-paste from old
  branches, stale docs, etc.) fails CI.
- Allowlists docs/SECURITY.md and CHANGELOG.md where the string is
  cited in rotation context.

backend/staticcheck.conf (new):
- Enables the full SA* correctness set.
- Temporarily disables ST1000/1003/1005/1020/1021/1022, U1000, S1016,
  S1031. These are stylistic/cosmetic checks; the project has a long
  tail of pre-existing hits there that would bloat every PR. Each is
  commented so the disable can be reverted in a dedicated cleanup.

Legit correctness issues surfaced by staticcheck and fixed in this PR:
- backend/analytics/token_distribution.go: 'best-effort MV refresh'
  block no longer dereferences a shadowed 'err'; scope-tight 'if err :='
  used for the subsequent QueryRow.
- backend/api/rest/middleware.go: compressionMiddleware() was parsing
  Accept-Encoding and doing nothing with it. Now it's a literal
  pass-through with a TODO comment pointing at gorilla/handlers.
- backend/api/rest/mission_control.go: shadowed 'err' from
  json.Unmarshal was assigned to an ignored outer binding via
  fmt.Errorf; replaced with a scoped 'if uerr :=' that lets the RPC
  fallback run as intended.
- backend/indexer/traces/tracer.go: best-effort CREATE TABLE no longer
  discards the error implicitly.
- backend/indexer/track2/block_indexer.go: 'latestBlock - uint64(i) >= 0'
  was a tautology on uint64. Replaced with an explicit
  'if uint64(i) > latestBlock { break }' guard so operators running
  count=1000 against a shallow chain don't underflow.
- backend/tracing/tracer.go: introduces a local ctxKey type and two
  constants so WithValue calls stop tripping SA1029.

Verification:
- go build ./... clean.
- go vet ./... clean.
- go test ./... all existing tests PASS.
- staticcheck ./... clean except for the SA1029 hits in
  api/middleware/auth.go and api/track4/operator_scripts_test.go,
  which are resolved by PR #4 once it merges to master.

Advances completion criterion 4 (CI in good health).
2026-04-18 19:10:20 +00:00
defiQUG
def11dd624 chore: refresh gru v2 deployment status 2026-04-18 12:05:17 -07:00
ad69385beb fix(security): fail-fast on missing JWT_SECRET, harden CSP, strip hardcoded passwords
backend/api/rest/server.go:
- NewServer() now delegates to loadJWTSecret(), which:
    - Rejects JWT_SECRET < 32 bytes (log.Fatal).
    - Requires JWT_SECRET when APP_ENV=production or GO_ENV=production.
    - Generates a 32-byte crypto/rand ephemeral secret in dev only.
    - Treats rand.Read failure as fatal (removes the prior time-based
      fallback that was deterministic and forgeable).
- Default Content-Security-Policy rewritten:
    - Drops 'unsafe-inline' and 'unsafe-eval'.
    - Drops private CIDRs (192.168.11.221:854[5|6]).
    - Adds frame-ancestors 'none', base-uri 'self', form-action 'self'.
    - CSP_HEADER is required in production; fatal if unset there.

backend/api/rest/server_security_test.go (new):
- Covers the three loadJWTSecret() paths (valid, whitespace-trimmed,
  ephemeral in dev).
- Covers isProductionEnv() across APP_ENV / GO_ENV combinations.
- Asserts defaultDevCSP contains no unsafe directives or private CIDRs
  and includes the frame-ancestors / base-uri / form-action directives.

scripts/*.sh:
- Removed '***REDACTED-LEGACY-PW***' default value from SSH_PASSWORD / NEW_PASSWORD in
  7 helper scripts. Each script now fails with exit 2 and points to
  docs/SECURITY.md if the password isn't supplied via env or argv.

EXECUTE_DEPLOYMENT.sh, EXECUTE_NOW.sh:
- Replaced hardcoded DB_PASSWORD='***REDACTED-LEGACY-PW***' with a ':?' guard that
  aborts with a clear error if DB_PASSWORD (and, for EXECUTE_DEPLOYMENT,
  RPC_URL) is not exported. Other env vars keep sensible non-secret
  defaults via ${VAR:-default}.

README.md:
- Removed the hardcoded Database Password / RPC URL lines. Replaced with
  an env-variable reference table pointing at docs/SECURITY.md and
  docs/DATABASE_CONNECTION_GUIDE.md.

docs/DEPLOYMENT.md:
- Replaced 'PASSWORD: SSH password (default: ***REDACTED-LEGACY-PW***)' with a
  required-no-default contract and a link to docs/SECURITY.md.

docs/SECURITY.md (new):
- Full secret inventory keyed to the env variable name and the file that
  consumes it.
- Five-step rotation checklist covering the Postgres role, the Proxmox
  VM SSH password, JWT_SECRET, vendor API keys, and a gitleaks-based
  history audit.
- Explicit note that merging secret-scrub PRs does NOT invalidate
  already-leaked credentials; rotation is the operator's responsibility.

Verification:
- go build ./... + go vet ./... pass clean.
- Targeted tests (LoadJWTSecret*, IsProduction*, DefaultDevCSP*) pass.

Advances completion criterion 2 (Secrets & config hardened). Residual
leakage from START_HERE.md / LETSENCRYPT_CONFIGURATION_GUIDE.md is
handled by PR #2 (doc consolidation), which deletes those files.
2026-04-18 19:02:27 +00:00
40c9af678f chore: consolidate documentation — delete status/fix/progress cruft
Before: 335 tracked .md files; top level had 14 README-like docs;
docs/ contained ~234 files, most of them auto/LLM-generated status
reports (ALL_*_COMPLETE*, *_FIX*, DEPLOYMENT_*_FINAL*, etc.).

After: 132 tracked .md files. Repo now has exactly five top-level
docs: README.md, QUICKSTART.md, RUNBOOK.md, CONTRIBUTING.md,
CHANGELOG.md (moved up from docs/).

Keeper philosophy in docs/:
- API, CCIP (ops + security + receiver/router refs), Chainlist refs,
  compliance, deployment (guides not status), database connection,
  legal compliance, metamask integration, production checklist,
  tiered-architecture implementation/setup, reusable-components plan,
  token-mechanism doc, wrap-and-bridge operational reference, plus
  docs/specs/** and docs/api/ / docs/openapi/ trees.

Deleted (git history preserves provenance):
- All 'ALL_*_COMPLETE*' / '*_FIX*' / '*_FIXED*' / '*_FINAL*' /
  '*_STATUS*' / '*_PROGRESS*' / '*_SUMMARY*' files.
- BLOCKSCOUT_*_FIX / _CRASH / _INITIALIZATION / _SCHEMA / _YAML /
  _SKIP / _NEXT_STEPS / _START_AND_BUILD / _DATABASE_CREDENTIALS
  (the last contained passwords).
- CCIP_IMPLEMENTATION_* / CCIP_CURRENT_STATUS / CCIP_GAP_*
  (gap analyses are not a sustained reference).
- NPMPLUS_CREDENTIALS_GUIDE.md (contained creds).
- LETSENCRYPT_CONFIGURATION_GUIDE.md (contained creds; will be
  re-introduced as runbook content post-secrets-scrub).
- docs/diagnostic-reports/, docs/feature-flags/ (run-time artifacts).

README.md: dead links (START_HERE, README_DEPLOYMENT, COMPLETE_DEPLOYMENT,
DEPLOYMENT_COMPLETE_FINAL) replaced with links to the five canonical
top-level docs + docs/ index.
2026-04-18 18:56:17 +00:00
db4b9a4240 chore: remove committed binaries and scratch dirs; tighten .gitignore
- Remove committed Go binaries:
    backend/bin/api-server (~18 MB)
    backend/cmd (~18 MB)
    backend/api/rest/cmd/api-server (~18 MB)
- Remove scratch / build output dirs from the repo:
    out/, cache/, test-results/
- Extend .gitignore to cover these paths plus playwright-report/
  and coverage/ so they don't drift back in.

Total artifact weight removed: ~54 MB of binaries + small scratch files.
2026-04-18 18:51:25 +00:00
defiQUG
e1c3b40cb0 Refine homepage freshness layout 2026-04-16 11:12:17 -07:00
defiQUG
251e37bd05 Improve explorer subsystem posture and wallet visibility 2026-04-13 21:35:36 -07:00
defiQUG
b5a2e0c0a4 feat(freshness): enhance diagnostics and update snapshot structure
- Introduced a new Diagnostics struct to capture transaction visibility state and activity state.
- Updated BuildSnapshot function to return diagnostics alongside snapshot, completeness, and sampling.
- Enhanced test cases to validate the new diagnostics data.
- Updated frontend components to utilize the new diagnostics information for improved user feedback on freshness context.

This change improves the observability of transaction activity and enhances the user experience by providing clearer insights into the freshness of data.
2026-04-12 18:22:08 -07:00
defiQUG
50c5435c0c feat(bridge-monitoring): show inventory shortfall for queued releases
Surface mission-control bridge_inventory scope, wei shortfall fields, and
relay card formatting for WETH display.

Made-with: Cursor
2026-04-12 06:44:20 -07:00
defiQUG
3fdb812a29 Freshness diagnostics API, UI trust notes, mission control/stats updates, and deploy scripts.
Made-with: Cursor
2026-04-12 06:33:54 -07:00
defiQUG
0972178cc5 refactor: rename SolaceScanScout to Solace and update related configurations
- Updated branding from "SolaceScanScout" to "Solace" across various files including deployment scripts, API responses, and documentation.
- Changed default base URL for Playwright tests and updated security headers to reflect the new branding.
- Enhanced README and API documentation to include new authentication endpoints and product access details.

This refactor aligns the project branding and improves clarity in the API documentation.
2026-04-10 12:52:17 -07:00
defiQUG
6eef6b07f6 feat: explorer API, wallet, CCIP scripts, and config refresh
- Backend REST/gateway/track routes, analytics, Blockscout proxy paths.
- Frontend wallet and liquidity surfaces; MetaMask token list alignment.
- Deployment docs, verification scripts, address inventory updates.

Check: go build ./... under backend/ (pass).
Made-with: Cursor
2026-04-07 23:22:12 -07:00
defiQUG
d931be8e19 fix(wallet): MetaMask Open Snap allowlist messaging + resolveExplorerApiBase
- Clarify stable MetaMask install allowlist vs open Snap permissions on /wallet
- Surface Flask / allowlist-application hint when install errors mention allowlist
- Add shared resolveExplorerApiBase helper for catalog URLs

Made-with: Cursor
2026-04-05 01:23:25 -07:00
defiQUG
f6e842ea83 Update public RPC capability metadata 2026-03-28 19:18:20 -07:00
defiQUG
141c8a278e Publish Chain 138 RPC capability metadata 2026-03-28 15:56:42 -07:00
defiQUG
96a78eda33 Centralize explorer bridge destination selectors 2026-03-28 15:18:49 -07:00
defiQUG
a7624db5f7 Prune explorer dead ends and harden route smoke 2026-03-28 15:15:23 -07:00
defiQUG
1c05931be4 Add dedicated explorer routes page 2026-03-28 15:04:42 -07:00
defiQUG
2698fd89a0 Promote explorer content links to real anchors 2026-03-28 14:09:23 -07:00
defiQUG
e54e2f668b Fix explorer SPA detail navigation fallback 2026-03-28 13:59:00 -07:00
defiQUG
c0eb601a62 Fix explorer address list regression and live link checks 2026-03-28 13:44:47 -07:00
defiQUG
7cf9f450e4 Harden explorer MetaMask data and navigation coverage 2026-03-28 13:40:32 -07:00
defiQUG
6096804ee6 Polish explorer frontend validation and utility pages 2026-03-28 13:26:42 -07:00
defiQUG
26892ccbb9 Fix explorer routing, links, and frontend API loading 2026-03-28 00:21:18 -07:00
defiQUG
011b4ff9b7 chore(scripts): align CCIP health/setup scripts with inventory loaders
Made-with: Cursor
2026-03-27 22:21:15 -07:00
defiQUG
b088cfa438 chore(scripts): use inventory + CCIP matrix in status/verify reports
Made-with: Cursor
2026-03-27 22:18:41 -07:00
defiQUG
00303e1ec7 feat(scripts): CCIP destination matrix + ccip-destinations helper
- Add config/ccip-destination-matrix.json (selectors, bridges, public RPCs)
- Drive configure-all-*-destinations scripts from matrix via jq
- Extend config/README; wire check-bridge-config and pre-flight-check

Made-with: Cursor
2026-03-27 22:17:12 -07:00
defiQUG
0629848e67 chore(scripts): comment fixes for inventory persistence paths
Made-with: Cursor
2026-03-27 22:11:50 -07:00
defiQUG
292a5eca0f chore(scripts): use load_explorer_runtime_env + address-inventory helper
Align remaining shell scripts with shared env loading (no direct .env source).

Made-with: Cursor
2026-03-27 22:10:38 -07:00
defiQUG
ed0af8aaa0 feat(scripts): resolve CCIP/LINK addresses via config inventory
- Add scripts/lib/address-inventory.sh (jq + JSON inventory fallback)
- Wire deployment helper scripts to load_explorer_runtime_env + resolve_address_value
- Persist new LINK to address-inventory.json via persist_inventory_value
- Document config/*.json in config/README.md

Made-with: Cursor
2026-03-27 22:09:32 -07:00
defiQUG
ca24d6127c chore: add address inventory and runtime-env JSON refs (dotenv cleanup)
Non-secret reference copies of former .env address surface for docs/scripts.

Made-with: Cursor
2026-03-27 19:19:25 -07:00
defiQUG
dc881c608f fix(frontend): explorer SPA bundle updates
Made-with: Cursor
2026-03-27 18:52:03 -07:00
defiQUG
b5f9f7192e Move explorer AI key loading to secure secrets 2026-03-27 17:11:16 -07:00
defiQUG
ed1ad621b5 Switch explorer AI provider to Grok 2026-03-27 16:51:04 -07:00
defiQUG
cdeddfd5a2 Add Chain 138 mirror tokens and gold unit metadata 2026-03-27 15:45:06 -07:00
defiQUG
47da9b19b1 Normalize token list JSON formatting 2026-03-27 15:44:37 -07:00
defiQUG
589fd48a36 Add global footer to frontend layout 2026-03-27 15:27:09 -07:00
defiQUG
9cfd146fb6 Reconcile explorer service and nginx ownership 2026-03-27 15:21:56 -07:00
defiQUG
3265e94da8 Harden explorer AI runtime and API ownership 2026-03-27 14:12:14 -07:00
defiQUG
c9e792d55f Add explorer AI chat and context endpoints 2026-03-27 13:37:53 -07:00
defiQUG
01e0633124 Upgrade explorer more menu into grouped tools hub 2026-03-27 12:11:18 -07:00
defiQUG
5195dfcf87 Add explorer liquidity access and live route proxies 2026-03-27 12:02:36 -07:00
defiQUG
2c6512f26d Update CCIP Router and Bridge Addresses for ChainID 138
- Changed CCIP Router address from `0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e` to `0x42DAb7b888Dd382bD5Adcf9E038dBF1fD03b4817` across multiple documentation files.
- Updated WETH9 Bridge address from `0x89dd12025bfCD38A168455A44B400e913ED33BE2` to `0xcacfd227A040002e49e2e01626363071324f820a`.
- Ensured all references to the new addresses are consistent throughout the documentation.

This update reflects the latest deployment configurations and ensures accurate contract references for ChainID 138.
2026-03-24 22:49:29 -07:00
defiQUG
d99c923f93 feat(frontend): explorer SPA and index updates; env verification report
- Expand explorer-spa.js and index.html for Chain 138 explorer UX
- Refresh ENV_VERIFICATION_REPORT.md

Made-with: Cursor
2026-03-24 18:11:08 -07:00
defiQUG
7312ae221c feat: update token list and Nginx configuration for Chain 138
- Added new compliant tokens including Tether EUR, Pound Sterling, and others to the DUAL_CHAIN_TOKEN_LIST.
- Updated version in the token list configuration to 1.2.
- Enhanced Nginx configuration to support token-aggregation API and serve token list and network configurations from specified paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-03-04 02:00:15 -08:00
defiQUG
974687c723 chore: sync submodule state (parent ref update)
Made-with: Cursor
2026-03-02 12:14:13 -08:00