* test add queueing to file service * further adjustments to download queueing * add check for whether the request is still in the queue to CheckQueue * forcefully release slot if download didn't finish in 15s * actually cancel the delay task * add metrics and refactor some of the request queue service * refactor pathing * reuse httpclient * add queue request dto to requestfile, enqueue users immediately if a slot is available * change startup to include all controllers * update server pathing * update pathing, again * several adjustments to auth, banning, jwt server tokens, renaming, authorization * update api I guess * adjust automated banning of charaident and reg * generate jwt on servers for internal authentication * remove mvcextensions Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
34 lines
1.7 KiB
C#
34 lines
1.7 KiB
C#
using MareSynchronosShared.Utils;
|
|
using System.Text;
|
|
|
|
namespace MareSynchronosStaticFilesServer;
|
|
|
|
public class StaticFilesServerConfiguration : MareConfigurationBase
|
|
{
|
|
public Uri FileServerGrpcAddress { get; set; } = null;
|
|
public int ForcedDeletionOfFilesAfterHours { get; set; } = -1;
|
|
public double CacheSizeHardLimitInGiB { get; set; } = -1;
|
|
public int UnusedFileRetentionPeriodInDays { get; set; } = 14;
|
|
public string CacheDirectory { get; set; }
|
|
public Uri? RemoteCacheSourceUri { get; set; } = null;
|
|
public Uri MainServerGrpcAddress { get; set; } = null;
|
|
public int DownloadQueueSize { get; set; } = 50;
|
|
public int DownloadTimeoutSeconds { get; set; } = 5;
|
|
public int DownloadQueueReleaseSeconds { get; set; } = 15;
|
|
public override string ToString()
|
|
{
|
|
StringBuilder sb = new();
|
|
sb.AppendLine(base.ToString());
|
|
sb.AppendLine($"{nameof(FileServerGrpcAddress)} => {FileServerGrpcAddress}");
|
|
sb.AppendLine($"{nameof(MainServerGrpcAddress)} => {MainServerGrpcAddress}");
|
|
sb.AppendLine($"{nameof(ForcedDeletionOfFilesAfterHours)} => {ForcedDeletionOfFilesAfterHours}");
|
|
sb.AppendLine($"{nameof(CacheSizeHardLimitInGiB)} => {CacheSizeHardLimitInGiB}");
|
|
sb.AppendLine($"{nameof(UnusedFileRetentionPeriodInDays)} => {UnusedFileRetentionPeriodInDays}");
|
|
sb.AppendLine($"{nameof(CacheDirectory)} => {CacheDirectory}");
|
|
sb.AppendLine($"{nameof(RemoteCacheSourceUri)} => {RemoteCacheSourceUri}");
|
|
sb.AppendLine($"{nameof(DownloadQueueSize)} => {DownloadQueueSize}");
|
|
sb.AppendLine($"{nameof(DownloadQueueReleaseSeconds)} => {DownloadQueueReleaseSeconds}");
|
|
return sb.ToString();
|
|
}
|
|
}
|