pubface 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ name: 'pubface CodeQL config'
2
+
3
+ # Exclude code that is not part of the production runtime from analysis.
4
+ # The test suite intentionally feeds malformed input and disables TLS
5
+ # verification in fixtures, which generates only false-positive noise, and
6
+ # ee-dist holds the prebuilt binaries, not source we maintain.
7
+ paths-ignore:
8
+ - test
9
+ - '**/test/**'
10
+ - ee-dist
@@ -0,0 +1,50 @@
1
+ # CodeQL static analysis for code quality and security.
2
+ # See https://docs.github.com/en/code-security/code-scanning
3
+ name: 'CodeQL Advanced'
4
+
5
+ on:
6
+ push:
7
+ branches: ['master']
8
+ pull_request:
9
+ branches: ['master']
10
+ schedule:
11
+ - cron: '40 17 * * 6'
12
+
13
+ jobs:
14
+ analyze:
15
+ name: Analyze (${{ matrix.language }})
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ # required for all workflows
19
+ security-events: write
20
+
21
+ # required to fetch internal or private CodeQL packs
22
+ packages: read
23
+
24
+ # only required for workflows in private repositories
25
+ actions: read
26
+ contents: read
27
+
28
+ strategy:
29
+ fail-fast: false
30
+ matrix:
31
+ include:
32
+ - language: actions
33
+ build-mode: none
34
+ - language: javascript-typescript
35
+ build-mode: none
36
+ steps:
37
+ - name: Checkout repository
38
+ uses: actions/checkout@v6
39
+
40
+ - name: Initialize CodeQL
41
+ uses: github/codeql-action/init@v4
42
+ with:
43
+ languages: ${{ matrix.language }}
44
+ build-mode: ${{ matrix.build-mode }}
45
+ config-file: ./.github/codeql/codeql-config.yml
46
+
47
+ - name: Perform CodeQL Analysis
48
+ uses: github/codeql-action/analyze@v4
49
+ with:
50
+ category: '/language:${{matrix.language}}'
@@ -27,8 +27,8 @@ jobs:
27
27
  contents: read
28
28
  id-token: write
29
29
  steps:
30
- - uses: actions/checkout@v4
31
- - uses: actions/setup-node@v4
30
+ - uses: actions/checkout@v6
31
+ - uses: actions/setup-node@v6
32
32
  with:
33
33
  node-version: 24
34
34
  registry-url: 'https://registry.npmjs.org'
@@ -3,11 +3,16 @@ on:
3
3
  schedule:
4
4
  - cron: '30 1 * * *'
5
5
 
6
+ permissions:
7
+ contents: read
8
+ issues: write
9
+ pull-requests: write
10
+
6
11
  jobs:
7
12
  stale:
8
13
  runs-on: ubuntu-latest
9
14
  steps:
10
- - uses: actions/stale@v8
15
+ - uses: actions/stale@v9
11
16
  with:
12
17
  stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
13
18
  stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
@@ -7,16 +7,27 @@ on:
7
7
  - master
8
8
 
9
9
  name: test
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ concurrency:
15
+ group: ${{ github.workflow }}-${{ github.ref }}
16
+ cancel-in-progress: true
17
+
10
18
  jobs:
11
19
  test:
12
20
  runs-on: ubuntu-latest
21
+ timeout-minutes: 10
13
22
  strategy:
14
23
  matrix:
15
24
  node-version: [22, 24]
16
25
  steps:
17
- - uses: actions/checkout@v4
18
- - uses: actions/setup-node@v4
26
+ - uses: actions/checkout@v6
27
+ - uses: actions/setup-node@v6
19
28
  with:
20
29
  node-version: ${{ matrix.node-version }}
30
+ cache: npm
21
31
  - run: npm ci
32
+ - run: npm run lint
22
33
  - run: npm test
