fakeconsole

command
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0 Imports: 51 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command fakeconsole serves the fake NodeService used by the container smoke test (test/e2e). It is not part of any release artifact.

It publishes demo.test -> whoami:80 (cache everything for 60s) and sites that exercise the origin address policy:

loop.test       -> node:80 (the node itself: CDN-Loop answers 508)
forbidden.test  -> 127.0.0.1:80 (special-purpose literal: 502)
hidden.test     -> hidden:80 (DNS answer on a network outside the
                   allow list: 502)
tls-ok.test     -> https://console:8444, SNI origin.test (200)
tls-bad.test    -> https://console:8444, SNI wrong.test (502: the
                   certificate is only valid for origin.test)
ua.test, js.test, pow.test, captcha.test  Under Attack with cookie302,
                   js, pow and captcha (proofs of work of 8 bits),
                   passes of 5 minutes
cc.test         CC: 2 requests per second per address, 20 per second
                   for the site, 2 seconds to escalate, up to cookie302
compress.test   gzip, Brotli and Zstandard for text/plain (from 1 byte)
crs-detect.test OWASP CRS, detect only (every request logged)
crs-block.test  OWASP CRS, blocking, rule 942100 excluded (every
                   request logged)
tags.test       origin console:8082 (Cache-Tag from the query, see
                   serveTestOrigin)
keep.test       like tags.test, keeps Cache-Tag for clients
slice.test      like tags.test, Range slices
swr.test        like tags.test, cached 1 s, stale-while-revalidate 60 s
sie.test        like tags.test, cached 1 s, stale-if-error 60 s
pages.test      error pages for 403 and 503 that intercept origin errors
                   (every request logged)
dead.test       origin console:9 (nothing listens: 502)
aff.test        origins console:8082 and console:8083 with session
                   affinity (120 s), nothing cached
smap.test       origin console:8082, cache key separates devices (for
                   sitemap prefetches of both variants)
active.test     origins console:8082 and console:8083 with an active
                   health check of /health every 5 s (one result
                   changes the state), nothing cached
rules.test      rules-v2: origin console:8082, group "api" whoami:80;
                   a dynamic redirect with query edits (/old/), a
                   rewrite to the api group with its own Host
                   (/api/), a port override (/port/), config rules
                   (/slow read timeout 1 s, /sampled logged, /ws
                   without WebSocket, /guarded Under Attack), bulk
                   redirects and a cache rule condition with a browser
                   TTL (/img/); compress.test has compression rules
                   (/gz-only gzip, /no-compress none, /no-gzip config
                   gzip=false)
v3.test         rules-v3: origin whoami:80; computed request headers
                   (x-req = http.request.id, x-info = version, scheme,
                   port and User-Agent; x-bad from ?bad=, skipped when
                   invalid), two Link lines (append), x-cache-status,
                   x-ua-match for User-Agent *CURL*, a block for the
                   Cookie role=admin with a 403 page of {{time}} and
                   {{path}}, a 303 to /signin with a computed next=
                   and a redirect to ?to= (a value expression target)

The sites of HTTP/2 to origins and gRPC, and their origins, are in h2.go.

Every revision also carries the layer-4 applications of l4.go (their origins run in this container too).

The configuration names the offline hosts of disabled sites (old.test, *.gone.test), answered with the built-in page unless POST /disabled-page publishes the platform's page for them. The listeners are :80, :8081 (PROXY protocol) and :8443 (HTTPS, reached from this container for the health certificate checks).

Every revision carries three challenge keys (e2e-key-1..3, current e2e-key-2) that GetChallengeKeys hands out.

POST /g11 publishes the G11 sites (several certificates, client certificates, session ticket keys; g11.go), whose certificates and ticket keys GetCertificates and GetSessionTicketKeys hand out.

The HTTPS origin's certificate comes from a separate CA that is written to --origin-ca-out; the node trusts it through --trusted-ca.

The origin allow list is the network(s) of this container, which the node and whoami share, so the Docker-internal origins stay reachable without widening the default policy. A plain-HTTP helper API serves the test script:

GET /pin      internal CA pin (--ca-sha256)
GET /token    single-use enrollment token
GET /applied  "<applied_revision> <state>" from the last ReportStatus
GET /stats    number of uploaded MinuteStats buckets
GET /node-id  node id the console assigned
POST /purge-prefix?site=&host=&path=  queue a prefix purge task
GET /task-results  "<task id> <state> <error code>" per result
GET /origin-health  one line per origin with failures from the last
              ReportStatus: "<site> <origin> <code> <error>"
POST /publish publish a new revision adding site demo2.test
POST /update  update the existing demo2 site with an alias, without adding a site ID
POST /ban?cidr=&site=&ttl=  add a manual ban (platform scope without site);
              answers "<id> <sequence>"
POST /unban?id=  lift a ban; answers the sequence
GET /ban-status  "<applied_sequence> <entries> <unapplied> <kernel_entries>
              <kernel-ban-v1: yes|no>" from the last ReportStatus
GET /security-events  "<kind> <site> <level> <address> <metric>" per
              reported CC event
GET /security-state   "<site> <level> <escalated paths>" per site above
              normal in the last ReportStatus
POST /crs?enabled=false  publish the base sites without the OWASP CRS
              (enabled=true: with it again); answers the revision
POST /disabled-page?enabled=true  publish the base sites with the
              platform's page for disabled sites (enabled=false: the
              built-in page again); answers the revision
GET /features supported features of the last ReportStatus, one per line
GET /logs     "<site> <status> <path> <waf_blocked> <rule ids>" per
              uploaded access log ("-" when no rule matched)
GET /waf-rules "<site> <rule id> <requests>" per uploaded minute
GET /request-ids "<site> <status> <path> <request id>" per uploaded
              access log
POST /purge-tag?site=&tag=  queue a tag purge task; answers its id
POST /purge-host?site=&host=  queue a host purge task; answers its id
POST /sitemap?site=&url=&max=&variants=desktop,mobile  queue a sitemap
              prefetch task; answers its id
POST /prefetch?site=&url=  queue a prefetch task of one URL; answers its id
GET /task-result?id=  "<state> <error code> <succeeded> <failed>" of a
              reported task ("-" for no code)
POST /health?port=&status=  the status of the test origin's /health
GET /flaky?port=  how many requests the test origin saw at /flaky
GET /active-health  "<site> <origin> <healthy> <code>" per ACTIVE entry
              of the last ReportStatus ("-" for no code)
GET /tls-health?sni=&host=&path=  a TLS request to node:8443 with that
              SNI (none when empty): "<certificate CN> <status> <body>",
              or "handshake-failed <error>"
GET /probe-token  a new one-time probe token
POST /probe-node?enabled=  let the node probe (targets: node-peer at the
              node's address on :9 (closed), :80 HTTP and TCP, :8081
              HTTP with PROXY protocol, :8443 HTTPS, and node-e2e itself
              on :80; 5 s interval, 2 s timeout, 3 attempts) or stop it
GET /probe-results  the latest round of each prober: "<prober> <node>
              <method> <port> <sent> <lost> <rtt_ms> <error>" per result
GET /metrics  "<cpu %> <load1> <memory total> <memory used> <egress bps>
              <connections>" of the last ReportStatus

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL