Add Dynamic DNS support

This commit is contained in:
nicolas.dorier
2019-07-24 17:59:30 +09:00
parent 8e07bf3ffb
commit 8896d89908
7 changed files with 297 additions and 0 deletions

View 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"),
};
}
}