Serverless Satis Solution

Solution for hosting private Composer repository without running any servers.

Sample Use Cases

Bellow are provided few sample use cases:

  1. Hosting private Composer repository with your company's internal packages
  2. Hosting repository with your commercial packages, which you license to your customers
  3. Hosting a mirror of public packages, to speed up your builds

How it works

First, you need to generate a Composer repository using s3-satis tool. The repository will be stored in a CloudFlare R2 bucket. Then, Private Satis Repository CloudFlare Worker will serve the repository to the users.

Requirements

Quick Start

For quick start, you can fork git repo for my composer.duma.dev repository.

GitHub Repository

In your forked repository, you need to update following files:

Then, you need to add following GitHub Secrets in your forked repository:

  • CLOUDFLARE_ACCOUNT_ID - ID of your CloudFlare account
  • CLOUDFLARE_API_TOKEN - CloudFlare API Token with Workers R2 Storage:Edit, Workers KV Storage:Edit, Workers Scripts:Edit, Account Settings:Read, Workers Routes:Edit, User Details:Read permissions
  • COMPOSER_TOKEN - GitHub Personal Access Token with repo scope
  • S3_ACCESS_KEY_ID - R2 access key ID
  • S3_SECRET_ACCESS_KEY - R2 secret access key

And you need to add following GitHub Variables in your forked repository:

  • S3_BUCKET - R2 bucket name
  • S3_ENDPOINT - R2 endpoint
  • S3_REGION - R2 region (use default us-east-1 if unsure)

After that, you can run actions from your forked repository.

  1. Go to Actions tab in your forked repository,
  2. Select Deploy CloudFlare Worker from sidebar,
  3. Click Run workflow button, select your branch and click Run workflow button.
  4. Select Publish Satis Repo from sidebar,
  5. Click Run workflow button, select your branch, leave rest of options as is and click Run workflow button.

While actions are running, you can go to CloudFlare KV and add your users.

When actions finish successfully, you should be able to access your repository from domain of your choice.