dathttpd icon indicating copy to clipboard operation
dathttpd copied to clipboard

Directory issue when daemonizing via pw2

Open stephenkistner opened this issue 7 years ago • 3 comments

Was running into some issues getting dathttpd to play nicely with pw2

dathttpd-error-2.log

Trying to run dathttpd via pm2 would continuously return the above error.

Line 73 of /lib/server.js is what the error references: var dat = dats.find(function (d) { return d.key.toString('hex') === site.datKey })

So looks to be an issue with how the directory's path is handled from pm2, which is (probably?) causing line 73 to return undefined.

I was able to resolve it by manually specifying my directory in the config yml as ~/home/stephen/.dathttpd (adding the tilde is what fixed it)

stephenkistner avatar Apr 03 '18 18:04 stephenkistner

Hey @stephenkistner

You mind sharing your config file? That would help me diagnose the issue.

pfrazee avatar Apr 03 '18 18:04 pfrazee

Sure, here it is:

ports:
  http: 5757
directory: ~/home/stephen/.dathttpd
letsencrypt: false
sites:
  dat.with.sk:
    url: dat://997759aded033555f983211b2fa88a5d9f8f4a7aca33cedfba4d006c2ce8972d/
  now.with.sk:
    url: dat://d51f7e84e34ed9203721b85b92ad58a353ee3dd1592e8b68e53c62a7d010e7c1/

stephenkistner avatar Apr 03 '18 18:04 stephenkistner

Hm, ok thanks for sharing. I'll see if I can figure out what's happening

pfrazee avatar Apr 03 '18 18:04 pfrazee