From 4f582a6712086a15d54ddceb61eefa97bc6df1ad Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Sun, 17 Mar 2019 13:42:54 +0900 Subject: [PATCH] Show onion hosts instead of url (can't know about ports) --- BTCPayServer/Services/TorServices.cs | 16 +++++++++++++--- BTCPayServer/Views/Server/Services.cshtml | 6 ++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/BTCPayServer/Services/TorServices.cs b/BTCPayServer/Services/TorServices.cs index 89a3cf2cd..52848f8ce 100644 --- a/BTCPayServer/Services/TorServices.cs +++ b/BTCPayServer/Services/TorServices.cs @@ -29,8 +29,11 @@ namespace BTCPayServer.Services { try { - var onionUrl = (await service.ReadingLines)[0].Trim(); - result.Add(new TorService() { Name = service.ServiceName, OnionUrl = onionUrl }); + var onionHost = (await service.ReadingLines)[0].Trim(); + var torService = new TorService() { Name = service.ServiceName, OnionHost = onionHost }; + if (service.ServiceName.Equals("BTCPayServer", StringComparison.OrdinalIgnoreCase)) + torService.ServiceType = TorServiceType.BTCPayServer; + result.Add(torService); } catch { @@ -43,7 +46,14 @@ namespace BTCPayServer.Services public class TorService { + public TorServiceType ServiceType { get; set; } = TorServiceType.Other; public string Name { get; set; } - public string OnionUrl { get; set; } + public string OnionHost { get; set; } + } + + public enum TorServiceType + { + BTCPayServer, + Other } } diff --git a/BTCPayServer/Views/Server/Services.cshtml b/BTCPayServer/Views/Server/Services.cshtml index 42d17c4dc..0ac810809 100644 --- a/BTCPayServer/Views/Server/Services.cshtml +++ b/BTCPayServer/Views/Server/Services.cshtml @@ -85,7 +85,7 @@

TOR hidden services

- TOR services hosted on this server + TOR services hosted on this server, services using auto service registration (like lightning services) will not appear here.
@@ -100,9 +100,7 @@ { - + }
@s.Name - See information - @s.OnionHost