Skip to content

Commit

Permalink
Pre update
Browse files Browse the repository at this point in the history
  • Loading branch information
fergalmoran committed Oct 17, 2024
1 parent c89c057 commit 31d7305
Show file tree
Hide file tree
Showing 30 changed files with 68 additions and 138 deletions.
2 changes: 0 additions & 2 deletions mixyboos-api/Controllers/DebugController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
using System.Reflection;
using System.Runtime.Versioning;
using System.Threading.Tasks;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using MixyBoos.Api.Controllers.Hubs;
using MixyBoos.Api.Data;
using MixyBoos.Api.Data.DTO;
using MixyBoos.Api.Data.Models;

Expand Down
1 change: 0 additions & 1 deletion mixyboos-api/Controllers/Hubs/ChatHub.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Mapster;
using Microsoft.AspNetCore.Authorization;
Expand Down
3 changes: 1 addition & 2 deletions mixyboos-api/Controllers/Hubs/DebugHub.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.SignalR;

namespace MixyBoos.Api.Controllers.Hubs;
Expand Down
1 change: 0 additions & 1 deletion mixyboos-api/Controllers/JobController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
Expand Down
3 changes: 0 additions & 3 deletions mixyboos-api/Controllers/LiveController.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
Expand All @@ -15,7 +13,6 @@
using MixyBoos.Api.Controllers.Hubs;
using MixyBoos.Api.Data;
using MixyBoos.Api.Data.DTO;
using MixyBoos.Api.Data.DTO.Wire;
using MixyBoos.Api.Data.Models;
using MixyBoos.Api.Services.Extensions;
using Quartz;
Expand Down
1 change: 0 additions & 1 deletion mixyboos-api/Controllers/MixController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Mime;
using System.Threading.Tasks;
using Bogus;
Expand Down
5 changes: 0 additions & 5 deletions mixyboos-api/Controllers/UploadController.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers;
using MixyBoos.Api.Data;
using MixyBoos.Api.Data.Models;
using MixyBoos.Api.Services;
using MixyBoos.Api.Services.Extensions;
Expand Down
1 change: 0 additions & 1 deletion mixyboos-api/Data/DTO/DebugDTO.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace MixyBoos.Api.Data.DTO {
public class DebugDTO {
Expand Down
1 change: 0 additions & 1 deletion mixyboos-api/Data/DTO/LiveShowDTO.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using MixyBoos.Api.Data.Models;

namespace MixyBoos.Api.Data.DTO {
public class LiveShowDTO {
Expand Down
2 changes: 1 addition & 1 deletion mixyboos-api/Data/MixyBoosContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ protected override void OnModelCreating(ModelBuilder mb) {
.WithOne(m => m.Mix);

mb.Entity<MixPlay>()
.HasKey(i => new {i.MixId, i.UserId});
.HasKey(i => new { i.MixId, i.UserId });

mb.Entity<Mix>()
.Navigation(m => m.Plays)
Expand Down
1 change: 0 additions & 1 deletion mixyboos-api/Data/Models/MixyBoosUser.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Threading.Channels;
using Mapster;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
Expand Down
3 changes: 1 addition & 2 deletions mixyboos-api/Data/Models/Tag.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;

namespace MixyBoos.Api.Data.Models;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -563,17 +563,17 @@ protected override void Up(MigrationBuilder migrationBuilder)
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ "0f8e07af-7dc4-4f33-b439-67b55f414275", null, "Artist", "ARTIST" },
{ "34296e64-181e-403e-ad60-5a24250ddc0e", null, "Admin", "ADMIN" },
{ "85a9d1fc-4488-47b1-b6a2-8d27d8e00b50", null, "SuperAdmin", "SUPERADMIN" },
{ "afc938e6-4c92-4706-9bbf-75b1987d001d", null, "Member", "MEMBER" }
{ "175718c9-7775-485a-8892-5a8036dd730e", null, "Artist", "ARTIST" },
{ "31672428-820e-48c4-8713-7b3e6daf3378", null, "Member", "MEMBER" },
{ "6fab2c7b-61f9-400e-9815-c9a1c6a685c0", null, "SuperAdmin", "SUPERADMIN" },
{ "aa509ee5-9995-46e5-8688-0de62b416791", null, "Admin", "ADMIN" }
});

migrationBuilder.InsertData(
schema: "oid",
table: "user",
columns: new[] { "Id", "AccessFailedCount", "Biography", "City", "ConcurrencyStamp", "Country", "DisplayName", "Email", "EmailConfirmed", "HeaderImage", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "ProfileImage", "SecurityStamp", "Slug", "StreamKey", "Title", "TwoFactorEnabled", "UserName" },
values: new object[] { new Guid("d67fa40e-702f-4d7c-a14b-ae516013a113"), 0, null, null, "ce08fd74-d3e1-4f51-a8ff-a52773d97c6f", null, "Fergal Moran", "[email protected]", true, null, false, null, "[email protected]", "FERGAL.MORAN", "AQAAAAIAAYagAAAAEAFmXzQvlABn0PbIi+LgKCBN+5+AU+4Mrvo/zMIwbwOrbNc/ph/yA6bYc6PGX405Mg==", null, false, null, null, null, "YfbUdfzcgjgIXvUaNZ3X9lQoyhdEc6nc", null, false, "fergal.moran" });
values: new object[] { new Guid("0511ec00-87b4-478f-a771-56df46158678"), 0, null, null, "8ce91cb9-f402-403c-ba1f-b0e2c1cc57ce", null, "Fergal Moran", "[email protected]", true, null, false, null, "[email protected]", "FERGAL.MORAN", "AQAAAAIAAYagAAAAEAns5488ljEkPba2z9w7Fy2FwEK1vSsPH/R1hqhS8f7bVxUDZAp87WX2yPq1QU6lfw==", null, false, null, null, null, "YfbUdfzcgjgIXvUaNZ3X9lQoyhdEc6nc", null, false, "fergal.moran" });

migrationBuilder.CreateIndex(
name: "IX_live_shows_UserId",
Expand Down
18 changes: 9 additions & 9 deletions mixyboos-api/Migrations/MixyBoosContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder
.HasDefaultSchema("mixyboos")
.UseCollation("en_US.utf8")
.HasAnnotation("ProductVersion", "8.0.0-rc.1.23419.6")
.HasAnnotation("ProductVersion", "9.0.0-preview.3.24172.4")
.HasAnnotation("Relational:MaxIdentifierLength", 63);

NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
Expand Down Expand Up @@ -60,25 +60,25 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasData(
new
{
Id = "85a9d1fc-4488-47b1-b6a2-8d27d8e00b50",
Id = "6fab2c7b-61f9-400e-9815-c9a1c6a685c0",
Name = "SuperAdmin",
NormalizedName = "SUPERADMIN"
},
new
{
Id = "34296e64-181e-403e-ad60-5a24250ddc0e",
Id = "aa509ee5-9995-46e5-8688-0de62b416791",
Name = "Admin",
NormalizedName = "ADMIN"
},
new
{
Id = "0f8e07af-7dc4-4f33-b439-67b55f414275",
Id = "175718c9-7775-485a-8892-5a8036dd730e",
Name = "Artist",
NormalizedName = "ARTIST"
},
new
{
Id = "afc938e6-4c92-4706-9bbf-75b1987d001d",
Id = "31672428-820e-48c4-8713-7b3e6daf3378",
Name = "Member",
NormalizedName = "MEMBER"
});
Expand Down Expand Up @@ -490,7 +490,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("MixId")
.HasColumnType("character varying(36)");

b.Property<Guid?>("UserId")
b.Property<Guid>("UserId")
.HasColumnType("uuid");

b.Property<DateTime>("DateCreated")
Expand Down Expand Up @@ -649,16 +649,16 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasData(
new
{
Id = new Guid("d67fa40e-702f-4d7c-a14b-ae516013a113"),
Id = new Guid("0511ec00-87b4-478f-a771-56df46158678"),
AccessFailedCount = 0,
ConcurrencyStamp = "ce08fd74-d3e1-4f51-a8ff-a52773d97c6f",
ConcurrencyStamp = "8ce91cb9-f402-403c-ba1f-b0e2c1cc57ce",
DisplayName = "Fergal Moran",
Email = "[email protected]",
EmailConfirmed = true,
LockoutEnabled = false,
NormalizedEmail = "[email protected]",
NormalizedUserName = "FERGAL.MORAN",
PasswordHash = "AQAAAAIAAYagAAAAEAFmXzQvlABn0PbIi+LgKCBN+5+AU+4Mrvo/zMIwbwOrbNc/ph/yA6bYc6PGX405Mg==",
PasswordHash = "AQAAAAIAAYagAAAAEAns5488ljEkPba2z9w7Fy2FwEK1vSsPH/R1hqhS8f7bVxUDZAp87WX2yPq1QU6lfw==",
PhoneNumberConfirmed = false,
StreamKey = "YfbUdfzcgjgIXvUaNZ3X9lQoyhdEc6nc",
TwoFactorEnabled = false,
Expand Down
30 changes: 4 additions & 26 deletions mixyboos-api/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
using System.IO;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Text;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.SignalR;
Expand All @@ -15,7 +10,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using MixyBoos.Api.Data;
using MixyBoos.Api.Data.Models;
using MixyBoos.Api.Data.Options;
Expand All @@ -24,7 +18,6 @@
using MixyBoos.Api.Services.Helpers;
using MixyBoos.Api.Services.Helpers.Audio;
using MixyBoos.Api.Services.Startup;
using MixyBoos.Api.Services.Startup.Mapster;
using Serilog;

var builder = WebApplication.CreateBuilder(args);
Expand All @@ -34,24 +27,9 @@

builder.CreateLogger(builder.Configuration);


builder.WebHost.ConfigureKestrel(options => {
var pemFile = builder.Configuration["SSL:PemFile"];
var keyFile = builder.Configuration["SSL:KeyFile"];
if (string.IsNullOrEmpty(pemFile) || string.IsNullOrEmpty(keyFile)) {
return;
}

options.Listen(IPAddress.Any, 5001, listenOptions => {
var certPem = File.ReadAllText("/etc/letsencrypt/live/dev.fergl.ie/fullchain.pem");
var keyPem = File.ReadAllText("/etc/letsencrypt/live/dev.fergl.ie/privkey.pem");
var x509 = X509Certificate2.CreateFromPem(certPem, keyPem);
listenOptions.UseHttps(x509);
});
});

builder.Services.Configure<DbScaffoldOptions>(builder.Configuration.GetSection("DbScaffoldOptions"));

builder.Services.Configure<DbScaffoldOptions>(
builder.Configuration.GetSection("DbScaffoldOptions")
);
builder.Services.AddScoped<IClaimsTransformation, ClaimsTransformer>();
builder.Services.AddTransient<IEmailSender, ARMMailSender>();
builder.Services.AddSingleton<IAudioFileConverter, AudioFileConverter>();
Expand Down
6 changes: 0 additions & 6 deletions mixyboos-api/Services/Extensions/AddOrUpdateExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.Extensions.Logging;
using MixyBoos.Api.Data.Models;

namespace MixyBoos.Api.Services.Extensions;
Expand Down
1 change: 0 additions & 1 deletion mixyboos-api/Services/Extensions/DbContextExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
Expand Down
3 changes: 0 additions & 3 deletions mixyboos-api/Services/Extensions/ModelBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.Extensions.Options;
using MixyBoos.Api.Data.Models;
using MixyBoos.Api.Data.Options;

Expand Down
4 changes: 0 additions & 4 deletions mixyboos-api/Services/Extensions/SlugifyExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using Bogus;
using Bogus.DataSets;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using MixyBoos.Api.Data;
using MixyBoos.Api.Data.Utils;
using MixyBoos.Api.Services.Helpers;

namespace MixyBoos.Api.Services.Extensions;

Expand Down
Loading

0 comments on commit 31d7305

Please sign in to comment.