| Age | Commit message (Collapse) | Author |
|
While at it, rename the README.adoc to README and made symlink
to it as README.adoc.
|
|
Some block code in the examples are not formatted correctly due to
spaces.
|
|
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
|
|
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.
|
|
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
|
|
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
}
}
|
|
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`.
|
|
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
|
|
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.
|
|
The latest changes on share module changes type Zone.SOA field type,
which affect the zone.d page.
|
|
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.
|
|
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.
|
|
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=
|
|
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.
|
|
In the /block.d page, in each provider we provide a button to update
the hosts file directly.
|
|
This is to make all terminology to be consistent, from configuration to
page URL, and API.
|
|
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>
|
|
See https://kilabit.info/journal/2022/gpl/ for more information.
|
|
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".
|
|
Instead of using px use em unit instead.
|
|
If the RR value is object print the value as "key=value,...".
|
|
Instead of relying on event "oninput" get the value of each record
values from the input element itself.
Also, convert type RR Type and MX Preferences to integer before passing
it to backend.
|
|
This is to allow user to trigger search by pressing Enter key on the
text input field without clicking button Search.
While at it, display information when no matched records found on search.
|
|
|
|
When user open the rescached web interface, the front page will
render and refresh the list of non-local caches per 10 seconds.
|
|
|
|
While at it, add more DNS RR types for displaying in the dashboard.
|
|
|
|
* Add function to search and remove non-local caches
* Refactoring no how to create and remove record from hosts file
|
|
* Trim dot "." suffix on RR.Name before creating new one
* Decrease the notification from default (5 seconds) to 3 seconds
* Use the phrase "zone file" instead of "master file"
* Update the SOA fields information to be less technical.
|
|
|
|
Previously, the fields to create new record is name, type, and value.
This commit move the type field to the top so when the type changes,
the fields below it also changes according to its type.
This is to simplify the field format for PTR record.
|
|
|
|
Since each zone file only allow one SOA record, the form for creating,
updating, or deleting the SOA record should be separated from others
resource record.
|
|
|
|
|
|
|
|
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.
|