diff --git a/.gitignore b/.gitignore index 0253345..6648e1e 100644 --- a/.gitignore +++ b/.gitignore @@ -115,3 +115,4 @@ conf.d # Playwright test-results/ playwright-report/ +.release/ diff --git a/.release b/.release index a6911a9..290b441 160000 --- a/.release +++ b/.release @@ -1 +1 @@ -Subproject commit a6911a90f1b15486fb319d844341421c78035b2a +Subproject commit 290b441b2052b219585e0690da703c56ee1e698e diff --git a/CHANGELOG.md b/CHANGELOG.md index 5671271..e2ee4a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 6c8aef8..89b3948 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,8 +2,8 @@ This handcrafted artisanal software is brought to you by: -|
msimerson (6) | -| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +|
msimerson (14) | +| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | this file is generated by [.release](https://github.com/msimerson/.release). Contribute to this project to get your GitHub profile included here. diff --git a/bin/start.js b/bin/start.js old mode 100644 new mode 100755 diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..79e4b21 --- /dev/null +++ b/eslint.config.mjs @@ -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', + }, + }, + }, +] diff --git a/index.js b/index.js index c7099fc..ac7f9cc 100644 --- a/index.js +++ b/index.js @@ -2,11 +2,13 @@ import http from 'node:http' 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', diff --git a/package.json b/package.json index 73cc1d0..08ec41a 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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 .", @@ -47,13 +47,13 @@ }, "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, @@ -61,7 +61,10 @@ "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" diff --git a/test/jwt-proxy.test.js b/test/jwt-proxy.test.js index 7bff9d3..08166ba 100644 --- a/test/jwt-proxy.test.js +++ b/test/jwt-proxy.test.js @@ -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) @@ -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')), ) @@ -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)) diff --git a/web/src/app.js b/web/src/app.js index ab81b48..448dd3d 100644 --- a/web/src/app.js +++ b/web/src/app.js @@ -937,8 +937,8 @@ function getRdataInput(field, value = '', rr, placeholder = ' ') { input += `` } input += `` - } 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':