Appearance
HTTPS and remote access
PBXsight's web UI and API are served by the program itself on one port. Where it listens, and whether that traffic is encrypted, is up to you. This page explains the choices, how to set up HTTPS with each kind of certificate, how to put it behind a reverse proxy, and what the app does on its own to protect a browser session.
First step: decide who needs to reach the UI (below); for anything beyond this machine, turn on HTTPS.
Decide who can reach the UI
server.listen decides it:
| Value | Reachable from | Typical for |
|---|---|---|
127.0.0.1:8080 | this machine only | the plain binary's default; a workstation |
0.0.0.0:8080 | every interface of the machine | the packages' and Docker image's default: a VM a team uses |
10.0.0.20:8080 | that interface only | a machine with a public and a private interface: listen on the private one |
Everyone logs in either way (Users and roles). Firewall the port to the networks your users come from; see Ports and firewall.
Know what's at risk over plain HTTP
Over HTTP the login password and the session cookie cross the network unencrypted. Anyone who can read that traffic (same Wi-Fi, a compromised switch, a VPN's far side — a VPN encrypts only up to its gateway) can take over the session, and with an operator's or admin's session, start load tests.
PBXsight says so in three places: a warning in its log at start (the UI is reachable from the network over plain HTTP: passwords and session cookies travel unencrypted) when it listens beyond localhost without HTTPS or a trusted proxy; a warning on the login and setup pages for a remote user over HTTP; and Account → Session → Connection (not encrypted (HTTP over the network)).
Plain HTTP is a reasonable choice on a trusted management network. Otherwise use HTTPS.
Turn on HTTPS
yaml
server:
listen: "0.0.0.0:8080"
tls:
enabled: true
cert_file: "/etc/pbxsight/tls/pbxsight.crt" # both empty = self-signed
key_file: "/etc/pbxsight/tls/pbxsight.key"
allowed_hosts: ["pbxsight.example.com"]HTTPS replaces HTTP on the same port (there's no second port and no redirect): users then open https://pbxsight.example.com:8080. TLS 1.2 is the minimum. Session cookies get the Secure flag. Set both cert_file and key_file, or neither. Restart the app after any change (sudo systemctl restart pbxsight, docker compose up -d).
Three ways to get a certificate, from best to simplest:
Use a certificate from your company's CA (recommended)
Browsers trust a certificate only when it comes from an authority they already know, for the exact name in the address bar. Most companies run an internal certificate authority (e.g. Active Directory Certificate Services, or the one IT uses for intranet sites) whose root is already installed on every company computer. A certificate from it means a padlock and nothing to install for anyone.
Pick the name people will open, e.g.
pbxsight.example.com, and add a DNS record pointing to the machine (or use its IP address).Ask IT for a server certificate for that name: subject alternative name = the DNS name (and/or the IP), extended key usage server authentication. You get the certificate in PEM format — append the intermediate CA certificates to it (the server sends the whole chain) — and its private key.
Install the files readable by the app's user only, e.g. for the packages:
shsudo install -d -m 0750 -o root -g pbxsight /etc/pbxsight/tls sudo install -m 0640 -o root -g pbxsight pbxsight.crt pbxsight.key /etc/pbxsight/tls/The service can read
/etc/pbxsight(its unit only blocks writes there). In Docker, mount the files into the container read-only, readable by UID 65532.Configure
server.tls.enabled: true,cert_file,key_file, and add the name toserver.allowed_hosts; restart.Check the log: https certificate file=… expires=… sha256=…. The app warns at start when the certificate expires within 14 days; renew it with IT, replace the files and restart.
A certificate from a public CA for a real domain works the same way.
Use your own certificate files
Any PEM certificate (chain) and private key the app can load work: from your own small CA, from an ACME client that runs on the host (PBXsight has no built-in Let's Encrypt), or from a certificate management tool. Same steps 3–5.
Use a self-signed certificate (no files)
With tls.enabled: true and no files, the app creates a self-signed certificate next to the database (tls-selfsigned.crt and tls-selfsigned.key; packages and Docker: /var/lib/pbxsight/):
- ECDSA P-256, valid 825 days (the longest browsers accept);
- valid for
localhost, the machine's host name, every interface address, thelistenaddress and every name inserver.allowed_hosts; - recreated at start when it expires within 30 days or a name or address is missing (e.g. after adding to
allowed_hosts) — so the fingerprint changes then.
Every browser warns until the certificate is trusted. The app logs its fingerprint at every start:
https certificate (self-signed) file=/var/lib/pbxsight/tls-selfsigned.crt sha256=3A:F1:…:9C names=localhost,pbxsight-vmBefore accepting the warning, compare that SHA-256 with the one the browser shows (click the warning → certificate details). If they match, nobody is in between. To stop the warning on one computer, trust the certificate there:
- macOS:
security add-trusted-cert -r trustRoot -k ~/Library/Keychains/login.keychain-db tls-selfsigned.crt, then restart the browser; - Windows: open the file → Install Certificate → Local Machine or Current User → Trusted Root Certification Authorities;
- Linux (system store, used by Chrome on many distributions): copy it to
/usr/local/share/ca-certificates/pbxsight.crtand runsudo update-ca-certificates(Debian/Ubuntu), or to/etc/pki/ca-trust/source/anchors/andsudo update-ca-trust(RHEL family); - Firefox has its own store: Settings → Privacy & Security → Certificates → View Certificates → Authorities → Import.
Repeat when the app replaces the certificate. With more than a couple of users, a company CA certificate saves everyone this step.
Put it behind a reverse proxy
A reverse proxy (nginx, Caddy, Traefik, HAProxy) can terminate HTTPS in front of PBXsight — useful if you already run one with certificates. Then:
- Let PBXsight listen on localhost (
server.listen: "127.0.0.1:8080"), or firewall its port so only the proxy reaches it. - List the proxy in
server.trusted_proxies(IPs or CIDRs;127.0.0.1when it runs on the same host). Only from these addresses does PBXsight believeX-Forwarded-For(the client address in the activity log and the failed-login limit: read from the right, the first address that isn't a listed proxy — list every proxy of a chain) andX-Forwarded-Proto: https(theSecurecookie flag, and no plain-HTTP warning). - Pass the original
Hostheader and add the public name toserver.allowed_hosts. PBXsight compares the browser'sOriginwithHostfor every change; a proxy that replacesHostwith the upstream address makes every change fail with cross-origin request refused. - Proxy WebSockets on
/ws(live updates every second).
nginx example:
nginx
server {
listen 443 ssl;
server_name pbxsight.example.com;
ssl_certificate /etc/nginx/tls/pbxsight.crt;
ssl_certificate_key /etc/nginx/tls/pbxsight.key;
client_max_body_size 16m; # extension-set CSV uploads (up to 10 MB)
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; # /ws
proxy_set_header Connection $http_connection;
proxy_read_timeout 1h;
}
}yaml
server:
listen: "127.0.0.1:8080"
allowed_hosts: ["pbxsight.example.com"]
trusted_proxies: ["127.0.0.1"]Caddy (pbxsight.example.com { reverse_proxy 127.0.0.1:8080 }) keeps Host, sets the forwarded headers and proxies WebSockets by default.
A request that came through a proxy never counts as "from this machine", so creating the first admin through it needs the setup token.
Built-in browser protections
These are always on; nothing to configure except allowed_hosts.
CSRF and DNS-rebinding protection
- Host check (DNS rebinding). A malicious website could point its own name at
127.0.0.1and make your browser talk to a local PBXsight. So PBXsight answers only requests whoseHostislocalhost, an IP address, or a name inserver.allowed_hosts; anything else gets403host … not allowed (add it to server.allowed_hosts). If you open the UI by a host name, that name must be listed. - Cross-site requests (CSRF). Another site open in the same browser could try to send a request that starts a test. Every request that changes something (anything but
GET,HEAD,OPTIONS) is refused when the browser marks it cross-site (Sec-Fetch-Site: cross-site) or when itsOriginisn't the app's own, and its body must be JSON or multipart — which a plain HTML form from another site can't send. Scripts andcurlsend noOriginand are not affected beyond the content type. - The session cookie is
SameSite=LaxandHttpOnly.
Security headers
Every response carries X-Frame-Options: DENY and Content-Security-Policy: frame-ancestors 'none' (the UI can't be framed by another site, so its buttons can't be clickjacked), X-Content-Type-Options: nosniff and Referrer-Policy: same-origin.
PBXsight doesn't send Strict-Transport-Security; add it at your reverse proxy if you want browsers to insist on HTTPS.