Where can I host a board file?
Anywhere that serves the file over https, lets other websites read it, and does not cache it for long. A storage bucket, a public GitHub repository or a web server you already run will all do.
What the host has to do
The board file is read by the browser on your monitor, from a page on fluxglow.com. That puts three requirements on wherever the file lives:
- https. Browsers will not let an https page read a plain http address.
- Cross-site reads. The response must carry the header
Access-Control-Allow-Origin: *, or namehttps://fluxglow.comin place of the star. - No long caching.
Cache-Control: no-cacheis the safe setting. A file cached for an hour is a board that is an hour old.
The choices
| Host | Updates show | Notes |
|---|---|---|
| Amazon S3, Google Cloud Storage, Cloudflare R2, Azure Blob Storage | At once | Needs a CORS rule and public read on the file. Costs pennies, or nothing, for one small file. |
| A public GitHub repository, read at its raw address | Within five minutes | Free and needs no settings. See the GitHub Actions example. |
| GitHub Pages | After the next Pages deploy | Allows cross-site reads as it comes. Suits a file that changes a few times a day. |
| A web server you already run | At once | Two headers in the server's configuration. |
Amazon S3
Give the bucket a CORS rule, once:
{
"CORSRules": [
{
"AllowedOrigins": ["https://fluxglow.com"],
"AllowedMethods": ["GET"],
"AllowedHeaders": ["*"]
}
]
}aws s3api put-bucket-cors --bucket your-bucket --cors-configuration file://cors.jsonThen upload the file whenever it changes:
aws s3 cp board.json s3://your-bucket/board.json \
--content-type application/json --cache-control no-cacheThe file also has to be readable without signing in, which is set in the bucket's permissions. Its address is then https://your-bucket.s3.amazonaws.com/board.json.
Google Cloud Storage
[
{
"origin": ["https://fluxglow.com"],
"method": ["GET"],
"responseHeader": ["Content-Type"],
"maxAgeSeconds": 300
}
]gcloud storage buckets update gs://your-bucket --cors-file=cors.json
gcloud storage cp board.json gs://your-bucket/board.json --cache-control=no-cacheWith public read on the object, its address is https://storage.googleapis.com/your-bucket/board.json.
A public GitHub repository
Commit the file and read it at its raw address:
https://raw.githubusercontent.com/OWNER/REPO/BRANCH/board.jsonGitHub adds the cross-site header itself. It also caches each file for five minutes, which is fine for a nightly job and too slow for a deploy you are watching.
Your own web server
location = /board.json {
add_header Access-Control-Allow-Origin "*";
add_header Cache-Control "no-cache";
}example.com {
root * /var/www/html
file_server
header /board.json {
Access-Control-Allow-Origin "*"
Cache-Control "no-cache"
}
}Check it before you hang the screen
curl -sI -H "Origin: https://fluxglow.com" https://example.com/board.jsonLook for access-control-allow-origin in what comes back. If it is missing, the board will say it can't reach the board file. Sending the Origin header matters, because some hosts only add the cross-site header when they are asked by a browser.
Anyone with the address can read it
The file is public by nature. Keep secrets out of it, and see what FluxGlow can and cannot see for hosting it inside your own network.
Related questions
-
Why does my board say it can't reach the board file?
Nearly always because the server holding the file does not allow other websites to read it. The fix is one response header on the file: Access-Control-Allow-Origin.
-
How do I show GitHub Actions status on a wall monitor?
Add one job to the end of your workflow. It turns the result of each job into a board file and pushes it to a branch of the same repository, and FluxGlow reads the file from there. There are no secrets to set up and nothing else to host.
-
Can FluxGlow see what is on my board?
No. Your browser fetches the board file straight from wherever you host it and draws it on the spot. The contents of the file never pass through FluxGlow.