mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
Add Dynamic DNS support
This commit is contained in:
43
BTCPayServer/Models/ServerViewModels/DynamicDnsViewModel.cs
Normal file
43
BTCPayServer/Models/ServerViewModels/DynamicDnsViewModel.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using BTCPayServer.Services;
|
||||
|
||||
namespace BTCPayServer.Models.ServerViewModels
|
||||
{
|
||||
public class DynamicDnsViewModel
|
||||
{
|
||||
public class WellKnownService
|
||||
{
|
||||
public WellKnownService(string name, string url)
|
||||
{
|
||||
Name = name;
|
||||
Url = url;
|
||||
}
|
||||
public string Name { get; set; }
|
||||
public string Url { get; set; }
|
||||
}
|
||||
|
||||
public DynamicDnsSettings Settings { get; set; }
|
||||
public string LastUpdated
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Settings?.LastUpdated is DateTimeOffset date)
|
||||
{
|
||||
return Views.ViewsRazor.ToTimeAgo(date);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public WellKnownService[] KnownServices { get; set; } = new []
|
||||
{
|
||||
new WellKnownService("noip", "https://dynupdate.no-ip.com/nic/update"),
|
||||
new WellKnownService("dyndns", "https://members.dyndns.org/v3/update"),
|
||||
new WellKnownService("duckdns", "https://www.duckdns.org/v3/update"),
|
||||
new WellKnownService("google", "https://domains.google.com/nic/update"),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user