MarceauKa / shaark

Self-hosted platform to keep and share your content: web links, posts, passwords and pictures.
582 stars 59 forks source link

✨ Health Checks for Links #79

Closed wyred closed 4 years ago

wyred commented 4 years ago

Here's a new feature that checks the http status code for each link using guzzle.

Once enabled, the health check task is hardcoded to run every 10 minutes, and only check up to a maximum of 20 links. You can configure how often to check each link at Settings. It is currently defaulted to 7 days, max 365.

healthcheck-settings

healthcheck-dashboard

healthcheck-deadlinks

guzzlehttp/guzzle is used to make the checks.

2 database columns http_status and http_checked_at are added to the links table.

I'm not familiar with vue so the links dashboard and dead links pages are done the traditional way using blade templates.

MarceauKa commented 4 years ago

Wow, nice work! Let me check that and I'll merge it :)

Edit: Give me some time, I'll add some nice enhancements to that (vue instead of blade for example)

Meuschke23 commented 4 years ago

Can individual links be excluded from the check? I also use the tool for links in the local network.

wyred commented 4 years ago

Some things to note, I used a Chrome user agent because sites like reddit block requests made with guzzle's default user agent. Even though with this user agent, some sites still manage to block and I have not been able to figure out how.

wyred commented 4 years ago

Can individual links be excluded from the check? I also use the tool for links in the local network.

As of now there's no way to exclude links, but the setting will come disabled by default so those links won't be pinged.

It's easy to add a way to exclude links but I'm not familiar with vue enough to build the interface for it.

MarceauKa commented 4 years ago

To Do

wyred commented 4 years ago

I've added the health check status on the link card, it will not show up if there's no data. healthcheck-1

Health check can now be disabled for a specific link healthcheck-2

List of disabled links can be viewed from control panel healthcheck-3

wyred commented 4 years ago

@MarceauKa I've been learning vuejs for a while so if you haven't converted the control panel to vue, I'd like to give it a try. Let me know : )

MarceauKa commented 4 years ago

@MarceauKa I've been learning vuejs for a while so if you haven't converted the control panel to vue, I'd like to give it a try. Let me know : )

I'm working to release that, don't worry! :D

MarceauKa commented 4 years ago

Hi, just merged this with a lot of improvements. Look at this commit: https://github.com/MarceauKa/shaark/commit/fd2acc7d07d0583a5379a2f1bd3aaacae064fbbd

There are major changes in UI, commands, translations, controllers and migration

MarceauKa commented 4 years ago

Released in 1.2.43