5 Quick Start
liquibyte edited this page 2026-11-27 14:59:02 -06:00

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

  1. 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 -b
    

    make test should end with passed: NUMBER failed: 0. One folder up you now have folio-server_0.1_amd64.deb, folio-node_0.1_all.deb, folio-client_0.1_all.deb and folio-desktop_0.1_amd64.deb. (amd64 is 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)

  2. Make your two keys. Your computer, as yourself, with sudo. Copy folio-client_0.1_all.deb there first. It holds the folio command, which signs your changes, and folio-mykeys, which makes the keys.

    sudo apt install ./folio-client_0.1_all.deb
    folio-mykeys
    folio-mykeys export > me.asc
    

    folio-mykeys makes 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 .pub and .asc are 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 DUR
    

    It 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-key to two USB sticks. (Owner Install Guide)

  3. Point the name at the server. Your DNS and firewall. The name dur.example.org must lead to the server, and ports 80, 443 and the SSH port must be open. Folio cannot do this for you.

  4. Install the server. The server, as yourself, with sudo. Copy folio-server_0.1_amd64.deb, your ~/.ssh/id_ed25519.pub, your me.asc and the bundle to the server first (for example with scp). Then:

    sudo apt install ./folio-server_0.1_amd64.deb nginx reprepro fcgiwrap cron
    sudo /usr/lib/folio/folio-install
    

    folio-install makes the user folio, the site's signer (the user folio-sign, which holds the signing keys), the site in /srv/folio with 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.pub you copied
    The owner's GPG public key file: the full path of the me.asc you copied. The site is not made without it
    The site's key bundle: the full path of the bundle you copied
    Its name, as the pages show it your site's name, for example Devuan User Repository
    A short form of the name, for page titles for example DUR
    Its web address https://dur.example.org
    What people give to ssh to reach it folio@dur.example.org
    The forge's SSH address to write to, ... ssh://git@forge.example.org/you for 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 same
    When 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-record and dur-site, or under your account's SSH / GPG Keys), then Enter. The setup checks that the site may write there
    The account's web address on the forge ... https://forge.example.org/you for 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 front certbot if the server is on the internet (install certbot python3-certbot-nginx first); front if another server in front of this one does https. A Folio site is always served over https

    It 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 in https://dur.example.org/ssh-host-keys). (Part 2)

  5. Check the door and the website. Your computer, as yourself.

    ssh folio@dur.example.org whoami
    

    ssh shows the fingerprint of the server's key and asks whether to trust it. Answer yes if it is one of those folio-install printed at the end. You should see your account name, role: owner and a pgp: line with your GPG key's fingerprint. Plain ssh like this only looks. Then open https://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.

  6. 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.org
    

    dur is the site's short name on your computer. --web is needed: folio fetches the site's SSH keys from https://dur.example.org/ssh-host-keys the first time, and trusts no others. More options may follow: --key names your SSH private key (for example ~/.ssh/id_ed25519), if not the usual one; given the .pub file, folio uses the private key file beside it and says so. The private key never leaves your computer. --pgp names the GPG key to sign with by its fingerprint. Without --pgp, folio signs with the key folio-mykeys made (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 whoami
    

    The first time, folio says folio: 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 as folio COMMAND: the site takes a change only as a request signed with your GPG key, so a stolen SSH key alone changes nothing. gpg-agent asks for your GPG key's passphrase when it signs.

  7. Install the build node. The node, as yourself, with sudo. Copy folio-node_0.1_all.deb there first.

    sudo apt install ./folio-node_0.1_all.deb
    sudo adduser builder
    grep builder /etc/subuid /etc/subgid
    

    The grep should show one line from each file. If it shows none, see the Build Node Guide.

  8. 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-node
    

    The last gpg line 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-FINGERPRINT
    

    The web line is the site's pages: the node fetches the site's SSH keys from there, over https, before it connects, and trusts no other. pgp is the fingerprint the last gpg line printed. site-key-fpr is the site's own key: the fingerprint the site's home page shows (and sudo -u folio /usr/lib/folio/folio-key show on the server, as The site's key:). Without it the node builds nothing. Copy ~/.ssh/folio-node.pub and ~/folio-node.asc to your computer.

  9. Let the node in. Your computer, as the owner.

    cat folio-node.pub folio-node.asc | folio admin node add node1
    

    You should see The build node node1 may come in (it builds for: amd64), and signs with the GPG key FINGERPRINT. (Build Node Guide)

  10. 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, a configure script, or pyproject.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 show prints the two git config lines 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:master
    

    To take unsigned commits instead: folio admin set signatures. (Forge Setup, A1, Member Guide)

  11. Have the site import it. Your computer, as the owner.

    folio watch https://forge.example.org/you
    

    The site imports every public repository of the account you, and looks again every two minutes. You should see a line PROJECT VERSION accepted: a new package, and you are its maintainer. A project that could not be imported shows PROJECT: not imported: and the reason. To import one repository only, use follow https://forge.example.org/you/PROJECT.git instead. (Forge Setup, A2)

  12. Build it. The node, as builder.

    folio-node once
    

    The 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 ends waiting (...) needs a package the site has not published yet, and is queued again when it is; one that ends failed (...) 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
    

    (Build Node Guide)

  13. 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 PROJECT
    

    setup.sh checks 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