iFargle / headscale-webui

A simple Headscale web UI for small-scale deployments.
Other
628 stars 57 forks source link

Subnet Routing Failover #54

Closed drag0n141 closed 1 year ago

drag0n141 commented 1 year ago

Is it planned to add the subnet failover function to the webui?

https://github.com/juanfont/headscale/pull/1024

iFargle commented 1 year ago

I'll give it a shot :)

iFargle commented 1 year ago

So it doesn't look like there's a way to do this via the builtin API, other than enabling / disabling routes in a certain order to determine which is primary.

As of now, it looks like if you just enable the route on two nodes it "just works" -- Do you need to be able to select which is primary?

iFargle commented 1 year ago

I can also add an indicator of route failover if that would be beneficial

drag0n141 commented 1 year ago

As of now, it looks like if you just enable the route on two nodes it "just works" -- Do you need to be able to select which is primary?

Yes correctly :) but dont know i that is possible i am not using the routing failover at the moment.

I can also add an indicator of route failover if that would be beneficial

I think that would help.

iFargle commented 1 year ago

It's technically possible -- I'll see what I can do! I'm working on rewriting how I manage routes so once that's done I"ll work on this

iFargle commented 1 year ago

I've added some preliminary work into v0.6.0 You can test with ghcr.io/ifargle/headscale-webui:testing right now if you'd like to try it out

drag0n141 commented 1 year ago

I have installed the :testing version. Now all Routes are duplicated. One normal Route and one as "Failover Pair"

iFargle commented 1 year ago

Interesting... All routes, including the exit routes?

iFargle commented 1 year ago

Can you give examples of the failover ranges you are using? All I'm doing right now is a simple list search to determine if there are duplicate IP's: https://github.com/iFargle/headscale-webui/blob/fc5908f3e2dba26d96756e9242babd2b63226bab/renderer.py#L307-L332

iFargle commented 1 year ago

Oh I see the issue.. https://github.com/iFargle/headscale-webui/blob/fc5908f3e2dba26d96756e9242babd2b63226bab/renderer.py#L313 Should be... https://github.com/iFargle/headscale-webui/blob/96a55a385d5557ce487521e52da45d734fa2b8ba/renderer.py#L313

I've pushed anew build. Let me know if you still see duplicates

iFargle commented 1 year ago

I need to figure out a better way to do this. I think in the next release I'll add another button to the machines page dedicated to managing routes. The way it's currently implemented is limited. It's also something I've been wanting for a bit but it'll require some work

drag0n141 commented 1 year ago

Now it looks good no more duplicates :)

image

iFargle commented 1 year ago

Perfect!
They're colored based on their pair. I think I'm going to add a routes page to this release. I'll see if I have time

iFargle commented 1 year ago

btw don't use testing for long -- I am always pushing updates to it so things will break all the time. Or just use this current release of testing until I push it to main :)

iFargle commented 1 year ago

Back at it this week. Made some good improvements in the testing build image

Once I finish the code up for better enabling/disabling of these routes it will be pushed to main

iFargle commented 1 year ago

Closing -- This will be in main in about 1.5 hours (multiarch builds take a while). Please use the main branch after it's available.

Thanks!