feat: Add backend support for one-click Rust server deployment
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
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:
@@ -34,6 +34,11 @@ export class NatsBridgeService implements OnModuleInit {
|
||||
this.emit(licenseId, 'server_status', data);
|
||||
});
|
||||
|
||||
this.nats.subscribe('corrosion.*.deploy.status', (data, subject) => {
|
||||
const licenseId = subject.split('.')[1];
|
||||
this.emit(licenseId, 'deploy_status', data);
|
||||
});
|
||||
|
||||
this.logger.log('NATS bridge subscriptions initialized');
|
||||
}
|
||||
|
||||
|
||||
@@ -70,4 +70,13 @@ export class NatsService implements OnModuleInit, OnModuleDestroy {
|
||||
timestamp: new Date().toISOString(),
|
||||
});
|
||||
}
|
||||
|
||||
/** Publish a deploy command to a specific license's companion agent */
|
||||
async sendDeployCommand(licenseId: string, config: Record<string, unknown>): Promise<void> {
|
||||
await this.publish(`corrosion.${licenseId}.cmd.deploy`, {
|
||||
action: 'deploy',
|
||||
config,
|
||||
timestamp: new Date().toISOString(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user