summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-06Release rescached v4.4.0 (2022-08-06)v4.4.0Shulhan
This release refactoring the resolver command as CLI to rescached server. The resolver command now can manage environment, caches, hosts.d, and zone.d in the server; not just query.
2022-08-06_www/doc: format documentation for resolverShulhan
Some block code in the examples are not formatted correctly due to spaces.
2022-08-06_AUR: track latest changes in AUR submoduleShulhan
2022-08-06go.mod: update all dependenciesShulhan
2022-07-11test: wait for server before running the testShulhan
On build.kilabit.info, 2 out 5 building this repository return an error dial tcp 127.0.0.1:5381: connect: connection refused This is due to server is not ready accepting connection while the test for client is already running.
2022-06-12all: un-export HostsFiles and Zones fields on EnvironmentShulhan
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.
2022-06-12_www: refactoring, various bug fixes and cleanupsShulhan
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
2022-06-12all: trim the zone's name from request on HTTP API zone.d record deleteShulhan
When calling API for zone.d record delete, client send the fully qualified domain name on record to be deleted, but caches store only the subdomains internally. This cause the delete action fail, because no internal record match with request.
2022-06-12all: make GET /api/hosts.d to return list of hosts.d if name is emptyShulhan
This is to provide an HTTP API to fetch list of hosts.d files on the server.
2022-06-12all: fixes HTTP API for updating environmentShulhan
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.
2022-06-12_www/block.d: fix the variable names on hosts block.dShulhan
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.
2022-06-09go.mod: update to share module v0.38.0Shulhan
This changes affect the dns Server where all caches related methods has been moved to field Caches.
2022-06-09all: add integration tests for HTTP API related to block.dShulhan
The test is conducted by running the server and call the HTTP API using the Client methods.
2022-06-09all: change the HTTP API to update hosts in block.dShulhan
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
2022-05-22all: use the exported Blockd type instead of interface{}Shulhan
Since we have exported the Blockd type from rescached package, any Blockd operation on the HTTP server and on the client on cmd/resolver can use it instead of using interface{}.
2022-05-22cmd/resolver: implement command to list hosts in block.dShulhan
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 } }
2022-05-22all: implement HTTP API to fetch list of block.dShulhan
Given the following request, GET /api/block.d It will return list of hosts in block.d as JSON format: { "data": { "<name>": <Blockd> ... } }
2022-05-22all: export and rename the hostsBlock type to BlockdShulhan
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.
2022-05-22all: add all known licensesShulhan
2022-05-22cmd/resolver: add command to print the program versionShulhan
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>
2022-05-22cmd/resolver: changes the help flag to commandShulhan
Executing "resolver help" will print the command usage.
2022-05-22all: simplify cmd/resolver documentationShulhan
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`.
2022-05-22all: change the test debug level from 2 to 1Shulhan
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.
2022-05-22all: move the documentation under _www/doc directoryShulhan
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
2022-05-17cmd/resolver: implement command to delete record on zoneShulhan
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.
2022-05-17all: update share moduleShulhan
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
2022-05-16all: use consistent parameter name for zone nameShulhan
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.
2022-05-16_www: fetch the zone's records when clicking zoneShulhan
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.
2022-05-16cmd/resolver: implement command to get records on zoneShulhan
Given the following command, $ resolver zone.d rr get <zone> It will fetch and print all records in the specific <zone>.
2022-05-16all: implement HTTP API to fetch records in zoneShulhan
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.
2022-05-16all: fix comment regarding HTTP path on HTTP handlersShulhan
2022-05-16cmd/resolver: add command to fetch and print all zonesShulhan
The command has the following format, resolver zone.d
2022-05-16all: add new HTTP API to get all zonesShulhan
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.
2022-05-16go.mod: update share moduleShulhan
The latest changes on share module changes type Zone.SOA field type, which affect the zone.d page.
2022-05-15cmd/resolver: implement command to add new record to zoneShulhan
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.
2022-05-15all: split zoneRecordRequest type into separate fileShulhan
2022-05-15all: refactoring the HTTP API for deleting zone recordShulhan
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.
2022-05-14all: refactoring HTTP API for adding new zone.d recordShulhan
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.
2022-05-14cmd/resolver: implement command to create and delete zone fileShulhan
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>
2022-05-14all: update documentation for resolverShulhan
Group each command and examples in its own section.
2022-05-14all: refactor the HTTP API for zone.dShulhan
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.
2022-05-13cmd/resolver: implement command to delete record on hosts fileShulhan
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.
2022-05-11all: ignore generated test files inside _test directoryShulhan
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.
2022-05-11cmd/resolver: implement command to add new record to hosts fileShulhan
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.
2022-04-25all: refactor the APIs to manage hosts.d resource records (RR)Shulhan
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=
2022-04-24cmd/resolver: move handling command env to resolverShulhan
2022-04-24cmd/resolver: simplify handling command "caches"Shulhan
Instead of splitting them into three methods, merge them into single method doCmdCaches.
2022-04-24cmd/resolver: simplify method to handle block.d commandShulhan
Instead of splitting them into three methods, merge them into single method.
2022-04-24cmd/resolver: implement command to manage hosts.dShulhan
The resolver cli now have command "hosts.d" to create, delete, and get the hosts file inside the hosts.d in the rescached server.
2022-04-24all: return the hosts file in response of hosts.d create and deleteShulhan
Instead of returning empty data, return the affected hosts file when creating a new one or when deleting existing one.