Table of Contents
- Owner Install Guide
Owner Install Guide
This guide takes you from nothing to a working Folio site: the packages built, the server set up, a build node building, and mail if you want it. Do the parts in order. Each part says which computer it runs on, as which user, what the guided setup does for you, and what you must do yourself.
For the shortest path, without the explanations, see the Quick Start. Allow an hour for a first install.
Words used on this page
| Word | What it is |
|---|---|
| forge | a server that keeps git repositories, such as a Forgejo or a Gitea. Your projects live there; the site only reads them |
| site | the Folio installation on your server: one folder, /srv/folio, that holds everything the site knows and offers |
| the record | the site's memory: small text files in /srv/folio/record, kept as a git repository, with one signed commit per change |
| the door | how anyone reaches the site's commands: over SSH, to the user folio. sshd runs one fixed program for that user, and that program knows whose key came in. Plain ssh folio@dur.example.org COMMAND can only look; a change must come as a request signed with your GPG key |
| the folio command | the program folio, from the package folio-client, that sends a change as a signed request: folio COMMAND. The desktop program does the same with buttons |
| owner | the one account nobody else can change, and the only one that can hand the site over. You, after this install |
| build node | a computer, or another user on a computer, that asks the site for work, builds packages and hands them back. The site builds nothing itself |
| apt archive | the folder of packages and signed package lists that apt installs from, at https://dur.example.org/apt/ |
| the site's key | the site's own GnuPG key. You make it on your own computer (folio-site-key init), and its master stays there; the server gets only the two signing keys under it, one that signs the apt archive's lists and one that signs every commit in the record |
| timed jobs | the lines in /etc/cron.d/folio that import new commits, look after the site's signing key, write to the forge and send mail |
How It Works explains each of these in full.
What you end up with
- A website at
https://dur.example.org, made only of files. - The door at
folio@dur.example.org: plain ssh to look, thefoliocommand (or the desktop program) for every change, signed with your GPG key. - A signed apt archive at
https://dur.example.org/apt/. - At least one build node that builds the packages.
- The site importing projects from your forge and, if you want, writing its record, pages and packages back to it.
What you need before you start
| You need | Why |
|---|---|
A server running Devuan (excalibur or newer), where you can use sudo |
the site runs here |
A name for the server that others can reach, for example dur.example.org |
people, browsers and apt use it |
| Ports open to the outside: 80 and 443 (web), and the server's SSH port | visitors use the web; everyone who takes part comes in over SSH |
| An account on a forge (Forgejo or Gitea) | your projects live there |
| An SSH key of your own, on your own computer | you are the site's owner, and the site knows you by that key |
| A GPG key of your own, on your own computer | every change you make is a request signed with it. The site is not made without it |
| A second computer, or a second user account, for building | builds never run as the site's user |
| Optional, for the site to write itself to the forge during the setup: see the next table | the setup asks for it; it can also be done later (Forge Setup, parts B and C) |
For publishing to the forge, have these at hand (the setup asks for
them in its step 5; answer - to any to leave it for later):
- The forge's SSH address to write to, up to your account:
ssh://git@forge.example.org/you, or with another SSH portssh://git@forge.example.org:2222/you. It is the address git pushes to over SSH, without a repository's name. - The fingerprint of the forge server's SSH host key, from the forge's
server itself. The setup fetches the key over the network and shows
its fingerprint; you compare it with this one and type it to confirm.
Get it in a way that does not pass through that network: on the forge's
server,
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub, or for a Forgejo or Gitea with an SSH server of its own,ssh-keygen -lf DATA/ssh/gitea.ed25519.pubin its data folder, or from the forge's administrator. - A way to add a key on the forge, with the right to write: either you may create repositories and add deploy keys to them, or you may add SSH keys to the account. The setup shows the site's own key and waits while you add it.
- The account's web address on the forge, for its package list:
https://forge.example.org/you. - An access token of the forge that may write packages, made on the forge beforehand (on a Forgejo: Settings, Applications, Generate New Token, with package set to Read and Write and every other line at No Access). Save its one line in a file on the server that the setup can read, or paste it when asked (it is not shown).
Why two keys. The SSH key says which account came in. The GPG key says that this account's person asked for exactly this command. The site takes a change only when both agree, so a stolen SSH key alone changes nothing, and a stolen GPG key alone gets nobody in.
If you have no keys yet. Make both with folio-mykeys, which comes
with the package folio-client (Part 1 builds it). On your own
computer, as your ordinary user:
folio-mykeys
It shows the keys you have and offers to make what is missing: the SSH
key ~/.ssh/id_ed25519 (the private half, which you never give to
anyone) with ~/.ssh/id_ed25519.pub (the public half, which you hand
out), and a GPG key in your keyring, whose fingerprint it notes in
~/.config/folio/pgp. 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. Then write the GPG public key to
a file:
folio-mykeys export > me.asc
Without folio-mykeys, ssh-keygen -t ed25519 makes the SSH key, and
gpg --full-generate-key then gpg --armor --export YOUR-KEY > me.asc
the GPG key.
Part 1: Build the packages
Folio comes as source. This part turns it into four Debian packages.
Where: any Devuan computer, as your ordinary user (with sudo). It
need not be the server. Use the same Devuan release as the server:
folio-server and folio-desktop are compiled programs, and they depend
on the libraries of the release they were built on.
-
Install what building needs:
sudo apt install build-essential debhelper pkg-config libgtk2.0-dev git gnupg openssh-clientPackage Why build-essentialthe C compiler and makedebhelperthe tools that make Debian packages pkg-config,libgtk2.0-devfor the desktop program gitto fetch Folio, and for the tests gnupg,openssh-clientthe tests make keys with them -
Fetch Folio and test it:
git clone https://forge.example.org/you/folio.git cd folio make testmake testbuilds the page generator and the search program (both in C, with hardened compiler flags), runs the desktop program's checks and the fuzz inputs that once found a mistake, checks that the programs are built hardened, then makes a throwaway site and tries every command on it, the right way and the wrong. The last line should readpassed: NUMBER failed: 0. Lines starting(skipped: ...)say which tests need a program that is not installed (reprepro,python3,openssl); they are fine to leave.Further checks of the C code exist, for whoever changes it; none is needed for an install:
make analyze(GCC's static analyser),make cppcheck(needscppcheck),make test-asan(the tests with programs built to stop at a memory error), andmake fuzz-search,make fuzz-record,make fuzz-checksandmake fuzz-door-output(made-up input thrown at the search, at the generator's readers of the record, and at the desktop program's checks and its reading of the site's answers). -
Build the packages:
dpkg-buildpackage -us -uc -b-us -ucmeans "do not sign them";-bmeans "only the installable packages, no source package". -
Check: one folder up there are now four packages. Beside them are files that describe the build, and
-dbgsympackages for debugging, which you can ignore.File Install it on folio-server_0.1_amd64.debthe server folio-node_0.1_all.debeach build node folio-client_0.1_all.debthe computer of everyone who takes part: it holds the foliocommand, which signs and sends changes, andfolio-mykeys, which makes the keys. Yours toofolio-desktop_0.1_amd64.debthe computer of anyone who wants the desktop program (it needs folio-client)
Part 2: Install the server
This part makes the site. The guided setup, folio-install, does most of
the work and asks questions as it goes.
Where: first your own computer, then the server.
-
On your own computer: install
folio-client(every change you make to the site goes through it):sudo apt install ./folio-client_0.1_all.deb(Run it in the folder that holds the packages.)
-
On your own computer: make the site's key. Its master stays on this computer for good; the server gets only the two signing keys under it. A GnuPG folder of its own is best, on a computer that is seldom on a network:
folio-site-key --home ~/dur-site-key init DURDURis the site's short name (the guided setup asks for it again, in its step 5). It asks for a passphrase for the master, twice: choose a strong one, and keep it somewhere other than this computer. It is never stored. You should seeThe site's key is made: FINGERPRINT, a signing key thatsigns the apt archiveand one thatsigns the record, and the name of the bundle it wrote, for examplefolio-key-init-20261126-101500.bundle. The bundle holds the public key and the two signing keys, not the master. -
On your own computer: keep the master safe. Copy the folder
~/dur-site-key(it holds the master, and its revocation certificate inopenpgp-revocs.d) to two USB sticks, and keep them in two places. Every later change of the key is made there (Owner and Administrator Guide). Never copy that folder to the server. -
On your own computer: copy the server package, your SSH public key, your GPG public key and the bundle to the server, for example:
folio-mykeys export > me.asc scp folio-server_0.1_amd64.deb ~/.ssh/id_ed25519.pub me.asc folio-key-init-*.bundle you@dur.example.org:The files land in your home folder on the server.
-
On the server, as your own user, with
sudo: install the package and the programs it works with, in the folder where the files landed:sudo apt install ./folio-server_0.1_amd64.deb nginx reprepro fcgiwrap cronThe package brings
git,openssh-server,gnupg,dpkg-dev,curlandsudoby itself (sudofor the one rule by which the site asks its signer for a signature). The others are named here because each one switches something on:Program What Folio uses it for Without it nginxserves the pages and the apt archive no website reprepromakes the apt archive nothing can be installed with apt fcgiwrapruns the search program for nginx no search box cronruns the timed jobs no importing of new commits, no writing to the forge, no mail a mail program ( default-mta, ormsmtp-mta)hands notifications on no mail. Part 4 sets one up; it can wait -
On the server, as your own user, with
sudo: run the guided setup:sudo /usr/lib/folio/folio-installRun it with
sudofrom your own account, not from a root login: it suggests your user name as the owner's account name.It goes through eight numbered steps. Each starts with a line like
== 5. The siteand says what it did. It is safe to run again: a step whose result exists already says so and leaves it alone, and the files it wrote for sshd, nginx, cron and sudo are brought up to what this Folio writes, unless you changed them by hand (then it shows the difference: see Troubleshooting).A site whose nginx file was written by an older
folio-install(one that kept neither how https is provided nor a copy of what it wrote) is not left behind: the upgrade takes how https is provided from the file itself (your own certificate files, certbot, or a server in front), says what it took and keeps it in/var/lib/folio/installed/nginx-answers, and puts what this Folio writes beside your file as/etc/nginx/sites-available/folio.folio-new, with the difference shown. Your file is never written over. To take Folio's:sudo mv /etc/nginx/sites-available/folio.folio-new /etc/nginx/sites-available/folio sudo /usr/lib/folio/folio-install(the second run checks it with
nginx -tand reloads nginx). To keep yours, with what you need of Folio's copied in by hand:sudo rm /etc/nginx/sites-available/folio.folio-new. From then on upgrades compare cleanly. If certbot provides https, runcertbot --nginx -d HOST --redirectagain after taking Folio's file, so that certbot adds its lines to it. If the answers it took are wrong, correct them innginx-answersand runfolio-installagain. -
Answer its questions. They come in this order. Press Enter to take the suggestion shown in
[brackets].Step Question What to answer 1 Go on anyway? [Y/n]asked only if the system is not Devuan. Folio is made and tested for Devuan; elsewhere service names and paths may differ. nstops1 Go on without them? [Y/n]asked only if nginx,reprepro,fcgiwrapor a mail program (default-mta) is missing; the line above lists which.nstops, so you can install them first; Enter goes on5 The owner's public key file:the .pubfile you copied, with its full path, for example/home/you/id_ed25519.pub5 The owner's GPG public key file:the .ascfile you copied, with its full path, for example/home/you/me.asc. Every change to the site is signed with this key's secret half, which stays on your computer5 The site's key bundle:the bundle folio-site-key initwrote (item 2), with its full path, for example/home/you/folio-key-init-20261126-101500.bundle. Its signing keys go to the signer (the userfolio-sign); the userfoliogets only the public key5 Its name, as the pages show itfor example Devuan User Repository5 A short form of the name, for page titlesfor example DUR. It also names things outside the site: the setup then shows the word it makes of it,The site's word is dur: the forge repositories dur-record and dur-site, and the file folio-dur.list that setup.sh writes on people's computers.It also names the site's keyring package (dur-archive-keyring), which keeps that name afterwards. Choose it now and keep it5 Its web addressthe real one, with https://, for examplehttps://dur.example.org. An address that does not start withhttps://is refused5 What people give to ssh to reach itfolio@dur.example.org5 The SSH portthe port the server's sshd listens on: 22unless you changed it. This only tells the pages what to show; it does not change sshd5 The distribution it is forDevuan5 The releases it builds forthe release names, separated by spaces: daedalus excalibur freia ceres5 The additions, one per releasewhat is added to a version so that each release's build has a version of its own, written release=addition, for exampleexcalibur=+devuan6. ForDevuanwith exactly the four releases above there is a suggestion; take it. Otherwise write your own, or-for none5 Where build nodes get the distribution's own packagesthe distribution's package mirror. It must start with https://. ForDevuanthe suggestion ishttps://pkgmaster.devuan.org/merged; take it (pkgmaster.devuan.orghas a valid https certificate, where the round-robindeb.devuan.orgdoes not)5 A logo for the top of every page, about 40 pixels high (a file)Enter for the Devuan logo that comes with Folio; the full path of your own file ( .png,.svg,.ico,.jpg,.gifor.webp); ornone5 Colour the logo by the theme? (yes or no)asked for an .svglogo only.yesif it is drawn in one colour5 Words to show beside the logoasked if there is a logo. With the Devuan logo and a name that starts with Devuan, the suggestion is the rest of the name (User Repository). Your own words, ornone5 The emblem alone, as a one-colour .svg, for the home page (a file)shown large and faint behind the home page's opening. Enter for the Devuan emblem; your own .svg; ornone5 A favicon: the small picture on the browser's tab (a file)your own file ( .ico,.pngor.svg), or Enter for none (Folio's own small mark is then used)5 The owner's account nameyour name on the site: 3 to 32 characters, lower-case letters, digits, or . _ + -5 The owner's real name (may stay empty)as you like 5 The forge's SSH address to write to, up to the account (ssh://git@forge.example.org/you), or - for noneitem 1 of "For publishing to the forge" above, or -to leave the forge for later. An address git does not write to over SSH is refused and asked again5 The fingerprint you compared (SHA256:...), or - to leave the forge for laterthe setup has shown The forge's server shows this SSH host key:and a fingerprint. Compare it with item 2. Only if they are the same, type it (or paste it). A fingerprint the server did not show is refused with... is not the fingerprint of a key the forge's server showed; compare again.If they differ, answer-and find out why: someone may be between your server and the forge5 When it is added, press Enter to check that the site may write there (- to check later):the setup has printed the site's own key ( ssh-ed25519 ... folio-site-dur) and the two ways to add it. Add it on the forge first (see the next list), then press Enter. The setup checks with a push that sends nothing and says for each repositorythe site may write there.orthe site may NOT write there yet: ...5 Check again? [Y/n]asked when the site may not write there yet. Fix what the line above says, then Enter; ngoes on, and the site keeps trying by itself every two minutes5 The account's web address on the forge (https://forge.example.org/you), or - for noneitem 4 above, for the forge's package list, or -5 The file with the token, or paste the token (it is not shown; - for later):the full path of the file with the token (item 5; the user foliomust be able to read it), or the token itself. What you type is not shown7 certbot, files or frontwho provides https (a Folio site is always served over https; there is no plain-http option): see the next table. Pressing Enter does not switch https on by itself The step 5 questions come from
folio-setup, whichfolio-installruns as the userfolio. Every answer can also be given beforehand in the environment: see Settings Reference.At the end of step 5 the setup says how changes are made, and that the new site requires signed commits:
Every change is a request signed with the GPG key of the account that asks: the owner's is FINGERPRINT. Plain ssh can only look; changes are made with the folio command (package folio-client) or the desktop program, which sign them. Signed commits are required: a commit is imported only if it is signed with the PGP key of whoever imports it or of one of the package's maintainers (each sets theirs with: pgp set). An unsigned commit, or one signed with any other key, is refused, and "imports" says why. To turn this off: admin set signatures (with nothing after it); to turn it on again: admin set signatures required.Keep it on unless you have a reason not to: without it, whoever can push to a project's repository on the forge has the site import that push in its maintainer's name, and for an administrator's or the owner's package it is published in
mainwithout review.The forge, in step 5. If you gave the forge's SSH address and confirmed its key, the setup records both (the settings
publish-toandpublish-host-key, in the site's first change, which the site's key signs), keeps that key as the only one ssh trusts there, and saysThe forge's SSH host key SHA256:... is confirmed.It then prints the site's own key and how to add it on the forge:- The tight way, best on a forge you share: create the two
repositories, empty and public (
dur-recordanddur-site; on a Forgejo the + at the top right, New Repository, with "Initialize repository" left unticked); in each, Settings, Deploy Keys, Add Deploy Key, paste the key line and tick Enable write access. - Or the account way: your picture at the top right, Settings, SSH / GPG Keys, Add Key, and paste it there. The site may then write to every repository your account may.
With the package list's address and the token, it records
registry-toand keeps the token in/srv/folio/private/forge/registry-token, with that address, until the first sending hands it to the signer; it is never shown again, and sent to that package list alone (a new address needs the token again: Forge Setup, C3). After the site is made it sends to the forge once (The forge: the first sending., then whatadmin publish-nowwould say). What was left out is listed underThe forge, left for later (...), each with the command that does it later; with no forge at all the setup saysNo forge was given, so the site publishes to none for now.The commands of Forge Setup, parts B and C, work the same either way, to change any of it later. - The tight way, best on a forge you share: create the two
repositories, empty and public (
-
Choose how https is provided. In step 7 the setup asks who provides https. A Folio site is always served over https; there is no plain-http option. The suggestion is
front.Answer Use it when What you must have ready certbotthe server is on the internet under its name sudo apt install certbot python3-certbot-nginxbeforehand, the name pointing at the server, and ports 80 and 443 open. A free certificate is fetched, plain http is sent on to https, and browsers are told to keep to https for a year (Strict-Transport-Security). Withoutcertbotinstalled the setup stops withcertbot is not installed. If fetching fails, the site answers over plain http meanwhile and the setup prints the command to try again:certbot --nginx -d dur.example.org --redirectfilesyou already have a certificate the certificate file (with its chain, usually fullchain.pem) and its key file (usuallyprivkey.pem), on the server. The setup asks for both paths. Plain http is then sent on to https (at the site's own name), and browsers are told to keep to https for a yearfrontanother server in front of this one does https and passes requests on (a reverse proxy) that server, set up as in "What the guided setup cannot do", item 3. This server then answers plain http on port 80 only. It sends Strict-Transport-Securitytoo, which reaches browsers through the server in frontIn every case the site's nginx file also sends a
Permissions-Policythat allows no camera, microphone, position or other device, keeps the theme cookie to https (Secure; HttpOnly), has caches ask again each time for the apt archive's index,setup.shand the key (so that a change of keys reaches computers at once), and limits the search to 10 questions a second from one address (20 more at once) and 4 at the same time; more are answered429 Too Many Requests.The question is asked once, when the web server's file for the site is first written. To choose again later, on the server:
sudo rm /etc/nginx/sites-available/folio /etc/nginx/sites-enabled/folio sudo /usr/lib/folio/folio-install -
What you should see at the end:
== Done Try it, as the owner, from the owner's computer: ssh folio@dur.example.org whoami You should see the owner's account name and "role: owner". That only looks. Changes are signed with the owner's GPG key: install the package folio-client on the owner's computer and use the folio command (folio help), or the desktop program (folio-desktop). The first time, ssh shows the site's key: it must be one of these (also on the site's home page, and in https://dur.example.org/ssh-host-keys): SHA256:CVYpUBmHbjdlUaVvk8umRnNrjXGFe2lKBsY3sDS5+vs (ED25519) SHA256:4keUqiFcvVfWP3x8CvIuKn3UjoUaxKlVm0hE76wFp3c (ECDSA) SHA256:xcH0tnmmredXCgilcCzLkREter9Zx61CJl5ODnkjWUw (RSA) The site writes itself to the forge at ssh://git@forge.example.org/you (admin publish-now sends at once, and says how it went).(Without a forge the last line reads
The site writes itself to no forge yet: admin publish-to ADDRESS (the Forge Setup guide, part B).)(With an SSH port other than 22 the command reads
ssh -p PORT folio@dur.example.org whoami.) Note the fingerprints: they are your server's own.The site's SSH keys. In step 6 the setup publishes the server's SSH keys (sshd's
/etc/ssh/ssh_host_ed25519_key.pub,ssh_host_ecdsa_key.pubandssh_host_rsa_key.pub) beside the pages, as the filessh-host-keys, in the form ofknown_hosts:dur.example.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA...(
[dur.example.org]:2222 ssh-ed25519 ...with another SSH port than 22.) The page generator writes it again each time it writes the pages, from the files in/etc/ssh, which every user may read (the setup makes them so if they are not). The home page shows the fingerprints. Thefoliocommand, the desktop program and build nodes fetch this file over https and connect only to a server that shows one of these keys; without it they do not connect. The setup saysThe site's SSH keys are published beside its pages (ssh-host-keys):and lists them. If sshd has no keys yet, it saysPROBLEM: the site's SSH keys could not be publishedinstead: make them withsudo ssh-keygen -A, then run the setup again.If sshd uses keys from other files (
HostKeylines in/etc/ssh/sshd_config), or the door is a server other than this one, the published keys are not the ones people meet: make the files in/etc/sshthe right ones. -
On your own computer: check that the door lets you in:
ssh folio@dur.example.org whoamiThe first time, ssh shows the fingerprint of the server's key and asks whether to trust it. Answer
yesif it is one of those the setup printed. You should see your account name,role: owner, and on thepgp:line your GPG key's fingerprint. -
On your own computer: tell the
foliocommand where the site is (the desktop program writes the same settings when you click Site..., Add... there):folio --add-site dur --ssh folio@dur.example.org --port 22 --web https://dur.example.orgIt keeps them in
~/.config/folio/sites/dur, and the first site added is the one in use.foliosigns with the GPG key~/.config/folio/pgpnames, whichfolio-mykeyswrote when it made the key. If you made the key another way, choose it withfolio-mykeys use FINGERPRINT(or give it with--pgp FINGERPRINT). The first time,foliofetches the site's SSH keys from the web address over https and keeps them in~/.config/folio/trust/dur/hosts/; it trusts only those. If your site's certificate comes from a certificate authority of your own rather than a public one (filesabove, with a certificate you made), add--ca ca.crt --ca-sha256 FINGERPRINT, the fingerprint asopenssl x509 -in ca.crt -noout -fingerprint -sha256shows it, and give both to every member (see the Member Guide). Every setting is in Settings Reference.Check it with
folio whoami. The first time,foliosaysfolio: the site's SSH keys were fetched from https://dur.example.org/ssh-host-keys and kept in ..., then shows the same as plain ssh did.Try one change, a harmless one: it is signed (gpg-agent may ask for your key's passphrase) and sent.
folio admin set mail-from noreply@dur.example.orgYou should see
mail-from is now: noreply@dur.example.org. If it is refused, Troubleshooting lists each refusal with its cause.Then open
https://dur.example.org/in a browser. The site's home page is there, with no packages yet.
If the guided setup stops
| It says | Why, and what to do |
|---|---|
folio-install: run this as root (sudo ...) |
run it with sudo |
folio-install: these packages are needed first: apt install ... |
install the packages it names, then run it again |
folio-install: the owner's public key file is needed (FOLIO_OWNER_KEY=/path/to/key.pub) |
the file you named does not exist or cannot be read. Give the full path |
folio-install: the site's key bundle is needed (FOLIO_SITE_KEY=...) |
make it first, on your own computer: folio-site-key init NAME (Part 2, item 2), copy it over, and give its full path |
folio-install: FILE: that is not a key bundle (folio-site-key makes them, on the owner's computer) |
you named another file. Give the .bundle file folio-site-key init wrote |
folio-install: FILE: that bundle holds the site's master key, which never comes to a server. ... |
the file holds the master (an export of the whole key). Delete it on the server (shred -u FILE) and give the bundle folio-site-key init wrote |
folio-install: FILE is not the bundle folio-site-key init makes |
a bundle of a later change of the key. Give the one init wrote |
folio-install: sudo is needed ..., or the line these packages are needed first: apt install sudo |
install sudo; the site asks its signer for signatures through it |
folio-setup: ... does not hold an SSH public key (it must be the .pub file). A site needs an owner; nothing was made. |
you named the private key, or another file. Give the .pub file |
folio-install: the owner's GPG public key file is needed (FOLIO_OWNER_PGP=/path/to/key.asc): every change is signed with it |
the file you named for the GPG key does not exist or cannot be read. Give the full path of the .asc file (on your computer: folio-mykeys export > me.asc, then copy it over) |
folio-setup: the owner's GPG public key file cannot be read: 'FILE'. Every change to a site is signed with its account's own GPG key, so the owner needs one (folio-mykeys pgp makes one; folio-mykeys export prints its public key). Nothing was made. |
the same, when folio-setup is run by itself. Make the key and give its file |
folio-setup: FILE: that is not a PGP public key (gpg --armor --export YOUR-KEY). Nothing was made. |
the file is not an armored public key: perhaps the binary form, or another file. Export it again with folio-mykeys export > me.asc |
folio-setup: FILE: that is a private PGP key. It never leaves your computer: send the public key (folio-mykeys export, or gpg --armor --export). Nothing was made. |
you exported the secret key. Delete that copy from the server (shred -u FILE) and give the public key |
folio-setup: FILE: send exactly one PGP public key. Nothing was made. |
the file holds several keys. Export only yours: gpg --armor --export FINGERPRINT > me.asc |
folio-setup: an account name has 3 to 32 characters, or ... must be lower-case letters, digits or . _ + - |
choose another owner's account name |
folio-setup: the web address must start with https:// (http is not accepted): ADDRESS |
a Folio site is served over https only. Give the address with https:// |
folio-setup: the distribution mirror must start with https:// (http is not accepted): ADDRESS |
build nodes fetch the distribution's packages over https only. Give a mirror with a valid https certificate, such as https://pkgmaster.devuan.org/merged |
folio-setup: the SSH port must be a number |
give the port as digits, for example 22 |
folio-setup: FILE: a picture must be a .png, .svg, .ico, .jpg, .gif or .webp file; nothing was made |
a logo or favicon of another kind (a .bmp, say). Convert it, or answer none, then run it again |
folio-setup: the setup did not finish; what it had made was taken away again, so it can simply be run again |
a later step failed; the lines above say which. Every answer is checked before anything is written, and what a failed setup made is removed, so fix the cause and run folio-install again |
folio-setup: FOLIO_FORGE_SSH: give the place on the forge, as git writes there: ..., FOLIO_FORGE_HOST_KEY: a fingerprint looks like SHA256:..., FOLIO_FORGE_WEB: ... or FOLIO_FORGE_TOKEN_FILE: that does not look like an access token ... |
an answer given beforehand in the environment is not of the form it must have; nothing was made. Correct it (see Settings Reference) |
folio-install: FOLIO_FORGE_TOKEN_FILE names a file that cannot be read: FILE |
give the full path of the token's file |
PROBLEM: the SSH host key of the forge's server could not be fetched from HOST (port PORT), at any address that name has |
the setup does not stop for it. The address is wrong, the forge's server does not answer there, or a firewall is in between. n to Try again? leaves the forge for later |
PROBLEM: SHA256:... is not the fingerprint of a key the forge's server showed. Nothing is sent to that server |
with --yes: FOLIO_FORGE_HOST_KEY is not the key the server showed. The site is made, but publishes to no forge. Compare again; if the keys really differ, someone may be in between |
.../dur-record: the site may NOT write there yet: ... |
the site's key is not on the forge yet, or without the right to write, or the repository is missing. The site is made, and tries by itself every two minutes; fix it on the forge, then folio admin publish-now |
folio-install: certbot is not installed: ... |
install certbot python3-certbot-nginx, or answer another way, then run it again |
written, but nginx finds a mistake: run 'nginx -t' |
run sudo nginx -t and read what it says. Often nginx's example site is in the way: item 2 below |
/srv/folio/FILE is a symbolic link, or in a folder reached through one, which nothing there should be; nothing was written there (remove it, then run this again) |
a file root hands the user folio (the owner's keys, the site's public key, the token, a backup to restore) was a link before it was written: Folio never makes one there. Find out who made it, remove it, and run folio-install again |
folio-install: /srv/folio/private/forge/ITEM is not a plain file (a symbolic link?), so it was not taken; nothing was changed (with --migrate) |
the forge's key or token of an older site is a link: Folio never makes one. Find out who made it, put the real file there, and run it again |
What the guided setup did
| Step | What it made |
|---|---|
| 1 | nothing: it checked the system and listed what is missing |
| 2 | the system user folio, with no password, whose home is the site's folder /srv/folio |
| 3 | the site's signer: the system user folio-sign (no password, no shell), its folder /var/lib/folio-sign (its keys readable by it alone, its log sign.log by everyone), and /etc/sudoers.d/folio, the one rule by which folio runs /usr/lib/folio/folio-signer as folio-sign |
| 4 | /etc/folio/folio.conf, which tells Folio's programs where the site's folder is and how its signer is reached (see Settings Reference) |
| 5 | the site itself in /srv/folio: the record with you as its owner (your SSH key, and your GPG key as accounts/NAME/pgp.asc) and its settings (signatures = required among them), the site's public key (its signing keys went to the signer, in /var/lib/folio-sign/gnupg), the first pages, and the file of keys sshd lets in (/srv/folio/private/sshd/authorized_keys). If you named a forge: the settings publish-to, publish-host-key and registry-to, the forge's confirmed host key (/srv/folio/private/forge/known_hosts), the site's key for writing there (with the signer, /var/lib/folio-sign/forge/key), the token (handed to the signer at the first sending), and the first sending |
| 6 | /etc/ssh/sshd_config.d/folio.conf: the user folio comes in with keys only, from that file, and gets no terminal and no forwarding. Also the file ssh-host-keys beside the pages, with sshd's own keys |
| 7 | /etc/nginx/sites-available/folio, switched on with a link in sites-enabled |
| 8 | /etc/cron.d/folio: every two minutes, import new commits, look after the site's signing key (a mail to the owner when it is due to be renewed) and then write to the forge; every five minutes, send waiting mail |
What the guided setup cannot do
Each of these is yours. None is optional unless it says so.
-
Give the server its name. The name
dur.example.orgmust lead to the server (a DNS record), and the firewall must let in ports 80, 443 and the SSH port. The setup can neither see nor change either. -
Remove nginx's example site, if it is in the way. If the browser shows "Welcome to nginx" instead of your site, on the server:
sudo rm /etc/nginx/sites-enabled/default sudo service nginx reload -
Set up the server in front, if you answered
front. In that server's nginx, inside theserverblock for your site's name:add_header Strict-Transport-Security "max-age=31536000" always; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://ADDRESS-OF-THE-FOLIO-SERVER:80; }proxy_set_header Host $host;passes the site's name on, which the Folio server's nginx needs to pick the site and to make the theme links work.proxy_passnames the Folio server. The server in front should also send plain http on to https, and sendStrict-Transport-Securityitself (the line above), so that browsers keep to https for a year even if the Folio server's header did not reach them; the Folio server sends the same header, and two of them do no harm.Let nothing but the server in front reach port 80 of the Folio server (a firewall, or a private network between them): otherwise anyone can come in over plain http around it. The setup cannot know the front server's address, so its nginx file listens on every address.
The search's limit (10 questions a second, 4 at the same time) counts by address, and behind a server in front every visitor comes from that server's address: all of them share one limit. To count each visitor's own, have the server in front send
X-Real-IP(the line above), and on the Folio server put these two lines in/etc/nginx/conf.d/folio-real-ip.conf, with the front server's address:set_real_ip_from ADDRESS-OF-THE-FRONT-SERVER; real_ip_header X-Real-IP;then
sudo nginx -tandsudo service nginx reload. (Folio does not do this by itself:set_real_ip_frommust name the one server whose word is trusted, and only you know it. The file lives beside the site's own, so upgrades do not take the site's file for one changed by hand.) -
Check the search. On the server,
sudo service fcgiwrap statusshould say it is running; if not,sudo service fcgiwrap start. It must run aswww-data, as Devuan's fcgiwrap service does: the search refuses to run as root, asfolio, or asfolio-sign, the user that holds the signing keys, and answersThe search is not set up: it runs as a user it must not run as. The setup switches the search box on only iffcgiwrapwas installed when the site was made (it looks in/usr/sbintoo, so it is found even when the setup was started withsurather thansu -). If you installed it later, switch it on from your own computer:folio admin set search yes -
Check sshd. Step 6 writes its settings into
/etc/ssh/sshd_config.d/folio.conf. That works only if/etc/ssh/sshd_configreads that folder. If the setup printed aNOTEabout it, add this line at the top of/etc/ssh/sshd_config, then runsudo service ssh reload:Include /etc/ssh/sshd_config.d/*.confWithout it,
ssh folio@dur.example.orgasks for a password, which a Folio site never does. If step 6 saidPROBLEM: sshd will not start with its settings as they are., it also printed sshd's own complaint on the next line (It says: ...): fix that (on a fresh system it is often missing host keys:sudo ssh-keygen -A; or a mistake infolio.confafter an edit by hand), then runsudo /usr/lib/folio/folio-installagain. It keeps afolio.confyou changed by hand (and shows what it would write), but checks sshd's settings again, and when they are right sayssshd accepts its settings, and was told to read them again. -
Pointing the site at your projects on the forge. The setup can have the site write itself to the forge (step 5 above), but it does not import projects: Forge Setup, part A, covers that, and parts B and C cover changing the forge the site writes to, or setting it up later if you left it out. Part 5 below.
-
A build node. Nothing is built until one exists: Part 3 below.
-
Mail (optional): Part 4 below.
-
Keep the site's master key on your own computer. It was made there (step 2) and the server never had it. Every change of the key is made there and brought to the server as a bundle: see Owner and Administrator Guide. A site set up by an older Folio has its master on the server until you move it (the same guide, "Moving the master off a server of an older site").
-
Backups. The forge can get the record, the pages and the packages, but never
/srv/folio/private(mail addresses, where the key stands) nor the signer's folder/var/lib/folio-sign(the signing keys, the forge key and the token). See Backup and Restore. -
Let people in. Nobody but you has an account. See Owner and Administrator Guide.
Part 3: A build node
A build node asks the site for work over SSH, fetches the project's source from the forge, builds it in a throwaway system as an ordinary user, and hands the packages and the log back. It comes in with a key of its own, which can only take builds and hand in results. The node can be the same computer as the site, as long as it is another user.
The full steps, with checks and what to do when something goes wrong, are in the Build Node Guide. In short:
-
On the node, with
sudo: install the package. It bringssbuildand everything else a build needs.sudo apt install ./folio-node_0.1_all.deb -
On the node, with
sudo: make an ordinary user for the builds (this guide calls itbuilder), and check that it may make throwaway systems:sudo adduser builder grep builder /etc/subuid /etc/subgidYou should see one line from each file. If not, see the Build Node Guide, step 2.
-
On the node, as
builder: make the node's two keys, with no passphrase so it works with nobody at the keyboard: an SSH key, which lets it in, and a GPG key of its own, which signs every claim and result it sends: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 NAME <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: -f10The last line prints the GPG key's fingerprint, for step 5.
-
On your own computer, as the owner: copy
~/.ssh/folio-node.puband~/folio-node.ascfrom the node to your computer, and let the node in under a name of 3 to 32 characters, both keys on standard input:cat folio-node.pub folio-node.asc | folio admin node add NAMEYou should see
The build node NAME may come in (it builds for: amd64), and signs with the GPG key FINGERPRINT.(Letting a node in is a change, so it is signed with your GPG key. From then on the site takes the node's claims and results only signed with the node's GPG key; see the Build Node Guide.) -
On the node, as
builder: tell the node where the site is, in 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-gnupgThe node fetches the site's SSH keys from the
webaddress before it connects (see the Build Node Guide). -
On the node, as
builder: run one build to see that it works, then keep it running:folio-node once folio-node runWith nothing waiting,
folio-node oncesaysnothing to build. The Build Node Guide says how to start it with the computer.
The guided setup cannot do this. A node is a different computer or user, and letting it in is an administrator's decision.
Part 4: Mail (optional)
People can ask the site to mail them when something happens to their
packages. Every five minutes the timed job hands the waiting messages to
the system's sendmail command (/usr/sbin/sendmail). The server needs a
program that provides it. Without one, the messages wait for a week and
are then dropped.
If the server already runs a mail server, skip to step 4.
Otherwise the smallest way is msmtp, which passes mail on through an
account on a mail server you already use. On the server, with
sudo:
-
Install it:
sudo apt install msmtp-mtamsmtp-mtaprovides/usr/sbin/sendmail. -
Write
/etc/msmtprc, with your mail server's details:defaults auth on tls on account default host mail.example.org port 587 from noreply@dur.example.org user THE-ACCOUNT password THE-PASSWORD -
Protect it, since it holds a password. The timed job runs as the user
folio, so that group may read it:sudo chmod 640 /etc/msmtprc sudo chgrp folio /etc/msmtprc -
On your own computer: tell the site which address its mail comes from, if Part 2 did not. Without this it is
noreply@and the host of the site's web address, which your mail server may refuse:folio admin set mail-from noreply@dur.example.org -
On your own computer: try it with your own address:
folio mail set you@example.orgYou should see
A code is on its way to you@example.org. When it arrives: mail confirm CODE. Within five minutes a mail with the code should arrive. Confirm it:folio mail confirm CODEYou should see
Notifications now go to you@example.org. -
If no mail arrives: on the server, see what is waiting, and send it now to see any complaint:
sudo -u folio /usr/lib/folio/folio-mail --show sudo -u folio /usr/lib/folio/folio-mailfolio-mail: no mail program (/usr/sbin/sendmail); the messages waitmeans step 1 is missing.
The guided setup cannot do this. It does not know your mail server or its password.
Part 5: Point the site at your forge
Go on to Forge Setup, part A. When that is done, your projects are imported and built. If you named the forge in the guided setup's step 5, the site writes itself back to it already; otherwise parts B and C set that up.
Checking the whole thing
From your own computer, unless it says otherwise.
| Check | How | You should see |
|---|---|---|
| You are the owner | ssh folio@dur.example.org whoami |
role: owner |
| Your GPG key is set | ssh folio@dur.example.org request-info |
pgp: FINGERPRINT, your key's, and not pgp: none |
| Changes are signed and taken | folio admin set mail-from noreply@dur.example.org |
mail-from is now: noreply@dur.example.org, or, when it was set to that before, mail-from is that already; nothing to change. |
| The pages are served | open https://dur.example.org/ |
the home page |
| The search answers | type a word in the search box | a result page |
| A node is let in | ssh folio@dur.example.org nodes |
the node's name and enabled |
| Projects are imported | ssh folio@dur.example.org packages |
one line per project |
| What was turned down | ssh folio@dur.example.org imports |
Nothing was turned down., or one line per project with the reason |
| Builds happen | the Builds page, or ssh folio@dur.example.org builds |
builds going from queued to succeeded |
| The archive exists | open https://dur.example.org/apt/, once a first build was published |
dists/, pool/, setup.sh and the key files |
| The record's signatures hold | ssh folio@dur.example.org admin verify |
0 with a signature that does NOT hold |
| What the site is doing | on the server: sudo tail -f /srv/folio/private/activity.log |
each command as it arrives, and each refusal with its reason |
A site made before changes were signed
A site set up before every change had to be signed has accounts with no
GPG key, the owner's among them. Such an account can still look, but
each change it asks for is refused. Plain ssh gets
folio: your account has no GPG key: it can look, but every change must be signed with your own GPG key. ...;
the folio command stops before it sends anything, with
folio: your account there (NAME) has no GPG key, so it can only look. ...;
and whoami says
note: your account has no GPG key, so it can only look (see: help).
Nobody can set their own first key, because a stolen SSH key would then
be enough to do it. This is how the site gets its keys:
-
On the owner's computer: install
folio-client, make a GPG key if you have none, and write its public key to a file:sudo apt install ./folio-client_0.1_all.deb folio-mykeys pgp folio-mykeys export > me.ascCopy
me.ascto the server. -
On the server, as your own user, with
sudo: set it as the owner's key. The userfoliomust be able to read the file, so the first line puts a copy in the site's folder, owned byfolio:sudo install -o folio -g folio -m 644 /home/you/me.asc /srv/folio/me.asc sudo -u folio /usr/lib/folio/folio-setup --owner-pgp /srv/folio/me.asc /srv/folio sudo rm /srv/folio/me.ascYou should see
NAME's GPG key is now FINGERPRINT: the owner signs changes with it from now on.This is the one change made without a signed request: only the owner can reach the server. The record shows it asthe owner's GPG key, set on the server, signed with the site's key. While the site's signing key has run out or is revoked, the record takes no change, this one included: the setup then stops with that reason, and the key comes first (see Owner and Administrator Guide). -
On the owner's computer: add the site with
folio --add-site, as in Part 2, item 11. -
For each other account: the person makes a GPG key (
folio-mykeys pgp) and sends you its public key (folio-mykeys export > their-key.asc). You set it, signed with your own key:folio admin pgp NAME < their-key.ascYou should see
NAME's GPG key is now FINGERPRINT: changes are signed with it from now on.The person is mailed about it. Until their key is set, an account can look and nothing more. An administrator can do this step too, once their own key is set, for every account but the owner's. -
For each build node: a node let in before nodes had GPG keys has none, and the site takes neither its claims nor its results. Its builder makes it one, and the node's settings name it (the Build Node Guide, steps 3 and 5); you set it:
folio admin node key NAME < folio-node.ascYou should see
The build node NAME signs with the GPG key FINGERPRINT from now on.Builds handed in before are not published (rebuildthem). -
For each package followed before: its timed imports name no signed request that set them up, and
folio-auditreports them. A maintainer records one with a signed follow of the address it already has:folio follow URL NAME.
The same --owner-pgp step is how an owner who lost their GPG key, or
had it stolen, sets a new one: nobody else can change the owner's
account.
Removing it again
On the server:
sudo apt remove folio-server
sudo rm -rf /srv/folio /etc/folio /etc/ssh/sshd_config.d/folio.conf \
/etc/nginx/sites-enabled/folio /etc/nginx/sites-available/folio \
/etc/cron.d/folio /etc/sudoers.d/folio /var/lib/folio-sign \
/var/lib/folio
sudo userdel folio
sudo userdel folio-sign
sudo service ssh reload
sudo service nginx reload
This deletes the site, and the signing keys the signer held, for good.
The master stays on your own computer, but a new site made later starts
with a new key of its own (folio-site-key init), which every computer
that uses the archive would have to fetch again. Make a backup first if there is any chance you want it back (see
Backup and Restore).
Using a site
Setting one up
Running one
- Owner and Administrator Guide
- Backup and Restore
- Settings Reference
- Command Reference
- Troubleshooting
Checking one