perki / backloop.dev

Loopback domain and SSL certs to serve https:// content form localhost
Other
8 stars 0 forks source link

Hardcoded path in the code makes 'backloop.dev' crash #4

Closed bfontaine closed 2 hours ago

bfontaine commented 3 hours ago

Hello, and thank you for this very useful tool.

I’m using the NPM package and running a simple backloop.dev ., but as soon as I request https://whatever.backloop.dev:4443/, the server crashes because it tries to mkdir a hardcoded path:

backloop.dev certificate OK, expires in 84 days
Server started on port 4443 serving files in '/home/baptiste/somedir'
You can open https://whatever.backloop.dev:4443/
/
node:fs:1372
  const result = binding.mkdir(
                         ^

Error: EACCES: permission denied, mkdir '/Users/perki/code/web-sherpy.ch'
    at Object.mkdirSync (node:fs:1372:26)
    at saveTofile (/home/baptiste/somedir/node_modules/backloop.dev/src/webserver/main.js:72:23)
    at fetchAndSave (/home/baptiste/somedir/node_modules/backloop.dev/src/webserver/main.js:82:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /home/baptiste/somedir/node_modules/backloop.dev/src/webserver/main.js:45:3 {
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/Users/perki/code/web-sherpy.ch'
}

Node.js v20.16.0

Looking at the code, there’s another hardcoded string here.

bfontaine commented 3 hours ago

It seems that this code shouldn’t be there; if I remove it everything works fine.

perki commented 2 hours ago

@bfontaine Thanks a lot for reporting this issue.. it was trailing code I should have removed. I just published v2.0.4

bfontaine commented 2 hours ago

Thank you; I confirm it works!