Self-hostable Git server over SSH + Git + HTTP
Self-hostable Git server with SSH (authorized keys), Git (git://), and HTTP endpoints. Users, repos, access control, and optional LFS — all driven by a config file.
composer require sugarcraft/candy-serve
use SugarCraft\Serve\{Config, Repo, SSH\SSHServer};
// Load config
$config = Config::fromDefaults();
// Create a repo
$repo = Repo::create($config, 'my-project');
echo "Repo path: {$repo->path()}\n";
// Spawn the SSH server
$server = new SSHServer($config);
$server->listen();
| Class | Method | Description |
|---|---|---|
| Config | fromDefaults() | Create default configuration |
| Config | fromYaml(path) | Load configuration from YAML |
| Repo | create(config, name) | Create a new repository |
| Repo | path() | Get repository path |
| SSHServer | new(config) | Create SSH server |
| SSHServer | listen() | Start listening for connections |
| GitDaemon | new(config) | Create Git daemon |
| HttpServer | new(config) | Create HTTP server |
VHS-recorded GIFs of every example shipped with the library. Regenerated automatically on every push that touches the source.