refactor: Rename project from dns-helper to ekdns across all files and documentation

This commit is contained in:
2026-03-04 17:03:30 -05:00
parent 03cbe1bb00
commit 3550193e63
25 changed files with 107 additions and 118 deletions
+3 -3
View File
@@ -9,8 +9,8 @@ import (
)
const (
StartMarker = "# DNSHelper <<-> START CONFIG"
EndMarker = "# DNSHelper <->> END CONFIG"
StartMarker = "# ekDNSHelper <<-> START CONFIG"
EndMarker = "# ekDNSHelper <->> END CONFIG"
)
// DNSEntry represents a single IP-to-hostname mapping.
@@ -116,7 +116,7 @@ func (m *Manager) Write(hf *HostsFile, backupDir string) error {
// This is required so the subsequent rename stays on the same filesystem
// partition (avoids EXDEV on Unix).
success := false
tempFile, err := m.fs.CreateTemp(filepath.Dir(hf.Path), ".dns-helper-tmp-*")
tempFile, err := m.fs.CreateTemp(filepath.Dir(hf.Path), ".ekdns-tmp-*")
if err != nil {
m.fs.Remove(backupPath) //nolint:errcheck
return fmt.Errorf("creating temp file: %w", err)
+1 -2
View File
@@ -1,6 +1,7 @@
package hostfile_test
import (
"ekdns/hostfile"
"errors"
"fmt"
"os"
@@ -8,8 +9,6 @@ import (
"strings"
"testing"
"time"
"dns-helper/hostfile"
)
// ---------------------------------------------------------------------------
+2 -2
View File
@@ -17,13 +17,13 @@ func ParseManagedBlock(lines []string) (prefix, managed, postfix []string, hasMa
endCount := 0
for i, line := range lines {
if strings.Contains(line, "DNSHelper <<-> START CONFIG") {
if strings.Contains(line, "ekDNSHelper <<-> START CONFIG") {
startCount++
if startIdx == -1 {
startIdx = i
}
}
if strings.Contains(line, "DNSHelper <->> END CONFIG") {
if strings.Contains(line, "ekDNSHelper <->> END CONFIG") {
endCount++
if endIdx == -1 {
endIdx = i
+3 -3
View File
@@ -4,7 +4,7 @@ import (
"strings"
"testing"
"dns-helper/hostfile"
"ekdns/hostfile"
)
// ---------------------------------------------------------------------------
@@ -253,7 +253,7 @@ func TestAssembleContent_EmptyManagedOmitsBlock(t *testing.T) {
t.Fatalf("expected 2 lines (no managed block), got %d: %v", len(result), result)
}
for _, line := range result {
if strings.Contains(line, "DNSHelper") {
if strings.Contains(line, "ekDNSHelper") {
t.Errorf("managed block markers should be absent when managed is empty: %v", result)
}
}
@@ -353,7 +353,7 @@ func TestRemoveAll_AssembleContentOmitsBlock(t *testing.T) {
t.Fatalf("expected 2 lines with no managed block, got %d: %v", len(result), result)
}
for _, line := range result {
if strings.Contains(line, "DNSHelper") {
if strings.Contains(line, "ekDNSHelper") {
t.Errorf("managed block markers should be absent after RemoveAll: %v", result)
}
}