Fix whitespace

parent a45a9711
Pipeline #240 passed with stage
in 1 minute and 5 seconds
.vs/
bin/
obj/
.vs/
bin/
obj/
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
namespace go.schub.wtf.Controllers
{
[ApiController]
[Route("/")]
public class LinksController : ControllerBase
{
private readonly IConfiguration _configuration;
namespace go.schub.wtf.Controllers
{
[ApiController]
[Route("/")]
public class LinksController : ControllerBase
{
private readonly IConfiguration _configuration;
private readonly IStorage _storage;
public LinksController(IConfiguration configuration, IStorage storage)
......@@ -16,20 +16,20 @@ namespace go.schub.wtf.Controllers
_configuration = configuration;
_storage = storage;
}
[HttpGet("/_refresh")]
[HttpGet("/_refresh")]
public string Refresh()
{
var links = GistLoader.LoadLinks(_configuration["GistID"]);
_storage.StoreLinksAsync(links);
return "success";
}
[HttpGet("{*key}")]
}
[HttpGet("{*key}")]
public async System.Threading.Tasks.Task<RedirectResult> GetLinkAsync(string key)
{
var url = await _storage.GetLinkAsync(key);
return Redirect(url.URL);
}
}
}
}
}
}
# This is what VS created, and it's running as root. ¯\_(ツ)_/¯
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY go.schub.wtf.csproj ./
RUN dotnet restore "./go.schub.wtf.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "go.schub.wtf.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "go.schub.wtf.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "go.schub.wtf.dll"]
# This is what VS created, and it's running as root. ¯\_(ツ)_/¯
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY go.schub.wtf.csproj ./
RUN dotnet restore "./go.schub.wtf.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "go.schub.wtf.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "go.schub.wtf.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "go.schub.wtf.dll"]
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using System.Net;
using Newtonsoft.Json.Linq;
......
namespace go.schub.wtf
namespace go.schub.wtf
{
public readonly struct Link
{
......
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using Microsoft.Extensions.Configuration;
using StackExchange.Redis;
......
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace go.schub.wtf
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace go.schub.wtf
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace go.schub.wtf
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddSingleton<IStorage, Storage>();
StackExchange.Redis.ConnectionMultiplexer.SetFeatureFlag("preventthreadtheft", true);
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
}
}
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace go.schub.wtf
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddSingleton<IStorage, Storage>();
StackExchange.Redis.ConnectionMultiplexer.SetFeatureFlag("preventthreadtheft", true);
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
}
}
version: "3"
services:
redis:
image: redis:latest
restart: always
expose:
- 6379
app:
image: docker-registry.0b101010.codes/schub.wtf/go.schub.wtf-dotnet:latest
restart: always
links:
- redis
volumes:
- ./appsettings.json:/app/appsettings.json
ports:
- "5000:5000"
version: "3"
services:
redis:
image: redis:latest
restart: always
expose:
- 6379
app:
image: docker-registry.0b101010.codes/schub.wtf/go.schub.wtf-dotnet:latest
restart: always
links:
- redis
volumes:
- ./appsettings.json:/app/appsettings.json
ports:
- "5000:5000"
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UserSecretsId>02188a8e-0246-4d39-ba0d-718a0684fd94</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="StackExchange.Redis" Version="2.1.30" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>
<ItemGroup>
<Folder Include="Lib\" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UserSecretsId>02188a8e-0246-4d39-ba0d-718a0684fd94</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="StackExchange.Redis" Version="2.1.30" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>
<ItemGroup>
<Folder Include="Lib\" />
</ItemGroup>
</Project>
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "go.schub.wtf", "go.schub.wtf.csproj", "{F475E597-330F-4625-9F33-A2B46FC8CC0E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F475E597-330F-4625-9F33-A2B46FC8CC0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F475E597-330F-4625-9F33-A2B46FC8CC0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F475E597-330F-4625-9F33-A2B46FC8CC0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F475E597-330F-4625-9F33-A2B46FC8CC0E}.Release|Any CPU.Build.0 = Release|Any CPU
{446502D2-7408-4E51-892B-6867DF49E9D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{446502D2-7408-4E51-892B-6867DF49E9D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{446502D2-7408-4E51-892B-6867DF49E9D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{446502D2-7408-4E51-892B-6867DF49E9D3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "go.schub.wtf", "go.schub.wtf.csproj", "{F475E597-330F-4625-9F33-A2B46FC8CC0E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F475E597-330F-4625-9F33-A2B46FC8CC0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F475E597-330F-4625-9F33-A2B46FC8CC0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F475E597-330F-4625-9F33-A2B46FC8CC0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F475E597-330F-4625-9F33-A2B46FC8CC0E}.Release|Any CPU.Build.0 = Release|Any CPU
{446502D2-7408-4E51-892B-6867DF49E9D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{446502D2-7408-4E51-892B-6867DF49E9D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{446502D2-7408-4E51-892B-6867DF49E9D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{446502D2-7408-4E51-892B-6867DF49E9D3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment