Skip to content

Commit

Permalink
Merge pull request #44 from bobbahbrown/v1.3.12
Browse files Browse the repository at this point in the history
Version 1.3.12 - Add user agent for scraper, add Shiptest 13
  • Loading branch information
bobbah authored Aug 22, 2021
2 parents 1b2d04e + 67d40b5 commit d8f050a
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 18 deletions.
29 changes: 27 additions & 2 deletions .idea/.idea.CentCom/.idea/workspace.xml

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

23 changes: 12 additions & 11 deletions CentCom.API/CentCom.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Version>1.3.11</Version>
<Version>1.3.12</Version>
<UserSecretsId>1f5f48fa-862f-4472-ba34-2c5a26035e88</UserSecretsId>
</PropertyGroup>

Expand All @@ -15,19 +15,20 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449"/>
<PackageReference Include="Enums.NET" Version="4.0.0"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.9"/>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.9"/>
<PackageReference Include="Npgsql" Version="5.0.7"/>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.7"/>
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.1.5"/>
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.1.5"/>
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUi" Version="6.1.5"/>
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" />
<PackageReference Include="Enums.NET" Version="4.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.9" />
<PackageReference Include="Npgsql" Version="5.0.7" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.7" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.1.5" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.1.5" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUi" Version="6.1.5" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CentCom.Common\CentCom.Common.csproj"/>
<ProjectReference Include="..\CentCom.Common\CentCom.Common.csproj" />
</ItemGroup>


Expand Down
13 changes: 13 additions & 0 deletions CentCom.API/Controllers/ScraperInfoController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Mvc;

namespace CentCom.API.Controllers
{
[Route("scraper")]
public class ScraperInfoController : Controller
{
public IActionResult Index()
{
return View();
}
}
}
2 changes: 1 addition & 1 deletion CentCom.API/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void ConfigureServices(IServiceCollection services)
{
x.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
x.JsonSerializerOptions.IgnoreNullValues = true;
});
}).AddRazorRuntimeCompilation();

// Add DB context
var dbConfig = new DbConfig();
Expand Down
12 changes: 12 additions & 0 deletions CentCom.API/Views/ScraperInfo/index.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@{
ViewBag.Title = "CentCom";
}
<h2 class="mb-3">Data Aggregation Bots</h2>
<p>
CentCom makes use of automated data aggregators which collect information from consenting websites. The information provided by our consenting partners is temporarily replicated within CentCom's databases, and is
updated often to reflect any modification or deletion of the source data. If your site is being parsed by CentCom without your consent, or you otherwise have any issues, contact the
developer bobbahbrown through Discord at bobbahbrown#0001.
</p>
<p>
Our aggregators can be identified by their user agent: <code>Mozilla/5.0 (compatible; CentComBot/&lt;version&gt; +https://centcom.melonmesa.com/scraper)</code>
</p>
2 changes: 1 addition & 1 deletion CentCom.Bot/CentCom.Bot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<Version>1.3.11</Version>
<Version>1.3.12</Version>
<TargetFramework>net5.0</TargetFramework>
<UserSecretsId>c8af1449-8cdf-4707-a66d-51e896551bfb</UserSecretsId>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion CentCom.Common/CentCom.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Version>1.3.11</Version>
<Version>1.3.12</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion CentCom.Exporter/CentCom.Exporter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Version>1.3.11</Version>
<Version>1.3.12</Version>
<UserSecretsId>a625260b-31a1-4f4b-84f4-96ccc7a335e7</UserSecretsId>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion CentCom.Server/CentCom.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<Version>1.3.11</Version>
<Version>1.3.12</Version>
<UserSecretsId>94572412-7eb8-4652-aff2-8afc154cf139</UserSecretsId>
</PropertyGroup>

Expand Down
6 changes: 6 additions & 0 deletions CentCom.Server/Services/RestBanService.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Reflection;
using System.Text;
using CentCom.Server.Exceptions;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -39,6 +40,11 @@ protected void FailedRequest(IRestResponse response)
protected void InitializeClient()
{
Client = BaseUrl != null ? new RestClient(BaseUrl) : null;
if (Client == null)
return;

// Setup user agent
Client.UserAgent = $"Mozilla/5.0 (compatible; CentComBot/{Assembly.GetExecutingAssembly().GetName().Version}; +https://centcom.melonmesa.com/scraper)";
}
}
}
6 changes: 6 additions & 0 deletions CentCom.Server/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@
"allowFulpExpiredSSL": true
},
"standardSources": [
{
"id": "shiptest",
"display": "Shiptest 13",
"roleplayLevel": "Medium",
"url": "https://bans.shiptest.ga/"
}
]
}

0 comments on commit d8f050a

Please sign in to comment.