PHPackages                             artisan-build/crate-server - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. artisan-build/crate-server

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

artisan-build/crate-server
==========================

The server package for Crate private Composer registry integrations.

v0.1.0(1mo ago)00MITPHPPHP ^8.3

Since Jul 8Pushed 1mo agoCompare

[ Source](https://github.com/artisan-build/crate-server)[ Packagist](https://packagist.org/packages/artisan-build/crate-server)[ RSS](/packages/artisan-build-crate-server/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (14)Versions (2)Used By (0)

Crate Server
============

[](#crate-server)

Server package for the Crate private Composer registry.

It stores the list of private repositories to serve, generates Satis configuration from that database state, dispatches Satis builds, mirrors generated registry output to storage, and serves Composer metadata and dist archives through a credential gate.

Served Repositories
-------------------

[](#served-repositories)

The package stores served repositories in the `served_repos` table. Each row contains the Composer package name, source URL, repository type, status, optional encrypted source credential, and `last_built_at` timestamp.

Commands:

```
php artisan crate:repos:add vendor/pkg https://github.com/vendor/pkg.git --source-token=...
php artisan crate:repos:add vendor/pkg https://github.com/vendor/pkg.git --type=vcs
php artisan crate:repos:list
php artisan crate:repos:remove vendor/pkg
```

`crate:repos:add` validates lowercase `vendor/package` names and stores source credentials encrypted via Eloquent casts. The list command intentionally does not print source credentials.

Satis Builds
------------

[](#satis-builds)

Builds are dispatched with:

```
php artisan crate:build
php artisan crate:build vendor/pkg
```

The command dispatches `ArtisanBuild\CrateServer\Jobs\BuildSatis`. A full build has no package argument. Passing a package performs an incremental build for that package and seeds the temporary output directory from the current archive storage before running Satis.

`SatisConfigGenerator` builds `satis.json` from the database:

- `homepage` is `CRATE_URL`.
- repositories come from `served_repos`.
- full builds require all registered packages.
- incremental builds require the requested package only.
- archives are configured as zip files under `dist` with `prefix-url` set to `CRATE_URL`.

For source credentials, the generator writes a scoped Composer auth config for the build process. GitHub hosts use `github-oauth`; other hosts use bearer auth.

`BuildSatis` runs the configured isolated Satis binary via Symfony Process, using the temporary build directory as `COMPOSER_HOME`. Successful builds mirror the generated output to `CRATE_ARCHIVE_DISK` under `CRATE_OUTPUT_DIR`. Failed builds store a redacted output tail so source credentials are not persisted in build logs.

The service provider schedules a daily full rebuild:

```
$schedule->command('crate:build --trigger=schedule')->daily();
```

Gated Registry Routes
---------------------

[](#gated-registry-routes)

The package registers Composer registry routes at the app root:

- `GET /packages.json`
- `GET /p2/{path}`
- `GET /dist/{path}`

All routes use `ArtisanBuild\CrateServer\Http\Middleware\EnsureValidCredential`, registered as `crate-server.credential`.

Composer authenticates with HTTP Basic auth. The username is conventional and ignored; the password is the Crate credential. The middleware resolves that password through `ArtisanBuild\BuiltForCloud\TokenRegistry` and returns `401` with `WWW-Authenticate: Basic realm="Crate"` when the credential is missing, unknown, expired, or revoked.

`RegistryFileController` streams files from the configured archive disk and output prefix:

- `packages.json` serves generated Composer root metadata.
- `p2/...` serves Composer v2 provider metadata.
- `dist/...` serves mirrored dist archives.

Traversal attempts containing `..` are rejected before storage access.

Configuration
-------------

[](#configuration)

Published config key: `crate-server`.

Environment variables:

- `CRATE_URL`: public registry URL used by Satis metadata and dist archive URLs.
- `CRATE_ARCHIVE_DISK`: storage disk for generated metadata and mirrored archives. Defaults to `FILESYSTEM_DISK` then `local`.
- `CRATE_SATIS_PATH`: isolated Satis binary path. Defaults to `vendor/bin/satis`.
- `CRATE_OUTPUT_DIR`: storage prefix for generated registry output. Defaults to `satis`.
- `CRATE_DB_*`: optional separate database connection settings. If omitted, the app's default database connection is reused as `crate`.

This package consumes `artisan-build/built-for-cloud` for token storage and credential resolution. The app mounts built-for-cloud's credential-management API separately via `config/built-for-cloud.php`.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1053395?v=4)[Ed Grosvenor](/maintainers/edgrosvenor)[@edgrosvenor](https://github.com/edgrosvenor)

---

Top Contributors

[![edgrosvenor](https://avatars.githubusercontent.com/u/1053395?v=4)](https://github.com/edgrosvenor "edgrosvenor (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

composerlaravelserverregistrycrate

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/artisan-build-crate-server/health.svg)

```
[![Health](https://phpackages.com/badges/artisan-build-crate-server/health.svg)](https://phpackages.com/packages/artisan-build-crate-server)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M341](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

20433.0M1.9k](/packages/illuminate-queue)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k57.2M688](/packages/laravel-scout)[illuminate/notifications

The Illuminate Notifications package.

483.1M1.2k](/packages/illuminate-notifications)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9922.4M147](/packages/roots-acorn)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
