This is an apt server built on Cloudflare's serverless stack (Workers + R2 + Cache).
It was created to reduce the load on the origin apt servers. Content is served from the edge cache whenever possible. It returns the hit items in the order of Cloudflare Cache -> Cloudflare R2 -> Origin Server.
It was inspired by https://github.com/cloudflare/serverless-registry
Warning
This server is an experimental implementation. Do not use it for daily use or in production environments.
-
Clone this repository
$ git clone [email protected]:takanotume24/serverless-apt-mirror.git $ cd serverless-apt-mirror
-
Setup Nodejs Environment
$ nvm install $ nvm use
-
Edit
wrangler.toml
$ cp wrangler.toml.example wrangler.toml
- Replace
archive.example.com
to your domain. - Chose origin apt server, and fill
ORIGIN_APT_SERVER = ""
.
- Replace
-
Deploy to Cloudflare Workers
$ npx wrangler deploy --env production
-
Edit source list
In Ubuntu 22.04,
archive.ubuntu,com
to your domain in/etc/apt/source.list
. -
Use apt server
$ sudo apt update Get:1 https://[your domain]/ubuntu jammy InRelease [270 kB] Get:2 https://[your domain]/ubuntu jammy-updates InRelease [128 kB] Get:3 https://[your domain]/ubuntu jammy-backports InRelease [127 kB]