Skip to content

Pawi1/pkgtug

Repository files navigation

pkgtug

pkgtug Test CodeQL Go License: MIT

A self-hosted, generic package manager and auto-updater for binary releases.

pkgtug tracks any git repository, builds its binaries when a new version appears, and distributes them to production hosts — without depending on GitHub/GitLab APIs, package registries, or any specific CI platform.

curl -fsSL https://pawi1.github.io/pkgtug/install.sh | sh

How it works

git push
    │
    ├─► POST /tug/fetch/<name>   (webhook — no auth)
    │       └─ git fetch on local clone
    │           └─ new tag / new SHA detected → job queued
    │
    └─► pkgtug-worker --once     (CI runner or daemon)
            └─ git clone → pre-build? → build → POST result to server
                    └─ manifest.json updated atomically
                            └─ pkgtug update              (on production hosts)
                                    └─ download → verify SHA256 → swap binary

Components

Binary Role
pkgtug-server Webhook receiver, job queue, manifest API, binary storage
pkgtug-worker Polls server for jobs, builds, uploads result
pkgtug Client CLI — installs and updates binaries on production hosts

The worker runs as a daemon on a build machine or as a one-shot CI job (GitHub Actions, GitLab CI, etc.).

Quick start

Server — copy config.example.yaml, set base_url, data_dir, worker_secret, and declare your packages, then:

pkgtug-server --config /etc/pkgtug/server.yaml

Worker — daemon on a build machine:

pkgtug-worker --server https://tug.example.com --secret <worker_secret> --interval 30s

One-shot in CI (--once --wait 90s handles the webhook/runner race):

pkgtug-worker --server https://tug.example.com --secret <worker_secret> --once --wait 90s

Copy contrib/github-actions-worker.yml to .github/workflows/pkgtug-build.yml for a ready-made GitHub Actions setup.

Client — add a remote and install:

pkgtug remote add main https://tug.example.com
pkgtug install myapp/server
pkgtug install github:cli/cli          # or straight from GitHub Releases
pkgtug update --all

Documentation

Building

make all              # server + worker + client → dist/
make build-linux-amd64
make build-linux-arm64

See CONTRIBUTING.md for development setup. For security issues see SECURITY.md.

License

MIT

About

A self-hosted, generic package manager and auto-updater for binary releases.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages