Unofficial
On this page
  1. 01A web target
  2. 02The website project
  3. 03Edit, push, publish
  4. 04What a publish does

A website from Git: build at every push, publish to your NAS's web server

Bucket & Code Server IDE keeps a static website in a Git repository on your NAS. Its pages live in src/, a Makefile copies them into public/, and every push runs a link check on the NAS's own runner. One button copies public/ to a web server, such as QTS's Web Server on the same NAS, and reads the page back to prove it is there.

  1. Targeta folder and its address
  2. ProjectNew project, Static website
  3. Pushmake test at every push
  4. Publishpublic/ to the target

The pictures come from the panel of Bucket & Code Server IDE with each field filled in as this guide describes. The NAS is at 192.168.1.20 and the account is called ola.

01A web target

A web target is where a website goes: a folder of this NAS that a web server answers for, or an rclone remote such as your own server over SFTP, FTP, WebDAV or S3. QTS's Web Server (Control Panel → Applications → Web Server) answers for the Web share at http://<NAS address>/, so a folder in it is the simplest target.

  1. On the Publish page (an admin's, under Administration) press Add a target in the Web targets card.
  2. Choose A folder of this NAS, give it a Name, and type the Folder: a folder of its own inside a share, such as /share/Web/mysite. It is empty or new, never a whole share, and it stays outside the data folder.
  3. Type the Public address that serves it, here http://192.168.1.20/mysite/: with http:// or https://, without a user, a password, a query or a fragment. Press Add the target. Add a web target: A folder of this NAS chosen, Name My website, Folder /share/Web/mysite, Public address http://192.168.1.20/mysite/, and the Add the target button
  4. Pick the target in the list and press Test. It copies a small file into the folder, reads it back from the public address and deletes it. The Web targets card: My website, /share/Web/mysite, http://192.168.1.20/mysite/, last test answers; the test copied a file, read it back at the public address and deleted it

An rclone target names a remote of the backups' rclone.conf and a path on it, with the public address that serves that path.

02The website project

Open New project from the Git page or the command palette (developer role; the Publish step below is an admin's).

  1. Template: under Websites choose Static website. The Static website card, chosen: pages and assets in src/, a Makefile that copies them into public/, and a link check as make test
  2. Name and visibility: the name, for example mysite, names the repository and the folder projects/mysite. Leave it Private unless every account may read it. Name mysite, Owner ola, and the choice between Private and Public
  3. Build: leave Build right after creating on.
  4. Publish: turn on Publish to my web server and pick the target. Add a target here does the same as the Publish page. Publish to my web server turned on: copies public/ to a web target and reads index.html back over its public address; the target My website chosen
  5. Review, then Create project. The page follows each step: the repository and its first commit, the first build, and the publish. Creating the project: Forgejo repository and first commit, First build, and Publish to my web server, each done

The site answers at the target's public address:

The template's page in a browser: mysite, This page is src/index.html, and a link About this site

03Edit, push, publish

  • Edit the pages in src/ in the editor (the project is in its projects/ folder), commit and push. make copies src/ into public/; make test checks that every local href= and src= of the pages leads to a file of public/; make clean removes public/.
  • Every push runs the project's workflow on the NAS's runner while the CI module is on: make test in the Ubuntu 24.04 builder environment. A broken link fails the run. Forgejo's Actions tab: build.yml run 1 of the first commit, passed
  • The project's page (Projects, or the Editor's side bar) builds and publishes by hand: Build runs make, Rebuild runs make clean and then make, and Publish to My website (an admin's) sends public/ to the target. Publishing never runs by itself after a push. The project's steps: Build, built, with the target default: all, Build again and Rebuild; Publish to web, published to My website, with the Publish to My website button

04What a publish does

  • It makes the target folder hold the site and nothing else: a file the site no longer has is removed. bvsd marks the folder with a file .bvs-web-target the first time it writes there (the test does too); a folder that holds other files and not this one is refused, so a publish never empties a folder that is not the site's.
  • After the copy it reads index.html back from the public address and compares it byte for byte. When the address does not serve what was copied, the job fails with web_check: and both values: the folder is not the one the web server answers for, or the address is wrong.
  • A project that makes a QPKG publishes the same way: the newest .qpkg and its .sha256, checked by sha256.