From postmarketOS
Jump to navigation Jump to search

Darkhttpd is a very simple http server. It is trivial to setup and serves static content over HTTP and nothing more. Turns out, that's exactly what we need to create an Alpine repository. Here are some tricks with that program.

Have your packages automatically upgradable

You can have your package served automatically so that an apk upgrade -U is all you need to install your home-built packages. For that to work, you need to:

initial setup

  • Add your keys to /etc/apk/keys on your phone. For that, you can use something like this:
scp /etc/apk/keys/*
sudo mv* /etc/apk/keys/
  • Add the repository on your phone
echo >>/etc/apk/repositories
# could be some other ip, and you could choose some other port

then, when you want to dev

  • Start darkhttpd started on your computer and to serve the repo. Just leave it running in a terminal somewhere
darkhttpd ~/.local/var/pmchroot/packages  # for pmbootstrap
darkhttpd ~/packages  # alternatively, for abuild
  • pmbootstrap build and apk upgrade -U a package when you want made a change
  • pmbootstrap build --force and apk fix -U pkgname to force an upgrade when you don't change the pkgrel
  • Enjoy!

An example automatic setup

on alpine


on something else

You can probably do the same with a runit or systemd service. If you do, please share here!