| Age | Commit message (Collapse) | Author |
|
* all: remove loading system hosts file::
Loading and caching system hosts file (for example, /etc/hosts in
POSIX) will leaks internal hosts if the rescached server is open to
public.
The system hosts file are handled by nssswitch.conf "files" internally
so no need to loading it.
* cmd/resolver: replace "math/rand" with "crypto/rand"::
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.
|
|
|
|
|
|
= Release share v0.50.1 (2023-11-05)
This release bring many enhancements to "lib/memfs", a library for
caching file system in memory.
=== Enhancements
* lib/memfs: return nil in AddChild if file not exist
* lib/memfs: quote the path in the returned error
* lib/memfs: add method Child to Node
* lib/memfs: call the Init method in the embedded file
* lib/memfs: include empty directory
* lib/memfs: re-scan directory content on Node’s Update
= Release share v0.50.0 (2023-10-04)
This release bring many enhancements thanks to linters like revive,
fieldaligment, and shadow.
This release also replace "math/rand.Seed" with "crypto/rand".
Since Go 1.20 the "math/rand.Seed" is considered deprecated (the initial
value of rand is seeded automatically, not zero).
Now, it is the time to replace "math/rand" with more secure random
number generator, from "crypto/rand".
This changes affect tests in package "lib/email", "lib/http", and
"lib/stmp".
= Release ciigo v0.10.1 (2023-11-07)
In this release, update on asciidoctor-go add new features to parse
unordered list with '-' and some bug fixes related to rendering list.
The update on share module fix for permission error when scanning using
memfs and HTTP redirect for request to directory that does not end with
slash.
|
|
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
|
|
The golangci-lint become unusable.
Even running "make" on the their master branch does not works.
Since I use go tip (master) on local, sometimes golangci-lint does not
run.
This changes replace golangci-lint with "go vet", fieldalignment and
shadow (from x/tools), and revive.
|
|
Loading and caching system hosts file (for example, /etc/hosts in POSIX)
will leaks internal hosts if the rescached server is open to public.
The system hosts file are handled by nssswitch.conf "files" internally
so no need to loading it.
|
|
=== Enhancements
* go.mod: set Go version to 1.19 and update share module
The latest share module has several fixes and enhancements regarding
DNS library, including
* lib/dns: simplify unpackDomainName return value for end
* lib/dns: use the packet length to derive current offset
* lib/dns: handle zone file with CRLF line ending
* lib/dns: allow parsing TXT rdata without quote in zone file
* lib/dns: fix parsing SRV record from zone file
* lib/dns: fix packing and unpacking resource record HINFO
* lib/dns: fix packing, parsing, and saving MINFO resource data
* _www/doc: update the index and resolver documentation
|
|
While at it, use "_" for unused parameter on methods.
|
|
|
|
The latest share module has several fixes and enhancements regarding
DNS library, including
* lib/dns: simplify unpackDomainName return value for end
* lib/dns: use the packet length to derive current offset
* lib/dns: handle zone file with CRLF line ending
* lib/dns: allow parsing TXT rdata without quote in zone file
* lib/dns: fix parsing SRV record from zone file
* lib/dns: fix packing and unpacking resource record HINFO
* lib/dns: fix packing, parsing, and saving MINFO resource data
|
|
|
|
While at it, rename the README.adoc to README and made symlink
to it as README.adoc.
|
|
This release refactoring the resolver command as CLI to rescached server.
The resolver command now can manage environment, caches, hosts.d, and
zone.d in the server; not just query.
|
|
Some block code in the examples are not formatted correctly due to
spaces.
|
|
|
|
|
|
On build.kilabit.info, 2 out 5 building this repository return an error
dial tcp 127.0.0.1:5381: connect: connection refused
This is due to server is not ready accepting connection while the test
for client is already running.
|
|
Previously those fields exported because web client need it to initialize
the content for /hosts.d and /zone.d pages.
Since we now have HTTP API for that, web client can call get request
to the respective API without depends on the environment.
|
|
On refactoring,
- standardize the method names on the rescached.js to match with the
Client, for example prefixing block.d operations with Blockd.
- use the GET /block.d, GET /hosts.d, GET /zone.d to fetch the
resources instead of using GET /environment for all.
On bug fixes,
- fix updating SOA record on zone.d due to refactoring
|
|
When calling API for zone.d record delete, client send the fully
qualified domain name on record to be deleted, but caches store only
the subdomains internally.
This cause the delete action fail, because no internal record match
with request.
|
|
This is to provide an HTTP API to fetch list of hosts.d files on the
server.
|
|
There are two issues when updating environment.
One is on the front, where debug value is send as string.
Another one is the back, where new environment overwrite all of options
where it should only update only DNS server options and Debug fields.
|
|
In the commit 0b92dbb8463d, we changes the field HostsBlocks in
Environment to HostBlockd, but we forgot to changes the code in
the web.
This changes fix this issue.
|
|
This changes affect the dns Server where all caches related methods has
been moved to field Caches.
|
|
The test is conducted by running the server and call the HTTP API using
the Client 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
}
}
|
|
Given the following request,
GET /api/block.d
It will return list of hosts in block.d as JSON format:
{
"data": {
"<name>": <Blockd>
...
}
}
|
|
In the Environment, we have a field HostsBlocks that reference
an unexported type hostsFile.
In order for any package to be able to use this field, we need to
export this type.
While at it, we rename the type from hostsBlock to Blockd to make it
simple and consistent with name.
|
|
|
|
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`.
|
|
Since we move and watch doc files, running "make dev" with debug level
set to 2 add more noise due to logs from converting .adoc files.
|
|
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.
|
|
345ee16 lib/dns: return the removed record on caches RemoveCachesByRR
a44f87f lib/dns: disable JSON marshaling Zone Records field
3f8e9c6 lib/dns: print the field Value on ResourceRecord Stringer instead
of rdlen
|
|
Some zone APIs use "name" and some use "zone" for passing the zone
name.
This changes made all zone APIs to use "name" as parameter name.
|
|
Previously, the zone's records is fetched along with response from
API environment.
If zone have many records, this cause the API environment response
larger, not suited for managing environment itself.
This changes make the zone's records to be fetched immediately when
user click on one of the zone file.
|
|
Given the following command,
$ resolver zone.d rr get <zone>
It will fetch and print all records in the specific <zone>.
|
|
Sending the following request to HTTP server:
GET /api/zone.d/rr?zone=<string>
where zone parameter is the zone name, it will return list of records
in that zone.
|
|
|
|
The command has the following format,
resolver zone.d
|
|
The HTTP API has the following format,
GET /api/zone.d
On success, it will return HTTP status code 200 with all zone formatted
as JSON in the body.
|
|
The latest changes on share module changes type Zone.SOA field type,
which affect the zone.d page.
|
|
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.
|
|
|