No description
Find a file
upfixb02rkd 4569542d1e 📝 Add a self-contained README
Resolves KaKi87/dynapt#1: consolidate the tutorial gist into the repository root and document the project accurately against the current implementation:

- Describe dynapt's purpose and its relationship to deb-get/AM (it fronts APT, it is not a package manager).
- Document installation (prebuilt DEBs to /opt/dynapt), configuration schema (port/concurrency/apps/githubAccessToken, app url/github/appimage/jq/id), APT source and startup/autostart setup.
- Reference every CLI command from main.js (serve, list, update, clean, version).
- Explain the pipelines (Fetch -> download wrap -> dpkg-scanpackages -> apt-ftparchive Release).
- Fold in the tested FOSS/proprietary app examples, troubleshooting, build/run and project layout sections.

Only the placeholder README.md (40 bytes) is replaced; no code changed.
2026-11-20 14:15:10 +00:00
lib ✨ Replace non-dash special characters 2025-10-21 19:51:32 +02:00
src ✨ Add GitHub access token support 2025-11-20 18:07:21 +01:00
.gitignore 🙈 Add '*.bak' 2024-09-01 18:17:22 +02:00
build.sh ➕ Add 'pipeline-ish' dependency 2025-02-28 20:45:10 -05:00
dirname.js 🐛 Fix paths from remote working directories 2024-07-17 00:26:19 +02:00
dynapt ➕ Add 'pipeline-ish' dependency 2025-02-28 20:45:10 -05:00
main.js ➕ Add 'loxer' dependency 2025-10-07 13:52:50 +02:00
permissions.sh ✨ Add 'jq' support 2025-11-20 17:18:57 +01:00
README.md 📝 Add a self-contained README 2026-11-20 14:15:10 +00:00

dynapt

Dynamic APT repository.

If you're frustrated that an app you use doesn't ship automated updates via an APT repository, a PPA or Flatpak, the classic solution is a file server hosting DEB files that the APT package manager can consume.

dynapt does exactly that, but on your local machine: it downloads DEB files (and can wrap AppImages into DEBs), turns them into a valid local APT repository, and serves it over HTTP so that ordinary apt commands work as if the app shipped its own repository.

Not a package manager. dynapt interfaces with APT instead. You keep using your usual tools — apt, aptitude, Synaptic or your desktop environment's app store. Compare with deb-get (a package manager for DEB files) and AM (a package manager for AppImage files).

Features

  • Mirror DEB files from a direct download URL or from GitHub Releases.
  • Wrap AppImages into installable DEB packages (with .desktop file, icon and optional /usr/bin launcher).
  • Apply a jq filter when a URL returns JSON that points to the real package file.
  • Cache downloads with ETags/GitHub release IDs so unchanged apps are not reprocessed.
  • Serve a standard APT repository (Packages and Release indices plus the data/ package store) over localhost HTTP.
  • Optional GitHub access token to avoid GitHub API rate limits.
  • Produces per-architecture DEB packages (amd64 and arm64).

Installation

Prebuilt DEBs (as produced by build.sh) are published on the releases page.

Download and install automatically (replace the architecture if needed):

wget "https://git.kaki87.net/KaKi87/dynapt/releases/download/0.0.0-dev.9b8fa75/dynapt-$(dpkg --print-architecture).deb" \
  && sudo apt install ./dynapt-$(dpkg --print-architecture).deb

Or grab it manually:

The package installs to /opt/dynapt and provides the dynapt command in /usr/bin.

Configuration

Create /opt/dynapt/config.json (when running from source, this is ./config.json next to main.js):

nano /opt/dynapt/config.json

Start from the minimal template:

{
    "port": 3000,
    "concurrency": null,
    "apps": []
}

Top-level options

Option Type Description
port integer Port the repository server listens on. Change it if 3000 is already in use.
concurrency integer or null Maximum number of apps downloaded/packaged at the same time. null (default) processes all apps in parallel for faster apt update; set 1 on low-power or low-bandwidth machines.
apps array List of apps to mirror/wrap, see below.
githubAccessToken string Optional GitHub personal access token to avoid API rate limits when tracking many GitHub-hosted apps.

The config is validated on every start with Joi. App id values are optional: dynapt generates a UUID (crypto.randomUUID()) and writes it back into the file automatically, where it is used as the cache key.

App options

Every item in apps supports at least name and exactly one download source (url or github):

Field Type Description
name string Display name of the app.
url string HTTPS direct download URL to a DEB or AppImage.
github object GitHub Release metadata.
github.repo string Repository in owner/name format (required).
github.filter string Optional filename filter (picomatch patterns) when multiple DEB/AppImage assets are available (architecture/variant selection).
github.prerelease boolean When true, follow the latest pre-release instead of the latest stable release.
appimage boolean or object true (or { "bin": "<command>" }) when the download is an AppImage that must be wrapped into a DEB. bin adds a launcher command in /usr/bin. Omit it to download a DEB directly.
jq string jq filter applied to a JSON url response to obtain the actual package file URL. Requires url.
id string Auto-generated UUID cache key — leave this out of hand-written configs.

Usage

Add dynapt as a local APT repository (adjust the port if you changed it):

