No description
Find a file
2025-11-24 00:59:47 +01:00
deploy.sh better default values 2025-11-23 23:43:07 +01:00
LICENSE update license 2025-11-24 00:25:29 +01:00
Makefile make scripts executable for world 2025-11-24 00:59:09 +01:00
README.md fix readme 2025-11-24 00:59:47 +01:00
setup-key.sh exit on incorrect usage. ensure correct user first 2025-11-24 00:55:54 +01:00

abstractnonsense/pages

These are scripts that we use on git.abstractnonsense.se to have deployment to a GitLab pages-like environment.

They are meant to be used in conjunction with actions/pages to deploy to pages.abstractnonsen.se, but could be set up for any other domain as well.

Requirements

You need

  • a webserver with webroot
  • write-access to the webroot by some user
  • the ability to add ssh-keys to that user

Installation

For Arch Linux, there is a PKGBUILD available at arch/pages-deployment-git, which you can directly use. It is still recommended to read through the installation instructions below to understand what is going on.

manual installation

We recommend a system-user that is solely used for the pages deployment. We will call it pages for the rest of this file. Create it with

sudo useradd --shell /bin/bash --comment 'Pages deployment user' pages --create-home

Edit the configuration variables in deploy.sh to your liking. The defaults are recommended, though. If you change the WEB_ROOT or STORAGE_ROOT, you also need to do adjust the paths in the Makefile for installation to succeed.

Now, install using make install, this copies files to their intended directories and sets permissions. Make sure that the corresponding directories in /var (but not in /opt) belong to the pages user:

sudo chown -R pages:pages /var/lib/pages/ /var/www/pages

Check that that var/lib/pages/keys has permissions 700 and is thus only accessible to the pages user.

Usage: Settting up a new repository

For each new repository, you want to do the following: Run /opt/pages/setup-key.sh <owner> <repository> to generate a ssh keypair and set up the pages user to accept this. Here, <owner> and <repository> can be anything, it will be the path relative to the webroot where this ssh key will be able to deploy to, but this would be the recommended pattern for git instances.

In your repository, add the displayed ssh key as a secret (Settings -> Actions -> Secrets, note that Actions need to be enabled, see Settings -> Repository -> Advanced Settings) named PAGES_SSH_KEY. Now you should be ready to use the action as described in actions/pages.