Server Setup
This project is ran on our Debian server, but this setup should work on any Debian-based server.
1. Install system dependencies
This project requires rsync for syncing the documentation from repos, and nginx for routing, and then node for running the framework.
$ sudo apt update
$ sudo apt install -y git curl rsync nginxUse the NodeSource repo for Node.js 22:
$ curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
$ sudo apt install -y nodejsYou can verify the correct version matches what this project requires:
$ node --version # v22.x.xThen we need the pnpm package manager:
$ npm install -g pnpm2. Clone the repo
$ git clone https://github.com/TrickfireRobotics/docs.git /home/trickfire/docs
$ cd /home/trickfire/docs3. Install dependencies and build
$ pnpm install --frozen-lockfile
$ pnpm site:buildThe first build takes 1–2 minutes. Subsequent builds are faster due to pnpm's cache.
4. Configure nginx
The sites-available/sites-enabled directories are not created automatically on all distros. Create them if missing, then copy the config and enable it:
$ sudo mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled
$ sudo cp /home/trickfire/docs/scripts/nginx.conf /etc/nginx/sites-available/trickfire-docs
$ sudo ln -s /etc/nginx/sites-available/trickfire-docs /etc/nginx/sites-enabled/trickfire-docsMake sure /etc/nginx/nginx.conf includes the sites-enabled directory inside its http {} block. Check with:
$ grep -n "sites-enabled" /etc/nginx/nginx.confIf nothing is returned, add this line inside the http {} block:
include /etc/nginx/sites-enabled/*;nginx runs as www-data and cannot traverse /home/trickfire by default. Grant execute permission:
$ sudo chmod o+x /home/trickfireThen test and reload:
$ sudo nginx -t
$ sudo nginx -s reloadThe config serves out/ on localhost:80. The Cloudflare tunnel (set up next) is what exposes this to the internet, nginx itself only listens on localhost.
5. Verify the server
$ curl -I http://localhost/
# HTTP/1.1 200 OKUpdating the server
The scripts/build.sh script handles updates automatically. To run it manually:
$ bash /home/trickfire/docs/scripts/build.shThis pulls the latest framework code, updates dependencies if the lockfile changed, and rebuilds the site. Content in content/ is untouched (it's gitignored).