Skip to content

Commit ec2d015

Browse files
committed
fix: security warning on serve command
1 parent 59acce6 commit ec2d015

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "terminfo.dev",
3-
"version": "3.1.0",
3+
"version": "3.1.1",
44
"description": "Test your terminal's feature support and contribute to terminfo.dev",
55
"keywords": [
66
"ansi",

cli/src/serve.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ export async function startDaemon(port = 0): Promise<void> {
187187

188188
const filepath = register(info)
189189

190+
console.log(`\x1b[33m⚠ Security warning: this opens an HTTP server on localhost:${actualPort}`)
191+
console.log(` Any local process can trigger terminal escape sequences via this server.`)
192+
console.log(` Only run this on trusted machines. Stop with Ctrl+C when done.\x1b[0m\n`)
190193
console.log(`\x1b[1mterminfo.dev\x1b[0m daemon running\n`)
191194
console.log(` Terminal: \x1b[1m${terminal.name}\x1b[0m ${terminal.version}`)
192195
console.log(` Port: \x1b[1m${actualPort}\x1b[0m`)
@@ -195,8 +198,6 @@ export async function startDaemon(port = 0): Promise<void> {
195198
console.log(` Test: curl http://localhost:${actualPort}/probe`)
196199
console.log(` Info: curl http://localhost:${actualPort}/info`)
197200
console.log(` Single: curl http://localhost:${actualPort}/probe/single?id=sgr.bold`)
198-
console.log(``)
199-
console.log(`\x1b[2mPress Ctrl+C to stop.\x1b[0m`)
200201

201202
// Clean up on exit
202203
const cleanup = () => {

0 commit comments

Comments
 (0)