| Age | Commit message (Collapse) | Author |
|
|
|
The module "share" has been moved to new repository at SourceHut and
we rename it to make it more unique instead of common English words
"share".
|
|
|
|
The random number from "math/rand" is predictable if the seed is known.
Even though the random number here is only for generating unique request
ID, we still need to prevent this by using more secure random number.
|
|
The update on share module affect the following changes,
* lib/dns: removing dns.ZoneRecords, replacing it with
map[string][]*dns.ResourceRecord
* lib/dns: file Name in Zone renamed to Origin
* lib/dns: replace call to Caches.InternalPopulate with
InternalPopulateZone that accept zone as parameter
|
|
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
}
}
|
|
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>
|
|
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>
|
|
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.
|
|
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.
|
|
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.
|