Table of Contents
Quick Start
The shortest path from nothing to a working Folio site, with one build node and a first project imported, built and installable with apt. Each step says which computer it runs on and as which user, and links to the full guide for the details. If a step does not give what it says you should see, follow its link.
The pieces
your own computer
(your SSH and GPG keys; you are the owner)
|
| folio COMMAND (over ssh, signed)
v
+-------------------+ import +-------------------------------+
| forge | -------> | the server: the Folio site |
| forge.example.org | | dur.example.org, /srv/folio |
| your projects, in | | the door: ssh, user "folio" |
| public git | <------- | the web: pages, apt archive |
| repositories | write +-------------------------------+
+-------------------+ back ^ |
| (optional) | ssh: take a build, | https
| fetch source | hand in the result v
v | visitors:
+-------------------+ | browsers, apt
| build node | -------------+
| user "builder" |
+-------------------+
| Piece | What it is |
|---|---|
| forge | a Forgejo or Gitea that holds your projects as git repositories. Folio only reads them (and, if you want, writes its own copies back) |
| the site | the Folio installation on your server. It imports projects, keeps every fact in its record (a git repository with one signed commit per change), and writes the website and the signed apt archive as plain files |
| the door | the only way to change the site, over ssh. There are no web logins or passwords. Your SSH key says which account comes in, and every change is a request signed with that account's GPG key. The folio command (package folio-client) makes and signs the request; plain ssh folio@dur.example.org COMMAND can only look |
| build node | a computer, or another user on the server, that asks the site for work, builds the package in a throwaway system, and hands it back |
| visitors | anyone with a browser or apt. They only read files |
You need four places to run commands. They can be fewer computers: the build node can be another user on the server, and Folio can be built on the server.
| Name in the steps | What it is |
|---|---|
| your computer | where your SSH key and GPG key are. You give the site commands from here |
| the build computer | any Devuan computer where you build Folio's packages |
| the server | a Devuan server reachable as dur.example.org, where you can use sudo |
| the node | the build node: a Devuan computer, or the server itself, with a user builder |
The steps
-
Build the packages. The build computer, as yourself, with
sudo. Use the same Devuan release as the server.sudo apt install build-essential debhelper pkg-config libgtk2.0-dev git gnupg openssh-client git clone https://forge.example.org/you/folio.git cd folio make test dpkg-buildpackage -us -uc -bmake testshould end withpassed: NUMBER failed: 0. One folder up you now havefolio-server_0.1_amd64.deb,folio-node_0.1_all.deb,folio-client_0.1_all.debandfolio-desktop_0.1_amd64.deb. (amd64is the build computer's processor type; on another type the server and desktop packages are named after it. The node and client packages are_all: they are only shell scripts, so one file installs on any processor type.) (Part 1) -
Make your two keys. Your computer, as yourself, with
sudo. Copyfolio-client_0.1_all.debthere first. It holds thefoliocommand, which signs your changes, andfolio-mykeys, which makes the keys.sudo apt install ./folio-client_0.1_all.deb folio-mykeys folio-mykeys export > me.ascfolio-mykeysmakes what you do not have yet: an SSH key (~/.ssh/id_ed25519), which lets you in, and a GPG key, which signs every change you ask the site for. It asks before it makes each one, asks for your name and e-mail address (they go into the GPG key), and asks once for a passphrase, which then locks both keys. The files ending in.puband.ascare the public halves, which you hand out; the private halves never leave your computer. (Owner Install Guide)Then make the site's own key, on this computer, where its master stays:
folio-site-key --home ~/dur-site-key init DURIt asks for a passphrase for the master, and writes a bundle (
folio-key-init-DATE.bundle) with the public key and the two signing keys the server gets. Copy~/dur-site-keyto two USB sticks. (Owner Install Guide) -
Point the name at the server. Your DNS and firewall. The name
dur.example.orgmust lead to the server, and ports 80, 443 and the SSH port must be open. Folio cannot do this for you. -
Install the server. The server, as yourself, with
sudo. Copyfolio-server_0.1_amd64.deb, your~/.ssh/id_ed25519.pub, yourme.ascand the bundle to the server first (for example withscp). Then:sudo apt install ./folio-server_0.1_amd64.deb nginx reprepro fcgiwrap cron sudo /usr/lib/folio/folio-installfolio-installmakes the userfolio, the site's signer (the userfolio-sign, which holds the signing keys), the site in/srv/foliowith you as its owner, and the settings for sshd, nginx, sudo and the timed jobs. It asks questions; press Enter for each suggestion except:Question Answer Go on without them? [Y/n]Enter (the missing one is the mail program, which can wait) The owner's public key file:the full path of the id_ed25519.pubyou copiedThe owner's GPG public key file:the full path of the me.ascyou copied. The site is not made without itThe site's key bundle:the full path of the bundle you copied Its name, as the pages show ityour site's name, for example Devuan User RepositoryA short form of the name, for page titlesfor example DURIts web addresshttps://dur.example.orgWhat people give to ssh to reach itfolio@dur.example.orgThe forge's SSH address to write to, ...ssh://git@forge.example.org/youfor the site to write itself to your forge from its first build on, or-to leave it for later (Forge Setup, parts B and C)The fingerprint you compared (SHA256:...), ...asked after the setup shows the forge server's key. Compare it with what the forge's server itself says (on it: ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub, or ask its administrator) and type it only if they are the sameWhen it is added, press Enter ...add the key the setup printed on the forge first (as a deploy key with write access on two new empty repositories dur-recordanddur-site, or under your account's SSH / GPG Keys), then Enter. The setup checks that the site may write thereThe account's web address on the forge ...https://forge.example.org/youfor the forge's package list, or-The file with the token, or paste the token ...a forge token with package: Read and Write (on the forge: Settings, Applications), from a file or pasted; it is not shown certbot, files or frontcertbotif the server is on the internet (installcertbot python3-certbot-nginxfirst);frontif another server in front of this one does https. A Folio site is always served over httpsIt ends with
== Done, the command to try next, and the fingerprints of the server's SSH keys (also on the site's home page, and inhttps://dur.example.org/ssh-host-keys). (Part 2) -
Check the door and the website. Your computer, as yourself.
ssh folio@dur.example.org whoamissh shows the fingerprint of the server's key and asks whether to trust it. Answer
yesif it is one of thosefolio-installprinted at the end. You should see your account name,role: ownerand apgp:line with your GPG key's fingerprint. Plain ssh like this only looks. Then openhttps://dur.example.org/in a browser: the home page is there, with no packages. If ssh asks for a password, or the browser shows "Welcome to nginx", see What the guided setup cannot do. -
Tell the folio command where the site is. Your computer, as yourself.
folio --add-site dur --ssh folio@dur.example.org --port 22 --web https://dur.example.orgduris the site's short name on your computer.--webis needed:foliofetches the site's SSH keys fromhttps://dur.example.org/ssh-host-keysthe first time, and trusts no others. More options may follow:--keynames your SSH private key (for example~/.ssh/id_ed25519), if not the usual one; given the.pubfile,foliouses the private key file beside it and says so. The private key never leaves your computer.--pgpnames the GPG key to sign with by its fingerprint. Without--pgp,foliosigns with the keyfolio-mykeysmade (it is named in~/.config/folio/pgp). A site whose https certificate comes from a certificate authority of its own also needs--ca FILE --ca-sha256 FINGERPRINT(see the Member Guide). The desktop program writes the same settings when you click Site..., Add... there. Check it:folio whoamiThe first time,
foliosaysfolio: the site's SSH keys were fetched from https://dur.example.org/ssh-host-keys and kept in ..., and then you should see the same as with ssh. From now on, every command that changes something is given asfolio COMMAND: the site takes a change only as a request signed with your GPG key, so a stolen SSH key alone changes nothing.gpg-agentasks for your GPG key's passphrase when it signs. -
Install the build node. The node, as yourself, with
sudo. Copyfolio-node_0.1_all.debthere first.sudo apt install ./folio-node_0.1_all.deb sudo adduser builder grep builder /etc/subuid /etc/subgidThe
grepshould show one line from each file. If it shows none, see the Build Node Guide. -
Make the node's keys. The node, as
builder. An SSH key lets it in; a GPG key of its own signs every claim and result it sends. Both have no passphrase, because the node runs unattended (Build Node Guide says why that is acceptable for a node).ssh-keygen -t ed25519 -N "" -f ~/.ssh/folio-node mkdir -m 700 ~/.folio-node-gnupg GNUPGHOME=~/.folio-node-gnupg gpg --batch --passphrase '' \ --quick-gen-key "build node node1 <node@dur.example.org>" ed25519 sign 2y GNUPGHOME=~/.folio-node-gnupg gpg --armor --export >~/folio-node.asc GNUPGHOME=~/.folio-node-gnupg gpg --with-colons --list-keys | grep -m 1 '^fpr' | cut -d: -f10 mkdir -p ~/.config/folio-nodeThe last
gpgline prints the GPG key's fingerprint.Then write the file
~/.config/folio-node/site:ssh = folio@dur.example.org port = 22 key = /home/builder/.ssh/folio-node web = https://dur.example.org pgp = FINGERPRINT gnupg = /home/builder/.folio-node-gnupg site-key-fpr = SITE-FINGERPRINTThe
webline is the site's pages: the node fetches the site's SSH keys from there, over https, before it connects, and trusts no other.pgpis the fingerprint the lastgpgline printed.site-key-fpris the site's own key: the fingerprint the site's home page shows (andsudo -u folio /usr/lib/folio/folio-key showon the server, asThe site's key:). Without it the node builds nothing. Copy~/.ssh/folio-node.puband~/folio-node.ascto your computer. -
Let the node in. Your computer, as the owner.
cat folio-node.pub folio-node.asc | folio admin node add node1You should see
The build node node1 may come in (it builds for: amd64), and signs with the GPG key FINGERPRINT.(Build Node Guide) -
Put a project on the forge. The forge, in a browser, then your computer. The repository must be public, and the project must say how it is built (a
Makefile,meson.build,CMakeLists.txt, aconfigurescript, orpyproject.toml). On the forge, +, New Repository, leave "Initialize repository" unticked.A new site imports only signed commits, checked against the GPG key your account has (the one you gave at install). So, in the project's folder, first have git sign with that key:
folio-mykeys showprints the twogit configlines that do it; run them. Then sign the newest commit and send the project:git commit --amend -S --no-edit git push ssh://git@forge.example.org/you/PROJECT.git HEAD:masterTo take unsigned commits instead:
folio admin set signatures. (Forge Setup, A1, Member Guide) -
Have the site import it. Your computer, as the owner.
folio watch https://forge.example.org/youThe site imports every public repository of the account
you, and looks again every two minutes. You should see a linePROJECT VERSION accepted: a new package, and you are its maintainer.A project that could not be imported showsPROJECT: not imported:and the reason. To import one repository only, usefollow https://forge.example.org/you/PROJECT.gitinstead. (Forge Setup, A2) -
Build it. The node, as
builder.folio-node onceThe first build takes a few minutes longer while the node makes its throwaway system. You should see a line ending
build N: succeeded. A build that endswaiting (...)needs a package the site has not published yet, and is queued again when it is; one that endsfailed (...)cannot be built as it is, for the reason in brackets (the Build Node Guide says what each means). The site queues one build per release, so keep the node running to do the rest:folio-node run -
Install the package. Any Devuan computer, with
sudo. Your own projects are in the reviewed part,main, and are published as soon as they are built.curl --proto '=https' -fsSLO https://dur.example.org/apt/setup.sh sudo sh setup.sh sudo apt install PROJECTsetup.shchecks the site's key, adds the archive to apt and installs the site's keyring package, which apt keeps up to date; apt then checks every package list against that key. (Public Guide)
What is left
The site works. Before others rely on it:
| What | Where |
|---|---|
| Have the site write its record, pages and packages back to the forge, if you left it out during the setup | Forge Setup, parts B and C |
| Mail notifications | Owner Install Guide, Part 4 |
Keep the master's folder (~/dur-site-key) safe on your own computer; renew the signing keys each year there (folio-site-key renew) and bring each bundle to the server |
Owner and Administrator Guide |
Backups, made as root and encrypted (--encrypt-to), of /srv/folio/private and the signer's keys, which the forge never gets |
Backup and Restore |
| Let other people in | Owner and Administrator Guide |
| Start the node with its computer | Build Node Guide |
Using a site
Setting one up
Running one
- Owner and Administrator Guide
- Backup and Restore
- Settings Reference
- Command Reference
- Troubleshooting
Checking one