text
stringlengths
9
39.2M
dir
stringlengths
25
226
lang
stringclasses
163 values
created_date
timestamp[s]
updated_date
timestamp[s]
repo_name
stringclasses
751 values
repo_full_name
stringclasses
752 values
star
int64
1.01k
183k
len_tokens
int64
1
18.5M
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safe_search: enabled: false bing: true duckduckgo: true google: true...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v19/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
651
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safe_search: enabled: false bing: true duckduckgo: true google: true...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v22/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
684
```yaml bind_host: 127.0.0.1 bind_port: 3000 auth_name: testuser auth_pass: testpassword dns: port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_ttl: 10 querylog_enabled: true ...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v3/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
235
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safe_search: enabled: false bing: true duckduckgo: true google: true...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v22/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
696
```yaml bind_host: 127.0.0.1 bind_port: 3000 auth_name: testuser auth_pass: testpassword dns: port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_ttl: 10 querylog_enabled: true ...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v3/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
237
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_ttl: 10 querylog_enabled: ...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v7/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
388
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_ttl: 10 querylog_enabled: ...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v7/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
393
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 local_domain_name: local protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensiti...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v10/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
441
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 local_domain_name: local protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensiti...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v10/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
443
```yaml bind_host: 127.0.0.1 bind_port: 3000 auth_name: testuser auth_pass: testpassword coredns: bind_host: 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_ttl: 1...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v2/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
249
```yaml bind_host: 127.0.0.1 bind_port: 3000 auth_name: testuser auth_pass: testpassword dns: bind_host: 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_ttl: 10 ...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v2/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
248
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v17/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
551
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v17/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
567
```yaml bind_host: 127.0.0.1 bind_port: 3000 auth_name: testuser auth_pass: testpassword dns: port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_ttl: 10 querylog_enabled: true ...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v4/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
295
```yaml bind_host: 127.0.0.1 bind_port: 3000 auth_name: testuser auth_pass: testpassword dns: port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_ttl: 10 querylog_enabled: true ...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v4/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
303
```yaml http: address: 127.0.0.1:3000 session_ttl: 3h debug_pprof: true users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safe_search: enabled: false bing: true duckdu...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v25/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
752
```yaml http: address: 127.0.0.1:3000 session_ttl: 3h pprof: enabled: true port: 6060 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safe_search: enabled: false bin...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v25/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
762
```yaml http: address: 127.0.0.1:3000 session_ttl: 3h pprof: enabled: true port: 6060 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 parental_sensitivity: 0 upstream_dns: - tls://1.1.1.1 - tls://1.0.0.1 - quic://8.8.8.8:784 bootstrap_dns: - 8.8.8...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v27/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
773
```yaml http: address: 127.0.0.1:3000 session_ttl: 3h pprof: enabled: true port: 6060 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 parental_sensitivity: 0 upstream_dns: - tls://1.1.1.1 - tls://1.0.0.1 - quic://8.8.8.8:784 bootstrap_dns: - 8.8.8...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v27/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
771
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v14/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
477
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v14/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
509
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v18/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
567
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_ttl: 10 querylog_enabled: ...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v6/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
316
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safe_search: enabled: false bing: true duckduckgo: true google: true...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v18/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
609
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_ttl: 10 querylog_enabled: ...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v6/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
344
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_host: 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_ttl: ...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v8/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
419
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v8/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
421
```yaml bind_host: 127.0.0.1 bind_port: 3000 web_session_ttl: 3 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safe_search: enabled: false bing: true duckduckgo: true ...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v23/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
703
```yaml http: address: 127.0.0.1:3000 session_ttl: 3h users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safe_search: enabled: false bing: true duckduckgo: true goo...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v23/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
702
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safe_search: enabled: false bing: true duckduckgo: true google: true...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v20/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
651
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safe_search: enabled: false bing: true duckduckgo: true google: true...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v20/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
652
```yaml http: address: 127.0.0.1:3000 session_ttl: 3h users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safe_search: enabled: false bing: true duckduckgo: true goo...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v24/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
743
```yaml http: address: 127.0.0.1:3000 session_ttl: 3h users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safe_search: enabled: false bing: true duckduckgo: true goo...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v24/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
746
```yaml bind_host: 127.0.0.1 bind_port: 3000 auth_name: testuser auth_pass: testpassword coredns: port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_ttl: 10 querylog_enabled: t...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v1/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
215
```yaml bind_host: 127.0.0.1 bind_port: 3000 auth_name: testuser auth_pass: testpassword coredns: port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_ttl: 10 querylog_enabled: t...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v1/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
221
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v16/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
543
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v16/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
533
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 local_domain_name: local protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensiti...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v13/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
471
```yaml bind_host: 127.0.0.1 bind_port: 3000 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safesearch_enabled: false parental_enabled: false parental_sensitivity: 0 blocked_response_...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v13/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
471
```yaml http: address: 127.0.0.1:3000 session_ttl: 3h pprof: enabled: true port: 6060 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 protection_enabled: true filtering_enabled: true safebrowsing_enabled: false safe_search: enabled: false bin...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v26/input.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
762
```go // Package ipset provides ipset functionality. package ipset import ( "net" ) // Manager is the ipset manager interface. // // TODO(a.garipov): Perhaps generalize this into some kind of a NetFilter type, // since ipset is exclusive to Linux? type Manager interface { Add(host string, ip4s, ip6s []net.IP) (n in...
/content/code_sandbox/internal/ipset/ipset.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
247
```yaml http: address: 127.0.0.1:3000 session_ttl: 3h pprof: enabled: true port: 6060 users: - name: testuser password: testpassword dns: bind_hosts: - 127.0.0.1 port: 53 parental_sensitivity: 0 upstream_dns: - tls://1.1.1.1 - tls://1.0.0.1 - quic://8.8.8.8:784 bootstrap_dns: - 8.8.8...
/content/code_sandbox/internal/configmigrate/testdata/TestMigrateConfig_Migrate/v26/output.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
765
```go //go:build !linux package ipset import ( "github.com/AdguardTeam/AdGuardHome/internal/aghos" ) func newManager(_ []string) (mgr Manager, err error) { return nil, aghos.Unsupported("ipset") } ```
/content/code_sandbox/internal/ipset/ipset_others.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
58
```go //go:build linux package ipset import ( "net" "strings" "testing" "github.com/AdguardTeam/golibs/errors" "github.com/digineo/go-ipset/v2" "github.com/mdlayher/netlink" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/ti-mo/netfilter" ) // fakeConn is a fake ipset...
/content/code_sandbox/internal/ipset/ipset_linux_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,190
```go package filtering // SafeSearch interface describes a service for search engines hosts rewrites. type SafeSearch interface { // CheckHost checks host with safe search filter. CheckHost must be safe // for concurrent use. qtype must be either [dns.TypeA] or [dns.TypeAAAA]. CheckHost(host string, qtype uint16...
/content/code_sandbox/internal/filtering/safesearch.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
432
```go //go:build linux package ipset import ( "bytes" "fmt" "net" "strings" "sync" "github.com/AdguardTeam/golibs/container" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/digineo/go-ipset/v2" "github.com/mdlayher/netlink" "github.com/ti-mo/netfilter" "golang.org/x...
/content/code_sandbox/internal/ipset/ipset_linux.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
4,106
```go package filtering import ( "encoding/json" "net/http" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" ) // handleSafeSearchEnable is the handler for POST /control/safesearch/enable // HTTP API. // // Deprecated: Use handleSafeSearchSettings. func (d *DNSFilter) handleSafeSearchEnable(w http.ResponseWr...
/content/code_sandbox/internal/filtering/safesearchhttp.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
450
```go package filtering import ( "fmt" "net/netip" "slices" "strings" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/miekg/dns" ) // Legacy DNS rewrites // LegacyRewrite is a single legacy DNS rewrite record. // // Instances of *LegacyRewrite must never be nil. type Le...
/content/code_sandbox/internal/filtering/rewrites.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,602
```go package filtering import ( "fmt" "io" "net/http" "os" "path/filepath" "slices" "strconv" "strings" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghrenameio" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/AdguardTeam/golibs/container" "github.com/AdguardTeam/goli...
/content/code_sandbox/internal/filtering/filter.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
4,412
```go package filtering import ( "github.com/AdguardTeam/urlfilter" "github.com/AdguardTeam/urlfilter/rules" "github.com/miekg/dns" ) // DNSRewriteResult is the result of application of $dnsrewrite rules. type DNSRewriteResult struct { Response DNSRewriteResultResponse `json:",omitempty"` RCode rules.RCode ...
/content/code_sandbox/internal/filtering/dnsrewrite.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
722
```go package filtering import ( "fmt" "sync/atomic" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/AdguardTeam/golibs/container" "github.com/AdguardTeam/golibs/log" ) // idGenerator generates filtering-list IDs in a way broadly compatible with the // legacy approach of AdGuard Hom...
/content/code_sandbox/internal/filtering/idgenerator.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
443
```go package filtering import ( "testing" "github.com/AdguardTeam/AdGuardHome/internal/aghalg" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/stretchr/testify/assert" ) func TestIDGenerator_Fix(t *testing.T) { t.Parallel() testCases := []struct { name string in []FilterYAM...
/content/code_sandbox/internal/filtering/idgenerator_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
465
```go package filtering_test import ( "bytes" "encoding/json" "io" "net/http" "net/http/httptest" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/filtering" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // TODO(d.kolyshe...
/content/code_sandbox/internal/filtering/rewritehttp_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,728
```go package filtering import ( "bytes" "fmt" "net/netip" "testing" "github.com/AdguardTeam/AdGuardHome/internal/aghtest" "github.com/AdguardTeam/AdGuardHome/internal/filtering/hashprefix" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" "github.com/AdguardTeam/golibs/testutil" "...
/content/code_sandbox/internal/filtering/filtering_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
5,451
```go package filtering import ( "fmt" "net/netip" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/AdguardTeam/golibs/hostsfile" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" "github.com/AdguardTeam/urlfilter/rules" "github.com/miekg/dns" ) // matchS...
/content/code_sandbox/internal/filtering/hosts.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
669
```go package filtering import ( "net" "net/http" "net/url" "os" "path/filepath" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // testTimeout is the common timeout...
/content/code_sandbox/internal/filtering/filter_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,155
```go package filtering import ( "fmt" "net/netip" "testing" "testing/fstest" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" "github.com/AdguardTeam/AdGuardHome/internal/aghtest" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/AdguardTeam/golibs/testutil" "github.com/Adguar...
/content/code_sandbox/internal/filtering/hosts_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,676
```go package filtering import ( "encoding/json" "fmt" "net/http" "net/netip" "net/url" "os" "path/filepath" "slices" "sync" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/AdguardTeam/golibs/errors" "github.com/Ad...
/content/code_sandbox/internal/filtering/http.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
4,212
```go // Package filtering implements a DNS request and response filter. package filtering import ( "context" "fmt" "io/fs" "net" "net/http" "net/netip" "os" "path/filepath" "runtime" "runtime/debug" "slices" "strings" "sync" "sync/atomic" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" ...
/content/code_sandbox/internal/filtering/filtering.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
8,472
```go package filtering import ( "net/netip" "path" "testing" "github.com/AdguardTeam/golibs/netutil" "github.com/miekg/dns" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestDNSFilter_CheckHostRules_dnsrewrite(t *testing.T) { const text = ` |cname^$dnsrewrite=new-cname |...
/content/code_sandbox/internal/filtering/dnsrewrite_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,674
```go package filtering import ( "encoding/json" "net/http" "slices" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/golibs/log" ) // TODO(d.kolyshev): Use [rewrite.Item] instead. type rewriteEntryJSON struct { Domain string `json:"domain"` Answer string `json:"answer"` } // han...
/content/code_sandbox/internal/filtering/rewritehttp.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,121
```go package filtering import ( "encoding/json" "fmt" "net/http" "slices" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/AdguardTeam/AdGuardHome/internal/schedule" "github.com/AdguardTeam/golibs/log" "github.com/Adgu...
/content/code_sandbox/internal/filtering/blocked.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,407
```go package filtering import ( "bytes" "encoding/json" "net/http" "net/http/httptest" "testing" "time" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestDNSFilter_handleFilteringSetURL(t *testing.T) { filtersDir := t.TempDir() ...
/content/code_sandbox/internal/filtering/http_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,063
```go package filtering import ( "net" "net/netip" "testing" "github.com/miekg/dns" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // TODO(e.burkov): All the tests in this file may and should me merged together. func TestRewrites(t *testing.T) { d, _ := newForTest(t, nil, nil) ...
/content/code_sandbox/internal/filtering/rewrites_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
3,164
```go // Package hashprefix used for safe browsing and parent control. package hashprefix import ( "crypto/sha256" "encoding/hex" "fmt" "slices" "strings" "time" "github.com/AdguardTeam/dnsproxy/upstream" "github.com/AdguardTeam/golibs/cache" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golib...
/content/code_sandbox/internal/filtering/hashprefix/hashprefix.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,509
```go package hashprefix import ( "testing" "time" "github.com/stretchr/testify/assert" ) func TestCacheItem(t *testing.T) { item := &cacheItem{ expiry: time.Unix(0x01_23_45_67_89_AB_CD_EF, 0), hashes: []hostnameHash{{ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, ...
/content/code_sandbox/internal/filtering/hashprefix/cache_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
834
```go package hashprefix import ( "crypto/sha256" "encoding/hex" "slices" "strings" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghtest" "github.com/AdguardTeam/golibs/cache" "github.com/miekg/dns" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) const ( cach...
/content/code_sandbox/internal/filtering/hashprefix/hashprefix_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,750
```go package hashprefix import ( "encoding/binary" "time" "github.com/AdguardTeam/golibs/log" ) // expirySize is the size of expiry in cacheItem. const expirySize = 8 // cacheItem represents an item that we will store in the cache. type cacheItem struct { // expiry is the time when cacheItem will expire. expi...
/content/code_sandbox/internal/filtering/hashprefix/cache.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
772
```go package rulelist import ( "bytes" "context" "fmt" "io" "net/http" "net/url" "os" "path/filepath" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghrenameio" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/ioutil" "github.com/AdguardTeam/urlfilter/filterlist" "github.com/...
/content/code_sandbox/internal/filtering/rulelist/filter.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,228
```go package rulelist import "github.com/AdguardTeam/golibs/errors" // ErrHTML is returned by [Parser.Parse] if the data is likely to be HTML. // // TODO(a.garipov): This error is currently returned to the UI. Stop that and // make it all-lowercase. const ErrHTML errors.Error = "data is HTML, not plain text" ```
/content/code_sandbox/internal/filtering/rulelist/error.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
83
```go package rulelist import ( "context" "fmt" "net/http" "sync" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/urlfilter" "github.com/AdguardTeam/urlfilter/filterlist" "github.com/c2h5oh/datasize" ) // Engine is a single DNS filter based on one or more r...
/content/code_sandbox/internal/filtering/rulelist/engine.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,722
```go package rulelist_test import ( "bufio" "bytes" "strings" "testing" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/testutil" "github.com/AdguardTeam/golibs/testutil/fakeio" "github.com/stretchr/testify/assert" "gith...
/content/code_sandbox/internal/filtering/rulelist/parser_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,989
```go package rulelist_test import ( "net/http" "net/url" "os" "path/filepath" "testing" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestFilter_Refresh(t *testing.T...
/content/code_sandbox/internal/filtering/rulelist/filter_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
574
```go package rulelist import ( "fmt" "strings" "sync" "github.com/AdguardTeam/urlfilter" "github.com/AdguardTeam/urlfilter/filterlist" ) // TextEngine is a single DNS filter based on a list of rules in text form. type TextEngine struct { // mu protects engine and storage. mu *sync.RWMutex // engine is the ...
/content/code_sandbox/internal/filtering/rulelist/textengine.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
600
```go package rulelist_test import ( "io" "net/http" "net/http/httptest" "net/url" "os" "path/filepath" "sync/atomic" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/require" ) func TestMain(m *testing...
/content/code_sandbox/internal/filtering/rulelist/rulelist_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
831
```go package rulelist import ( "bufio" "bytes" "fmt" "hash/crc32" "io" "slices" "github.com/AdguardTeam/golibs/errors" ) // Parser is a filtering-rule parser that collects data, such as the checksum // and the title, as well as counts rules and removes comments. type Parser struct { title string rules...
/content/code_sandbox/internal/filtering/rulelist/parser.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,451
```go package rulelist_test import ( "net/http" "testing" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/AdguardTeam/golibs/testutil" "github.com/AdguardTeam/urlfilter" "github.com/miekg/dns" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestE...
/content/code_sandbox/internal/filtering/rulelist/engine_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
419
```go package rulelist_test import ( "testing" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/AdguardTeam/golibs/testutil" "github.com/AdguardTeam/urlfilter" "github.com/miekg/dns" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestNewTextEngine...
/content/code_sandbox/internal/filtering/rulelist/textengine_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
266
```go // Package rulelist contains the implementation of the standard rule-list // filter that wraps an urlfilter filtering-engine. // // TODO(a.garipov): Add a new update worker. package rulelist import ( "fmt" "github.com/c2h5oh/datasize" "github.com/google/uuid" ) // DefaultRuleBufSize is the default length of...
/content/code_sandbox/internal/filtering/rulelist/rulelist.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
547
```go package rewrite import ( "net/netip" "testing" "github.com/AdguardTeam/golibs/netutil" "github.com/AdguardTeam/urlfilter" "github.com/AdguardTeam/urlfilter/rules" "github.com/miekg/dns" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestNewDefaultStorage(t *testing.T)...
/content/code_sandbox/internal/filtering/rewrite/storage_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
3,705
```go // Package rewrite implements DNS Rewrites storage and request matching. package rewrite import ( "fmt" "slices" "strings" "sync" "github.com/AdguardTeam/golibs/container" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/urlfilter" "github.com/AdguardTeam/urlfilter/filterlist" "github.com/Ad...
/content/code_sandbox/internal/filtering/rewrite/storage.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,658
```go package rewrite import ( "testing" "github.com/stretchr/testify/assert" ) func TestItem_equal(t *testing.T) { const ( testDomain = "example.org" testAnswer = "1.1.1.1" ) testItem := &Item{ Domain: testDomain, Answer: testAnswer, } testCases := []struct { left *Item right *Item name str...
/content/code_sandbox/internal/filtering/rewrite/item_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
748
```go package rewrite import ( "fmt" "net/netip" "strings" "github.com/miekg/dns" ) // Item is a single DNS rewrite record. type Item struct { // Domain is the domain pattern for which this rewrite should work. Domain string `yaml:"domain"` // Answer is the IP address, canonical name, or one of the special ...
/content/code_sandbox/internal/filtering/rewrite/item.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
435
```go // Package safesearch implements safesearch host matching. package safesearch import ( "bytes" "encoding/binary" "encoding/gob" "fmt" "net/netip" "strings" "sync" "time" "github.com/AdguardTeam/AdGuardHome/internal/filtering" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.co...
/content/code_sandbox/internal/filtering/safesearch/safesearch.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,186
```go package safesearch import ( "net/netip" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/filtering" "github.com/AdguardTeam/urlfilter/rules" "github.com/miekg/dns" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // TODO(a.garipov): Move as much of this as possi...
/content/code_sandbox/internal/filtering/safesearch/safesearch_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
637
```go package safesearch_test import ( "context" "net" "net/netip" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/filtering" "github.com/AdguardTeam/AdGuardHome/internal/filtering/rulelist" "github.com/AdguardTeam/AdGuardHome/internal/filtering/safesearch" "github.com/AdguardTeam/golibs/testut...
/content/code_sandbox/internal/filtering/safesearch/safesearch_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,409
```go package safesearch import _ "embed" //go:embed rules/bing.txt var bing string //go:embed rules/google.txt var google string //go:embed rules/pixabay.txt var pixabay string //go:embed rules/duckduckgo.txt var duckduckgo string //go:embed rules/ecosia.txt var ecosia string //go:embed rules/yandex.txt var yan...
/content/code_sandbox/internal/filtering/safesearch/rules.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
207
```go //go:build darwin || openbsd package aghos import ( "os" "syscall" ) func setRlimit(val uint64) (err error) { var rlim syscall.Rlimit rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) } func haveAdminRights() (bool, error) { return os.Getuid() == 0, nil } func isOpe...
/content/code_sandbox/internal/aghos/os_bsd.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
115
```go package aghos // PreCheckActionStart performs the service start action pre-check. func PreCheckActionStart() (err error) { return preCheckActionStart() } ```
/content/code_sandbox/internal/aghos/service.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
37
```go package aghos // ConfigureSyslog reroutes standard logger output to syslog. func ConfigureSyslog(serviceName string) (err error) { return configureSyslog(serviceName) } ```
/content/code_sandbox/internal/aghos/syslog.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
39
```go //go:build windows package aghos import ( "strings" "github.com/AdguardTeam/golibs/log" "golang.org/x/sys/windows" "golang.org/x/sys/windows/svc/eventlog" ) type eventLogWriter struct { el *eventlog.Log } // Write implements io.Writer interface for eventLogWriter. func (w *eventLogWriter) Write(b []byte...
/content/code_sandbox/internal/aghos/syslog_windows.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
343
```go //go:build freebsd package aghos import ( "os" "syscall" ) func setRlimit(val uint64) (err error) { var rlim syscall.Rlimit rlim.Max = int64(val) rlim.Cur = int64(val) return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) } func haveAdminRights() (bool, error) { return os.Getuid() == 0, nil } func i...
/content/code_sandbox/internal/aghos/os_freebsd.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
116
```go //go:build !darwin package aghos // preCheckActionStart performs the service start action pre-check. func preCheckActionStart() (err error) { return nil } ```
/content/code_sandbox/internal/aghos/service_others.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
41
```go //go:build windows package aghos import ( "os" "os/signal" "golang.org/x/sys/windows" ) func setRlimit(val uint64) (err error) { return Unsupported("setrlimit") } func haveAdminRights() (bool, error) { var token windows.Token h := windows.CurrentProcess() err := windows.OpenProcessToken(h, windows.TOK...
/content/code_sandbox/internal/aghos/os_windows.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
261
```go // Package aghos contains utilities for functions requiring system calls and // other OS-specific APIs. OS-specific network handling should go to aghnet // instead. package aghos import ( "bufio" "fmt" "io" "os" "os/exec" "path" "runtime" "slices" "strconv" "strings" "github.com/AdguardTeam/golibs/e...
/content/code_sandbox/internal/aghos/os.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,126
```go //go:build !windows package aghos import ( "log/syslog" "github.com/AdguardTeam/golibs/log" ) // configureSyslog sets standard log output to syslog. func configureSyslog(serviceName string) (err error) { w, err := syslog.New(syslog.LOG_NOTICE|syslog.LOG_USER, serviceName) if err != nil { // Don't wrap t...
/content/code_sandbox/internal/aghos/syslog_others.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
112
```go package aghos import ( "fmt" "io" "io/fs" "github.com/AdguardTeam/golibs/container" "github.com/AdguardTeam/golibs/errors" ) // FileWalker is the signature of a function called for files in the file tree. // As opposed to filepath.Walk it only walk the files (not directories) matching // the provided patt...
/content/code_sandbox/internal/aghos/filewalker.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
923
```go //go:build linux package aghos import ( "io" "os" "syscall" "github.com/AdguardTeam/golibs/osutil" "github.com/AdguardTeam/golibs/stringutil" ) func setRlimit(val uint64) (err error) { var rlim syscall.Rlimit rlim.Max = val rlim.Cur = val return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlim) } fun...
/content/code_sandbox/internal/aghos/os_linux.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
300
```go package aghos import ( "io/fs" "path" "testing" "testing/fstest" "github.com/AdguardTeam/golibs/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // errFS is an fs.FS implementation, method Open of which always returns // errFSOpen. type errFS struct{} // errFSOpen is...
/content/code_sandbox/internal/aghos/filewalker_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
374
```go package aghos import ( "fmt" "io" "io/fs" "path/filepath" "github.com/AdguardTeam/golibs/container" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/osutil" "github.com/fsnotify/fsnotify" ) // event is a convenient alias for an empty struct to s...
/content/code_sandbox/internal/aghos/fswatcher.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,326