Dasherr icon indicating copy to clipboard operation
Dasherr copied to clipboard

[Feature] Server Side Host Check

Open LeeThompson opened this issue 2 years ago • 9 comments

An option to have host check done on the server side rather than the browser.

This would be useful for:

  • Work around http/https issues
  • Allow remote checking of intranet services
  • Allow checking for services on an isolated subnet

This may also be a fix for #16

LeeThompson avatar Feb 02 '23 18:02 LeeThompson

That actually might be a good idea - I'll definitely try it. Thank you!

erohtar avatar Feb 03 '23 14:02 erohtar

I feel really bad not responding here sooner, but I've been really busy recently, and once when I got to work on this (about a week back) I was getting errors that didn't make sense - turns out it was my local php server at fault that I had up for testing.

Anyway, pls try this when you get a chance. I've made the server check really flexible by making it a per-tile setting (just like disableCheck)

  • serverCheck - (Optional) If set to 1, the online check will run at the server, instead of in browser

The server check would likely only work for urls that are externally accessible (as opposed to Tailscale generated ones, as is the case with most of mine), but I'm open to updating the php function if needed.

dasherr.1.06.00.beta.zip

erohtar avatar Feb 25 '23 15:02 erohtar

Seems to work but seeing some unexpected anomalies with a https & http mix where it's actually inconsistent. I am really not sure what's going on with it and I'm not prepared to think it's an issue with dasherr at this point. Will do more testing.

It would be nice if these serverCheck and disableCheck could be set at section and page levels as well.

Update: For some reason the widgets aren't working anymore if I'm in https, if I'm in http they work.

LeeThompson avatar Feb 26 '23 21:02 LeeThompson

It would be nice if these serverCheck and disableCheck could be set at section and page levels as well.

Right now I feel the server check is only good for exceptional use and someone would enable it in select few tiles. If it was more widely usable then I'd also feel this is called for. Though it's possible that my personal setup is what makes me see it that way (nothing open to outside internet, and every machine on Tailscale).

For some reason the widgets aren't working anymore if I'm in https, if I'm in http they work.

I'm willing to bet that has something to do with mixed content. Maybe if someday I moved the widget processing to php as well, but that day is not today :)

erohtar avatar Feb 27 '23 17:02 erohtar

Fair enough!

I don't use Tailscale myself, most of the stuff isn't internet accessible but a few are.

LeeThompson avatar Feb 28 '23 00:02 LeeThompson

Is Glances internet accessible? For me it isn't and server can't access something via php if I give it a Tailscale address or localhost. Though I'm not ruling out the possibility of me mucking something up because of my inexperience with how server side programming works.

erohtar avatar Mar 01 '23 13:03 erohtar

No, right now everything I'm doing is intranet. Glances is local only. In theory the php test should work in either case since it is on the same local subnet as Glances.

LeeThompson avatar Mar 02 '23 01:03 LeeThompson

Next chance I get, I'll create an extremely simple PHP to test if Glances data can be read at the server and then JS can pull that info periodically through there instead of directly - you think that might help solve any CORS/MixedContent related issues?

erohtar avatar Mar 02 '23 19:03 erohtar

It should since the PHP function will be essentially acting as a proxy and since Dashrr would presumably be running on the same subnet as Glances it should be fine.

I already do monitoring of intranet services this way. (Personally I don't really need Dashrr's checks for that reason but I imagine others might want it to be more flexible but it's really locked down on the web client side - and rightfully so.)

LeeThompson avatar Mar 02 '23 19:03 LeeThompson