Skip to content

GOATS2K/constellation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

constellation

Distribute your GitHub releases in your closed-source projects.

Constellation works by querying GitHub to fetch releases created in your private projects.

Requirements

Note about release names

To ensure that Constellation is able to parse your releases for version, platform and target CPU architecture - ensure that your release filenames follow this naming convention.

$application_name-$version-$platform-$architecture
constellation-v0.1.0-darwin-aarch64.zip

This will probably change in the future.

Configuration

Using either a .env file in Constellation's root directory, or exporting variables using Docker or your favorite shell, set the following variables:

  • GITHUB_TOKEN - containing your private access token
  • JWT_SECRET_KEY - a strong key used to sign JWT tokens

Installation

Local

bun install

Docker

services:
  constellation:
    container_name: constellation
    image: goats2k/constellation:0.2.0
    restart: unless-stopped
    environment:
      - GITHUB_TOKEN=<your-pat-here>
      - JWT_SECRET_KEY=<your-secret-key-here>
    ports:
      - 127.0.0.1:8000:8000

Usage

Generating a bearer token for your application

Constellation uses a claim in the supplied bearer token to figure out what repository it should look for releases in.

This is to make sure the application is only able to fetch releases from its own repository and to make enumeration of other projects impossible.

To generate a token pointing to a repository, run the following command:

bun run create-token <repository-name>

Alternatively, if running via Docker, after setting up the image:

docker exec -it constellation bun run create-token <repository-name>

Which will output the following:

JWT token for <repository-name>: <your token here>

Running Constellation

Local

bun start

Docker (if using the supplied Compose file)

docker compose up -d

Getting releases

Set the token from the create-token command in an Authorization header.

Authorization: Bearer <token>

Constellation exposes the following endpoints for updates:

  • GET /versions
    • This returns every release available in your repository.
  • GET /versions?includePrerelease=true
    • This returns every release, including prereleases, available in your repository.
  • GET /versions/<version>?platform=<platform>&arch=<arch>
    • This returns the actual release with a download link.