| Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
Previously, the HTTP API for deleting a record is by passing the
parameters as JSON in the body.
This may cause issue if HTTP client does not support sending body
in DELETE method.
This changes the method to pass the parameters in the query,
DELETE /zone.d/rr?zone=<string>&type=<string>&record=<base64 json>
Parameters,
- zone: the zone name,
- type: the record type,
- record: the content of record with its domain name and value.
|
|
Previously, the request for adding new record on zone file is by passing
the zone name and type inside the path,
/zone.d/:name/rr/:type
This commit changes it to pass all parameters inside the request body
as JSON,
{
"zone": <string>,
"kind": <string>,
"record": <base64 string|base64 JSON>
}
For example, to add A record for subdomain "www" to zone file "my.zone",
the request format would be,
{
"zone": "my.zone",
"kind": "A",
"record": "eyJOYW1lIjoid3d3IiwiVmFsdWUiOiIxMjcuMC4wLjEifQ=="
}
Where "record" value is equal to `{"Name":"www","Value":"127.0.0.1"}`.
On the response, we changes it to return only the new record instead of
all record in the zone.
|
|
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>
|
|
Group each command and examples in its own section.
|
|
Previously, the the HTTP API for creating and deleting zone file is
by passing the zone file name in path of URL.
This changes move the parameter name to POST body when creating new
zone file and in the DELETE query when deleting zone file.
|
|
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 _test directory is used as base directory when running local test
(for example, by executing "make dev").
Any files inside the _test should not be ignored.
|
|
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>
|