Skip to main content

Host APT repos on GitHub

Project description

apt-repo-maker

apt-repo-maker is a program to create and host an APT repo on GitHub. Yes, this means committing binaries to a repo, because why not. It wraps reprepro with a very simple CLI.

Setup

Run apt-repo setup. Usage is as follows.

usage: apt-repo setup [-h] --public-key PUBLIC_KEY --private-key PRIVATE_KEY --description DESCRIPTION --origin ORIGIN --label LABEL --codename CODENAME --arch ARCH [ARCH ...] --component
                      COMPONENT [COMPONENT ...] [--splash SPLASH] [--private]
                      name

positional arguments:
  name

options:
  -h, --help            show this help message and exit
  --public-key PUBLIC_KEY
                        public key to copy to repo
  --private-key PRIVATE_KEY
                        private key to sign packages with
  --description DESCRIPTION
  --origin ORIGIN
  --label LABEL
  --codename CODENAME
  --arch ARCH [ARCH ...]
  --component COMPONENT [COMPONENT ...]
  --splash SPLASH       HTML splash page for the repo
  --private             make repo private

All of the parameters are required and are fairly self-explanatory. The public key should be an exported file and the private key should be the private key ID in GPG.

Add some DEB files to the repo.

usage: apt-repo add [-h] name debs [debs ...]

positional arguments:
  name
  debs        DEB files to add (either just their locations, or <location>:<component>)

options:
  -h, --help  show this help message and exit

Note: You can specify DEB files with just their filenames, or like <location>:<component>; for example: mydeb_1.0.0-1_all.deb:main. Architecture will be determined automatically (by reading packages' actual architecture fields; not by assuming from their names).

Other stuff you can do

  • List the packages in the repo

    usage: apt-repo list [-h] [--no-format] name
    
    positional arguments:
    name
    
    options:
    -h, --help   show this help message and exit
    --no-format  do not pretty-print list
    
  • Remove packages in the repo

    usage: apt-repo remove [-h] name packages [packages ...]
    
    positional arguments:
    name
    packages    packages to remove
    
    options:
    -h, --help  show this help message and exit
    
  • Getting low on space on the GitHub repo? Run the clean function

    usage: apt-repo clean [-h] name
    
    positional arguments:
    name
    
    options:
    -h, --help  show this help message and exit
    

How can users add my created repos to their APT sources

This is largely a question about APT, not something for this project specifically, but I'll lend a hand.

If your GitHub repo is private, tell those who need access to it to generate a personal access token with repo read abilities (you can do so in the web interface, or even use a Selenium script). Then they should add the following to their /etc/apt/sources.list.

deb https://<username>:<personal_access_token>@raw.githubusercontent.com/<repo_host_username>/<repo_name>/gh-pages <codename> <component>

If your GitHub repo is public, the same method can be followed (<username>:<password> is not necessary though), or you can use this much nicer form.

deb https://<repo_host_username>.github.io/<repo_name>/ <codename> <component>

That's the whole point of GitHub pages, after all, that "nicer form".

Limitations

  • Files on stored GitHub can be no greater than 100 MB. This poses a significant issue for hosting APT repos, as 100 MB packages aren't too uncommon. Consider breaking your package up into multiple parts that are dependent on each other if you need to upload a package greater than 100 MB

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apt_repo_maker-3.0.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

apt_repo_maker-3.0.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file apt_repo_maker-3.0.0.tar.gz.

File metadata

  • Download URL: apt_repo_maker-3.0.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.5 Darwin/22.6.0

File hashes

Hashes for apt_repo_maker-3.0.0.tar.gz
Algorithm Hash digest
SHA256 5d796262c78c4dc4014b721084f6875121f109387a8df5a0328ae4011f873abd
MD5 9da16a222bb9c9b4e5f5a90f1f45b18d
BLAKE2b-256 f079597737ec8c6f6c805b44dae47129cb9b44d9f44eaa0798494f2f1635fb70

See more details on using hashes here.

File details

Details for the file apt_repo_maker-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: apt_repo_maker-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.5 Darwin/22.6.0

File hashes

Hashes for apt_repo_maker-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14054b1aeb62ced0e4daa28482223c0465f1c3d6b19839522527dce8cdad4e8a
MD5 0033ace00e9ace559693f1084eb7160a
BLAKE2b-256 0bcbd43bceabdc047aeb20d7332084c869561db98ddc4c7cdf5eacebd46610b6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page