echo "deb [trusted=yes] http://127.0.0.1:3000/ /" | sudo tee /etc/apt/sources.list.d/dynapt.list

Start the server (it listens on localhost:<port> and rebuilds the repository on demand whenever a client requests Packages or Release):

nohup dynapt &

Make it start automatically at boot with cron:

crontab -l | { cat; echo "@reboot dynapt"; } | crontab -

Then use APT as normal: sudo apt update && sudo apt install <app>.

CLI reference

The dynapt command (entry point main.js, run with Deno) provides:

Command Description
dynapt (no command) or dynapt serve Run the APT repository server.
dynapt list Print a table of configured apps, packaged files and their installed/available versions (queries the local apt database).
dynapt update Download and package all configured apps without touching APT — useful to debug fetch problems.
dynapt clean Remove the cached cache.json and downloaded/generated data/ files.
dynapt version (or -v, -V, --version) Print the dynapt version.

How it works under the hood

On each repository request dynapt reuses a cached update (for 60 seconds) and, for every app:

  1. Resolves the download — direct url, a GitHub Release asset list (with optional jq transform), honoring ETag/if-none-match and GitHub release IDs so unchanged apps are skipped.
  2. Downloads the file into data/<appId>-<index>/.
  3. For AppImages, extracts the embedded .desktop/icon files, rewrites the desktop entry, and builds a DEB with dpkg-deb.
  4. Indexes the result with dpkg-scanpackages into a .package stanza and eventually a Packages list.
  5. Generates the APT Release file with apt-ftparchive.

App configuration examples

FOSS apps

Tested configurations for open-source apps are documented on the related issues/discussions:

Proprietary apps

Discord

{
    "name": "Discord",
    "url": "https://discord.com/api/download?platform=linux&format=deb"
}

Free Download Manager

{
    "name": "Free Download Manager",
    "url": "https://files2.freedownloadmanager.org/6/latest/freedownloadmanager.deb"
}

kDrive

{
    "name": "kDrive",
    "url": "https://www.infomaniak.com/drive/latest",
    "jq": ".[\"linux-amd64\"].downloadurl",
    "appimage": true
}

Replace amd64 with arm64 where applicable.

Kiro

{
    "name": "Kiro",
    "url": "https://prod.download.desktop.kiro.dev/stable/metadata-linux-x64-deb-stable.json",
    "jq": ".releases[].updateTo.url | select(endswith(\".deb\"))"
}

LM Studio

{
    "name": "LM Studio",
    "url": "https://lmstudio.ai/download/latest/linux/x64",
    "appimage": true
}

Troubleshooting

Logs

In addition to the APT command output, check the latest entries in /opt/dynapt/dynapt.log (next to the executable) for download and packaging errors.

Clean the cache

Remove previously downloaded and packaged files, then re-download them on the next apt update:

dynapt clean

Update without APT

Debug download problems without involving APT:

dynapt update

Update APT only for the dynapt repository:

sudo apt update \
  -o Dir::Etc::sourcelist="sources.list.d/dynapt.list" \
  -o Dir::Etc::sourceparts="-" \
  -o APT::Get::List-Cleanup="0"

Inspect packaged versions

dynapt list

Building from source

Requirements:

  • Deno
  • Debian/Ubuntu tooling and utilities: bash, coreutils, dpkg, dpkg-dev, dpkg-scanpackages, apt, apt-ftparchive, squashfs-tools (unsquashfs), file (AppImage introspection and DEB packaging).

Build both amd64 and arm64 packages (uses deno compile per target):

./build.sh

The resulting .deb files are written to the build/ directory. The compile flags and allowed subprocesses/network imports live in permissions.sh.

Running from a source checkout

./dynapt                 # run the server (same calls as the installed package)
deno run --no-prompt --allow-sys=hostname \
  --allow-env --allow-run --allow-import --allow-read \
  --allow-write --allow-net main.js

The dynapt wrapper sources permissions.sh for its allow-list.

Project layout

Path Purpose
main.js CLI entry point (commander): server, list, update, clean, version.
dirname.js Resolves the base directory (executable directory when compiled, source directory otherwise).
src/getConfig.js Reads and Joi-validates config.json, assigns app UUIDs.
src/server.js Fastify server exposing /Packages, /Release and data/.
src/updatePackages.js Download, cache (ETag/ID), AppImage→DEB wrapping, Packages/Release generation.
src/list.js dynapt list table.
lib/createDebFromAppimage.js Extracts an AppImage and builds a Debian package.
lib/extractAppimage.js Locates and extracts bundled .desktop/icons via unsquashfs.
lib/getBinArchitecture.js Falls back to file to derive architecture.
lib/buildDeb.js Shells out to dpkg-deb --build.
lib/loxer.js Logging setup.

Status and roadmap

dynapt is experimental. Once it reaches a stable release it will provide its own APT self-updates and an optional step-by-step wizard instead of this manual setup/procedure; a stable CLI/GUI is also planned. Until then it must be updated manually. Subscribe to the tutorial gist or watch this repository for release notifications.

Questions, bug reports and feature requests are welcome as repository issues.


Thank you for using dynapt. ❤️