# Security Broadwave is a server you run at home. It has no account password. With device sign-in off, which is the default, anything that can open port 8477 can use the web app and the API, so keep that port on your own network. ## Names the server answers to A request is refused when its name is a public DNS name the server was not given. That stops a web page from calling Broadwave by pointing the page's own name at your server's address. These names work without any extra setting: - An address, such as the one your router gave the computer. - A one-word name. - A name ending in `.local` or `.lan`, and the home names `.home.arpa`, `.fritz.box`, and `.attlocal.net`. Set `BROADWAVE_HOSTS` to any other name you use, comma-separated. A leading dot covers the subdomains of that name, such as `.example.com`. A browser that sends `Sec-Fetch-Site` is allowed on port 443, or when the name has no port. The check does not look at HTTPS. Any other public name needs `BROADWAVE_HOSTS`. The README lists the same rule under image options. A refused request answers with the name it saw, and tells you to set `BROADWAVE_HOSTS` to that name. ## Requests A page on another site cannot change the server. A request that changes something has to come from this server's own pages, or from an app that is not a browser. The live socket and the stream exports refuse a page on another site too. Plex, Jellyfin, Channels, and curl send no browser site header and are not affected. The tuner interface this server offers to other apps on port 8478 uses the same name check as the API. Responses carry `X-Content-Type-Options: nosniff`. The web app can still be framed, so a home dashboard can show it. ## Fetches Playlists, guides, artwork, scoreboards, and the release check use http or https. Other schemes are refused. Cloud metadata names and addresses are refused, however the address is written: decimal, hex, octal, IPv4-mapped, or NAT64. Redirects are checked the same way. Link-local addresses are refused for playlists, guides, and artwork. A tuner is allowed one, because a tuner with no DHCP server gives itself a 169.254 address. Private addresses (`10/8`, `172.16/12`, `192.168/16`, IPv6 ULA), loopback, and `.local` names work everywhere. When ffmpeg or ffprobe opens a URL, the input is limited to http, https, tcp, tls, and crypto. A remote playlist cannot hand either program a file on this machine. A recording on disk is still opened as a file. A playlist you add by its path on this machine is still read. ## Files A channel number from a playlist is cleaned before it becomes a recording's file name, so the file stays in the recordings folder. Show and season folders are cleaned the same way. Artwork, backups, and the library are served from ids and from names that stay inside their own folders. ## Size Each cap is far past real use and stops a file that never ends or a compression bomb: - A playlist, read or uploaded: 128 MB and 250,000 channels. A 30,000-channel playlist is about 15 MB. - A guide after it is unpacked: 512 MB. xz may use 256 MB while it unpacks. - A picture: 32 megapixels, and no side past 16,384. - A folder of videos: 200,000 files. - Event sockets: 128 at once. - Apps copying the broadcast through the exports or the tuner interface: 32 at once. People watching in Broadwave are not counted. - A recording you start: a day. Playlist text, guide XML, the tables inside a broadcast, and fMP4 fragments are read with their own caps. ## Secrets A password, token, secret, or key in a playlist or guide address, and a tuner `DeviceAuth`, are masked before they are shown or written to diagnostics, the device list, and the support bundle. The field name is matched in any case, and a password in an Xtream-style stream path (`/live///`) is masked too. A source saved before a field was masked still fetches with its login. Settings shows the guide address with its password removed, and saving that page keeps the stored password. ffmpeg's messages go through the same log filter. A failed tuner or artwork request does not repeat its address. ## What is stored Channels, the guide, recordings, and watch history stay in the database on the machine that runs Broadwave. The tuner's `DeviceAuth` value is read when a guide request needs it and is not written to the database or the log. A Schedules Direct password, a playlist password, and a guide or artwork key are stored so the server can refresh those sources. Settings does not show a saved password. The Schedules Direct password and the movie artwork key stay blank and say Saved, on the web and in the Apple apps. The TheSportsDB key field says Saved on the web and stays blank in the Apple apps. The log keeps those values out. ## Support bundle Settings calls the download "Download a support bundle". The hint under the button is "Logs, versions, and settings. Passwords are left out." The same zip is at `http://:8477/api/v1/support`. The zip holds `versions.json`, `doctor.json`, `config.json`, and `logs.txt`. Passwords, tuner credentials, and `DeviceAuth` are removed before the file is saved. ## Secure name on the home network The server gets its own HTTPS name, such as `lan.abcdefghij.direct.wolfeup.com`, with a Let's Encrypt certificate, and serves the same API and media on it with HTTP/2. Nothing is installed on the phone or the router. The apps use it when it answers and stay on the plain address when it does not. Over HTTP/2 live playlists carry a preload hint, so Apple players run low-latency HLS: on Apple TV about three seconds closer to live, and a channel starts sooner (`BROADWAVE_LL_HINTS=0` leaves the hint out). - **The name.** On first start the server makes an Ed25519 key, `direct/server.key` in the config folder (mode 0600, outside the catalog and its backups), and registers it with the direct service at `api.direct.wolfeup.com`. The service returns a random ten-letter label. Every later call is signed with that key over the method, path, time, and body, and must be within five minutes of the service's clock, so only this server can change its name. - **Addresses.** The server reports the home network address it routes from (and that interface's `fd00::/8` addresses). The service publishes only private ranges: `10/8`, `172.16/12`, `192.168/16`, `100.64/10`, and `fd00::/8`. A name under the service can never point at a public site. The record is DNS only, with a five-minute TTL. A new address is reported within five minutes, and the same one once a day. - **The certificate.** The server asks Let's Encrypt for `lan.