| Age | Commit message (Collapse) | Author |
|
Instead of returning empty data, return the affected hosts file when
creating a new one or when deleting existing one.
|
|
This is to prevent panic when hosts.d is not exist and client try to
create new hosts file on it.
|
|
|
|
Using dynamic value in the URL path is not a good practice, so we
move the API for hosts.d to create, delete, and get to form and query
parameters.
|
|
Instead of passing whole block.d object with single field Name set,
send the request using urlencoded form.
|
|
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 URL /api/block.d/enable activate the hosts in block.d, while
The URL /api/block.d/disable deactivate the hosts in block.d.
Both of this API accept single parameter "name" in the body as
application/x-www-form-urlencoded.
|
|
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.
|
|
In the /block.d page, in each provider we provide a button to update
the hosts file directly.
|
|
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 API receive the block.d name and if it valid, the server will
fetch latest hosts file from the block provider based on the registered
URL.
|
|
If the hosts block file never created before and the directory to
hosts block file is not exist, the hostsBlock update method will return
an error.
This changes fix this issue by creating the path to hosts block directory
first before fetching and storing the new update.
|
|
This is to make sure that all required fields that are empty in the
configuration initialized to its default values.
|
|
This is to make all terminology to be consistent, from configuration to
page URL, and API.
|
|
|
|
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.
|
|
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.
|
|
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 serve-doc command require ciigo [1] command.
[1] git.sr.ht/~shulhan/ciigo
|
|
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.
|
|
|
|
Both types are similar, since the lib/http already imported we replace
the internal response to minimize duplicate and confusion later.
While at it, use consistent variable naming and declaration using var
in all methods.
|
|
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.
|
|
This release re-licensing the rescached under GPL 3.0 or later.
See https://kilabit.info/journal/2022/gpl/ for more information.
|
|
See https://kilabit.info/journal/2022/gpl/ for more information.
|
|
|
|
=== New features
* www: implement functionality to remove cache by record name
=== Bug fixes
* www: check for possible null on NameServers environment
* www: fix caches record type showing "undefined"
=== Chores
* all: fix format of all asciidoc files
* cmd/rescached: add command "embed" and to run in development mode
|
|
The idea is to be able to view all content of documentation inside the
_doc file using the following command:
_doc$ ciigo serve
|
|
This is to make the adoc files parsed and rendered correctly by
asciidocgo and asciidoc tools.
|
|
The CHANGELOG.adoc file is formatted using asciidoc markup.
So, to make the rendered HTML readable, it must adhere to the asciidoc
format, especially when formatting the list content.
|
|
|
|
Changes,
* lib/memfs: skip mount if the Root node has been initialized
* lib/http: remove field memfs.Options in ServerOptions
|
|
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.
|
|
In the web user interface (WUI), we have a button "Remove from cache"
that displayed per record, but somehow this feature is not implemented,
probably missing from commits due to rebase or I completely forgot about
it.
Anyway, this commit implement the feature to remove record from cache
by clicking the button. On success, it will remove the removed record
from search result.
Fix #10
|
|
|
|
Due to refactoring on DNS library, we forgot to rename the field QType
to RType on the frontend. This cause the record type on caches showed
on the page as "undefined".
|
|
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.
|