Fix localdev
This commit is contained in:
@ -12,9 +12,11 @@ namespace NostrStreamer.Services;
|
|||||||
public class LndNode
|
public class LndNode
|
||||||
{
|
{
|
||||||
private readonly Network _network;
|
private readonly Network _network;
|
||||||
|
private readonly ILogger<LndNode> _logger;
|
||||||
|
|
||||||
public LndNode(Config config)
|
public LndNode(Config config, ILogger<LndNode> logger)
|
||||||
{
|
{
|
||||||
|
_logger = logger;
|
||||||
_network = Network.GetNetwork(config.Network) ?? Network.RegTest;
|
_network = Network.GetNetwork(config.Network) ?? Network.RegTest;
|
||||||
var channelOptions = new GrpcChannelOptions();
|
var channelOptions = new GrpcChannelOptions();
|
||||||
ConfigureClient(channelOptions, config.Lnd);
|
ConfigureClient(channelOptions, config.Lnd);
|
||||||
@ -152,7 +154,9 @@ public class LndNode
|
|||||||
return await InvoicesClient.AddHoldInvoiceAsync(req);
|
return await InvoicesClient.AddHoldInvoiceAsync(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ConfigureClient(GrpcChannelOptions opt, LndConfig conf)
|
private void ConfigureClient(GrpcChannelOptions opt, LndConfig conf)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var macaroon = File.ReadAllBytes(Environment.ExpandEnvironmentVariables(conf.MacaroonPath));
|
var macaroon = File.ReadAllBytes(Environment.ExpandEnvironmentVariables(conf.MacaroonPath));
|
||||||
var cert = File.ReadAllBytes(Environment.ExpandEnvironmentVariables(conf.CertPath));
|
var cert = File.ReadAllBytes(Environment.ExpandEnvironmentVariables(conf.CertPath));
|
||||||
@ -174,4 +178,9 @@ public class LndNode
|
|||||||
opt.Credentials = ChannelCredentials.Create(ChannelCredentials.SecureSsl,
|
opt.Credentials = ChannelCredentials.Create(ChannelCredentials.SecureSsl,
|
||||||
CallCredentials.FromInterceptor(asyncInterceptor));
|
CallCredentials.FromInterceptor(asyncInterceptor));
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Configure failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -4,7 +4,7 @@ services:
|
|||||||
srs-origin:
|
srs-origin:
|
||||||
image: ossrs/srs:5
|
image: ossrs/srs:5
|
||||||
volumes:
|
volumes:
|
||||||
- "./docker/srs-origin.conf:/usr/local/srs/conf/srs.conf"
|
- "./docker/srs-origin.conf:/usr/local/srs/conf/docker.conf"
|
||||||
ports:
|
ports:
|
||||||
- "9001:1935"
|
- "9001:1935"
|
||||||
- "9002:1985"
|
- "9002:1985"
|
||||||
@ -13,7 +13,7 @@ services:
|
|||||||
srs-edge:
|
srs-edge:
|
||||||
image: ossrs/srs:5
|
image: ossrs/srs:5
|
||||||
volumes:
|
volumes:
|
||||||
- "./docker/srs-edge.conf:/usr/local/srs/conf/srs.conf"
|
- "./docker/srs-edge.conf:/usr/local/srs/conf/docker.conf"
|
||||||
ports:
|
ports:
|
||||||
- "9005:1935"
|
- "9005:1935"
|
||||||
- "1985:1985"
|
- "1985:1985"
|
||||||
@ -43,3 +43,7 @@ services:
|
|||||||
- "9011:9001"
|
- "9011:9001"
|
||||||
volumes:
|
volumes:
|
||||||
- "minio-dvr:/data"
|
- "minio-dvr:/data"
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
ports:
|
||||||
|
- "6666:6379"
|
@ -118,6 +118,6 @@ vhost full.in.zap.stream {
|
|||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
forward {
|
forward {
|
||||||
enabled on;
|
enabled on;
|
||||||
backend http://10.100.2.226:5295/api/srs;
|
backend http://host.docker.internal:5295/api/srs;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -32,10 +32,10 @@ vhost hls.zap.stream {
|
|||||||
|
|
||||||
http_hooks {
|
http_hooks {
|
||||||
enabled on;
|
enabled on;
|
||||||
on_publish http://10.100.2.226:5295/api/srs;
|
on_publish http://host.docker.internal:5295/api/srs;
|
||||||
on_unpublish http://10.100.2.226:5295/api/srs;
|
on_unpublish http://host.docker.internal:5295/api/srs;
|
||||||
on_hls http://10.100.2.226:5295/api/srs;
|
on_hls http://host.docker.internal:5295/api/srs;
|
||||||
on_dvr http://10.100.2.226:5295/api/srs;
|
on_dvr http://host.docker.internal:5295/api/srs;
|
||||||
}
|
}
|
||||||
|
|
||||||
dvr {
|
dvr {
|
||||||
|
Reference in New Issue
Block a user