diff --git a/dhcpd/README.md b/internal/dhcpd/README.md similarity index 100% rename from dhcpd/README.md rename to internal/dhcpd/README.md diff --git a/dhcpd/check_other_dhcp.go b/internal/dhcpd/check_other_dhcp.go similarity index 99% rename from dhcpd/check_other_dhcp.go rename to internal/dhcpd/check_other_dhcp.go index c4716256..38471e48 100644 --- a/dhcpd/check_other_dhcp.go +++ b/internal/dhcpd/check_other_dhcp.go @@ -10,7 +10,7 @@ import ( "runtime" "time" - "github.com/AdguardTeam/AdGuardHome/dhcpd/nclient4" + "github.com/AdguardTeam/AdGuardHome/internal/dhcpd/nclient4" "github.com/AdguardTeam/golibs/log" "github.com/insomniacslk/dhcp/dhcpv4" "github.com/insomniacslk/dhcp/dhcpv6" diff --git a/dhcpd/check_other_dhcp_windows.go b/internal/dhcpd/check_other_dhcp_windows.go similarity index 100% rename from dhcpd/check_other_dhcp_windows.go rename to internal/dhcpd/check_other_dhcp_windows.go diff --git a/dhcpd/db.go b/internal/dhcpd/db.go similarity index 100% rename from dhcpd/db.go rename to internal/dhcpd/db.go diff --git a/dhcpd/dhcp_http.go b/internal/dhcpd/dhcp_http.go similarity index 99% rename from dhcpd/dhcp_http.go rename to internal/dhcpd/dhcp_http.go index 7f2e8b8a..447dcebf 100644 --- a/dhcpd/dhcp_http.go +++ b/internal/dhcpd/dhcp_http.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/jsonutil" "github.com/AdguardTeam/golibs/log" diff --git a/dhcpd/dhcpd.go b/internal/dhcpd/dhcpd.go similarity index 99% rename from dhcpd/dhcpd.go rename to internal/dhcpd/dhcpd.go index f42842b8..f678388e 100644 --- a/dhcpd/dhcpd.go +++ b/internal/dhcpd/dhcpd.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/log" ) diff --git a/dhcpd/dhcpd_test.go b/internal/dhcpd/dhcpd_test.go similarity index 100% rename from dhcpd/dhcpd_test.go rename to internal/dhcpd/dhcpd_test.go diff --git a/dhcpd/helpers.go b/internal/dhcpd/helpers.go similarity index 100% rename from dhcpd/helpers.go rename to internal/dhcpd/helpers.go diff --git a/dhcpd/nclient4/client.go b/internal/dhcpd/nclient4/client.go similarity index 100% rename from dhcpd/nclient4/client.go rename to internal/dhcpd/nclient4/client.go diff --git a/dhcpd/nclient4/client_test.go b/internal/dhcpd/nclient4/client_test.go similarity index 100% rename from dhcpd/nclient4/client_test.go rename to internal/dhcpd/nclient4/client_test.go diff --git a/dhcpd/nclient4/conn_unix.go b/internal/dhcpd/nclient4/conn_unix.go similarity index 100% rename from dhcpd/nclient4/conn_unix.go rename to internal/dhcpd/nclient4/conn_unix.go diff --git a/dhcpd/nclient4/ipv4.go b/internal/dhcpd/nclient4/ipv4.go similarity index 100% rename from dhcpd/nclient4/ipv4.go rename to internal/dhcpd/nclient4/ipv4.go diff --git a/dhcpd/network_utils.go b/internal/dhcpd/network_utils.go similarity index 99% rename from dhcpd/network_utils.go rename to internal/dhcpd/network_utils.go index c7a7fae8..b6e45312 100644 --- a/dhcpd/network_utils.go +++ b/internal/dhcpd/network_utils.go @@ -10,7 +10,7 @@ import ( "runtime" "strings" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/file" diff --git a/dhcpd/network_utils_test.go b/internal/dhcpd/network_utils_test.go similarity index 100% rename from dhcpd/network_utils_test.go rename to internal/dhcpd/network_utils_test.go diff --git a/dhcpd/os_windows.go b/internal/dhcpd/os_windows.go similarity index 100% rename from dhcpd/os_windows.go rename to internal/dhcpd/os_windows.go diff --git a/dhcpd/router_adv.go b/internal/dhcpd/router_adv.go similarity index 100% rename from dhcpd/router_adv.go rename to internal/dhcpd/router_adv.go diff --git a/dhcpd/router_adv_test.go b/internal/dhcpd/router_adv_test.go similarity index 100% rename from dhcpd/router_adv_test.go rename to internal/dhcpd/router_adv_test.go diff --git a/dhcpd/server.go b/internal/dhcpd/server.go similarity index 100% rename from dhcpd/server.go rename to internal/dhcpd/server.go diff --git a/dhcpd/v4.go b/internal/dhcpd/v4.go similarity index 100% rename from dhcpd/v4.go rename to internal/dhcpd/v4.go diff --git a/dhcpd/v46_windows.go b/internal/dhcpd/v46_windows.go similarity index 100% rename from dhcpd/v46_windows.go rename to internal/dhcpd/v46_windows.go diff --git a/dhcpd/v4_test.go b/internal/dhcpd/v4_test.go similarity index 100% rename from dhcpd/v4_test.go rename to internal/dhcpd/v4_test.go diff --git a/dhcpd/v6.go b/internal/dhcpd/v6.go similarity index 100% rename from dhcpd/v6.go rename to internal/dhcpd/v6.go diff --git a/dhcpd/v6_test.go b/internal/dhcpd/v6_test.go similarity index 100% rename from dhcpd/v6_test.go rename to internal/dhcpd/v6_test.go diff --git a/dnsfilter/README.md b/internal/dnsfilter/README.md similarity index 100% rename from dnsfilter/README.md rename to internal/dnsfilter/README.md diff --git a/dnsfilter/blocked_services.go b/internal/dnsfilter/blocked_services.go similarity index 100% rename from dnsfilter/blocked_services.go rename to internal/dnsfilter/blocked_services.go diff --git a/dnsfilter/dnsfilter.go b/internal/dnsfilter/dnsfilter.go similarity index 99% rename from dnsfilter/dnsfilter.go rename to internal/dnsfilter/dnsfilter.go index b3881686..81ec3d63 100644 --- a/dnsfilter/dnsfilter.go +++ b/internal/dnsfilter/dnsfilter.go @@ -11,7 +11,7 @@ import ( "strings" "sync" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/dnsproxy/upstream" "github.com/AdguardTeam/golibs/cache" "github.com/AdguardTeam/golibs/log" diff --git a/dnsfilter/dnsfilter_test.go b/internal/dnsfilter/dnsfilter_test.go similarity index 100% rename from dnsfilter/dnsfilter_test.go rename to internal/dnsfilter/dnsfilter_test.go diff --git a/dnsfilter/rewrites.go b/internal/dnsfilter/rewrites.go similarity index 100% rename from dnsfilter/rewrites.go rename to internal/dnsfilter/rewrites.go diff --git a/dnsfilter/rewrites_test.go b/internal/dnsfilter/rewrites_test.go similarity index 100% rename from dnsfilter/rewrites_test.go rename to internal/dnsfilter/rewrites_test.go diff --git a/dnsfilter/safe_search.go b/internal/dnsfilter/safe_search.go similarity index 100% rename from dnsfilter/safe_search.go rename to internal/dnsfilter/safe_search.go diff --git a/dnsfilter/safesearch.go b/internal/dnsfilter/safesearch.go similarity index 100% rename from dnsfilter/safesearch.go rename to internal/dnsfilter/safesearch.go diff --git a/dnsfilter/sb_pc.go b/internal/dnsfilter/sb_pc.go similarity index 100% rename from dnsfilter/sb_pc.go rename to internal/dnsfilter/sb_pc.go diff --git a/dnsfilter/sb_pc_test.go b/internal/dnsfilter/sb_pc_test.go similarity index 100% rename from dnsfilter/sb_pc_test.go rename to internal/dnsfilter/sb_pc_test.go diff --git a/dnsfilter/tests/dns.txt b/internal/dnsfilter/tests/dns.txt similarity index 100% rename from dnsfilter/tests/dns.txt rename to internal/dnsfilter/tests/dns.txt diff --git a/dnsforward/access.go b/internal/dnsforward/access.go similarity index 100% rename from dnsforward/access.go rename to internal/dnsforward/access.go diff --git a/dnsforward/access_test.go b/internal/dnsforward/access_test.go similarity index 100% rename from dnsforward/access_test.go rename to internal/dnsforward/access_test.go diff --git a/dnsforward/config.go b/internal/dnsforward/config.go similarity index 99% rename from dnsforward/config.go rename to internal/dnsforward/config.go index cd245ee2..c673252b 100644 --- a/dnsforward/config.go +++ b/internal/dnsforward/config.go @@ -10,8 +10,8 @@ import ( "net/http" "sort" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/dnsproxy/proxy" "github.com/AdguardTeam/dnsproxy/upstream" "github.com/AdguardTeam/golibs/log" diff --git a/dnsforward/dnsforward.go b/internal/dnsforward/dnsforward.go similarity index 97% rename from dnsforward/dnsforward.go rename to internal/dnsforward/dnsforward.go index 1d2c3d7b..6569f6c3 100644 --- a/dnsforward/dnsforward.go +++ b/internal/dnsforward/dnsforward.go @@ -8,10 +8,10 @@ import ( "sync" "time" - "github.com/AdguardTeam/AdGuardHome/dhcpd" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" - "github.com/AdguardTeam/AdGuardHome/querylog" - "github.com/AdguardTeam/AdGuardHome/stats" + "github.com/AdguardTeam/AdGuardHome/internal/dhcpd" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/querylog" + "github.com/AdguardTeam/AdGuardHome/internal/stats" "github.com/AdguardTeam/dnsproxy/proxy" "github.com/AdguardTeam/golibs/log" "github.com/joomcode/errorx" diff --git a/dnsforward/dnsforward_http.go b/internal/dnsforward/dnsforward_http.go similarity index 100% rename from dnsforward/dnsforward_http.go rename to internal/dnsforward/dnsforward_http.go diff --git a/dnsforward/dnsforward_test.go b/internal/dnsforward/dnsforward_test.go similarity index 99% rename from dnsforward/dnsforward_test.go rename to internal/dnsforward/dnsforward_test.go index fbffc5c4..2b76602a 100644 --- a/dnsforward/dnsforward_test.go +++ b/internal/dnsforward/dnsforward_test.go @@ -18,10 +18,10 @@ import ( "testing" "time" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" - "github.com/AdguardTeam/AdGuardHome/dhcpd" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/dhcpd" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" "github.com/AdguardTeam/dnsproxy/proxy" "github.com/AdguardTeam/dnsproxy/upstream" "github.com/miekg/dns" diff --git a/dnsforward/filter.go b/internal/dnsforward/filter.go similarity index 98% rename from dnsforward/filter.go rename to internal/dnsforward/filter.go index d2e5535a..0d325624 100644 --- a/dnsforward/filter.go +++ b/internal/dnsforward/filter.go @@ -3,7 +3,7 @@ package dnsforward import ( "strings" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" "github.com/AdguardTeam/dnsproxy/proxy" "github.com/AdguardTeam/golibs/log" "github.com/joomcode/errorx" diff --git a/dnsforward/handle_dns.go b/internal/dnsforward/handle_dns.go similarity index 98% rename from dnsforward/handle_dns.go rename to internal/dnsforward/handle_dns.go index d770250c..0f9c764b 100644 --- a/dnsforward/handle_dns.go +++ b/internal/dnsforward/handle_dns.go @@ -5,9 +5,9 @@ import ( "strings" "time" - "github.com/AdguardTeam/AdGuardHome/dhcpd" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/dhcpd" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/dnsproxy/proxy" "github.com/AdguardTeam/golibs/log" "github.com/miekg/dns" diff --git a/dnsforward/ipset.go b/internal/dnsforward/ipset.go similarity index 98% rename from dnsforward/ipset.go rename to internal/dnsforward/ipset.go index b95d567b..eeea4608 100644 --- a/dnsforward/ipset.go +++ b/internal/dnsforward/ipset.go @@ -5,7 +5,7 @@ import ( "strings" "sync" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/log" "github.com/miekg/dns" ) diff --git a/dnsforward/ipset_test.go b/internal/dnsforward/ipset_test.go similarity index 100% rename from dnsforward/ipset_test.go rename to internal/dnsforward/ipset_test.go diff --git a/dnsforward/msg.go b/internal/dnsforward/msg.go similarity index 99% rename from dnsforward/msg.go rename to internal/dnsforward/msg.go index 80997ed6..7b295b31 100644 --- a/dnsforward/msg.go +++ b/internal/dnsforward/msg.go @@ -5,7 +5,7 @@ import ( "net" "time" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" "github.com/AdguardTeam/dnsproxy/proxy" "github.com/miekg/dns" ) diff --git a/dnsforward/stats.go b/internal/dnsforward/stats.go similarity index 92% rename from dnsforward/stats.go rename to internal/dnsforward/stats.go index 231ead78..0459321c 100644 --- a/dnsforward/stats.go +++ b/internal/dnsforward/stats.go @@ -5,11 +5,11 @@ import ( "strings" "time" - "github.com/AdguardTeam/AdGuardHome/querylog" + "github.com/AdguardTeam/AdGuardHome/internal/querylog" "github.com/miekg/dns" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" - "github.com/AdguardTeam/AdGuardHome/stats" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/stats" "github.com/AdguardTeam/dnsproxy/proxy" ) diff --git a/dnsforward/util.go b/internal/dnsforward/util.go similarity index 96% rename from dnsforward/util.go rename to internal/dnsforward/util.go index be8f23b7..da87f810 100644 --- a/dnsforward/util.go +++ b/internal/dnsforward/util.go @@ -27,7 +27,7 @@ func stringArrayDup(a []string) []string { // Get IP address from net.Addr object // Note: we can't use net.SplitHostPort(a.String()) because of IPv6 zone: -// https://github.com/AdguardTeam/AdGuardHome/issues/1261 +// https://github.com/AdguardTeam/AdGuardHome/internal/issues/1261 func ipFromAddr(a net.Addr) string { switch addr := a.(type) { case *net.UDPAddr: diff --git a/home/auth.go b/internal/home/auth.go similarity index 99% rename from home/auth.go rename to internal/home/auth.go index afb7f0ed..ce8eb055 100644 --- a/home/auth.go +++ b/internal/home/auth.go @@ -82,7 +82,7 @@ func InitAuth(dbFilename string, users []User, sessionTTL uint32) *Auth { if err != nil { log.Error("Auth: open DB: %s: %s", dbFilename, err) if err.Error() == "invalid argument" { - log.Error("AdGuard Home cannot be initialized due to an incompatible file system.\nPlease read the explanation here: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#limitations") + log.Error("AdGuard Home cannot be initialized due to an incompatible file system.\nPlease read the explanation here: https://github.com/AdguardTeam/AdGuardHome/internal/wiki/Getting-Started#limitations") } return nil } diff --git a/home/auth_glinet.go b/internal/home/auth_glinet.go similarity index 100% rename from home/auth_glinet.go rename to internal/home/auth_glinet.go diff --git a/home/auth_glinet_test.go b/internal/home/auth_glinet_test.go similarity index 100% rename from home/auth_glinet_test.go rename to internal/home/auth_glinet_test.go diff --git a/home/auth_test.go b/internal/home/auth_test.go similarity index 100% rename from home/auth_test.go rename to internal/home/auth_test.go diff --git a/home/clients.go b/internal/home/clients.go similarity index 98% rename from home/clients.go rename to internal/home/clients.go index fce33cb3..06333bd8 100644 --- a/home/clients.go +++ b/internal/home/clients.go @@ -13,10 +13,10 @@ import ( "github.com/AdguardTeam/dnsproxy/proxy" - "github.com/AdguardTeam/AdGuardHome/dhcpd" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" - "github.com/AdguardTeam/AdGuardHome/dnsforward" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/dhcpd" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/utils" ) diff --git a/home/clients_http.go b/internal/home/clients_http.go similarity index 100% rename from home/clients_http.go rename to internal/home/clients_http.go diff --git a/home/clients_tags.go b/internal/home/clients_tags.go similarity index 100% rename from home/clients_tags.go rename to internal/home/clients_tags.go diff --git a/home/clients_test.go b/internal/home/clients_test.go similarity index 99% rename from home/clients_test.go rename to internal/home/clients_test.go index 9f6131ca..5d5a3c81 100644 --- a/home/clients_test.go +++ b/internal/home/clients_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/AdguardTeam/AdGuardHome/dhcpd" + "github.com/AdguardTeam/AdGuardHome/internal/dhcpd" "github.com/stretchr/testify/assert" ) diff --git a/home/config.go b/internal/home/config.go similarity index 97% rename from home/config.go rename to internal/home/config.go index 348e72fa..4728c2e3 100644 --- a/home/config.go +++ b/internal/home/config.go @@ -6,11 +6,11 @@ import ( "path/filepath" "sync" - "github.com/AdguardTeam/AdGuardHome/dhcpd" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" - "github.com/AdguardTeam/AdGuardHome/dnsforward" - "github.com/AdguardTeam/AdGuardHome/querylog" - "github.com/AdguardTeam/AdGuardHome/stats" + "github.com/AdguardTeam/AdGuardHome/internal/dhcpd" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" + "github.com/AdguardTeam/AdGuardHome/internal/querylog" + "github.com/AdguardTeam/AdGuardHome/internal/stats" "github.com/AdguardTeam/golibs/file" "github.com/AdguardTeam/golibs/log" yaml "gopkg.in/yaml.v2" diff --git a/home/control.go b/internal/home/control.go similarity index 99% rename from home/control.go rename to internal/home/control.go index 78789aa8..bb52a479 100644 --- a/home/control.go +++ b/internal/home/control.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/AdguardTeam/AdGuardHome/dnsforward" + "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" "github.com/AdguardTeam/golibs/log" "github.com/NYTimes/gziphandler" ) diff --git a/home/control_filtering.go b/internal/home/control_filtering.go similarity index 99% rename from home/control_filtering.go rename to internal/home/control_filtering.go index e3dd9d46..3d1a7d18 100644 --- a/home/control_filtering.go +++ b/internal/home/control_filtering.go @@ -12,7 +12,7 @@ import ( "strings" "time" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/log" "github.com/miekg/dns" ) diff --git a/home/control_install.go b/internal/home/control_install.go similarity index 98% rename from home/control_install.go rename to internal/home/control_install.go index ba66f8f4..47437e59 100644 --- a/home/control_install.go +++ b/internal/home/control_install.go @@ -13,9 +13,9 @@ import ( "runtime" "strconv" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" - "github.com/AdguardTeam/AdGuardHome/dhcpd" + "github.com/AdguardTeam/AdGuardHome/internal/dhcpd" "github.com/AdguardTeam/golibs/log" ) diff --git a/home/control_test.go b/internal/home/control_test.go similarity index 100% rename from home/control_test.go rename to internal/home/control_test.go diff --git a/home/control_update.go b/internal/home/control_update.go similarity index 95% rename from home/control_update.go rename to internal/home/control_update.go index b8f6bcbe..2ab5d6a2 100644 --- a/home/control_update.go +++ b/internal/home/control_update.go @@ -10,8 +10,8 @@ import ( "strings" "syscall" - "github.com/AdguardTeam/AdGuardHome/update" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/update" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/log" ) @@ -46,7 +46,7 @@ func handleGetVersionJSON(w http.ResponseWriter, r *http.Request) { Context.controlLock.Unlock() if err != nil && strings.HasSuffix(err.Error(), "i/o timeout") { // This case may happen while we're restarting DNS server - // https://github.com/AdguardTeam/AdGuardHome/issues/934 + // https://github.com/AdguardTeam/AdGuardHome/internal/issues/934 continue } break diff --git a/home/control_update_test.go b/internal/home/control_update_test.go similarity index 98% rename from home/control_update_test.go rename to internal/home/control_update_test.go index 1b1d254e..82101249 100644 --- a/home/control_update_test.go +++ b/internal/home/control_update_test.go @@ -53,10 +53,10 @@ func TestDoUpdate(t *testing.T) { updateDir: Context.workDir + "/agh-update-" + newver, backupDir: Context.workDir + "/agh-backup", configName: Context.workDir + "/AdGuardHome.yaml", - updateConfigName: Context.workDir + "/agh-update-" + newver + "/AdGuardHome/AdGuardHome.yaml", + updateConfigName: Context.workDir + "/agh-update-" + newver + "/AdGuardHome/internal/AdGuardHome.yaml", curBinName: Context.workDir + "/AdGuardHome", bkpBinName: Context.workDir + "/agh-backup/AdGuardHome", - newBinName: Context.workDir + "/agh-update-" + newver + "/AdGuardHome/AdGuardHome", + newBinName: Context.workDir + "/agh-update-" + newver + "/AdGuardHome/internal/AdGuardHome", } assert.Equal(t, uu.pkgURL, u.pkgURL) diff --git a/home/dns.go b/internal/home/dns.go similarity index 97% rename from home/dns.go rename to internal/home/dns.go index 5328bf96..418a0837 100644 --- a/home/dns.go +++ b/internal/home/dns.go @@ -5,11 +5,11 @@ import ( "net" "path/filepath" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" - "github.com/AdguardTeam/AdGuardHome/dnsforward" - "github.com/AdguardTeam/AdGuardHome/querylog" - "github.com/AdguardTeam/AdGuardHome/stats" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" + "github.com/AdguardTeam/AdGuardHome/internal/querylog" + "github.com/AdguardTeam/AdGuardHome/internal/stats" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/dnsproxy/proxy" "github.com/AdguardTeam/golibs/log" "github.com/joomcode/errorx" diff --git a/home/filter.go b/internal/home/filter.go similarity index 99% rename from home/filter.go rename to internal/home/filter.go index f21522df..6bcb831c 100644 --- a/home/filter.go +++ b/internal/home/filter.go @@ -15,8 +15,8 @@ import ( "sync/atomic" "time" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/log" ) diff --git a/home/filter_test.go b/internal/home/filter_test.go similarity index 100% rename from home/filter_test.go rename to internal/home/filter_test.go diff --git a/home/home.go b/internal/home/home.go similarity index 96% rename from home/home.go rename to internal/home/home.go index 09df0d57..c32f904c 100644 --- a/home/home.go +++ b/internal/home/home.go @@ -21,18 +21,18 @@ import ( "gopkg.in/natefinch/lumberjack.v2" - "github.com/AdguardTeam/AdGuardHome/update" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/update" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/joomcode/errorx" - "github.com/AdguardTeam/AdGuardHome/isdelve" + "github.com/AdguardTeam/AdGuardHome/internal/isdelve" - "github.com/AdguardTeam/AdGuardHome/dhcpd" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" - "github.com/AdguardTeam/AdGuardHome/dnsforward" - "github.com/AdguardTeam/AdGuardHome/querylog" - "github.com/AdguardTeam/AdGuardHome/stats" + "github.com/AdguardTeam/AdGuardHome/internal/dhcpd" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" + "github.com/AdguardTeam/AdGuardHome/internal/querylog" + "github.com/AdguardTeam/AdGuardHome/internal/stats" "github.com/AdguardTeam/golibs/log" ) @@ -382,7 +382,7 @@ Please note, that this is crucial for a server to be able to use privileged port You have two options: 1. Run AdGuard Home with root privileges 2. On Linux you can grant the CAP_NET_BIND_SERVICE capability: -https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#running-without-superuser` +https://github.com/AdguardTeam/AdGuardHome/internal/wiki/Getting-Started#running-without-superuser` log.Fatal(msg) } diff --git a/home/home_test.go b/internal/home/home_test.go similarity index 100% rename from home/home_test.go rename to internal/home/home_test.go diff --git a/home/i18n.go b/internal/home/i18n.go similarity index 100% rename from home/i18n.go rename to internal/home/i18n.go diff --git a/home/memory.go b/internal/home/memory.go similarity index 92% rename from home/memory.go rename to internal/home/memory.go index 5ca1c12f..fd666f57 100644 --- a/home/memory.go +++ b/internal/home/memory.go @@ -11,7 +11,7 @@ import ( // memoryUsage implements a couple of not really beautiful hacks which purpose is to // make OS reclaim the memory freed by AdGuard Home as soon as possible. // See this for the details on the performance hits & gains: -// https://github.com/AdguardTeam/AdGuardHome/issues/2044#issuecomment-687042211 +// https://github.com/AdguardTeam/AdGuardHome/internal/issues/2044#issuecomment-687042211 func memoryUsage(args options) { if args.disableMemoryOptimization { log.Info("Memory optimization is disabled") diff --git a/home/mobileconfig.go b/internal/home/mobileconfig.go similarity index 100% rename from home/mobileconfig.go rename to internal/home/mobileconfig.go diff --git a/home/mobileconfig_test.go b/internal/home/mobileconfig_test.go similarity index 100% rename from home/mobileconfig_test.go rename to internal/home/mobileconfig_test.go diff --git a/home/options.go b/internal/home/options.go similarity index 100% rename from home/options.go rename to internal/home/options.go diff --git a/home/options_test.go b/internal/home/options_test.go similarity index 100% rename from home/options_test.go rename to internal/home/options_test.go diff --git a/home/rdns.go b/internal/home/rdns.go similarity index 98% rename from home/rdns.go rename to internal/home/rdns.go index 297e1925..5a34a27f 100644 --- a/home/rdns.go +++ b/internal/home/rdns.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/AdguardTeam/AdGuardHome/dnsforward" + "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" "github.com/AdguardTeam/golibs/cache" "github.com/AdguardTeam/golibs/log" "github.com/miekg/dns" diff --git a/home/rdns_test.go b/internal/home/rdns_test.go similarity index 88% rename from home/rdns_test.go rename to internal/home/rdns_test.go index 84c996d1..399886c4 100644 --- a/home/rdns_test.go +++ b/internal/home/rdns_test.go @@ -3,7 +3,7 @@ package home import ( "testing" - "github.com/AdguardTeam/AdGuardHome/dnsforward" + "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" "github.com/stretchr/testify/assert" ) diff --git a/home/service.go b/internal/home/service.go similarity index 99% rename from home/service.go rename to internal/home/service.go index fbe612cf..c3551143 100644 --- a/home/service.go +++ b/internal/home/service.go @@ -9,7 +9,7 @@ import ( "strings" "syscall" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/log" "github.com/kardianos/service" ) @@ -452,7 +452,7 @@ exit 0 ` // OpenWrt procd init script -// https://github.com/AdguardTeam/AdGuardHome/issues/1386 +// https://github.com/AdguardTeam/AdGuardHome/internal/issues/1386 const openWrtScript = `#!/bin/sh /etc/rc.common USE_PROCD=1 diff --git a/home/tls.go b/internal/home/tls.go similarity index 100% rename from home/tls.go rename to internal/home/tls.go diff --git a/home/upgrade.go b/internal/home/upgrade.go similarity index 99% rename from home/upgrade.go rename to internal/home/upgrade.go index 4021c206..bf9e5b51 100644 --- a/home/upgrade.go +++ b/internal/home/upgrade.go @@ -5,7 +5,7 @@ import ( "os" "path/filepath" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/file" "github.com/AdguardTeam/golibs/log" diff --git a/home/upgrade_test.go b/internal/home/upgrade_test.go similarity index 100% rename from home/upgrade_test.go rename to internal/home/upgrade_test.go diff --git a/home/web.go b/internal/home/web.go similarity index 98% rename from home/web.go rename to internal/home/web.go index 0d9881c2..976ea3ab 100644 --- a/home/web.go +++ b/internal/home/web.go @@ -9,7 +9,7 @@ import ( "strconv" "sync" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/log" "github.com/NYTimes/gziphandler" "github.com/gobuffalo/packr" @@ -63,7 +63,7 @@ func CreateWeb(conf *WebConfig) *Web { w.errLogger = golog.New(&lw, "", 0) // Initialize and run the admin Web interface - box := packr.NewBox("../build/static") + box := packr.NewBox("../../build/static") // if not configured, redirect / to /install.html, otherwise redirect /install.html to / http.Handle("/", postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(http.FileServer(box))))) diff --git a/home/whois.go b/internal/home/whois.go similarity index 98% rename from home/whois.go rename to internal/home/whois.go index a0d22bbb..ecd76a7b 100644 --- a/home/whois.go +++ b/internal/home/whois.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/cache" "github.com/AdguardTeam/golibs/log" diff --git a/home/whois_test.go b/internal/home/whois_test.go similarity index 91% rename from home/whois_test.go rename to internal/home/whois_test.go index 3ea73c53..f8109e92 100644 --- a/home/whois_test.go +++ b/internal/home/whois_test.go @@ -3,7 +3,7 @@ package home import ( "testing" - "github.com/AdguardTeam/AdGuardHome/dnsforward" + "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" "github.com/stretchr/testify/assert" ) diff --git a/isdelve/delve.go b/internal/isdelve/delve.go similarity index 100% rename from isdelve/delve.go rename to internal/isdelve/delve.go diff --git a/isdelve/doc.go b/internal/isdelve/doc.go similarity index 100% rename from isdelve/doc.go rename to internal/isdelve/doc.go diff --git a/isdelve/nodelve.go b/internal/isdelve/nodelve.go similarity index 100% rename from isdelve/nodelve.go rename to internal/isdelve/nodelve.go diff --git a/querylog/decode.go b/internal/querylog/decode.go similarity index 98% rename from querylog/decode.go rename to internal/querylog/decode.go index d0346daf..ed44fa1d 100644 --- a/querylog/decode.go +++ b/internal/querylog/decode.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" "github.com/AdguardTeam/golibs/log" "github.com/miekg/dns" ) diff --git a/querylog/decode_test.go b/internal/querylog/decode_test.go similarity index 100% rename from querylog/decode_test.go rename to internal/querylog/decode_test.go diff --git a/querylog/json.go b/internal/querylog/json.go similarity index 100% rename from querylog/json.go rename to internal/querylog/json.go diff --git a/querylog/qlog.go b/internal/querylog/qlog.go similarity index 98% rename from querylog/qlog.go rename to internal/querylog/qlog.go index a5780ef1..0420d59e 100644 --- a/querylog/qlog.go +++ b/internal/querylog/qlog.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" "github.com/AdguardTeam/golibs/log" "github.com/miekg/dns" ) diff --git a/querylog/qlog_file.go b/internal/querylog/qlog_file.go similarity index 100% rename from querylog/qlog_file.go rename to internal/querylog/qlog_file.go diff --git a/querylog/qlog_file_test.go b/internal/querylog/qlog_file_test.go similarity index 100% rename from querylog/qlog_file_test.go rename to internal/querylog/qlog_file_test.go diff --git a/querylog/qlog_http.go b/internal/querylog/qlog_http.go similarity index 98% rename from querylog/qlog_http.go rename to internal/querylog/qlog_http.go index 93647a8d..473df2a4 100644 --- a/querylog/qlog_http.go +++ b/internal/querylog/qlog_http.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/jsonutil" "github.com/AdguardTeam/golibs/log" diff --git a/querylog/qlog_reader.go b/internal/querylog/qlog_reader.go similarity index 100% rename from querylog/qlog_reader.go rename to internal/querylog/qlog_reader.go diff --git a/querylog/qlog_reader_test.go b/internal/querylog/qlog_reader_test.go similarity index 100% rename from querylog/qlog_reader_test.go rename to internal/querylog/qlog_reader_test.go diff --git a/querylog/qlog_test.go b/internal/querylog/qlog_test.go similarity index 99% rename from querylog/qlog_test.go rename to internal/querylog/qlog_test.go index c4f34e75..078d39fe 100644 --- a/querylog/qlog_test.go +++ b/internal/querylog/qlog_test.go @@ -7,7 +7,7 @@ import ( "github.com/AdguardTeam/dnsproxy/proxyutil" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" "github.com/miekg/dns" "github.com/stretchr/testify/assert" ) diff --git a/querylog/querylog.go b/internal/querylog/querylog.go similarity index 96% rename from querylog/querylog.go rename to internal/querylog/querylog.go index 7f6b4c87..7b4bed6d 100644 --- a/querylog/querylog.go +++ b/internal/querylog/querylog.go @@ -5,7 +5,7 @@ import ( "net/http" "time" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" "github.com/miekg/dns" ) diff --git a/querylog/querylog_file.go b/internal/querylog/querylog_file.go similarity index 100% rename from querylog/querylog_file.go rename to internal/querylog/querylog_file.go diff --git a/querylog/querylog_search.go b/internal/querylog/querylog_search.go similarity index 98% rename from querylog/querylog_search.go rename to internal/querylog/querylog_search.go index afa8afc2..024253e2 100644 --- a/querylog/querylog_search.go +++ b/internal/querylog/querylog_search.go @@ -4,7 +4,7 @@ import ( "io" "time" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/log" ) diff --git a/querylog/search_criteria.go b/internal/querylog/search_criteria.go similarity index 98% rename from querylog/search_criteria.go rename to internal/querylog/search_criteria.go index a9d38fb1..a4213408 100644 --- a/querylog/search_criteria.go +++ b/internal/querylog/search_criteria.go @@ -3,7 +3,7 @@ package querylog import ( "strings" - "github.com/AdguardTeam/AdGuardHome/dnsfilter" + "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" ) type criteriaType int diff --git a/querylog/search_params.go b/internal/querylog/search_params.go similarity index 100% rename from querylog/search_params.go rename to internal/querylog/search_params.go diff --git a/stats/stats.go b/internal/stats/stats.go similarity index 100% rename from stats/stats.go rename to internal/stats/stats.go diff --git a/stats/stats_http.go b/internal/stats/stats_http.go similarity index 100% rename from stats/stats_http.go rename to internal/stats/stats_http.go diff --git a/stats/stats_test.go b/internal/stats/stats_test.go similarity index 100% rename from stats/stats_test.go rename to internal/stats/stats_test.go diff --git a/stats/stats_unit.go b/internal/stats/stats_unit.go similarity index 99% rename from stats/stats_unit.go rename to internal/stats/stats_unit.go index 09908945..650760db 100644 --- a/stats/stats_unit.go +++ b/internal/stats/stats_unit.go @@ -135,7 +135,7 @@ func (s *statsCtx) dbOpen() bool { if err != nil { log.Error("Stats: open DB: %s: %s", s.conf.Filename, err) if err.Error() == "invalid argument" { - log.Error("AdGuard Home cannot be initialized due to an incompatible file system.\nPlease read the explanation here: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#limitations") + log.Error("AdGuard Home cannot be initialized due to an incompatible file system.\nPlease read the explanation here: https://github.com/AdguardTeam/AdGuardHome/internal/wiki/Getting-Started#limitations") } return false } diff --git a/update/check.go b/internal/update/check.go similarity index 100% rename from update/check.go rename to internal/update/check.go diff --git a/update/test/AdGuardHome.tar.gz b/internal/update/test/AdGuardHome.tar.gz similarity index 100% rename from update/test/AdGuardHome.tar.gz rename to internal/update/test/AdGuardHome.tar.gz diff --git a/update/test/AdGuardHome.zip b/internal/update/test/AdGuardHome.zip similarity index 100% rename from update/test/AdGuardHome.zip rename to internal/update/test/AdGuardHome.zip diff --git a/update/update_test.go b/internal/update/update_test.go similarity index 98% rename from update/update_test.go rename to internal/update/update_test.go index 7481ba3f..44013960 100644 --- a/update/update_test.go +++ b/internal/update/update_test.go @@ -30,7 +30,7 @@ func TestUpdateGetVersion(t *testing.T) { const jsonData = `{ "version": "v0.103.0-beta2", "announcement": "AdGuard Home v0.103.0-beta2 is now available!", - "announcement_url": "https://github.com/AdguardTeam/AdGuardHome/releases", + "announcement_url": "https://github.com/AdguardTeam/AdGuardHome/internal/releases", "selfupdate_min_version": "v0.0", "download_windows_amd64": "https://static.adguard.com/adguardhome/beta/AdGuardHome_windows_amd64.zip", "download_windows_386": "https://static.adguard.com/adguardhome/beta/AdGuardHome_windows_386.zip", @@ -71,7 +71,7 @@ func TestUpdateGetVersion(t *testing.T) { assert.Nil(t, err) assert.Equal(t, "v0.103.0-beta2", info.NewVersion) assert.Equal(t, "AdGuard Home v0.103.0-beta2 is now available!", info.Announcement) - assert.Equal(t, "https://github.com/AdguardTeam/AdGuardHome/releases", info.AnnouncementURL) + assert.Equal(t, "https://github.com/AdguardTeam/AdGuardHome/internal/releases", info.AnnouncementURL) assert.Equal(t, "v0.0", info.SelfUpdateMinVersion) assert.True(t, info.CanAutoUpdate) diff --git a/update/updater.go b/internal/update/updater.go similarity index 99% rename from update/updater.go rename to internal/update/updater.go index 469544dc..31fc9c72 100644 --- a/update/updater.go +++ b/internal/update/updater.go @@ -14,7 +14,7 @@ import ( "strings" "time" - "github.com/AdguardTeam/AdGuardHome/util" + "github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/golibs/log" ) diff --git a/util/auto_hosts.go b/internal/util/auto_hosts.go similarity index 100% rename from util/auto_hosts.go rename to internal/util/auto_hosts.go diff --git a/util/auto_hosts_test.go b/internal/util/auto_hosts_test.go similarity index 100% rename from util/auto_hosts_test.go rename to internal/util/auto_hosts_test.go diff --git a/util/dns.go b/internal/util/dns.go similarity index 100% rename from util/dns.go rename to internal/util/dns.go diff --git a/util/helpers.go b/internal/util/helpers.go similarity index 100% rename from util/helpers.go rename to internal/util/helpers.go diff --git a/util/helpers_test.go b/internal/util/helpers_test.go similarity index 100% rename from util/helpers_test.go rename to internal/util/helpers_test.go diff --git a/util/net.go b/internal/util/net.go similarity index 100% rename from util/net.go rename to internal/util/net.go diff --git a/util/network_utils.go b/internal/util/network_utils.go similarity index 100% rename from util/network_utils.go rename to internal/util/network_utils.go diff --git a/util/network_utils_test.go b/internal/util/network_utils_test.go similarity index 100% rename from util/network_utils_test.go rename to internal/util/network_utils_test.go diff --git a/util/os_freebsd.go b/internal/util/os_freebsd.go similarity index 90% rename from util/os_freebsd.go rename to internal/util/os_freebsd.go index 8254d897..042e83fe 100644 --- a/util/os_freebsd.go +++ b/internal/util/os_freebsd.go @@ -10,7 +10,7 @@ import ( ) // Set user-specified limit of how many fd's we can use -// https://github.com/AdguardTeam/AdGuardHome/issues/659 +// https://github.com/AdguardTeam/AdGuardHome/internal/issues/659 func SetRlimit(val uint) { var rlim syscall.Rlimit rlim.Max = int64(val) diff --git a/util/os_unix.go b/internal/util/os_unix.go similarity index 91% rename from util/os_unix.go rename to internal/util/os_unix.go index 9826a68c..53557566 100644 --- a/util/os_unix.go +++ b/internal/util/os_unix.go @@ -10,7 +10,7 @@ import ( ) // Set user-specified limit of how many fd's we can use -// https://github.com/AdguardTeam/AdGuardHome/issues/659 +// https://github.com/AdguardTeam/AdGuardHome/internal/issues/659 func SetRlimit(val uint) { var rlim syscall.Rlimit rlim.Max = uint64(val) diff --git a/util/os_windows.go b/internal/util/os_windows.go similarity index 100% rename from util/os_windows.go rename to internal/util/os_windows.go diff --git a/util/pprof.go b/internal/util/pprof.go similarity index 100% rename from util/pprof.go rename to internal/util/pprof.go diff --git a/util/syslog_others.go b/internal/util/syslog_others.go similarity index 100% rename from util/syslog_others.go rename to internal/util/syslog_others.go diff --git a/util/syslog_windows.go b/internal/util/syslog_windows.go similarity index 100% rename from util/syslog_windows.go rename to internal/util/syslog_windows.go diff --git a/util/tls.go b/internal/util/tls.go similarity index 97% rename from util/tls.go rename to internal/util/tls.go index 48b8b35a..534231a6 100644 --- a/util/tls.go +++ b/internal/util/tls.go @@ -15,7 +15,7 @@ import ( // Return the x509 certificate pool object // Return nil if nothing has been found. // This means that Go.crypto will use its default algorithm to find system root CA list. -// https://github.com/AdguardTeam/AdGuardHome/issues/1311 +// https://github.com/AdguardTeam/AdGuardHome/internal/issues/1311 func LoadSystemRootCAs() *x509.CertPool { if runtime.GOOS != "linux" { return nil diff --git a/main.go b/main.go index f712d6c0..a040da7d 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,7 @@ package main import ( - "github.com/AdguardTeam/AdGuardHome/home" + "github.com/AdguardTeam/AdGuardHome/internal/home" ) // version will be set through ldflags, contains current version