aptify

command module
v0.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2024 License: AGPL-3.0 Imports: 40 Imported by: 0

README

aptify

Probably the quickest, and easiest, way to create a Debian APT repository from a list of deb files.

Installation

From APT

Add my apt repository to your system.

Then install aptify:

Currently packages are only published for Debian 12 (Bookworm).

sudo apt update
sudo apt install aptify
GitHub Releases

Download statically linked binaries from the GitHub releases page:

Latest Release

Docker

Pull the latest Docker image from GitHub Container Registry:

docker pull ghcr.io/dpeckett/aptify:latest

Usage

Initialize Keys

You'll need a GPG key to sign your repository. If you don't have one, you can create one using the init-keys command:

aptify init-keys

The resulting key will be written to your $XDG_CONFIG_HOME/aptify/ directory. You should back this up somewhere safe.

Create Repository

You'll need a simple YAML file describing the repository you want to create.

A demonstration file is provided in the examples directory. Schema for the repository configuration is defined in the v1alpha1/types.go file.

aptify build -c examples/demo.yaml -d ./demo-repo

This will create a directory called demo-repo containing the repository.

Serve Repository

You can serve the repository using any web server you like. However for convenience, aptify includes an embedded web server that you can use to serve the repository.

To start a server listening on http://localhost:8080:

aptify serve -d ./demo-repo

You can enable HTTPS support by passing the --tls flag and providing a domain/email for Let's Encrypt certificate issuance.

Use Repository

To use the repository, you'll need to add a new apt source to your system. You can do this by downloading the signing key and adding the repository to your /etc/apt/sources.list.d directory.

In a production setting the signing key should be downloaded over HTTPS.

curl -fsL http://localhost:8080/signing_key.asc | sudo tee /etc/apt/keyrings/demo-repo-keyring.asc > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/demo-repo-keyring.asc] http://localhost:8080/ $(. /etc/os-release && echo $VERSION_CODENAME) stable" | sudo tee /etc/apt/sources.list.d/demo-repo.list > /dev/null

Packages can now be installed from the repository.

sudo apt update
sudo apt install hello-world
Docker

You can also serve the repository using a Docker container.

# Create a config volume to store letsencrypt certificates.
docker volume create aptify-config

# Serve the repository.
docker run -d --rm --name=aptify \
  -p80:8080/tcp -p443:8443/tcp \
  -v aptify-config:/home/nonroot/.config/aptify \
  -v $(pwd)/demo-repo:/home/nonroot/demo-repo \
  ghcr.io/dpeckett/aptify:latest serve \
  --listen="" --tls --domain=<YOUR_DOMAIN> --email=<YOUR_EMAIL> \
  -d /home/nonroot/demo-repo

Replace <YOUR_DOMAIN> and <YOUR_EMAIL> with the public domain where the registry will be hosted and your email address respectively.

Systemd

Install aptify from the APT repository and perform the following steps to create a systemd service:

sudo adduser --system --home /var/lib/aptify --no-create-home --group aptify
sudo mkdir -p /var/lib/aptify
sudo chown -R aptify:aptify /var/lib/aptify
sudo install -m 644 /usr/share/aptify/aptify.service /etc/systemd/system/aptify.service
sudo systemctl daemon-reload
sudo systemctl enable aptify
sudo systemctl start aptify

You can then add a repository to /var/lib/aptify/repo' and it will be served on http://localhost:8080`.

Telemetry

By default aptify gathers anonymous crash and usage statistics. This anonymized data is processed on our servers within the EU and is not shared with third parties. You can opt out of telemetry by setting the DO_NOT_TRACK=1 environment variable.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
deb

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL