Docs / Running yasp

Running a public demo

A demo install lets anyone look around a real yasp without an account: the status page, and the dashboard behind it. It's read-only, so visitors can't change anything or make the server send email or call other addresses.

# Turning it on

base_url = "https://demo.example.com"

[demo]
enabled = true

Then fill it with sample data:

yasp --config /etc/yasp/yasp.toml demo-seed

demo-seed adds monitors that check the yasp server itself, components with 90 days of history, a weekly maintenance window (so one is always coming up), two resolved incidents (one with a postmortem), incident templates, a second page in another theme, a private page (password demo), subscribers, alert channels and an on-call rotation. Every address is at example.com and the channels are switched off, so nothing is sent; don't give a demo install a mail server. It's safe to run again: what already exists is skipped.

# What visitors get

  • The sign-in page offers Explore the demo dashboard. It signs them in as a shared demo account with the admin role, so every screen opens, settings included.
  • Every change is refused. Saving a form sends them back where they were with "This is a read-only demo, so nothing was changed." Test now answers that tests are off. Only signing out goes through. A yellow bar on every dashboard screen says it's a demo.
  • Nothing that shows people or where messages go. The Users screen, the audit log and the subscribers list (and its CSV export) are left out, alert channels show no addresses, and the config export is off. Heartbeat and alert monitors show their push address with the token hidden, so nobody can push fake results to the public page.
  • Private pages treat demo visitors as anonymous: they get the page's own sign-in, like anyone else. The seeded partner page's password is demo.
  • Status pages carry a bar saying they're a demo, with a link to the dashboard. They take no subscriptions (email, Slack, Teams, webhook or browser push) and private pages send no sign-in emails.

# Use sample data only

A demo install is for sample data. Demo visitors can still read most of what's in it: monitor targets, components, incidents, templates, probes and settings. Don't put real services or customers on it, and don't turn [demo] on for an install you use.

You can still sign in to manage it: add [oidc], [saml] or [email_login] and the sign-in page shows them under or, if you run this yasp. Your changes are visible to visitors; your account isn't.

Turning [demo] off and restarting signs every demo visitor out. The demo account can never act as an admin once the demo is off.

# Behind Cloudflare or another proxy

Cloudflare in front of yasp needs SSL/TLS mode Full (strict): Flexible sends plain HTTP to yasp, which redirects it to HTTPS, and the browser loops. For the certificate on yasp's side, a Cloudflare origin certificate is the simplest: create one under SSL/TLS → Origin Server, save it and its key on the server, and point yasp at them:

[tls]
cert = "/etc/yasp/origin.pem"
key = "/etc/yasp/origin-key.pem"

Automatic certificates ([tls] acme_email) work too, as long as Cloudflare passes http://…/.well-known/acme-challenge/ requests through to yasp on port 80.

List the proxy's addresses in [server] trusted_proxies so rate limits see visitors' addresses rather than the proxy's.

# Deploying every release automatically

The demo workflow (.github/workflows/demo.yml) runs after each release and installs it on the demo server. It only tells the server which release to install. The server downloads it from GitHub, checks it against the release's SHA256SUMS, restarts yasp, waits for /readyz, and puts the previous binary back if the new one doesn't come up. Pre-releases (v1.2.3-rc.1) are skipped; run the workflow by hand to deploy any release.

On the server, once:

# the script the deploy key may run, and a user for the key
sudo install -m 755 deploy/demo/yasp-demo-deploy /usr/local/sbin/yasp-demo-deploy
sudo useradd --system --create-home --shell /bin/sh yasp-deploy
echo 'yasp-deploy ALL=(root) NOPASSWD: /usr/local/sbin/yasp-demo-deploy' \
  | sudo tee /etc/sudoers.d/yasp-demo-deploy && sudo chmod 440 /etc/sudoers.d/yasp-demo-deploy

# a key only the workflow has, limited to that script
ssh-keygen -t ed25519 -N '' -C 'yasp demo deploy' -f demo-deploy
sudo install -d -m 700 -o yasp-deploy -g yasp-deploy ~yasp-deploy/.ssh
echo "command=\"/usr/local/sbin/yasp-demo-deploy\",restrict $(cat demo-deploy.pub)" \
  | sudo tee ~yasp-deploy/.ssh/authorized_keys
sudo chown yasp-deploy: ~yasp-deploy/.ssh/authorized_keys && sudo chmod 600 ~yasp-deploy/.ssh/authorized_keys

If yasp doesn't answer on http://127.0.0.1:8080, put its ready address in /etc/yasp/deploy.env, e.g. YASP_READY_URL=https://127.0.0.1/readyz.

In GitHub, under Settings → Environments → New environment, create demo. Under Deployment branches and tags, allow only main: the workflow runs from main after a release, so nothing on another branch can reach the key. Then add:

NameValue
SecretDEMO_SSH_KEYthe contents of demo-deploy (then delete the file)
SecretDEMO_KNOWN_HOSTSthe output of ssh-keyscan -t ed25519 your.server
VariableDEMO_HOSTyasp-deploy@your.server
VariableDEMO_URLthe demo's public address, e.g. https://demo.example.com