1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00

Use Kerstrel instead of Caddy

This commit is contained in:
Maksym Pavlenko
2017-01-04 11:32:04 -08:00
parent 84a4888be7
commit 39f1bd7c55
7 changed files with 9 additions and 59 deletions

View File

@@ -1,2 +0,0 @@
FROM zzrot/alpine-caddy
COPY Caddyfile /etc/Caddyfile

View File

@@ -1,38 +0,0 @@
http://podsync.net, https://podsync.net, http://new.podsync.net, https://new.podsync.net, http://localhost:2015
{
gzip
errors stdout
ratelimit 2 3 second {
/feed
/download
}
proxy / {%REDIRECT_HOST%}:{%REDIRECT_PORT%} {
header_upstream Host {host}
transparent
}
tls pavlenko.maksym@gmail.com
header / {
# Remove ASP.NET specific headers
-Server
-X-Powered-By
-X-Sourcefiles
# Enable cross-site filter (XSS) and tell browser to block detected attacks
X-XSS-Protection "1; mode=block"
# Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
X-Content-Type-Options "nosniff"
# Disallow the site to be rendered within a frame (clickjacking protection)
X-Frame-Options "DENY"
}
}
www.podsync.net {
redir https://podsync.net{uri}
}

View File

@@ -8,7 +8,7 @@ namespace Podsync
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseKestrel(options => options.AddServerHeader = false)
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()

View File

@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Http.Authentication;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Podsync.Helpers;
using Podsync.Services;
using Podsync.Services.Builder;
using Podsync.Services.Links;
@@ -82,6 +83,7 @@ namespace Podsync
{
AutomaticAuthenticate = true,
AutomaticChallenge = true,
CookieName = "podsync_cookies",
LoginPath = new PathString("/login"),
LogoutPath = new PathString("/logout")
});

View File

@@ -6,8 +6,4 @@ Remove-Item $OUTPUT_DIR -Force -Recurse -ErrorAction Ignore
& "dotnet" publish --configuration release --output $OUTPUT_DIR
& "docker" build -t podsync .
# docker run -d -p 5001:5001 podsync
& "docker-compose" up -d
& "docker-compose" up -d --build

View File

@@ -15,6 +15,6 @@
"PatreonSecret": ""
},
"ApplicationInsights": {
"InstrumentationKey": ""
"InstrumentationKey": "7250dc81-d025-4fa5-af49-6d8ea8024863"
}
}

View File

@@ -7,7 +7,9 @@ services:
context: .
dockerfile: Dockerfile
args:
- PORT=56247
- PORT=80
ports:
- 80:80
environment:
- Podsync:RedisConnectionString=redis
env_file:
@@ -16,14 +18,4 @@ services:
image: redis
command: redis-server --appendonly yes
volumes:
- /redis_data:/data
caddy:
build:
context: .
dockerfile: Caddy.Dockerfile
ports:
- 80:80
- 443:443
environment:
- REDIRECT_HOST=app
- REDIRECT_PORT=56247
- /data/redis:/data