TFNS / CTFNote

CTFNote is a collaborative tool aiming to help CTF teams to organise their work.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sugestion to fix custom port Hedgedoc problems

Anthares101 opened this issue · comments

The problem

In my use case I'm not able to use the port 443 for https so I'm forced to have a url like: <domain>:<port>. In theory this shouldn't be a problem but looks like Hedgedoc doesn't manage well a port in the CMD_DOMAIN variable and ends up generating wrong URLs for some features (In my case the URLs were like: <domain>:<port>:<port>).

This problem could be solved by doing this:

  • Changing the Hedgedoc port to the same custom port used to serve the application with CMD_PORT
  • Use only the domain as the CMD_DOMAIN value (Without the port!)
  • Enable the CMD_URL_ADDPORT option to make Hedgedoc add the port to the URL

The thing is that the Nginx used with the front docker image has the port 3000 for Hedgedoc hard coded, so that changes will produce a failure trying to open a task for example.

Sugestion

A solution for this could be to parameterize the Hedgedoc port used in the Nginx configuration to take the CMD_PORT value. envsubst can be used to generate the Nginx configuration dynamically before nginx starts.