Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

action: Add action to check bridge connectivity #1147

Merged
merged 17 commits into from
Oct 31, 2019
Merged

action: Add action to check bridge connectivity #1147

merged 17 commits into from
Oct 31, 2019

Conversation

logmanoriginal
Copy link
Contributor

It is currently not simply possible to check if the remote server for a bridge is reachable or not, which means some of the bridges might no longer work because the server is no longer on the internet.

In order to find those bridges we can either check each bridge individually (which takes a lot of effort), or use an automated script to do this for us.

If a server is no longer reachable it could mean that it is temporarily unavailable, or shutdown permanently. The results of this script will at least help identifying such servers.


This PR adds a new action connectivity which returns a page that checks each bridge individually. It only checks bridges on the whitelist and uses JavaScript to make the page somewhat responsive.

Note that I didn't use PHPUnit for the testing because it doesn't make sense to fail tests on bridges unrelated to fixes. There might also be some benefit for administrators if they want to check if a bridge works on their servers.

The implementation is still very rough (more like a proof of concept). This is what the process looks like (on my end at least).

image

Pressing [Show] opens a new tab to the bridge on our front page.


Disclaimer
I'm no JS programmer, so don't get too irritated by the implementation.

What is your opinion on this?
Should this be part of the repository?
Let me know if you have a better idea of detecting inoperable bridges.

@logmanoriginal logmanoriginal added the New-Feature This is a new feature label Jun 1, 2019
@logmanoriginal logmanoriginal self-assigned this Jun 1, 2019
@logmanoriginal
Copy link
Contributor Author

logmanoriginal commented Jun 9, 2019

I added a few things to make it respond better to user input.

  • Split into multiple files to separate JavaScript and CSS code
  • This action now only works in debug mode (because it has no value to "normal" users)
  • The process can be aborted by pressing "x" on the status message
  • Added status icons to the message (processing, aborted, done)
  • Added a new status (yellow) if the process is aborted
  • The page now always responds to user input while processing in the background

I'm currently thinking about adding one more status for bridges where the server redirects requests.
Let me know if you have further suggestions.

Here are a few impressions

Screenshot from 2019-06-09 17-16-11


Screenshot from 2019-06-09 17-16-44


Screenshot from 2019-06-09 17-17-46

@logmanoriginal
Copy link
Contributor Author

Added two more features.

  • Mark redirected bridges (blue) => This requires a change in lib/contents.php
  • Show tool tip for icons

image


Screenshot from 2019-06-09 18-38-56


By the way, this is what inactive bridges (not on the whitelist) look like

image

@teromene
Copy link
Member

I am good with this !
The only downside I see is that it kinda acts as a replacement to real tests, but it's definitely better than nothing.

<head>
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about linking to bootstap's CDNs tbh. If needed I'll do a CSS in another PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean to include the CSS files in the repository, or to replace Bootstrap entirely?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe include the CSS for now

@logmanoriginal
Copy link
Contributor Author

Thanks for your feedback @teromene

I am good with this !
The only downside I see is that it kinda acts as a replacement to real tests, but it's definitely better than nothing.

I agree that the border between real tests and this action is somewhat blurry, but there is an important difference. Real tests run on Travis, while this action can be used on any server without having to install any third-party software.

This has become very helpful to me for detecting bridges that simply don't work on my server (although they seem to work for others). I could even use this action to filter inaccessible sites/bridges from my whitelist.

That said, we clearly need to limit the amount of functionality to keep it maintainable. Let me know if you find anything that should rather be left out.

@teromene
Copy link
Member

Appart from the CSS thing, LGTM

It is currently not simply possible to check if the remote
server for a bridge is reachable or not, which means some
of the bridges might no longer work because the server is
no longer on the internet.

In order to find those bridges we can either check each
bridge individually (which takes a lot of effort), or use
an automated script to do this for us.

If a server is no longer reachable it could mean that it is
temporarily unavailable, or shutdown permanently. The results
of this script will at least help identifying such servers.
Connectivity checks take a long time to execute and can require a lot
of bandwidth. Therefore, administrators should be able to determine
when and who is able to utilize this action. The best way to prevent
regular users from accessing this action is by making it available in
debug mode only (public servers should never run in debug mode anyway).
Also adds titles to status icons (Successful, Redirected, Inactive, Failed)
@logmanoriginal logmanoriginal changed the title [WIP] action: Add action to check bridge connectivity action: Add action to check bridge connectivity Oct 31, 2019
@logmanoriginal logmanoriginal merged commit cdc1d9c into RSS-Bridge:master Oct 31, 2019
@logmanoriginal logmanoriginal deleted the BridgeConnectivity branch October 31, 2019 21:02
infominer33 pushed a commit to web-work-tools/rss-bridge that referenced this pull request Apr 17, 2020
* action: Add action to check bridge connectivity

It is currently not simply possible to check if the remote
server for a bridge is reachable or not, which means some
of the bridges might no longer work because the server is
no longer on the internet.

In order to find those bridges we can either check each
bridge individually (which takes a lot of effort), or use
an automated script to do this for us.

If a server is no longer reachable it could mean that it is
temporarily unavailable, or shutdown permanently. The results
of this script will at least help identifying such servers.

* [Connectivity] Use Bootstrap container to properly display contents

* [Connectivity] Limit connectivity checks to debug mode

Connectivity checks take a long time to execute and can require a lot
of bandwidth. Therefore, administrators should be able to determine
when and who is able to utilize this action. The best way to prevent
regular users from accessing this action is by making it available in
debug mode only (public servers should never run in debug mode anyway).

* [Connectivity] Split implemenation into multiple files

* [Connectivity] Make web page responsive to user input

* [Connectivity] Make status message sticky

* [Connectivity] Add icon to the status message

* [contents] Add the ability for getContents to return header information

* [Connectivity] Add header information to the reply Json data

* [Connectivity] Add new status (blue) for redirected sites

Also adds titles to status icons (Successful, Redirected, Inactive, Failed)

* [Connectivity] Fix show doesn't work for inactive bridges

* [Connectivity] Fix typo

* [Connectivity] Catch errors in promise chains

* [Connectivity] Allow search by status and update dynamically

* [Connectivity] Add a progress bar

* [Connectivity] Use bridge factory

* [Connectivity] Import Bootstrap v4.3.1 CSS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New-Feature This is a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants