rework server responsibilities (#18)
* rework server responsibilities add remote configuration * start metrics only when compiled as not debug * add some more logging to discord bot * fixes of some casts * make metrics port configurable, minor fixes * add docker bullshit * md formatting * adjustments to docker stuff * fix docker json files, fix some stuff in discord bot, add /useradd for Discord bot * adjust docker configs and fix sharded.bat * fixes for logs, cache file provider repeat trying to open filestream Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
49
Docker/run/config/sharded/files-shard-1.json
Normal file
49
Docker/run/config/sharded/files-shard-1.json
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Host=/var/run/postgresql;Port=5432;Database=mare;Username=mare;Keepalive=15;Minimum Pool Size=10;Maximum Pool Size=50;No Reset On Close=true;Max Auto Prepare=50;Enlist=false"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"MareSynchronosStaticFilesServer": "Information",
|
||||
"MareSynchronosShared": "Information",
|
||||
"System.IO": "Information"
|
||||
},
|
||||
"File": {
|
||||
"BasePath": "logs",
|
||||
"FileAccessMode": "KeepOpenAndAutoFlush",
|
||||
"FileEncodingName": "utf-8",
|
||||
"DateFormat": "yyyMMdd",
|
||||
"MaxFileSize": 104857600,
|
||||
"Files": [
|
||||
{
|
||||
"Path": "<date:yyyy>/<date:MM>/<date:dd>/mare-<date:HH>-<counter:0000>.log"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"MareSynchronos": {
|
||||
"DbContextPoolSize": 512,
|
||||
"ShardName": "Files Shard 1",
|
||||
"MetricsPort": 6250,
|
||||
"FileServerGrpcAddress": "http://mare-files:6205",
|
||||
"ForcedDeletionOfFilesAfterHours": 2,
|
||||
"CacheSizeHardLimitInGiB": 5,
|
||||
"UnusedFileRetentionPeriodInDays": 14,
|
||||
"CacheDirectory": "/marecache/",
|
||||
"RemoteCacheSourceUri": "http://mare-files:6200/cache/",
|
||||
"MainServerGrpcAddress": "http://mare-server:6005"
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"Http": {
|
||||
"Url": "http://+:6200"
|
||||
}
|
||||
}
|
||||
},
|
||||
"IpRateLimiting": {},
|
||||
"IPRateLimitPolicies": {}
|
||||
}
|
||||
49
Docker/run/config/sharded/files-shard-2.json
Normal file
49
Docker/run/config/sharded/files-shard-2.json
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Host=/var/run/postgresql;Port=5432;Database=mare;Username=mare;Keepalive=15;Minimum Pool Size=10;Maximum Pool Size=50;No Reset On Close=true;Max Auto Prepare=50;Enlist=false"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"MareSynchronosStaticFilesServer": "Information",
|
||||
"MareSynchronosShared": "Information",
|
||||
"System.IO": "Information"
|
||||
},
|
||||
"File": {
|
||||
"BasePath": "logs",
|
||||
"FileAccessMode": "KeepOpenAndAutoFlush",
|
||||
"FileEncodingName": "utf-8",
|
||||
"DateFormat": "yyyMMdd",
|
||||
"MaxFileSize": 104857600,
|
||||
"Files": [
|
||||
{
|
||||
"Path": "<date:yyyy>/<date:MM>/<date:dd>/mare-<date:HH>-<counter:0000>.log"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"MareSynchronos": {
|
||||
"DbContextPoolSize": 512,
|
||||
"ShardName": "Files Shard 2",
|
||||
"MetricsPort": 6250,
|
||||
"FileServerGrpcAddress": "http://mare-files:6205",
|
||||
"ForcedDeletionOfFilesAfterHours": 2,
|
||||
"CacheSizeHardLimitInGiB": 5,
|
||||
"UnusedFileRetentionPeriodInDays": 14,
|
||||
"CacheDirectory": "/marecache/",
|
||||
"RemoteCacheSourceUri": "http://mare-files:6200/cache/",
|
||||
"MainServerGrpcAddress": "http://mare-server:6005"
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"Http": {
|
||||
"Url": "http://+:6200"
|
||||
}
|
||||
}
|
||||
},
|
||||
"IpRateLimiting": {},
|
||||
"IPRateLimitPolicies": {}
|
||||
}
|
||||
53
Docker/run/config/sharded/files-shard-main.json
Normal file
53
Docker/run/config/sharded/files-shard-main.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Host=/var/run/postgresql;Port=5432;Database=mare;Username=mare;Keepalive=15;Minimum Pool Size=10;Maximum Pool Size=50;No Reset On Close=true;Max Auto Prepare=50;Enlist=false"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"MareSynchronosStaticFilesServer": "Information",
|
||||
"MareSynchronosShared": "Information",
|
||||
"System.IO": "Information"
|
||||
},
|
||||
"File": {
|
||||
"BasePath": "logs",
|
||||
"FileAccessMode": "KeepOpenAndAutoFlush",
|
||||
"FileEncodingName": "utf-8",
|
||||
"DateFormat": "yyyMMdd",
|
||||
"MaxFileSize": 104857600,
|
||||
"Files": [
|
||||
{
|
||||
"Path": "<date:yyyy>/<date:MM>/<date:dd>/mare-<date:HH>-<counter:0000>.log"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"MareSynchronos": {
|
||||
"DbContextPoolSize": 512,
|
||||
"ShardName": "Files",
|
||||
"MetricsPort": 6250,
|
||||
"FileServerGrpcAddress": "",
|
||||
"ForcedDeletionOfFilesAfterHours": -1,
|
||||
"CacheSizeHardLimitInGiB": -1,
|
||||
"UnusedFileRetentionPeriodInDays": 14,
|
||||
"CacheDirectory": "/marecache/",
|
||||
"RemoteCacheSourceUri": "",
|
||||
"MainServerGrpcAddress": "http://mare-server:6005"
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"Http": {
|
||||
"Url": "http://+:6200"
|
||||
},
|
||||
"Grpc": {
|
||||
"Protocols": "Http2",
|
||||
"Url": "http://+:6205"
|
||||
}
|
||||
}
|
||||
},
|
||||
"IpRateLimiting": {},
|
||||
"IPRateLimitPolicies": {}
|
||||
}
|
||||
39
Docker/run/config/sharded/haproxy-shards.cfg
Normal file
39
Docker/run/config/sharded/haproxy-shards.cfg
Normal file
@@ -0,0 +1,39 @@
|
||||
global
|
||||
log /dev/log local0
|
||||
log /dev/log local1 notice
|
||||
daemon
|
||||
|
||||
ca-base /etc/ssl/certs
|
||||
crt-base /etc/ssl/private
|
||||
|
||||
ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
|
||||
ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
|
||||
ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
|
||||
|
||||
defaults
|
||||
log global
|
||||
mode http
|
||||
option httplog
|
||||
option dontlognull
|
||||
timeout connect 5000
|
||||
timeout client 50000
|
||||
timeout server 50000
|
||||
|
||||
frontend mare
|
||||
bind :6000
|
||||
default_backend mare-servers
|
||||
|
||||
frontend mare-files
|
||||
bind :6200
|
||||
default_backend mare-files
|
||||
|
||||
backend mare-servers
|
||||
balance leastconn
|
||||
cookie SERVER insert indirect nocache
|
||||
server mare1 mare-shard-1:6000 cookie mare1
|
||||
server mare2 mare-shard-2:6000 cookie mare2
|
||||
|
||||
backend mare-files
|
||||
balance roundrobin
|
||||
server files1 mare-files-shard-1:6200
|
||||
server files2 mare-files-shard-2:6200
|
||||
44
Docker/run/config/sharded/server-shard-1.json
Normal file
44
Docker/run/config/sharded/server-shard-1.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Host=/var/run/postgresql;Port=5432;Database=mare;Username=mare;Keepalive=15;Minimum Pool Size=10;Maximum Pool Size=50;No Reset On Close=true;Max Auto Prepare=50;Enlist=false"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"MareSynchronosServer": "Information",
|
||||
"MareSynchronosShared": "Information",
|
||||
"System.IO": "Information"
|
||||
},
|
||||
"File": {
|
||||
"BasePath": "logs",
|
||||
"FileAccessMode": "KeepOpenAndAutoFlush",
|
||||
"FileEncodingName": "utf-8",
|
||||
"DateFormat": "yyyMMdd",
|
||||
"MaxFileSize": 104857600,
|
||||
"Files": [
|
||||
{
|
||||
"Path": "<date:yyyy>/<date:MM>/<date:dd>/mare-<date:HH>-<counter:0000>.log"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"MareSynchronos": {
|
||||
"DbContextPoolSize": 512,
|
||||
"ShardName": "Shard 1",
|
||||
"MetricsPort": 6050,
|
||||
"MainServerGrpcAddress": "http://mare-server:6005",
|
||||
"RedisConnectionString": "redis,password=secretredispassword"
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"Http": {
|
||||
"Url": "http://+:6000"
|
||||
}
|
||||
}
|
||||
},
|
||||
"IpRateLimiting": {},
|
||||
"IPRateLimitPolicies": {}
|
||||
}
|
||||
44
Docker/run/config/sharded/server-shard-2.json
Normal file
44
Docker/run/config/sharded/server-shard-2.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Host=/var/run/postgresql;Port=5432;Database=mare;Username=mare;Keepalive=15;Minimum Pool Size=10;Maximum Pool Size=50;No Reset On Close=true;Max Auto Prepare=50;Enlist=false"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"MareSynchronosServer": "Information",
|
||||
"MareSynchronosShared": "Information",
|
||||
"System.IO": "Information"
|
||||
},
|
||||
"File": {
|
||||
"BasePath": "logs",
|
||||
"FileAccessMode": "KeepOpenAndAutoFlush",
|
||||
"FileEncodingName": "utf-8",
|
||||
"DateFormat": "yyyMMdd",
|
||||
"MaxFileSize": 104857600,
|
||||
"Files": [
|
||||
{
|
||||
"Path": "<date:yyyy>/<date:MM>/<date:dd>/mare-<date:HH>-<counter:0000>.log"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"MareSynchronos": {
|
||||
"DbContextPoolSize": 512,
|
||||
"ShardName": "Shard 2",
|
||||
"MetricsPort": 6050,
|
||||
"MainServerGrpcAddress": "http://mare-server:6005",
|
||||
"RedisConnectionString": "redis,password=secretredispassword"
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"Http": {
|
||||
"Url": "http://+:6000"
|
||||
}
|
||||
}
|
||||
},
|
||||
"IpRateLimiting": {},
|
||||
"IPRateLimitPolicies": {}
|
||||
}
|
||||
60
Docker/run/config/sharded/server-shard-main.json
Normal file
60
Docker/run/config/sharded/server-shard-main.json
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Host=/var/run/postgresql;Port=5432;Database=mare;Username=mare;Keepalive=15;Minimum Pool Size=10;Maximum Pool Size=50;No Reset On Close=true;Max Auto Prepare=50;Enlist=false"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"MareSynchronosServer": "Information",
|
||||
"MareSynchronosShared": "Information",
|
||||
"System.IO": "Information"
|
||||
},
|
||||
"File": {
|
||||
"BasePath": "logs",
|
||||
"FileAccessMode": "KeepOpenAndAutoFlush",
|
||||
"FileEncodingName": "utf-8",
|
||||
"DateFormat": "yyyMMdd",
|
||||
"MaxFileSize": 104857600,
|
||||
"Files": [
|
||||
{
|
||||
"Path": "<date:yyyy>/<date:MM>/<date:dd>/mare-<date:HH>-<counter:0000>.log"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"MareSynchronos": {
|
||||
"DbContextPoolSize": 512,
|
||||
"ShardName": "Main",
|
||||
"MetricsPort": 6050,
|
||||
"MainServerGrpcAddress": "",
|
||||
"FailedAuthForTempBan": 5,
|
||||
"TempBanDurationInMinutes": 5,
|
||||
"WhitelistedIps": [
|
||||
""
|
||||
],
|
||||
"RedisConnectionString": "redis,password=secretredispassword",
|
||||
"CdnFullUrl": "http://localhost:6200/cache/",
|
||||
"StaticFileServiceAddress": "http://mare-files:6205",
|
||||
"MaxExistingGroupsByUser": 3,
|
||||
"MaxJoinedGroupsByUser": 6,
|
||||
"MaxGroupUserCount": 100,
|
||||
"PurgeUnusedAccounts": false,
|
||||
"PurgeUnusedAccountsPeriodInDays": 14
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"Http": {
|
||||
"Url": "http://+:6000"
|
||||
},
|
||||
"Grpc": {
|
||||
"Protocols": "Http2",
|
||||
"Url": "http://+:6005"
|
||||
}
|
||||
}
|
||||
},
|
||||
"IpRateLimiting": {},
|
||||
"IPRateLimitPolicies": {}
|
||||
}
|
||||
53
Docker/run/config/standalone/files-standalone.json
Normal file
53
Docker/run/config/standalone/files-standalone.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Host=/var/run/postgresql;Port=5432;Database=mare;Username=mare;Keepalive=15;Minimum Pool Size=10;Maximum Pool Size=50;No Reset On Close=true;Max Auto Prepare=50;Enlist=false"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"MareSynchronosStaticFilesServer": "Information",
|
||||
"MareSynchronosShared": "Information",
|
||||
"System.IO": "Information"
|
||||
},
|
||||
"File": {
|
||||
"BasePath": "logs",
|
||||
"FileAccessMode": "KeepOpenAndAutoFlush",
|
||||
"FileEncodingName": "utf-8",
|
||||
"DateFormat": "yyyMMdd",
|
||||
"MaxFileSize": 104857600,
|
||||
"Files": [
|
||||
{
|
||||
"Path": "<date:yyyy>/<date:MM>/<date:dd>/mare-<date:HH>-<counter:0000>.log"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"MareSynchronos": {
|
||||
"DbContextPoolSize": 512,
|
||||
"ShardName": "Files",
|
||||
"MetricsPort": 6250,
|
||||
"FileServerGrpcAddress": "",
|
||||
"ForcedDeletionOfFilesAfterHours": -1,
|
||||
"CacheSizeHardLimitInGiB": -1,
|
||||
"UnusedFileRetentionPeriodInDays": 14,
|
||||
"CacheDirectory": "/marecache/",
|
||||
"RemoteCacheSourceUri": "",
|
||||
"MainServerGrpcAddress": "http://mare-server:6005"
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"Http": {
|
||||
"Url": "http://+:6200"
|
||||
},
|
||||
"Grpc": {
|
||||
"Protocols": "Http2",
|
||||
"Url": "http://+:6205"
|
||||
}
|
||||
}
|
||||
},
|
||||
"IpRateLimiting": {},
|
||||
"IPRateLimitPolicies": {}
|
||||
}
|
||||
60
Docker/run/config/standalone/server-standalone.json
Normal file
60
Docker/run/config/standalone/server-standalone.json
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Host=/var/run/postgresql;Port=5432;Database=mare;Username=mare;Keepalive=15;Minimum Pool Size=10;Maximum Pool Size=50;No Reset On Close=true;Max Auto Prepare=50;Enlist=false"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"MareSynchronosServer": "Information",
|
||||
"MareSynchronosShared": "Information",
|
||||
"System.IO": "Information"
|
||||
},
|
||||
"File": {
|
||||
"BasePath": "logs",
|
||||
"FileAccessMode": "KeepOpenAndAutoFlush",
|
||||
"FileEncodingName": "utf-8",
|
||||
"DateFormat": "yyyMMdd",
|
||||
"MaxFileSize": 104857600,
|
||||
"Files": [
|
||||
{
|
||||
"Path": "<date:yyyy>/<date:MM>/<date:dd>/mare-<date:HH>-<counter:0000>.log"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"MareSynchronos": {
|
||||
"DbContextPoolSize": 512,
|
||||
"ShardName": "Main",
|
||||
"MetricsPort": 6050,
|
||||
"MainServerGrpcAddress": "",
|
||||
"FailedAuthForTempBan": 5,
|
||||
"TempBanDurationInMinutes": 5,
|
||||
"WhitelistedIps": [
|
||||
""
|
||||
],
|
||||
"RedisConnectionString": "",
|
||||
"CdnFullUrl": "http://localhost:6200/cache/",
|
||||
"StaticFileServiceAddress": "http://mare-files:6205",
|
||||
"MaxExistingGroupsByUser": 3,
|
||||
"MaxJoinedGroupsByUser": 6,
|
||||
"MaxGroupUserCount": 100,
|
||||
"PurgeUnusedAccounts": false,
|
||||
"PurgeUnusedAccountsPeriodInDays": 14
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"Http": {
|
||||
"Url": "http://+:6000"
|
||||
},
|
||||
"Grpc": {
|
||||
"Protocols": "Http2",
|
||||
"Url": "http://+:6005"
|
||||
}
|
||||
}
|
||||
},
|
||||
"IpRateLimiting": {},
|
||||
"IPRateLimitPolicies": {}
|
||||
}
|
||||
39
Docker/run/config/standalone/services-standalone.json
Normal file
39
Docker/run/config/standalone/services-standalone.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Host=/var/run/postgresql;Port=5432;Database=mare;Username=mare;Keepalive=15;Minimum Pool Size=10;Maximum Pool Size=50;No Reset On Close=true;Max Auto Prepare=50;Enlist=false"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"MareSynchronosServices": "Information",
|
||||
"MareSynchronosShared": "Information",
|
||||
"System.IO": "Information"
|
||||
},
|
||||
"File": {
|
||||
"BasePath": "logs",
|
||||
"FileAccessMode": "KeepOpenAndAutoFlush",
|
||||
"FileEncodingName": "utf-8",
|
||||
"DateFormat": "yyyMMdd",
|
||||
"MaxFileSize": 104857600,
|
||||
"Files": [
|
||||
{
|
||||
"Path": "<date:yyyy>/<date:MM>/<date:dd>/mare-<date:HH>-<counter:0000>.log"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"MareSynchronos": {
|
||||
"DbContextPoolSize": 512,
|
||||
"ShardName": "Services",
|
||||
"MetricsPort": 6150,
|
||||
"MainServerGrpcAddress": "http://mare-server:6005",
|
||||
"DiscordBotToken": ""
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
},
|
||||
"IpRateLimiting": {},
|
||||
"IPRateLimitPolicies": {}
|
||||
}
|
||||
Reference in New Issue
Block a user