diff --git a/.gitignore b/.gitignore index 77713e8..9cd5497 100644 --- a/.gitignore +++ b/.gitignore @@ -260,5 +260,5 @@ paket-files/ __pycache__/ i*.pyc -# For Visual Studio Code -*/.vscode/ +# For Visual Studio Code. +.vscode diff --git a/Migrations/20180304034317_initial.Designer.cs b/Migrations/20180304034317_initial.Designer.cs deleted file mode 100644 index cab3af1..0000000 --- a/Migrations/20180304034317_initial.Designer.cs +++ /dev/null @@ -1,98 +0,0 @@ -// -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; -using System.Collections.Generic; -using YTManager; - -namespace YTManager.Migrations -{ - [DbContext(typeof(MediaDB))] - [Migration("20180304034317_initial")] - partial class initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); - - modelBuilder.Entity("YTManager.Models.Channel", b => - { - b.Property("PrimaryKey") - .ValueGeneratedOnAdd(); - - b.Property("AddedtoDB"); - - b.Property("Description") - .IsRequired(); - - b.Property("Refreshed"); - - b.Property("ThumbnailURL") - .IsRequired(); - - b.Property("Title") - .IsRequired(); - - b.Property>("UserTags"); - - b.Property("YoutubeID") - .IsRequired(); - - b.HasKey("PrimaryKey"); - - b.ToTable("Channels"); - }); - - modelBuilder.Entity("YTManager.Models.Video", b => - { - b.Property("PrimaryKey") - .ValueGeneratedOnAdd(); - - b.Property("AddedToYT"); - - b.Property("AddedtoDB"); - - b.Property("ChannelPrimaryKey"); - - b.Property("Description") - .IsRequired(); - - b.Property("Duration"); - - b.Property>("Tags") - .IsRequired(); - - b.Property("ThumbnailURL") - .IsRequired(); - - b.Property("Title") - .IsRequired(); - - b.Property("YoutubeID") - .IsRequired(); - - b.HasKey("PrimaryKey"); - - b.HasIndex("ChannelPrimaryKey"); - - b.ToTable("Videos"); - }); - - modelBuilder.Entity("YTManager.Models.Video", b => - { - b.HasOne("YTManager.Models.Channel", "Channel") - .WithMany("Videos") - .HasForeignKey("ChannelPrimaryKey") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20180305045634_Tag change.Designer.cs b/Migrations/20180305045634_Tag change.Designer.cs deleted file mode 100644 index f3337d7..0000000 --- a/Migrations/20180305045634_Tag change.Designer.cs +++ /dev/null @@ -1,98 +0,0 @@ -// -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; -using System.Collections.Generic; -using YTManager; - -namespace YTManager.Migrations -{ - [DbContext(typeof(MediaDB))] - [Migration("20180305045634_Tag change")] - partial class Tagchange - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); - - modelBuilder.Entity("YTManager.Models.Channel", b => - { - b.Property("PrimaryKey") - .ValueGeneratedOnAdd(); - - b.Property("AddedtoDB"); - - b.Property("Description") - .IsRequired(); - - b.Property("Refreshed"); - - b.Property("ThumbnailURL") - .IsRequired(); - - b.Property("Title") - .IsRequired(); - - b.Property>("UserTags"); - - b.Property("YoutubeID") - .IsRequired(); - - b.HasKey("PrimaryKey"); - - b.ToTable("Channels"); - }); - - modelBuilder.Entity("YTManager.Models.Video", b => - { - b.Property("PrimaryKey") - .ValueGeneratedOnAdd(); - - b.Property("AddedToYT"); - - b.Property("AddedtoDB"); - - b.Property("ChannelPrimaryKey"); - - b.Property("Description") - .IsRequired(); - - b.Property("Duration"); - - b.Property>("Tags") - .IsRequired(); - - b.Property("ThumbnailURL") - .IsRequired(); - - b.Property("Title") - .IsRequired(); - - b.Property("YoutubeID") - .IsRequired(); - - b.HasKey("PrimaryKey"); - - b.HasIndex("ChannelPrimaryKey"); - - b.ToTable("Videos"); - }); - - modelBuilder.Entity("YTManager.Models.Video", b => - { - b.HasOne("YTManager.Models.Channel", "Channel") - .WithMany("Videos") - .HasForeignKey("ChannelPrimaryKey") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20180305045634_Tag change.cs b/Migrations/20180305045634_Tag change.cs deleted file mode 100644 index ef414ef..0000000 --- a/Migrations/20180305045634_Tag change.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; - -namespace YTManager.Migrations -{ - public partial class Tagchange : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/Migrations/20180305052950_Made tags required.Designer.cs b/Migrations/20180305052950_Made tags required.Designer.cs deleted file mode 100644 index ca16736..0000000 --- a/Migrations/20180305052950_Made tags required.Designer.cs +++ /dev/null @@ -1,99 +0,0 @@ -// -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; -using System.Collections.Generic; -using YTManager; - -namespace YTManager.Migrations -{ - [DbContext(typeof(MediaDB))] - [Migration("20180305052950_Made tags required")] - partial class Madetagsrequired - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); - - modelBuilder.Entity("YTManager.Models.Channel", b => - { - b.Property("PrimaryKey") - .ValueGeneratedOnAdd(); - - b.Property("AddedtoDB"); - - b.Property("Description") - .IsRequired(); - - b.Property("Refreshed"); - - b.Property("ThumbnailURL") - .IsRequired(); - - b.Property("Title") - .IsRequired(); - - b.Property("UserTags") - .IsRequired(); - - b.Property("YoutubeID") - .IsRequired(); - - b.HasKey("PrimaryKey"); - - b.ToTable("Channels"); - }); - - modelBuilder.Entity("YTManager.Models.Video", b => - { - b.Property("PrimaryKey") - .ValueGeneratedOnAdd(); - - b.Property("AddedToYT"); - - b.Property("AddedtoDB"); - - b.Property("ChannelPrimaryKey"); - - b.Property("Description") - .IsRequired(); - - b.Property("Duration"); - - b.Property>("Tags") - .IsRequired(); - - b.Property("ThumbnailURL") - .IsRequired(); - - b.Property("Title") - .IsRequired(); - - b.Property("YoutubeID") - .IsRequired(); - - b.HasKey("PrimaryKey"); - - b.HasIndex("ChannelPrimaryKey"); - - b.ToTable("Videos"); - }); - - modelBuilder.Entity("YTManager.Models.Video", b => - { - b.HasOne("YTManager.Models.Channel", "Channel") - .WithMany("Videos") - .HasForeignKey("ChannelPrimaryKey") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20180305052950_Made tags required.cs b/Migrations/20180305052950_Made tags required.cs deleted file mode 100644 index dd05956..0000000 --- a/Migrations/20180305052950_Made tags required.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; - -namespace YTManager.Migrations -{ - public partial class Madetagsrequired : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "UserTags", - table: "Channels", - nullable: false, - oldClrType: typeof(List), - oldNullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn>( - name: "UserTags", - table: "Channels", - nullable: true, - oldClrType: typeof(string[])); - } - } -} diff --git a/Migrations/20180305055427_Fixed videos tags.cs b/Migrations/20180305055427_Fixed videos tags.cs deleted file mode 100644 index 19b58bf..0000000 --- a/Migrations/20180305055427_Fixed videos tags.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; - -namespace YTManager.Migrations -{ - public partial class Fixedvideostags : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/Migrations/20180305055427_Fixed videos tags.Designer.cs b/Migrations/20190127210534_initial.Designer.cs similarity index 89% rename from Migrations/20180305055427_Fixed videos tags.Designer.cs rename to Migrations/20190127210534_initial.Designer.cs index 196c33e..08e458a 100644 --- a/Migrations/20180305055427_Fixed videos tags.Designer.cs +++ b/Migrations/20190127210534_initial.Designer.cs @@ -1,25 +1,25 @@ // +using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using YTManager; namespace YTManager.Migrations { [DbContext(typeof(MediaDB))] - [Migration("20180305055427_Fixed videos tags")] - partial class Fixedvideostags + [Migration("20190127210534_initial")] + partial class initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); + .HasAnnotation("ProductVersion", "2.2.1-servicing-10028") + .HasAnnotation("Relational:MaxIdentifierLength", 63); modelBuilder.Entity("YTManager.Models.Channel", b => { diff --git a/Migrations/20180304034317_initial.cs b/Migrations/20190127210534_initial.cs similarity index 91% rename from Migrations/20180304034317_initial.cs rename to Migrations/20190127210534_initial.cs index 613a523..b339f02 100644 --- a/Migrations/20180304034317_initial.cs +++ b/Migrations/20190127210534_initial.cs @@ -1,7 +1,6 @@ -using Microsoft.EntityFrameworkCore.Metadata; +using System; using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace YTManager.Migrations { @@ -15,13 +14,13 @@ namespace YTManager.Migrations { PrimaryKey = table.Column(nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), - AddedtoDB = table.Column(nullable: false), - Description = table.Column(nullable: false), - Refreshed = table.Column(nullable: false), - ThumbnailURL = table.Column(nullable: false), Title = table.Column(nullable: false), - UserTags = table.Column>(nullable: true), - YoutubeID = table.Column(nullable: false) + Description = table.Column(nullable: false), + ThumbnailURL = table.Column(nullable: false), + YoutubeID = table.Column(nullable: false), + AddedtoDB = table.Column(nullable: false), + Refreshed = table.Column(nullable: false), + UserTags = table.Column(nullable: false) }, constraints: table => { @@ -34,15 +33,15 @@ namespace YTManager.Migrations { PrimaryKey = table.Column(nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), + Title = table.Column(nullable: false), + Description = table.Column(nullable: false), + YoutubeID = table.Column(nullable: false), + ThumbnailURL = table.Column(nullable: false), AddedToYT = table.Column(nullable: false), AddedtoDB = table.Column(nullable: false), - ChannelPrimaryKey = table.Column(nullable: false), - Description = table.Column(nullable: false), Duration = table.Column(nullable: false), - Tags = table.Column>(nullable: false), - ThumbnailURL = table.Column(nullable: false), - Title = table.Column(nullable: false), - YoutubeID = table.Column(nullable: false) + ChannelPrimaryKey = table.Column(nullable: false), + Tags = table.Column(nullable: false) }, constraints: table => { diff --git a/Migrations/MediaDBModelSnapshot.cs b/Migrations/MediaDBModelSnapshot.cs index db62a9a..f53438f 100644 --- a/Migrations/MediaDBModelSnapshot.cs +++ b/Migrations/MediaDBModelSnapshot.cs @@ -1,11 +1,9 @@ // +using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using YTManager; namespace YTManager.Migrations @@ -18,7 +16,8 @@ namespace YTManager.Migrations #pragma warning disable 612, 618 modelBuilder .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); + .HasAnnotation("ProductVersion", "2.2.1-servicing-10028") + .HasAnnotation("Relational:MaxIdentifierLength", 63); modelBuilder.Entity("YTManager.Models.Channel", b => { diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json index 4333360..02559fd 100644 --- a/Properties/launchSettings.json +++ b/Properties/launchSettings.json @@ -20,7 +20,7 @@ "commandName": "Project", "launchUrl": "api/values", "environmentVariables": { - "POSTGRESQL_DBSTR": "Server=192.168.1.2;Port=32768;Database=postgres;User Id=postgres;", + "POSTGRESQL_DBSTR": "Server=localhost;Port=32768;Database=DumbYT;User Id=DumbYT;Password=DumbYTPassword;", "ASPNETCORE_ENVIRONMENT": "Development" }, "applicationUrl": "http://localhost:62214/" diff --git a/Startup.cs b/Startup.cs index 8d010ee..8577dd1 100644 --- a/Startup.cs +++ b/Startup.cs @@ -18,7 +18,7 @@ namespace YTManager { public static string DBStr { get { string s = Environment.GetEnvironmentVariable("POSTGRESQL_DBSTR"); - s = s ?? "Server=localhost;Port=32768;Database=postgres;User Id=postgres;"; + s = s ?? "Server=localhost;Port=32768;Database=DumbYT;User Id=DumbYT;Password=DumbYTPassword;"; return s; } } diff --git a/YTManager.csproj b/YTManager.csproj index e6bd364..1056508 100644 --- a/YTManager.csproj +++ b/YTManager.csproj @@ -1,38 +1,38 @@ - netcoreapp2.0 + netcoreapp2.2 2.5 - - - + + + - + - - - - - - - + + + + + + + - - + + diff --git a/dumbyt_dotnet.service b/dumbyt_dotnet.service index c211065..c1ffc42 100644 --- a/dumbyt_dotnet.service +++ b/dumbyt_dotnet.service @@ -4,8 +4,8 @@ After=network-online.target Wants=network-online.target systemd-networkd-wait-online.service [Service] -WorkingDirectory=/root/BackEnd/bin/Debug/netcoreapp2.0/ -ExecStart=/usr/bin/dotnet /root/BackEnd/bin/Debug/netcoreapp2.0/YTManager.dll +WorkingDirectory=/var/www/BackEnd/bin/Release/netcoreapp2.0/ +ExecStart=/usr/bin/dotnet /var/www/BackEnd/bin/Release/netcoreapp2.0/YTManager.dll ; Restart configuration Restart=always @@ -14,13 +14,13 @@ Restart=always SyslogIdentifier=dumbyt_dotnet ; User and Cgroup the process will run as. -User=root -Group=root +User=hak8or +Group=hak8or Environment=ASPNETCORE_ENVIRONMENT=Production Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false Environment=ASPNETCORE_URLS="http://*:62214" -Environment=POSTGRESQL_DBSTR="Server=192.168.1.2;Port=32768;Database=postgres;User Id=postgres;" +Environment=POSTGRESQL_DBSTR="Server=10.10.10.200;Port=32768;Database=DumbYT;User Id=DumbYT;Password=DumbYT;" [Install] WantedBy=multi-user.target