feat: Add backend support for one-click Rust server deployment
All checks were successful
Test Asgard Runner / test (push) Successful in 2s

Add deploy endpoint, DTO, NATS command publisher, and WebSocket bridge
subscription to support the one-click server deployment feature via the
companion agent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell
2026-02-21 14:45:06 -05:00
parent ee7fdb897d
commit 834e17e7cf
5 changed files with 75 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ import { ApiTags, ApiBearerAuth, ApiOperation } from '@nestjs/swagger';
import { ServersService } from './servers.service';
import { UpdateServerConfigDto } from './dto/update-config.dto';
import { SendCommandDto } from './dto/send-command.dto';
import { DeployServerDto } from './dto/deploy-server.dto';
import { CurrentTenant } from '../../common/decorators/current-tenant.decorator';
import { RequirePermission } from '../../common/decorators/require-permission.decorator';
import { JwtAuthGuard } from '../../common/guards/jwt-auth.guard';
@@ -62,4 +63,14 @@ export class ServersController {
async restartServer(@CurrentTenant() licenseId: string) {
return await this.serversService.restartServer(licenseId);
}
@Post('deploy')
@RequirePermission('server.manage')
@ApiOperation({ summary: 'Deploy Rust server via companion agent' })
async deployServer(
@CurrentTenant() licenseId: string,
@Body() dto: DeployServerDto,
) {
return await this.serversService.deployServer(licenseId, dto);
}
}