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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,4 @@ conf.d
# Playwright
test-results/
playwright-report/
.release/
2 changes: 1 addition & 1 deletion .release
Submodule .release updated from a6911a to 290b44
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

### Unreleased

### [0.2.2] - 2026-07-25

- test and start fixes

### [0.2.0] - 2026-07-24

- move group list to left nav
Expand All @@ -18,6 +22,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
- wiring up forms to object models
- improve configurator


[0.2.0]: https://github.com/NicTool/server/releases/tag/v0.2.0
[0.0.2]: https://github.com/NicTool/server/releases/tag/v0.0.2
[0.2.2]: https://github.com/NicTool/server/releases/tag/v0.2.2
4 changes: 2 additions & 2 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

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/server/commits?author=msimerson">6</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/server/commits?author=msimerson">14</a>) |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |

<sub>this file is generated by [.release](https://github.com/msimerson/.release).
Contribute to this project to get your GitHub profile included here.</sub>
Empty file modified bin/start.js
100644 → 100755
Empty file.
31 changes: 31 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import globals from 'globals'
import js from '@eslint/js'

export default [
{
ignores: ['**/package-lock.json', 'node_modules/**', '.release/**', 'html/dist/**'],
},
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.node,
},
},
rules: {
'no-unused-vars': 'warn',
},
},
{
files: ['web/src/**/*.js'],
languageOptions: {
globals: {
...globals.browser,
// loaded as a script tag from the CDN bundle in html/index.html
bootstrap: 'readonly',
},
},
},
]
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
import https from 'node:https'
import path from 'node:path'
import fs from 'node:fs/promises'
import { fileURLToPath } from 'node:url'

import { stringify } from 'smol-toml'
import mysql from 'mysql2/promise'

const __dirname = new URL('.', import.meta.url).pathname
// .pathname is drive-relative on Windows ("/D:/a/server")
const __dirname = fileURLToPath(new URL('.', import.meta.url))

const MIME = {
'.html': 'text/html; charset=utf-8',
Expand Down Expand Up @@ -363,7 +365,7 @@
}

// Strip runtime-only flags from the toml payload
const { startApi: _startApi, _hostname: _h, _suggested: _s, ...config } = body

Check warning on line 368 in index.js

View workflow job for this annotation

GitHub Actions / lint / lint

'_s' is assigned a value but never used

Check warning on line 368 in index.js

View workflow job for this annotation

GitHub Actions / lint / lint

'_h' is assigned a value but never used

Check warning on line 368 in index.js

View workflow job for this annotation

GitHub Actions / lint / lint

'_startApi' is assigned a value but never used

