Skip to content

Commit

Permalink
Port settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Atralupus committed Oct 6, 2023
1 parent 46a860c commit 3044eb9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using StackExchange.Redis;
using Libplanet.Crypto;
using NineChronicles.Headless.Services;

Expand All @@ -27,7 +26,7 @@ public List<Address> ListBlockedAddresses(int offset, int limit)
{
var server = _db.Multiplexer.GetServer(_db.Multiplexer.GetEndPoints().First());
var keys = server
.Keys(database: _db.Database, pattern: "*")
.Keys()
.Select(k => new Address(k.ToString()))
.ToList();

Expand Down
2 changes: 2 additions & 0 deletions NineChronicles.Headless.AccessControlCenter/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ namespace NineChronicles.Headless.AccessControlCenter
{
public class Configuration
{
public int Port { get; set; }

public string AccessControlServiceType { get; set; } = null!;

public string AccessControlServiceConnectionString { get; set; } = null!;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using NineChronicles.Headless.AccessControlCenter.AccessControlService;
using System.Linq;
using Libplanet.Crypto;

namespace NineChronicles.Headless.AccessControlCenter.Controllers
Expand Down Expand Up @@ -36,9 +37,12 @@ public ActionResult AllowAccess(string address)
}

[HttpGet("entries")]
public ActionResult<List<Address>> ListBlockedAddresses(int offset, int limit)
public ActionResult<List<string>> ListBlockedAddresses(int offset, int limit)
{
return _accessControlService.ListBlockedAddresses(offset, limit);
return _accessControlService
.ListBlockedAddresses(offset, limit)
.Select(a => a.ToString())
.ToList();
}
}
}
2 changes: 1 addition & 1 deletion NineChronicles.Headless.AccessControlCenter/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static void Main(string[] args)
acsConfig.AccessControlServiceType,
acsConfig.AccessControlServiceConnectionString
);
var hostBuilder = service.Configure(Host.CreateDefaultBuilder(), 31259);
var hostBuilder = service.Configure(Host.CreateDefaultBuilder(), acsConfig.Port);
var host = hostBuilder.Build();
host.Run();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"Port": "31259",
"AccessControlServiceType": "redis",
"AccessControlServiceConnectionString": "localhost:6379"
}

0 comments on commit 3044eb9

Please sign in to comment.