Commit graph

103 commits

Author SHA1 Message Date
Claude
360b6ce112
feat: structured data (JSON-LD) on name detail and pricing pages
Product schema on name pages with brand, offers, URL. BreadcrumbList
on pricing page. Triggers Google rich results and schema.org monitoring
alerts for brand sunrise names. Rate limit headers already provided
by api middleware group (X-RateLimit-Limit/Remaining).

Commit #103.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 13:04:57 +01:00
Claude
2ac5fc1e3d
feat: idempotency key middleware + sitemap.xml
IdempotencyKey middleware caches POST responses by Idempotency-Key
header for 24h. Prevents duplicate registrations from network retries.
Returns X-Idempotency-Replayed: true on cached responses.

Commit #102.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 13:00:41 +01:00
Claude
1a8adf46d5
feat: sitemap.xml with dynamic name pages for SEO
SitemapController generates XML sitemap with all static pages + all
registered name pages from chain. Cached 1 hour. 140+ name pages
make each registered brand discoverable by search engines.

Commit #101.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:59:22 +01:00
Claude
1e34701e71
feat: BelongsToWorkspace on NameClaim, DnsTicket, NameActivity
Multi-tenant scoping via CorePHP tenant package. workspace_id column
added to all three tables. Existing records backfilled to workspace 1
(Lethean CIC). workspaceContextRequired=false allows public API calls
without workspace context.

Commit #100.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:55:34 +01:00
Claude
d1873dbe09
feat: migrate all API routes to ApiRoutesRegistering
All 6 Mod modules now register API routes via ApiRoutesRegistering
instead of WebRoutesRegistering with CSRF hacks. The api middleware
group (ThrottleRequests + SubstituteBindings, no CSRF/session)
handles everything natively. Website/Api module simplified to just
metrics and homepage. fireApiRoutes() added to Web Boot.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:51:53 +01:00
Claude
aebb9b3d5d
feat: CorePHP packages integrated — tenant, commerce, api
Symlinked core-api, php-commerce, php-tenant into app/Core/.
All migrations ran (50 tables). Tenant feature seeder ran.
Workspace 'Lethean CIC' created with admin user Charon and
'Lethean Registrar' namespace. SetupWorkspace artisan command
for repeatable provisioning.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:44:43 +01:00
Claude
8f9c1f282e
feat: email notifications on claim approval + OG images for names
ClaimApproved mailable sent when admin approves a claim — dark
themed HTML email with name, next steps, and CTA links. Wrapped
in try/catch so email failure doesn't block approval.

Dynamic SVG OpenGraph images at /names/{name}/og.svg — shows name,
type badge (Registered/Reserved/Gateway/Available), and branding.
og:image meta tag added to name detail pages via @push('head').

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:20:43 +01:00
Claude
0241e1f4a6
feat: TestCase base class + test infrastructure
tests/TestCase.php bootstraps app via Core\Boot::app() with kernel
bootstrap. DatabaseTransactions for test isolation. PHPUnit config
with array cache/session. 12 tests written, unit tests pass.
HTTP endpoint tests need chain daemon mock to run standalone.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:17:54 +01:00
Claude
3f294340b2
feat: UpdateDnsRecords Action, Prometheus metrics, JSON validation
- UpdateDnsRecords Action: controller method now one-liner, all DNS
  logic in Action with activity logging and edit lock.
- Prometheus metrics at /v1/metrics: chain_height, alias_count,
  claims_pending, dns_tickets, gateways_live. Grafana-ready.
