Upload / Up1

Client-side encrypted image host web server
MIT License
813 stars 97 forks source link

support fully qualified paths for use with scripts like pm2 #66

Open mikedevita opened 7 years ago

mikedevita commented 7 years ago

I use this for an internal imgur type mirror for our enterprise and it works great, however typically we use pm2 to manage the start/stop of nodejs scripts.

something like pm2 start --name img.domain.com /opt/conf/www/img.domain.com/server/server.js is what we try to achieve however i noticed that relative/local paths for the configs are being used, specifically noticed this at server/server.js:220. I changed this to be something like.

main(path.resolve('./','server/', 'server.conf'))

and i use full paths from root for the server.conf for the i and client directories yet i get file not found when i try to refresh a page after uploading an image.

Is there something else im missing to get this to work without cd'ing into server/ and running node server.js &

mikedevita commented 7 years ago

to temporarily work around this i have created a dead simple shell script called server.sh with execute perms in /opt/conf/www/img.domain/com/server.sh

#!/bin/bash
cd /opt/conf/www/img.domain.com/server;
node server.js

i then run it via pm2

pm2 start --name img.domain.com /opt/conf/www/img.domain.com/server.sh