| Age | Commit message (Collapse) | Author |
|
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.
|
|
There are two APIs to manage hosts.d RR: create and delete.
Previously, the create API pass the hosts name inside and values inside
the path,
POST /hosts.d/<name>/rr?domain=&value=
This commit changes the request type to form, so all parameters move
to body,
POST /hosts.d/rr
Content-Type: application/x-www-form-urlencoded
name=&domain=&value=
On delete API, we changes the name parameter to be send on query
parameter along with domain to be deleted.
Previously, the delete API was
DELETE /hosts.d/<name>/rr?domain=
now it become
DELETE /hosts.d/rr?name=&domain=
|
|
|
|
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.
|
|
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
|