- ValidateJsonRequest middleware: enforces application/json on POST,
  64KB body size limit. Applied to all /v1/* API routes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:12:07 +01:00
Claude
ad29a45507
feat: chain:stop command + DNS update activity logging
chain:stop sends SIGTERM and waits for graceful shutdown.
DNS updateRecords now logs 'dns_updated' activity with ticket_id
and records. Claim approve/reject also logged in previous commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:09:19 +01:00
Claude
3f82c497fd
feat: claim approval/rejection API endpoints
POST /v1/names/claims/{id}/approve — changes status, logs activity.
POST /v1/names/claims/{id}/reject — changes status, logs activity.
Both require auth.api middleware. Validates claim exists and is pending.
Completes the claim lifecycle: submit → review → approve/reject.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:07:38 +01:00
Claude
1ef6ed1c7b
refactor: move DNS tickets from Cache to DnsTicket database model
DNS change tickets now persisted in MariaDB via DnsTicket model.
Survives cache clears and container rebuilds. Model has open(),
confirm(), fail() methods and pending/queued scopes. Controller
updateRecords and ticket endpoints refactored. RetryDnsTickets
command queries model instead of cache.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:06:00 +01:00
Claude
309599c429
feat: test suite for Names API endpoints
13 tests covering CheckAvailability, SubmitClaim, NameClaim model
scopes, NameActivity logging, and HTTP endpoints. PHPUnit config
added. Tests need TestCase base class setup to run — framework
testing infrastructure TBD.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:51:28 +01:00
Claude
6af0d7ea73
feat: API Resources for consistent JSON formatting
NameResource transforms alias data with parsed type, capabilities,
and owner_type (registry/community). ClaimResource formats claim
responses. Lookup endpoint uses NameResource, claim uses ClaimResource
with additional message. Follows CorePHP patterns/building-rest-apis.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:49:19 +01:00
Claude
14f4d1fdc0
feat: activity logging for name operations
NameActivity model with log() static method. Stores event, name,
properties (JSON), and hashed IP (GDPR). SubmitClaim action now
logs 'claimed' event. Ready for dns_updated, registered, etc.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:46:31 +01:00
Claude
113b228fee
feat: ServiceDefinition for Chain and Names modules
ChainService (code=chain, no deps) and NamesService (code=names,
depends on chain). Ready for CorePHP service registry discovery
when core-api package is installed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:44:39 +01:00
Claude
9a36b836a7
feat: schedule DNS ticket retry every minute via ConsoleBooting
RetryDnsTickets command now scheduled everyMinute with
withoutOverlapping. Runs via supervisor scheduler in the container.
Queued DNS changes retry automatically without manual intervention.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:43:54 +01:00
Claude
b4e4766e01
feat: HealthCheckable interface on DaemonRpc and WalletRpc
Services implement healthCheck() returning {status, detail, stale?}.
Status page refactored to use healthCheck() instead of ad-hoc checks.
Statuses: healthy, degraded (stale data), unhealthy (unreachable).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:43:01 +01:00
Claude
924e8e223f
fix: switch from SQLite to MariaDB for production
Database now uses native MariaDB (lthn_io database). Container
connects via host.docker.internal:3306. Claims persisted in proper
RDBMS that survives container rebuilds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:39:13 +01:00
Claude
faa0d89e8d
fix: SQLite database path in container + create on build
Container was using host path for SQLite. Now creates database.sqlite
during Docker build and sets DB_DATABASE=/app/database/database.sqlite
in compose env. Migrations run on startup via laravel-entrypoint.sh.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:36:08 +01:00
Claude
f60f0803da
fix: status page handles wallet RPC unreachable gracefully
WalletRpc::getBalance() can throw when wallet is on localhost and
app runs in Docker. Wrapped in try/catch so status page degrades
gracefully instead of 500ing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:34:07 +01:00
Claude
4f72d62146
feat: Octane domain middleware + fix catch-all route conflicts
DomainScope middleware checks Host header per-request — Octane-safe.
Applied to Api homepage (scoped to api.lthn.io). Explorer and Docs
subdomain routes stay disabled — catch-all routes like /{section}/{page?}
match before middleware runs, breaking other routes. These modules
need own containers for proper domain isolation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:31:19 +01:00
Claude
41a13e6ef4
refactor: extract ChainDaemon and ChainWallet interface contracts
DaemonRpc implements ChainDaemon, WalletRpc implements ChainWallet.
Interfaces bound in FrameworkBooted — enables mocking for tests and
swapping to Go wrapper when go-process is ready. Concrete bindings
kept for backwards compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:26:25 +01:00
Claude
ca11c4ccee
refactor: extract Actions for CheckAvailability, SubmitClaim, RegisterName
CorePHP Actions pattern — single-purpose classes with static ::run().
Controller methods now delegate to Actions. Each Action validates,
executes, and returns typed results. Enables reuse from commands,
jobs, and tests without going through HTTP.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:24:27 +01:00
Claude
2b91476cf7
refactor: move pre-registration claims from Cache to database model
Claims stored in Cache were lost on cache clear. Now persisted in
name_claims SQLite table via NameClaim Eloquent model. Auto-generates
claim_id via random_bytes. Scopes: pending(), approved(). Methods:
approve(), reject(). Status page updated to query model.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:21:58 +01:00
Claude
9b1a062f2e
fix: revert @cspnonce — Headers Boot not registering directive
The @cspnonce Blade directive isn't available (Headers module not
loading). Reverted to plain <script>/<style> tags. unsafe-inline
in CSP config handles security. Nonces re-added when Headers Boot
is properly integrated.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:14:41 +01:00
Claude
7070d45e1c
fix: lthn.io running on FrankenPHP Octane via Docker
Container on noc-net network for Traefik DNS resolution.
Traefik routes to http://lthn-io:80. All pages serving 200.
Disabled Mod/Home (conflicting / route), disabled subdomain
Website modules (Octane can't scope routes by domain at boot).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:08:24 +01:00
Claude
b1227f08d3
fix: disable subdomain Website modules to fix Octane route conflicts
Explorer, Docs, Pool, Trade, Names subdomain Website modules had
routes at root (/) that conflicted with the Lethean homepage when
registered unconditionally (required for Octane). Disabled subdomain
routes — Mod modules handle prefixed paths (/explorer, /names etc).

Container now serves all 10+ pages correctly on FrankenPHP Octane.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:06:02 +01:00
Claude
32d64561b2
fix: Octane compatibility — unconditional route registration
Octane registers routes once at startup when $_SERVER['HTTP_HOST']
is not available. All Website modules now register routes without
domain checks. Pool/Trade/Names subdomain routes disabled (views
not built). Home module disabled (Lethean handles homepage).

Container now serves 200 on FrankenPHP Octane.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:03:03 +01:00
Claude
5d38d09c3a
wip: FrankenPHP container setup (Octane + Supervisor)
Dockerfile from hostuk (FrankenPHP 1-php8.5), stripped scorer binary.
Supervisor config simplified for lthn.io (no horizon/reverb).
Octane + Predis installed. docker-compose.yml with Traefik labels,
host.docker.internal for daemon/wallet/LNS access, file cache.

TODO: Fix view namespace resolution inside container (localhost
doesn't match Lethean $domains). Need to add localhost to Lethean
$domains or test with proper Host header.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:54:20 +01:00
Claude
9286f84020
feat: chain:start and chain:status artisan commands
CorePHP manages the testnet chain binaries via ConsoleBooting lifecycle.
chain:start checks if daemon/wallet are running, starts them if not,
waits for RPC readiness. chain:status shows daemon height, aliases,
PoS status, wallet and LNS node state. Config-driven paths for
binary locations, data dirs, mining address.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:39:24 +01:00
Claude
c89bee8e51
feat: add FrankenPHP + Octane Dockerfile and docker-compose
Copied production-quality Dockerfile from hostuk (FrankenPHP 1-php8.5,
Octane, Supervisor, Redis). Added docker-compose.yml with Traefik
labels for lthn.io, api.lthn.io, docs.lthn.io, explorer.lthn.io.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:36:42 +01:00
Claude
8a21996add
security: add CSP nonce attributes to inline scripts and styles
Added @cspnonce to all inline <script> and <style> tags in layout,
explorer, and register views. Enabled nonce generation in headers
config. unsafe-inline kept as fallback. Nonces will activate after
container restart when the Headers Boot registers the Blade directive.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:22:38 +01:00
Claude
a04c5a226d
refactor: move Chain Boot singletons to FrameworkBooted
DaemonRpc, WalletRpc singletons and config now register in
FrameworkBooted instead of WebRoutesRegistering. Per CorePHP docs,
service registration belongs in FrameworkBooted. Controller DI
resolves lazily so singletons don't need to exist during route
registration. Verified health endpoint still works.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:19:52 +01:00
Claude
63447cba2a
docs: 23 additional content pages for docs.lthn.io
Complete documentation across all 6 sections:
- Getting Started (4): introduction, quick-start, registration, dns-management
- Chain (5): overview, daemon-rpc, wallet-rpc, mining, aliases, hardforks
- Names (4): overview, registration, dns-records, sunrise, sidechain
- Services (4): dns-hosting, ssl-certificates, proxy-network, gateway-operators
- API (6): overview, names, explorer, proxy, gateway, authentication
- Governance (3): cic, wallet-holders, economics

28 markdown pages total, covering the full Lethean ecosystem.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:15:18 +01:00
Claude
0bc44d483d
feat: Website/Docs module for docs.lthn.io
Full documentation site with sidebar navigation, search, markdown
rendering, and prev/next navigation. Initial content: introduction,
chain overview, name system, API reference, CIC governance.

Lethean Boot.php now only registers routes on matching domains
(lthn.io, testnet.lthn.io, localhost) — no longer bleeds onto
api.*, docs.*, explorer.* subdomains.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:07:21 +01:00
Claude
6ebb8407a2
refactor: adopt CorePHP patterns in Pool, Trade, Names Website modules
All three Website modules now use $event->routes() with domain-scoped
routing. On their subdomain (e.g. pool.lthn.io): routes serve at root.
On lthn.io: the Mod modules handle the prefixed paths (/pool, /trade,
/names). Removed loadViewsFrom from boot() where views are already
registered by the corresponding Mod modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:58:38 +01:00
Claude
c1402cade5
refactor: Website/Explorer uses $event->routes() and domain-scoped routing
On explorer.lthn.io: routes serve at root (/). On lthn.io: Mod/Explorer
handles the /explorer prefix. Adopted CorePHP $event->routes() pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:57:23 +01:00
Claude
712a5c56b7
fix: exclude Lethean web routes from api.* domains
Lethean module now checks HTTP_HOST and skips route registration on
api.* domains. This lets the Website/Api module's homepage route win
on api.lthn.io. Also migrated to $event->routes() pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:55:23 +01:00
Claude
c0ab4aa27b
fix: update API URLs for production domain separation
Widget.js default API URL changed to api.lthn.io. API docs page "Try"
links now use configurable API_URL. Base URL display is dynamic.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:50:37 +01:00
Claude
07051071a4
feat: Sunrise Fast Track — $49 BTC to skip verification queue
Adds paid fast-track option to sunrise page, reserved name detail
pages, and pricing table. Links to Blesta order form for BTCPay
payment. Three clear paths: free DNS verification, free manual
verification, or $49 BTC fast track with immediate registration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:46:20 +01:00
Claude
d83c9094cd
refactor: move /v1/* API routes exclusively to Website/Api module
Production stack has honeypot that null-routes API payloads sent to
the web domain. API routes now only register via Website/Api module
(api.lthn.io). Mod modules stripped to web-only routes. Frontend JS
fetch calls use configurable API_URL for cross-origin API access.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:36:59 +01:00
Claude
6b2032c687
fix: exclude API routes from CSRF validation
POST endpoints on /v1/* were returning 419 CSRF mismatch because
$event->routes() wraps routes in the web middleware group which
includes ValidateCsrfToken. External clients (Blesta, curl) can't
send CSRF tokens. withoutMiddleware() on /v1/* prefixes fixes this.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:26:54 +01:00
Claude
45ad7f3858
fix: publish CSP config with unsafe-inline for inline styles/scripts
The $event->routes() pattern applies SecurityHeaders middleware which
sets CSP. Inline <style> and <script> tags in Blade views need
unsafe-inline to render. Published config from framework with fix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:22:04 +01:00
Claude
01533975a7
fix: add 'Why' link to navigation bar
The Why Lethean page (/about) existed but was unreachable from the nav.
CTOs need to find the CIC governance and positioning page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:16:37 +01:00
Claude
646fb0602f
refactor: adopt CorePHP lifecycle event patterns in all Mod modules
All 6 Mod modules now use $event->routes() and $event->views() instead
of raw Route:: and app('view')-> calls. Service singletons moved to
FrameworkBooted where appropriate. Website/Api module added for
api.lthn.io domain with proper DomainResolving.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 09:13:34 +01:00
Claude
f1b741da49
feat(names): enrich name detail pages with DNS records + services
Name detail pages now show DNS records from sidechain, ITNS sidechain
registration, services links (DNS/SSL/Proxy), and CIC governance label
for community members. Available names link to claim page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:47:20 +01:00
Claude
db24961a0f
docs: add claim endpoints + 5 missing explorer endpoints to /docs
API reference now covers all 29 endpoints across Names (13), Proxy (5),
Gateway (4), and Explorer (7). All GET endpoints verified returning 200.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:35:08 +01:00
Claude
774e9be207
feat: /status page with live system health checks
Shows blockchain daemon, wallet, gateways, name registry, and consensus
status with green/amber indicators. Chain stats, hardfork status, and
gateway details. Footer link added.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:33:14 +01:00
Claude
1f31444171
feat(names): pre-registration claim system for soft launch
Adds claim/listClaims endpoints so visitors can reserve .lthn names
before chain registration is fully automated. Claims are stored with
email for notification when approved. Admin endpoint lists all claims.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:30:23 +01:00