CrewLink-server
CrewLink-server copied to clipboard
No means to set SSL port
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.
Needless to say, I am not going to run this as the root
user.
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.
- Go to src/index.ts
- Edit the port number on line #13.
const port = parseInt(process.env.PORT || (httpsEnabled ? '443' : '9736'));
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))
Oh, you're right, @C0rn3j. I've read over it. Thanks.