@@ 11,6 11,8 @@ import "git.src.quest/~skye/erya-go/util"
var FeluConfig *config
type config struct {
+ ServiceName string
+
// Data directory, with trailing slash
DataDir string
@@ 20,10 22,13 @@ type config struct {
DNSBindIP string
DNSBindPort int32
+ DNSPattern string
}
func InitConfig() {
FeluConfig = &config {
+ ServiceName: util.LoadEnvStr("FELU_SERVICE_NAME", "FeluDDNS"),
+
DataDir: util.LoadEnvStr("FELU_DB_PATH", "/var/felu/"),
FrontendBindAddr: util.LoadEnvStr("FELU_FRONTEND_BIND_ADDR", "0.0.0.0:8080"),
@@ 32,5 37,6 @@ func InitConfig() {
DNSBindIP: util.LoadEnvStr("FELU_DNS_BIND_IP", "0.0.0.0"),
DNSBindPort: util.LoadEnvInt32("FELU_DNS_BIND_PORT", 53),
+ DNSPattern: util.LoadEnvStr("FELU_DNS_PATTERN", "."),
}
}
@@ 6,10 6,13 @@
*/
package dns
-import "github.com/miekg/dns"
+import (
+ "git.src.quest/~skye/felu-ddns/config"
+ "github.com/miekg/dns"
+)
func Run(addr string) error {
- dns.HandleFunc("ddns.fuckdns.org.", handleDnsRequest)
+ dns.HandleFunc(config.FeluConfig.DNSPattern, handleDnsRequest)
server := &dns.Server{
Addr: addr,