Store S3 public host address

This commit is contained in:
2023-07-31 12:53:05 +01:00
parent 55c96a73b9
commit aa00be72d5
3 changed files with 5 additions and 6 deletions

View File

@ -58,4 +58,5 @@ public sealed class S3BlobConfig
public string? Region { get; init; }
public string BucketName { get; init; } = "zap-stream-dvr";
public bool DisablePayloadSigning { get; init; }
public Uri PublicHost { get; init; } = null!;
}

View File

@ -75,14 +75,11 @@ public class S3DvrStore : IDvrStore
var tsUpload = sw.Elapsed;
var ret = new UriBuilder(url)
{
Scheme = _config.ServiceUrl.Scheme
};
var ret = new Uri(_config.PublicHost, new Uri(url).AbsolutePath);
_logger.LogInformation("download={tc:#,##0}ms, probe={pc:#,##0}ms, upload={uc:#,##0}ms", tsDownload.TotalMilliseconds,
tsProbe.TotalMilliseconds, tsUpload.TotalMilliseconds);
return new(ret.Uri, probe.Duration.TotalSeconds);
return new(ret, probe.Duration.TotalSeconds);
}
}

View File

@ -28,7 +28,8 @@
"DvrStore": {
"ServiceUrl": "http://localhost:9010",
"AccessKey": "TQcxug1ZAXfnZ5bvc9n5",
"SecretKey": "p7EK4qew6DBkBPqrpRPuJgTOc6ChUlfIcEdAwE7K"
"SecretKey": "p7EK4qew6DBkBPqrpRPuJgTOc6ChUlfIcEdAwE7K",
"PublicHost": "http://localhost:9010"
}
}
}