| Age | Commit message (Collapse) | Author |
|
The telemetry collect the Go runtime/metrics and forward it to questdb
instance in localhost.
|
|
While at it, use "_" for unused parameter on methods.
|
|
We have HTTP API to enable or disable block.d by batch by passing all
block.d records.
The name of HTTP API is /v2/block.d/update and this is duplicate with
API to update the content of hosts in block.d.
This changes fix this by creating new HTTP API /v2/block.d/fetch
that fetch the latest hosts file from specific block.d by its name.
While at it,
- reformat html and JavaScript files using js-beautify
- rename constants and methods for HTTP APIs
- add and update comments for some HTTP APIs
|
|
Since we have exported the Blockd type from rescached package, any
Blockd operation on the HTTP server and on the client on cmd/resolver
can use it instead of using interface{}.
|
|
Given the following command
$ resolver block.d
It will print all hosts in block.d in the JSON format, for example
{
"pgl.yoyo.org": {
"Name": "pgl.yoyo.org",
"URL": "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts\u0026showintro=0\u0026startdate[day]=\u0026startdate[month]=\u0026startdate[year]=\u0026mimetype=plaintext",
"LastUpdated": "2022-04-20 01:54:30 WIB",
"IsEnabled": false
},
"someonewhocares.org": {
"Name": "someonewhocares.org",
"URL": "http://someonewhocares.org/hosts/hosts",
"LastUpdated": "2022-04-20 00:53:22 WIB",
"IsEnabled": false
},
"winhelp2002.mvps.org": {
"Name": "winhelp2002.mvps.org",
"URL": "http://winhelp2002.mvps.org/hosts.txt",
"LastUpdated": "2022-04-20 01:35:38 WIB",
"IsEnabled": false
}
}
|
|
Executing "resolver version" will print the current version based
on the latest tag, number of commit, and latest commit hash:
v<TAG>.r<number-of-commit>.<commit-hash>
|
|
Executing "resolver help" will print the command usage.
|
|
It is hard to keep the documentation in sync between manual page,
the Go documentation, and command line usage.
A changes in manual page need to be copied into two different places.
To simplify this, we make the Go doc comment as summary and the command
line usage is set from output of `go tool doc ./cmd/resolver`.
|
|
This also allow the latest/released documentation viewed on
the web user interface under /doc path.
While at it, reformat HTML and CSS files using js-beautify and
JavaScript files using clang-format [1].
[1] https://google.github.io/styleguide/jsguide.html#formatting
|
|
Given the following command
$ resolver zone.d rr delete <zone> <"@" | subdomain> <type> <class> <value>
It will delete the record in zone by given subdomain, type, class, and
value.
|
|
Given the following command,
$ resolver zone.d rr get <zone>
It will fetch and print all records in the specific <zone>.
|
|
The command has the following format,
resolver zone.d
|
|
The command has the following signature,
zone.d rr add <zone> <"@" | subdomain> <ttl> <type> <class> <value> ...::
The domain name can be set to origin using "@" or empty string, subdomain
(without ending with "."), or fully qualified domain name (end with ".").
If ttl is set to 0, it will default to 604800 (7 days).
List of valid type are A, NS, CNAME, PTR, MX, TXT, and AAAA.
List of valid class are IN, CS, HS.
|
|
The command to create new zone file has the following signature:
zone.d create <name>
While command to delete zone file has the following signature:
zone.d delete <name>
|
|
Group each command and examples in its own section.
|
|
The command has the following signature,
resolver hosts.d rr delete <name> <domain>
Given the hosts name "hosts" and domain "my.hosts" it will delete
all records that have domain name "my.hosts" inside the file.
|
|
The command has the following signature,
resolver hosts.d rr add <name> <domain> <value>
Given the hosts file name "hosts" and domain "my.hosts" with value
"127.0.0.1", it will add new line "127.0.0.1 my.hosts" to the "hosts"
file.
If the domain name already exists, the new record will be appended
instead of replaced.
|
|
|
|
Instead of splitting them into three methods, merge them into single
method doCmdCaches.
|
|
Instead of splitting them into three methods, merge them into single
method.
|
|
The resolver cli now have command "hosts.d" to create, delete, and get
the hosts file inside the hosts.d in the rescached server.
|
|
The following command enable specific hosts in block.d by name:
resolver block.d enable <name>
and the following command disable it
resolver block.d disable <name>
|
|
Previously, all files required for installing rescached scattered in
different directories.
This changes move all files into single directory _sys with the
directory structure matched with target system.
|
|
The following command: "resolver block.d update x" will fetch the
latest hosts file from the block.d provider "x" based on its registered
URL.
|
|
|
|
Previously, running an instance of rescached assume that all
configurations and cache are located in /etc/rescached and
/var/cache/rescached.
It possible that we may want to use different base directory (or $PREFIX,
in the auto tools terms), for example "/opt/rescached" or as showed
in the "dev" task in the Makefile, we use "_test" as base directory
for running test instance.
This changes also fix an error when loading hosts file from non-existant
hosts.d directory.
|
|
The URL and contents from this provider is now empty and has not been
updated.
|
|
This changes add new directory called "block.d" under rescached.
This directory contains hosts file fetched from URL defined in hosts
block configuration.
In this way, we did not mixed between user created hosts file and
external hosts file.
In the configuration file, we changes the hosts block format from
single line
hosts_block = <URL>
into subsection with dynamic name,
[block.d "<name>"]
name = <name>
url = <URL>
|
|
The env command now accept sub command "update" with argument path to
the file or "-" for standard input.
The content of file is formatted using JSON, the same as output of "env"
command.
If the content of file is valid, server will be restarted immediately.
|
|
The "env" command fetch the current server environment and print as
ini format to stdout.
|
|
If the number of Answer is zero, break the attempt and continue the next
query name.
This is to fix the loop end when server return OK but with zero answer.
|
|
Since share 9329196125fe, the populateQueries has been moved to package
lib/net as a method of ResolvConf.
|
|
On the HTTP side, if the query parameter "name" for "DELETE /api/caches"
is "all" it will remove all caches.
On the resolver side, if the parameter for "caches remove" is "all"
it will remove all caches.
This changes require latest lib/dns on share module.
|
|
Instead of printing the full date and time, print the ReceivedAt and
AccessedAt fields in the perspective of current time.
For example, 1m ago, 30s ago.
|
|
The "caches" command accept second sub command "remove" that accept
single domain name to be removed from caches.
This changes affect the HTTP API for caches delete to return the removed
answer on the response data.
|
|
The "caches" command accept sub command "search" with a string
argument.
Given the following command "caches search bit", the resolver will
call HTTP API to rescached server to search for caches that have name
contains bit.
|
|
The caches command fetch and print all caches from rescached server.
|
|
Previously, the resolver command only for querying DNS server.
In this changes and in the future, the resolver command will be client
for DNS and rescached server.
|
|
|
|
The latest share module move the Watcher and DirWatcher from package io
to package memfs, also it simplify watching files on existing MemFS
instance using method Watch.
|
|
See https://kilabit.info/journal/2022/gpl/ for more information.
|
|
This save the memory size from 80 to 72 bytes (-8 bytes).
|
|
This two commands is used internally for development.
The "embed" command embed all files inside "_www" directory into
Go file "memfs_generate.go".
This command replace "internal/generate_memfs.go".
The "dev" command run the rescached server in development mode using
"cmd/rescached/rescached.cfg.test" as the configuration.
The "dev" command listen on DNS port 5350, so to prevent conflict with
live rescached server, we run script _bin/nft_dnstest_chain.sh to redirect
UDP and TCP requests from port 53 to port 5350.
|
|
Previously, we initialize the rescached Server by passing the
path to configuration file and initialize the environment inside the
server.
This commit changes it to pass the instance of Environment. The idea
is to allow creating and running rescached Server without creating
configuration file first.
|
|
This changes update the code based on refactoring on lib/dns package
on share module.
|
|
Using TCP for parent name server is discouraged, because most of server
disallow keeping the connection alive.
The valid use case for TCP connection is when server received truncated
UDP answer.
Using UDP as parent scheme, will automatically assume that the server
also capable of handling query in TCP.
This is required when client (for example, your browser) re-send the query
after receiving truncated UDP answer.
Any query received by rescached through TCP will forwarded to the parent
name server as TCP too, using the same address and port defined in one of
UDP parent.
While at it, use Cloudflare DNS server as default in configuration
and as example in documentation.
|
|
|
|
== New features
Rescached now have a web user interface (wui) that can be accessed at
http://127.0.0.1:5380.
The interface can be used to monitoring caches, managing caches, environment,
blocked hosts, internal hosts files, and zone files.
== Breaking changes
* The `rescached::dir.hosts` now default to "/etc/rescached/hosts.d"
* The `rescached::dir.master` now default to "/etc/rescached/zone.d"
|
|
Since the default parent is DNS over TLS, https://18.136.35.199,
which is run using self-signed certificate, we need to allow_insecure
to true to make the forward can connect without error.
|
|
Remove empty options in configurations to minimize confusion and
comment options that have default values.
|