mwt / rclone-makerepo

Generate a complete APT/YUM repository for Rclone with automatic updates.
https://mirror.mwt.me/rclone/
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Enable Rclone team to use this #2

Open mwt opened 2 years ago

mwt commented 2 years ago

Ideally, this can be used to close rclone/rclone#136, which is an issue about Rclone hosting their own APT and YUM repositories on the apt.rclone.org and yum.rclone.org domains. There are several ways to achieve this.

Solution 1: point Rclone domains to the current installation

The simplest implementation would be to use two CNAME records to point apt.rclone.org and yum.rclone.org to mirror.mwt.me. This may be unappealing because the Rclone team has their own infrastructure and this implementation is not actually "self-hosted". I can however, give the Rclone devs an account on my sever so that they can control it.

Solution 2: copy files to Rclone infrastructure

Another possibility would be to copy the repository files to Rclone infrastructure on each build. This could be accomplished by adding a line to the end of the script which copies the files.

Solution 3: get this script running on Rclone infrastructure or GitHub actions

This is the only option that allows the Rclone developers to use a gpg certificate that I have no access to. Getting the script running on the Rclone infrastructure should not be especially difficult. It could run on GitHub actions, though the code is optimized for a persistent environment. If you're using GitHub actions, it makes more sense to use sed instead of jq and apt-ftparchive instead of the reprepro fork.

mwt commented 2 years ago

The tarball on the releases page: https://github.com/mwt/rclone-makerepo/releases/download/v0.1.0/rclone-makerepo_amd64.tar.gz contains this repo and has some packages bundled so that the it can be run on focal.

mwt commented 2 years ago

Here's a minimal example of a GitHub action that runs the script:

https://github.com/mwt/rclone-makerepo-example/blob/main/.github/workflows/test.yml

I think it's mostly useful for reference for setting it up on your own build server. You can see it's not very involved. GitHub actions is a little tricky because it doesn't have persistent storage. It would be rough to rebuild from scratch each time when you have multiple versions.

On the older hand, you could use actions, Rclone mount the ~/rclone-makerepo/dist folder, and pull/push the ~/rclone-makerepo/reprepro/db folder. That should avoid rebuilding and also redownloading old packages.

I think that a cronjob on a server is the efficient way to do it, but GitHub actions is possible.