headplane icon indicating copy to clipboard operation
headplane copied to clipboard

Expiry information

Open Gurkengewuerz opened this issue 1 year ago • 2 comments

Hey @tale,

thank you for your work on this nice looking admin ui for the latest alpha of headscale!

I am recreating my network using preauth keys with a 5 years expiration

docker compose exec headscale headscale preauthkey create --user <username> --expiration 5y --reusable

After registering the node I have a fully connected node with the given expiration of 0001-01-01 00:00:00 and Expired no. 2024-05-18_14-43-01

But the UI shows an expired tag. 2024-05-18_14-44-33

Maybe the API also sends the expired column?

Keep up your work its awesome!

Gurkengewuerz avatar May 18 '24 12:05 Gurkengewuerz

The API doesn't actually send the expired column, it's calculated here: https://github.com/juanfont/headscale/blob/main/hscontrol/types/node.go#L138. I'll fix this soon!

tale avatar May 18 '24 17:05 tale

Following up, I'm actually not sure what an expired date looks like on here. Because JS engines traditionally have had interesting Date parsing, 0001-01-01 00:00:00 becomes January 1, 2001. My thinking is I might need to add a date library to check if its a valid datestamp after 1970.

tale avatar May 23 '24 23:05 tale

3bd5cc99aa3b1ee7649e6979cb55726f8477b77f fixes it for me (available in 0.1.8). Can you confirm this also resolves the issue for you?

tale avatar Jun 02 '24 05:06 tale

I'm on the latest docker image and it does not work for me. My headscale Version is on 0.23.0-alpha11. I can confirm that my non expiring nodes sends 0001-01-01T00:00:00Z in the routes/_data.machines._index route which is different from 0001-01-01 00:00:00.

Gurkengewuerz avatar Jun 02 '24 11:06 Gurkengewuerz

Ugh, okay, I just pushed a fix for it, but it might be a little while before I cut a release. If you want to try it now, ghcr.io/tale/headplane:edge.

tale avatar Jun 02 '24 22:06 tale

Looks good to me now. :)

Gurkengewuerz avatar Jun 03 '24 06:06 Gurkengewuerz

Stable in 0.1.9.

tale avatar Jun 04 '24 02:06 tale

But I got another wrong information showing the expiration date on the headplane UI. The node has an expiration date, not '0001-01-01', but headplane also shows 'Never' for 'Expiry' in Machine Details. I think it should show the actual expiration date here, but not.

leeaash avatar Dec 23 '24 04:12 leeaash