85 lines
2.7 KiB
Markdown
85 lines
2.7 KiB
Markdown
# Aptly
|
|
|
|
Aptly is a Debian/Ubuntu APT repository management tool. Use it to create and publish private APT repositories that your machines can install from.
|
|
|
|
## Configuration
|
|
|
|
Key settings in your instance's `config.yaml`:
|
|
|
|
- **domain** - Where aptly will be accessible (default: `aptly.{your-cloud-domain}`)
|
|
- **storage** - Persistent volume size for packages (default: `5Gi`)
|
|
|
|
## Access
|
|
|
|
After deployment:
|
|
- `https://aptly.{your-cloud-domain}/` — Published repository root (for APT clients, no auth required)
|
|
- `https://aptly.{your-cloud-domain}/api` — REST API for managing repos and snapshots (requires credentials)
|
|
- `https://aptly.{your-cloud-domain}/public.key` — GPG public key for APT clients to import
|
|
|
|
## Credentials
|
|
|
|
The API is protected by HTTP basic authentication. The username defaults to `aptly` (configurable via `apiUser` in `config.yaml`). The password is auto-generated and stored in your instance's `secrets.yaml` under `apps.aptly.apiPassword`.
|
|
|
|
To retrieve it:
|
|
```bash
|
|
wild secret get aptly apiPassword
|
|
```
|
|
|
|
To use the API with curl:
|
|
```bash
|
|
curl -u aptly:{your-api-password} https://aptly.{your-cloud-domain}/api/version
|
|
```
|
|
|
|
## GPG Signing
|
|
|
|
A GPG signing key is generated automatically on first deployment and stored on the persistent volume. The public key is exported to `/public.key` and is accessible without authentication so APT clients can import it:
|
|
|
|
```bash
|
|
curl -fsSL https://aptly.{your-cloud-domain}/public.key | \
|
|
sudo tee /usr/share/keyrings/my-repo.gpg > /dev/null
|
|
```
|
|
|
|
## Common Workflows
|
|
|
|
Aptly is managed through its REST API or the `aptly` CLI (run inside the pod). The REST API docs are at https://www.aptly.info/doc/api/.
|
|
|
|
### Running aptly commands inside the pod
|
|
|
|
```bash
|
|
kubectl -n aptly exec -it deploy/aptly -- bash
|
|
```
|
|
|
|
### Publish a local repository
|
|
|
|
```bash
|
|
# Create a local repo
|
|
aptly repo create my-packages
|
|
|
|
# Add packages
|
|
aptly repo add my-packages /path/to/package.deb
|
|
|
|
# Publish
|
|
aptly publish repo my-packages
|
|
```
|
|
|
|
The published repo will be available at `https://aptly.{your-cloud-domain}/`.
|
|
|
|
### Configure a machine to use the repository
|
|
|
|
```bash
|
|
# Import the signing key
|
|
curl -fsSL https://aptly.{your-cloud-domain}/public.key | \
|
|
sudo tee /usr/share/keyrings/my-repo.gpg > /dev/null
|
|
|
|
# Add the repo
|
|
echo "deb [signed-by=/usr/share/keyrings/my-repo.gpg] https://aptly.{your-cloud-domain}/ stable main" | \
|
|
sudo tee /etc/apt/sources.list.d/my-repo.list
|
|
|
|
sudo apt update
|
|
```
|
|
|
|
## Notes
|
|
|
|
- All aptly data (GPG keys, database, package pool, published repos) is stored on the persistent volume at `/opt/aptly`.
|
|
- The REST API (port 8080) and the nginx file server (port 80) both run inside the pod via supervisord. The ingress routes to nginx (port 80).
|