package/.ncurc.js ADDED
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ upgrade: true,
3
+ // pubface is bundled into standalone binaries with @yao-pkg/pkg, which only
4
+ // supports CommonJS. Any dependency that ships as pure ESM (no CommonJS
5
+ // entry point) breaks the pkg build, so such upgrades must be rejected here
6
+ // and the dependency kept on its last CommonJS-compatible release.
7
+ reject: [
8
+ // Add pure-ESM upgrades here as they appear, e.g.:
9
+ // 'some-package'
10
+ ]
11
+ };
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "1.1.2"
2
+ ".": "1.1.4"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.4](https://github.com/postalsys/pubface/compare/v1.1.3...v1.1.4) (2026-06-19)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * bump nodemailer to 9.0.1 ([ec61b8f](https://github.com/postalsys/pubface/commit/ec61b8f4fca81c8776c4dd9e8e15de7e64ffabe3))
9
+
10
+ ## [1.1.3](https://github.com/postalsys/pubface/compare/v1.1.2...v1.1.3) (2026-06-15)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * update dependencies ([6950a03](https://github.com/postalsys/pubface/commit/6950a03f4e4c3995367ed409fdafb5d4a2aa1753))
16
+
3
17
  ## [1.1.2](https://github.com/postalsys/pubface/compare/v1.1.1...v1.1.2) (2026-05-29)
4
18
 
5
19
 
package/CLAUDE.md ADDED
@@ -0,0 +1,138 @@
1
+ # Claude Development Guidelines
2
+
3
+ ## Project Overview
4
+
5
+ pubface resolves the public-facing network interfaces of the current machine.
6
+ For each non-internal local interface it makes an outbound HTTPS request (bound
7
+ to that local address) to a resolver service - by default
8
+ `https://api.nodemailer.com/` - to learn the public IP address the outside world
9
+ sees, then performs a reverse-DNS (PTR) lookup on that IP. It returns an array of
10
+ `{ localAddress, ip, name, family, defaultInterface }` entries.
11
+
12
+ It ships in two forms:
13
+
14
+ - A CommonJS module exposing `resolvePublicInterfaces()`.
15
+ - A `pubface` CLI that prints the resolved interfaces as JSON, also distributed
16
+ as prebuilt standalone binaries.
17
+
18
+ pubface is a dependency of EmailEngine (`../emailengine`).
19
+
20
+ ## Project Structure
21
+
22
+ - `index.js` - Main module. Public interface detection, DNS/PTR resolution, the
23
+ outbound HTTPS resolver request, and result sorting. Exports
24
+ `resolvePublicInterfaces` plus an `_internal` object used only by the tests.
25
+ - `bin/pubface.js` - CLI entry point (calls `resolvePublicInterfaces` and prints
26
+ JSON).
27
+ - `test/index.test.js` - Test suite (Node.js native test runner).
28
+ - `eslint.config.mjs` - Flat ESLint config.
29
+ - `package.json` - Also holds the `pkg` build configuration (binary targets).
30
+
31
+ ## Technology Stack
32
+
33
+ - **Runtime**: Node.js (CommonJS, no build step for the library itself)
34
+ - **Dependencies**: `ipaddr.js` (IP parsing), `nodemailer` (the `nodemailer/lib/fetch`
35
+ helper is used for the bound outbound HTTPS request)
36
+ - **License**: MIT No Attribution (MIT-0)
37
+
38
+ ## Development Commands
39
+
40
+ ```
41
+ npm test # Run the test suite (node --test 'test/**/*.test.js')
42
+ npm run lint # Lint with ESLint
43
+ npm run format # Format code with Prettier
44
+ npm run update # Refresh dependencies (see Dependency Management)
45
+ npm run licenses # Regenerate licenses.txt from production dependencies
46
+ npm run build-source # Reinstall production-only deps for a binary build
47
+ npm run build-dist # Build standalone binaries with @yao-pkg/pkg (Brotli compressed)
48
+ npm run build-dist-fast # Build binaries without compression (faster, for debugging)
49
+ ```
50
+
51
+ ## Testing
52
+
53
+ - Uses the Node.js native test runner (`node:test`) with `node:assert/strict`.
54
+ - Tests live in `test/` and are matched by the `test/**/*.test.js` glob.
55
+ - Tests are hermetic: network, DNS, and `os.networkInterfaces()` are mocked via
56
+ `node:test` mocks, so no live network access is required. Keep them that way -
57
+ new tests must not depend on real DNS or the live resolver service.
58
+ - Helper functions are exported through `module.exports._internal` purely so the
59
+ tests can exercise them; this object is not part of the public API.
60
+
61
+ ## Packaging (@yao-pkg/pkg)
62
+
63
+ We package pubface into standalone executables with
64
+ [`@yao-pkg/pkg`](https://github.com/yao-pkg/pkg) (the maintained fork of the now
65
+ unmaintained `vercel/pkg`). The build configuration and target list live under
66
+ the `pkg` key in `package.json`; binaries target Node 24 for Linux x64, macOS
67
+ x64, macOS arm64, and Windows x64 and are written to `ee-dist/`.
68
+
69
+ **`@yao-pkg/pkg` only supports CommonJS.** Every runtime dependency - and the
70
+ project's own code - must be requireable as CommonJS. Do not add pure-ESM
71
+ dependencies (packages that ship only an ESM entry point with no CommonJS
72
+ fallback); they break the binary build even when they work fine under plain
73
+ `node`. When evaluating or upgrading a dependency, confirm it still exposes a
74
+ CommonJS entry point.
75
+
76
+ ## Dependency Management
77
+
78
+ - `npm run update` removes `node_modules` and `package-lock.json`, runs
79
+ `ncu -u` (npm-check-updates) to bump every dependency to its latest allowed
80
+ version, then reinstalls.
81
+ - `.ncurc.js` controls which upgrades `ncu` is allowed to take. Add any package
82
+ whose newer releases are pure ESM (or otherwise break the `@yao-pkg/pkg` build
83
+ or our supported Node range) to its `reject` list, with a comment explaining
84
+ why, so it stays pinned to its last compatible release.
85
+ - After updating dependencies, run `npm run lint` and `npm test`, and remember
86
+ that production dependency changes are user-facing - commit them with a `fix:`
87
+ prefix so a release is cut (see Commit Conventions).
88
+
89
+ ## Releases
90
+
91
+ - Releases are managed by `release-please` (config in `release-please-config.json`
92
+ and `.release-please-manifest.json`), driven by Conventional Commit messages on
93
+ `master`.
94
+ - On a release, the `release` workflow publishes to npm with provenance
95
+ (`npm publish --provenance --access public`).
96
+ - Prebuilt CLI binaries are built locally with `npm run build-dist` and attached
97
+ to the GitHub release.
98
+
99
+ ## Code Style Rules
100
+
101
+ - Never use emojis in code or documentation, only printable ASCII characters.
102
+ - Use a single hyphen-minus (`-`) as a dash in UI copy and user-facing strings.
103
+ Never use double hyphens (`--`), em dashes, or en dashes.
104
+ - The codebase is CommonJS (`require`/`module.exports`, `'use strict'`). Keep new
105
+ code CommonJS; do not introduce ESM syntax in files that are bundled by
106
+ `@yao-pkg/pkg`.
107
+
108
+ ## Commit Conventions
109
+
110
+ - Use [Conventional Commits](https://www.conventionalcommits.org/) - `feat:`,
111
+ `fix:`, `chore:`, `docs:`, etc. `release-please` relies on these prefixes to
112
+ decide version bumps and changelog entries.
113
+ - When composing git commit messages, do not include Claude as a co-contributor.
114
+ - For commits that do not change runtime behavior (docs, comments, CI/workflow
115
+ tweaks, formatting), append `[skip ci]` to the commit message to avoid
116
+ triggering the GitHub Actions workflows. Exception: do not add `[skip ci]` to
117
+ commits using a `fix:` or `feat:` prefix - those must run so the release action
118
+ is triggered.
119
+
120
+ ## After Making Code Changes
121
+
122
+ 1. Run `npm run format` and `npm run lint`.
123
+ 2. Run `npm test` and make sure the suite passes.
124
+ 3. Consider `/simplify` to review changed code and `/security-review` to check
125
+ for security issues before committing.
126
+ 4. After pushing, check the GitHub Actions runs for the push (for example
127
+ `gh run list --branch <branch>`) and report their status, including CodeQL. If
128
+ a run fails for a strange or unrelated reason (for example a checkout step
129
+ reporting "account suspended", HTTP 403, or other auth/infrastructure errors
130
+ that have nothing to do with the change), check <https://www.githubstatus.com/>
131
+ for an active GitHub incident before assuming the failure is caused by the
132
+ change.
133
+
134
+ ## Related Projects
135
+
136
+ - **EmailEngine** (`../emailengine`): The primary consumer of pubface and the
137
+ source of these maintenance conventions. Keep the package-management and
138
+ release rules here aligned with EmailEngine's.
package/SECURITY.md ADDED
@@ -0,0 +1,76 @@
1
+ # Security Policy
2
+
3
+ pubface is a small library and CLI that resolves the public-facing network
4
+ interfaces of the current machine. For each local interface it makes an outbound
5
+ HTTPS request to a resolver service to learn the public IP address the outside
6
+ world sees, then performs a reverse-DNS (PTR) lookup. It does not store
7
+ credentials or accept inbound connections, but because it is embedded in other
8
+ applications (for example EmailEngine) we take security reports seriously and
9
+ aim to respond quickly.
10
+
11
+ ## Supported Versions
12
+
13
+ Security fixes are released only against the latest version. We do not backport
14
+ patches to older releases - upgrading to the current release line is the
15
+ supported way to receive security updates.
16
+
17
+ | Version | Supported |
18
+ | ------- | ------------------ |
19
+ | 1.x | :white_check_mark: |
20
+ | < 1.0 | :x: |
21
+
22
+ If you are on an older version, please upgrade. See the release notes at
23
+ <https://github.com/postalsys/pubface/releases> before updating.
24
+
25
+ ## Reporting a Vulnerability
26
+
27
+ **Please do not report security vulnerabilities through public GitHub issues,
28
+ pull requests, or discussions.**
29
+
30
+ Report privately through one of the following channels:
31
+
32
+ 1. **GitHub Security Advisories (preferred).** Open a private report at
33
+ <https://github.com/postalsys/pubface/security/advisories/new>. This keeps the
34
+ discussion private until a fix is published and lets us credit you.
35
+ 2. **Email.** Send details to **andris@postalsys.com** (the contact listed in
36
+ [`SECURITY.txt`](SECURITY.txt)). Encrypt sensitive details if possible.
37
+
38
+ When reporting, please include as much of the following as you can:
39
+
40
+ - The affected version(s) and environment (pubface version, Node.js version, OS,
41
+ whether used as a library, the `pubface` CLI, or a prebuilt binary).
42
+ - A clear description of the issue and its impact (e.g. SSRF, injection,
43
+ information disclosure, denial of service, remote code execution).
44
+ - A minimal proof of concept or reproduction steps.
45
+ - Any suggested remediation, if you have one.
46
+
47
+ We are a small team, so there is no guaranteed response time - sometimes reports
48
+ are handled within hours, sometimes they take longer. Accepted issues are fixed
49
+ in a new release and coordinated through a GitHub Security Advisory, and
50
+ reporters who wish to be named are credited.
51
+
52
+ ## CVEs
53
+
54
+ We track and disclose vulnerabilities through GitHub Security Advisories. We do
55
+ not request or manage CVE identifiers ourselves. If you need a CVE assigned for a
56
+ reported issue, please request one yourself - for example, through GitHub's own
57
+ CVE request flow on the published advisory, or another CNA.
58
+
59
+ ## Scope
60
+
61
+ In scope: the pubface source in this repository - the public-interface
62
+ resolution logic, the DNS/PTR handling, the outbound HTTPS request handling, and
63
+ the `pubface` CLI.
64
+
65
+ Out of scope:
66
+
67
+ - Vulnerabilities in your own application code that integrates with pubface.
68
+ - The remote resolver service that pubface queries (by default
69
+ `https://api.nodemailer.com/`) and any DNS infrastructure it relies on.
70
+ - Misconfiguration of your environment - for example, pointing `RESOLV_URL` at an
71
+ untrusted resolver endpoint.
72
+ - Issues that require an already-compromised host.
73
+ - Vulnerabilities in third-party dependencies that are already publicly known and
74
+ have no pubface-specific impact (report those upstream).
75
+
76
+ Thank you for helping keep pubface and its users safe.
package/SECURITY.txt ADDED
@@ -0,0 +1,27 @@
1
+ -----BEGIN PGP SIGNED MESSAGE-----
2
+ Hash: SHA256
3
+
4
+ Contact: https://github.com/postalsys/pubface/security/advisories/new
5
+ Contact: mailto:andris@postalsys.com
6
+ Expires: 2027-06-01T00:00:00.000Z
7
+ Encryption: https://keys.openpgp.org/vks/v1/by-fingerprint/5D952A46E1D8C931F6364E01DC6C83F4D584D364
8
+ Preferred-Languages: en, et
9
+ Canonical: https://github.com/postalsys/pubface/blob/master/SECURITY.txt
10
+ Policy: https://github.com/postalsys/pubface/blob/master/SECURITY.md
11
+ -----BEGIN PGP SIGNATURE-----
12
+
13
+ iQJPBAEBCAA5FiEEXZUqRuHYyTH2Nk4B3GyD9NWE02QFAmowLdMbFIAAAAAABAAO
14
+ bWFudTIsMi41KzEuMTIsMCwzAAoJENxsg/TVhNNk9VkP+gLaYxcYWcUOfpLKq7+F
15
+ PvJ5ImuwDYCXTv0ufp+bOZWO+dJHBa77z6rGqGzY47PFzhbDi+CspwiEAe/Njiu2
16
+ UVctz864tu+kjG3ddRHj0CRNAuHds1qIz+wqeECJwiHcRCQ2BD5ZZjo5POYfwumJ
17
+ tkiSE6YnECw0T8HYlYUPQpuO+OU1fLbTEZvhnkD7ekyEzjOxHdwJp2s6X4SB97IQ
18
+ 0w0P0gmySiY4oOq1a7Y1H7Gnqzn14slqprAf2o6nHnprdpa+XXx5ypPVRf35UyNU
19
+ 1iEjkFebk/IojGuy07rQ6Q6KnxtCQVgeKFKmF0/cw837cWO/gcoeJFg8RTu0+ap2
20
+ 0JI2+3f58/fC4f1XHNjDKz+A1vvkP12TehDj4N65t0FXgfe2qfp4L1BfI9KSYnz0
21
+ Zclg2uk3qkStWx4s1sLo0/OHZdozSGgrUWAmN0FS5C8bDUhumzAkdLHe4QC/55Pm
22
+ 5sGQAIvKzlMxFQlM4ctbAc1SzqTSy4X1sFSmFXO9DrnnB0thicII5Qv/IxikvNh7
23
+ CQi7ZfKyLq4r/xkit8Ma3kl+ooL3WudFd6VbiqLYlbd0g0XltONt80S7FddwHtsz
24
+ E+Y6RFT2ikGhqjP14mTqKcefp6VHUgEcM+RP1BSbjri3OEt0n78Dkhyn0n9genHC
25
+ Rwrr997ja0xt/OdvTK4fGWS1
26
+ =FLnW
27
+ -----END PGP SIGNATURE-----
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pubface",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Resolve public network interfaces for current machine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,14 +29,14 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "ipaddr.js": "2.4.0",
32
- "nodemailer": "8.0.10"
32
+ "nodemailer": "9.0.1"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@eslint/js": "^10.0.1",
36
- "eslint": "^10.4.0",
36
+ "@yao-pkg/pkg": "6.20.0",
37
+ "eslint": "^10.5.0",
37
38
  "license-report": "6.8.5",
38
- "pkg": "5.8.1",
39
- "prettier": "^3.8.3"
39
+ "prettier": "^3.8.4"
40
40
  },
41
41
  "pkg": {
42
42
  "assets": [
@@ -44,10 +44,10 @@
44
44
  "licenses.txt"
45
45
  ],
46
46
  "targets": [
47
- "node18-linux-x64",
48
- "node18-macos-x64",
49
- "node18-macos-arm64",
50
- "node18-win-x64"
47
+ "node24-linux-x64",
48
+ "node24-macos-x64",
49
+ "node24-macos-arm64",
50
+ "node24-win-x64"
51
51
  ],
52
52
  "outputPath": "ee-dist"
53
53
  }