ottomated / CrewLink-server

Voice Relay server for CrewLink.
GNU General Public License v3.0
694 stars 444 forks source link

No means to set SSL port #99

Open dopeghoti opened 3 years ago

dopeghoti commented 3 years ago

I want to enable SSL but when using SSL mode, CrewLink defaults to attempting to bind to TCP port 443, which only the root user can do. Please provide a means to select the TCP port to bind to.

dopeghoti commented 3 years ago

Needless to say, I am not going to run this as the root user.

jordy-u commented 3 years ago

If you use docker, you can map the port with: docker run --env-file ./parameters.conf -d -p 1000:443 <container id> to use port 1000 instead of port 443.

If you don't use docker, but installed it via git.

  1. Go to src/index.ts
  2. Edit the port number on line #13. const port = parseInt(process.env.PORT || (httpsEnabled ? '443' : '9736'));
C0rn3j commented 3 years ago

If you read that line carefully you can see that you can set it via PORT env variable, so this is already supported, just not documented.

[0] # HTTPS="yes" PORT="1234" ADDRESS="sc2.rys.pw" yarn start
yarn run v1.22.10
$ yarn compile && node dist/index.js
$ tsc
2020-12-22T13:09:18+0100 <info> CrewLink Server started: sc2.rys.pw
[0] # ss -tulpn | grep 1234 
tcp   LISTEN 0      511                                  *:1234             *:*    users:(("node",pid=856,fd=20))    
jordy-u commented 3 years ago

Oh, you're right, @C0rn3j. I've read over it. Thanks.