| Age | Commit message (Collapse) | Author |
|
The telemetry collect the Go runtime/metrics and forward it to questdb
instance in localhost.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
This is to make sure that all required fields that are empty in the
configuration initialized to its default values.
|
|
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.
|
|
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>
|
|
List of changes,
* Remove unused constants keyIsEnabled, keyIsSystem, and keyLastUpdated.
* Use the method String on instance of Duration instead of fmt.Sprintf.
* Replace any usage of io/ioutil package with its replacement.
* Check for error from calling Environment.init and Zone.Add.
* Prefix all returned error on hostsBlock.update method.
* Add "lint" task as part of default target, build.
|
|
The "env" command fetch the current server environment and print as
ini format to stdout.
|
|
See https://kilabit.info/journal/2022/gpl/ for more information.
|
|
Previously, the options for HTTP server initialized internally, which
make it uneasy to changes the default rescached instance when running
in development mode.
This commit move the HTTP server initialization inside the Environment
init method. If its nil, the init will set the default HTTP server
options along with the Memfs.
|
|
This minimize storage size allocated by
* hostBlocks: from 88 to 80 bytes (-8 bytes)
* Environment: from 344 to 288 bytes (-56 bytes)
|
|
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.
|
|
The update bring new features and enhancements for DNS server.
* add support to save and load caches to/from storage
rescached now able to save and load caches to local storage upon
restart.
On POSIX, the caches is stored in /var/cache/rescached/rescached.gob,
encoded using gob.
Update #9
* remove the fallback name servers (NS) from server options
The original idea of fallback NS is to send the query to the one
define in resolv.conf, instead of using the one defined by user in
ServerOptions NameServers, when an error occured.
But, most of error usually caused by network (disconnected, time out),
so re-sending query to fallback NS does not have any effect if the
network it self is not working.
This changes remove the unnecessary and complex fallback NS from
server.
* do not cache truncated answer
Previously only answer with non-zero response code is ignored.
This changes ignore also answer where response header is truncated.
* lib/dns: make the TCP forwarders as complementary of UDP
The TCP forwarders only active when client send the DNS request as TCP.
When the server receive that request it should also forward the request
as TCP not as UDP to prevent the truncated response.
Another use case for TCP is when the response is truncated, the client
will send the query back through TCP connection. The server should
forward this request using TCP instead of UDP.
|
|
|
|
|
|
While at it,
* update code with latest dns library
* check for empty name servers when updating environment
|
|
Currently, it allow user to add or remove new resource record from the
master zone file.
|
|
|
|
The UI will update (insert or remove) the records on cache on the fly.
|
|
|
|
The user interface, which can be accessed at
http://127.0.0.1:5380/#hostsblock, contains list of hosts block sources
that can be enabled or disabled using check box.
If enabled and the file is outdated, it will fetch the latest list
and store it at /etc/rescached/hosts.d/<name>, where name is the domain
name of source.
|
|
Previously, user can change the location where the hosts files and master
file using "rescached::dir.host" and "rescached::dir.master" options.
This change disallow chaning both options and make them static.
|
|
While at it, unexport it.
|