anthonyraymond / joal

An open source command line RatioMaster with an optional WebUI.
Apache License 2.0
613 stars 65 forks source link

Pre-fill connection settings in WebUI #201

Closed seth100 closed 1 year ago

seth100 commented 1 year ago

Hi,

I'm using latest Docker version and, since I remove all browser data every day, it's a bit tiring for me to always set again connection settings in WebUI (by clicking on the "Change connection settings" button). Is there a way to automatically tell WebUI to pre-fill server address, server port, path prefix, secret token fields with values I want?

Thanks

anthonyraymond commented 1 year ago

It's not recommented but you can do it:

you have to provide an url_parameter:

https://myjoal.example.com/ui?ui_credentials=XXXXXX

Where the value XXXXXX is the result of URI encoding a json object. If you want to get one without getting your hand on code here is how you do it:

  1. In the folowing string, replace the yyyyy with your values {"host": "yyyyy", "port": "yyyyy", "pathPrefix": "yyyyy", "secretToken": "yyyyy"}
  2. Paste the string in this url encoder: https://www.urlencoder.org/
  3. Copy the output and you have your value of XXXXXX

assuming all my value were yyyyy, i would have a result of : %7B%22host%22%3A%22yyyyyy%22%2C%22port%22%3A%22yyyyyy%22%2C%22pathPrefix%22%3A%22yyyyyy%22%2C%22secretToken%22%3A%22yyyyyy%22%7D and a full URL as: https://myjoal.example.com/ui?ui_credentials=%7B%22host%22%3A%22yyyyyy%22%2C%22port%22%3A%22yyyyyy%22%2C%22pathPrefix%22%3A%22yyyyyy%22%2C%22secretToken%22%3A%22yyyyyy%22%7D

seth100 commented 1 year ago

@anthonyraymond great, it works now, thanks!