Example #1
0
        private async Task UpdateTeamVulnbox(long teamId, long?hetznerServerId, string?ipv4, string?rootPassword, LandingPageVulnboxStatus status, CancellationToken token)
        {
            var dbTeam = await this.context.Vulnboxes
                         .Where(t => t.LandingPageTeamId == teamId)
                         .SingleAsync(token);

            dbTeam.HetznerServerId = hetznerServerId;
            dbTeam.VulnboxStatus   = status;
            dbTeam.ExternalAddress = ipv4;
            dbTeam.RootPassword    = rootPassword;
            await this.context.SaveChangesAsync(token);
        }
Example #2
0
 public static async Task UpdateTeamVulnbox(IServiceProvider serviceProvider, long teamId, long?serverId, string?ipv4, string?rootPassword, LandingPageVulnboxStatus status, CancellationToken token)
 {
     using var scope = serviceProvider.CreateScope();
     var db = scope.ServiceProvider.GetRequiredService <LandingPageDatabase>();
     await db.UpdateTeamVulnbox(teamId, serverId, ipv4, rootPassword, status, token);
 }