if (!config.store?.type) {
return respond(
Expand Down
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nictool/server",
"version": "0.2.0",
"version": "0.2.2",
"description": "NicTool server, the DNS managers server component",
"main": "index.js",
"type": "module",
Expand All @@ -13,7 +13,7 @@
"clean": "rm -rf coverage node_modules package-lock.json html/dist",
"format:check": "npm run prettier; npm run lint",
"format": "npm run prettier -- --write && npm run lint:fix",
"lint": "npx eslint **/*.js",
"lint": "npx eslint .",
"lint:fix": "npm run lint -- --fix",
"prettier": "npx prettier --ignore-path .gitignore --check .",
"prettier:fix": "npx prettier --ignore-path .gitignore --write .",
Expand Down Expand Up @@ -47,21 +47,24 @@
},
"homepage": "https://github.com/NicTool/server#readme",
"dependencies": {
"@nictool/api": "3.0.0-alpha.12",
"@nictool/dns-nameserver": "file:../dns-nameserver",
"@nictool/dns-resource-record": "file:../dns-resource-record",
"@nictool/dns-zone": "file:../dns-zone",
"@nictool/api": "^3.0.2",
"@nictool/dns-nameserver": "^0.8.0",
"@nictool/dns-resource-record": "^1.8.1",
"@nictool/dns-zone": "^1.2.3",
"joi": "^18.2.3",
"mysql2": "^3.23.1",
"smol-toml": "^1.7.0"
"smol-toml": "^1.7.1"
},
"prettier": {
"printWidth": 90,
"singleQuote": true,
"semi": false
},
"devDependencies": {
"@playwright/test": "^1.61.1",
"@eslint/js": "^10.0.1",
"eslint": "^10.8.0",
"globals": "^17.8.0",
"@playwright/test": "^1.62.0",
"jsdom": "^29.1.1",
"lit": "^3.3.3",
"vite": "^8.1.5"
Expand Down
16 changes: 6 additions & 10 deletions test/jwt-proxy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import os from 'node:os'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

const apiDir = fileURLToPath(new URL('../node_modules/@nictool/api/', import.meta.url))
const apiDir = fileURLToPath(
new URL('./', import.meta.resolve('@nictool/api/package.json')),
)
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'nt-jwt-'))
const store = path.join(tmp, 'store')
fs.mkdirSync(store)
Expand Down Expand Up @@ -63,12 +65,8 @@ before(async () => {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
process.chdir(apiDir) // the API loads config from ./conf.d relative to cwd

const { default: Group } = await import(
new URL('../node_modules/@nictool/api/lib/group/index.js', import.meta.url)
)
const { default: User } = await import(
new URL('../node_modules/@nictool/api/lib/user/index.js', import.meta.url)
)
const { default: Group } = await import('@nictool/api/lib/group/index.js')
const { default: User } = await import('@nictool/api/lib/user/index.js')
const groupCase = JSON.parse(
fs.readFileSync(path.join(apiDir, 'routes/test/group.json')),
)
Expand All @@ -81,9 +79,7 @@ before(async () => {
password: userCase.password,
}

const { init: initAPI } = await import(
new URL('../node_modules/@nictool/api/routes/index.js', import.meta.url)
)
const { init: initAPI } = await import('@nictool/api/routes/index.js')
const apiServer = await initAPI()

const { startServer } = await import(new URL('../index.js', import.meta.url))
Expand Down
4 changes: 2 additions & 2 deletions web/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
escapeHtml,
fieldToId,
formatZoneRecordTtl,
getRdataPreview,

Check warning on line 8 in web/src/app.js

View workflow job for this annotation

GitHub Actions / lint / lint

'getRdataPreview' is defined but never used
parseInputValue,
parseOptionalTtlValue,
} from './lib/format.js'
Expand Down Expand Up @@ -39,7 +39,7 @@
}

let currentGroupId = null
let rootGroupId = null

Check warning on line 42 in web/src/app.js

View workflow job for this annotation

GitHub Actions / lint / lint

'rootGroupId' is assigned a value but never used
let zoneDefaults = {
ttl: 86400,
refresh: 16384,
Expand Down Expand Up @@ -127,7 +127,7 @@
modal.show()
}

async function copyTextToClipboard(value) {

Check warning on line 130 in web/src/app.js

View workflow job for this annotation

GitHub Actions / lint / lint

'copyTextToClipboard' is defined but never used
const text = `${value ?? ''}`

try {
Expand Down Expand Up @@ -214,7 +214,7 @@
})
}

function switchGroup(gid, name) {

Check warning on line 217 in web/src/app.js

View workflow job for this annotation

GitHub Actions / lint / lint

'name' is defined but never used
currentGroupId = gid
const groupNav = document.getElementById('groupNav')
if (groupNav) groupNav.currentGid = gid
Expand Down Expand Up @@ -937,8 +937,8 @@
input += `<option value="${escapeHtml(`${o[0]}`)}" ${value === o[0] ? 'selected' : ''}>${escapeHtml(`${o[0]}`)}${o[1] ? ` - ${escapeHtml(`${o[1]}`)}` : ''}</option>`
}
input += `</select>`
} else if (rr.get('type') === 'NAPTR' && field === 'flags') {
} else {
// NAPTR flags are characters, not numeric (RFC 3403)
} else if (!(rr.get('type') === 'NAPTR' && field === 'flags')) {
switch (field) {
case 'cert type':
case 'hash algorithm':
Expand Down Expand Up @@ -1107,7 +1107,7 @@
e.preventDefault()
attemptLogin()
})
document.getElementById('logout_button').addEventListener('click', (event) => {

Check warning on line 1110 in web/src/app.js

View workflow job for this annotation

GitHub Actions / lint / lint

'event' is defined but never used
attemptLogout()
})
document.getElementById('profileMenuItem').addEventListener('click', (event) => {
Expand Down
Loading