Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
min: ${{ steps.get.outputs.min }}

test:
needs: [ get-lts ]
needs: [get-lts]
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -46,7 +46,7 @@ jobs:
- run: npm test

test-mac:
needs: [ get-lts ]
needs: [get-lts]
runs-on: macos-latest
strategy:
matrix:
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
run: docker compose -f docker/docker-compose.yml down -v

test-win:
needs: [ get-lts ]
needs: [get-lts]
runs-on: windows-latest
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,5 @@ dist

package-lock.json
.release/
conf.d/*.pem
conf.d/
CLAUDE.md
42 changes: 26 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

### Unreleased

### [3.0.0] - 2026-07-25
### [3.0.3] - 2026-07-27

- many updates for data stores and NS backends
- feat(mysql): new NS columns: engine, listen, publisher, transport, dnssec
- change: */store/toml -> */store/file
- change(sql/*.sql): made setup non-destructive
- feat: self describing password hashes (#56)

### [3.0.2] - 2026-07-25

- release 3.0.0
- dep(rr): bump version
- fix: generate conf.d/http.toml on 1st start

### [3.0.0-alpha.13] - 2026-07-24
### 3.0.0-alpha.13 - 2026-07-24

- fix(sql): quote mysql 8 keyword rank
- fix: subgroup searching
- feat: paginate zone records (#53)

### [3.0.0-alpha.12] - 2026-04-14
### 3.0.0-alpha.12 - 2026-04-14

- toml backend (#49)
- add: TOML stores for group, nameserver, permission, session (#47)
Expand All @@ -29,7 +37,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
- ci: update permissions to be explicit (#42)
- docker compose support + env var config overrides (#40)

### [3.0.0-alpha.11] - 2026-04-07
### 3.0.0-alpha.11 - 2026-04-07

- decorate user & group with permissions
- add some missing PUT routes
Expand All @@ -39,24 +47,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
- zone factory & subclasses
- user factory, toml, mysql, mongodb, elastic classes

### [3.0.0-alpha.10] - 2026-03-25
### 3.0.0-alpha.10 - 2026-03-25

- config: replace .yaml with .toml
- zone_record can be empty, default 0
- feat(zone records): create and delete

### [3.0.0-alpha.9] - 2026-03-15
### 3.0.0-alpha.9 - 2026-03-15

- feat(zone): use DataTable for list, added search/limit options
- routes/zr: add extra data about ZR parse failures

### [3.0.0-alpha.8] - 2026-03-14
### 3.0.0-alpha.8 - 2026-03-14

- lib/zone: add limit option
- lib/nameserver.js: handle null fields from DB
- routes/zone: report zone name on validation failure

### [3.0.0-alpha.6] - 2025-04-08
### 3.0.0-alpha.6 - 2025-04-08

- dep(eslint): upgraded to v9
- dep(\*): bump versions to latest
Expand All @@ -68,7 +76,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
- change(routes/ns): GET id is optional, result is always array
- change(routes/zone): GET id is optional, result is always array

### [3.0.0-alpha.5] - 2024-03-06
### 3.0.0-alpha.5 - 2024-03-06

- feat(lib/zone): added, with tests, fixes #22
- feat(lib/zone_record): added, with tests, fixes #23
Expand All @@ -77,12 +85,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
- sql: return indicative boolean for delete
- test(zr): added maps from NT SQL 2 to dns-rr std formats

### [3.0.0-alpha.4] - 2024-03-05
### 3.0.0-alpha.4 - 2024-03-05

- feat(lib/nameserver): added, with tests
- feat(routes/nameserver): added, with tests

### [3.0.0-alpha.3]
### 3.0.0-alpha.3

- routes/permission: added GET, POST, DELETE
- permission.get: default search with deleted=0
Expand All @@ -92,18 +100,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
- lib/group.get: convert booleans
- lib/user.get: convert booleans

[3.0.2]: https://github.com/NicTool/api/releases/tag/v3.0.2
[3.0.3]: https://github.com/NicTool/api/releases/tag/v3.0.3
[3.0.0-alpha.0]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.0
[3.0.0-alpha.1]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.1
[3.0.0-alpha.2]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.2
[3.0.0-alpha.3]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.3
[3.0.0-alpha.4]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.4
[3.0.0-alpha.5]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.5
[3.0.0-alpha.6]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.6
[3.0.0-alpha.7]: https://github.com/NicTool/api/releases/tag/v3.0.0-alpha.7
[3.0.0-alpha.8]: https://github.com/NicTool/api/releases/tag/v3.0.0-alpha.8
[3.0.0-alpha.9]: https://github.com/NicTool/api/releases/tag/v3.0.0-alpha.9
[3.0.0-alpha.9]: https://github.com/NicTool/api/releases/tag/3.0.0-alpha.9
[3.0.0]: https://github.com/NicTool/api/releases/tag/v3.0.0
[3.0.0-alpha.10]: https://github.com/NicTool/api/releases/tag/v3.0.0-alpha.10
[3.0.0-alpha.11]: https://github.com/NicTool/api/releases/tag/v3.0.0-alpha.11
[3.0.0-alpha.12]: https://github.com/NicTool/api/releases/tag/v3.0.0-alpha.12
[3.0.0-alpha.13]: https://github.com/NicTool/api/releases/tag/v3.0.0-alpha.13
[3.0.0]: https://github.com/NicTool/api/releases/tag/v3.0.0
[3.0.0-alpha.7]: https://github.com/NicTool/api/releases/tag/v3.0.0-alpha.7
[3.0.0-alpha.8]: https://github.com/NicTool/api/releases/tag/v3.0.0-alpha.8
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This handcrafted artisanal software is brought to you by:

| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/NicTool/api/commits?author=msimerson">30</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/586805?v=4"><br><a href="https://github.com/aberoham">aberoham</a> (<a href="https://github.com/NicTool/api/commits?author=aberoham">1</a>) |
| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/NicTool/api/commits?author=msimerson">32</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/586805?v=4"><br><a href="https://github.com/aberoham">aberoham</a> (<a href="https://github.com/NicTool/api/commits?author=aberoham">1</a>) |
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |

<sub>this file is generated by [.release](https://github.com/msimerson/.release).
Expand Down
45 changes: 21 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ A RESTful JSON web service that exposes DNS management functions to users.
1. Install [Node.js](https://nodejs.org/en/download/)
2. Download the NicTool v3 API


```
mkdir nictool && cd nictool
git clone https://github.com/NicTool/api.git
Expand All @@ -36,7 +35,6 @@ or

will start up the HTTP service on the port specified in `conf.d/http.yml`. The default URL for the service is [http://localhost:3000](http://localhost:3000) and the API methods have documentation at [http://localhost:3000/documentation#/](http://localhost:3000/documentation#/).


## Using the API service

Until the NicTool 3.0 HTTP client is written, using a web browser (in Developer mode) or a CLI HTTP utility like curl can be used. Here's a quick tutorial:
Expand All @@ -46,7 +44,7 @@ Until the NicTool 3.0 HTTP client is written, using a web browser (in Developer
`curl -X POST http://localhost:3000/session`

```json
{"statusCode":400,"error":"Bad Request","message":"Invalid request payload input"}
{ "statusCode": 400, "error": "Bad Request", "message": "Invalid request payload input" }
```

The request was rejected because it's missing the required parameters, as shown in the documentation. Create a file called nt-auth.json and store the credentials of a NicTool user therein. Then try the auth request again:
Expand All @@ -63,26 +61,26 @@ That's not the easiest to read so lets pipe it through `json_pp`:

```json
{
"group" : {
"id" : 4096,
"name" : "example.com"
},
"meta" : {
"api" : {
"version" : "3.0.0"
},
"msg" : "you are logged in"
},
"session" : {
"id" : 162
},
"user" : {
"email" : "unit-test@example.com",
"first_name" : "Unit",
"id" : 4096,
"last_name" : "Test",
"username" : "unit-test"
}
"group": {
"id": 4096,
"name": "example.com"
},
"meta": {
"api": {
"version": "3.0.0"
},
"msg": "you are logged in"
},
"session": {
"id": 162
},
"user": {
"email": "unit-test@example.com",
"first_name": "Unit",
"id": 4096,
"last_name": "Test",
"username": "unit-test"
}
}
```

Expand Down Expand Up @@ -143,4 +141,3 @@ curl -b nt-session -X GET http://localhost:3000/user/4096 --header "Content-Type
}
}
```

20 changes: 13 additions & 7 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ services:
- ../sql:/sql:ro
- ../sql/init-mysql.sh:/docker-entrypoint-initdb.d/init-mysql.sh:ro
ports:
- "${DB_PORT:-3307}:3306"
- '${DB_PORT:-3307}:3306'
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
test: ['CMD', 'healthcheck.sh', '--connect', '--innodb_initialized']
interval: 5s
timeout: 5s
retries: 10
Expand All @@ -25,7 +25,7 @@ services:
context: ..
dockerfile: docker/Dockerfile
ports:
- "${API_PORT:-3000}:3000"
- '${API_PORT:-3000}:3000'
depends_on:
db:
condition: service_healthy
Expand All @@ -35,9 +35,15 @@ services:
NICTOOL_DB_USER: ${NICTOOL_DB_USER:-nictool}
NICTOOL_DB_USER_PASSWORD: ${NICTOOL_DB_USER_PASSWORD}
NICTOOL_DB_NAME: ${NICTOOL_DB_NAME:-nictool}
NICTOOL_HTTP_HOST: "0.0.0.0"
NICTOOL_HTTP_HOST: '0.0.0.0'
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:3000/documentation').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"]
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/documentation').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))",
]
interval: 10s
timeout: 5s
retries: 10
Expand All @@ -50,7 +56,7 @@ services:
dockerfile: docker/Dockerfile
hostname: localhost
ports:
- "${SERVER_PORT:-8080}:${SERVER_CONTAINER_PORT:-8080}"
- '${SERVER_PORT:-8080}:${SERVER_CONTAINER_PORT:-8080}'
depends_on:
api:
condition: service_healthy
Expand All @@ -66,7 +72,7 @@ services:
NICTOOL_DB_NAME: ${NICTOOL_DB_NAME:-nictool}
NICTOOL_API_HOST: api
NICTOOL_API_PORT: 3000
NICTOOL_BIND_HOST: "0.0.0.0"
NICTOOL_BIND_HOST: '0.0.0.0'

volumes:
db-data:
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default [
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.node
...globals.node,
},
},
rules: {
Expand Down
Loading
Loading