Cronicle icon indicating copy to clipboard operation
Cronicle copied to clipboard

fixing live_log on multiserver (workaround)

Open mikeTWC1984 opened this issue 4 years ago • 0 comments

There are few scenarios when live_log is broken for multi node setup

  • reverse proxy / LB
  • virtual network ( containers)
  • and even if running cronicle using built-in https option

It's doesn't work properly because servers would have different port/hostname/protocol, however those still could be directly accessible from UI (if using proper parameters). This could be fixed by assigning separate live_log url for each server. Turns out it could be achieved by simple custom_live_log_socket_url config tweak, just need to allow it to be object, and look up url by job hostname

Basically need to replace this "if"

https://github.com/jhuckaby/Cronicle/blob/8acbbf50fbe25cdc88494bfdf6a6d10d70c7455a/htdocs/js/pages/JobDetails.class.js#L869

with something like this:

if ( config.custom_live_log_socket_url ) {
    remote_api_url= config.custom_live_log_socket_url[job.hostname]
    if( typeof config.custom_live_log_socket_url === "string" ) remote_api_url = config.custom_live_log_socket_url ;
    
} 

Ideally this should be just a server parameter (editable on UI)

This also requires to fix this: https://github.com/jhuckaby/Cronicle/issues/313

mikeTWC1984 avatar Oct 24 '20 03:10 mikeTWC1984