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

added openspeedtest #834

Merged
merged 5 commits into from
Jan 21, 2023
Merged

added openspeedtest #834

merged 5 commits into from
Jan 21, 2023

Conversation

Svelte-Enthusiast
Copy link
Contributor

@Svelte-Enthusiast Svelte-Enthusiast commented Jan 10, 2023

Added #808 , openspeedtest

☑️ Self Check before Merge

  • I have tested the template using the method described in README.md thoroughly
  • I have ensured that I put as much default values as possible (except passwords) to ensure minimum effort required for end users to get started.
  • I have ensured that I am not using the "latest" tag as this tag is dynamically changing and might break the one-click app. Use a fixed version.
  • I have made sure that instructions.start and instructions.end are clear and self-explanatory.
  • Icon is added as a png file to the logos directory.

@openspeedtest
Copy link

@Svelte-Enthusiast Thank you for the PR.

Default port for http : 3000

Default port for https : 3001

  • Written in Vanilla Javascript (Client-Side). No PHP, Node Js, or any other Server-Side programming languages are used.
  • This is a docker implementation using nginxinc/nginx-unprivileged:stable-alpine. uses significantly fewer resources.
  • Nginx Deliver our static SpeedTest application, That is how it works.

I don't know how caprover handles apps.
If you run behind a reverse proxy and reverse proxy is used for handling HTTPS.
I think it's better to run the app in HTTP mode, to save server resources.
3000 is the HTTP port.

@githubsaturn
Copy link
Collaborator

Thanks! Formatting seems to be not working. Suggest running npm run formatter-write to reformat your changes.

@@ -2,23 +2,23 @@ captainVersion: 4

services:
'$$cap_appname':
image: index.docker.io/openspeedtest/latest:$$cap_openspeedtest_version
image: index.docker.io/test/latest:$$cap_test_version
Copy link
Collaborator

Choose a reason for hiding this comment

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

lots of wrong replacement here. All "openspeedtest" instances in the definition are converted to test

instructions:
start: |-
OpenSpeedTest is a self-hosted speedtest. You can read more about this on https://openspeedtest.com/selfhosted-speedtest.
Test is a self-hosted speedtest. You can read more about this on https://test.com/selfhosted-speedtest.
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here... Test is a self-hosted speedtest. You can read more about this on https://test.com/selfhosted-speedtest.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

super weird. the only thing i did was run the formatter. i fixed it with the next push

@githubsaturn githubsaturn merged commit 54c04f8 into caprover:master Jan 21, 2023
@githubsaturn
Copy link
Collaborator

Thanks!

@openspeedtest - I assume you maintain this image. I suggest you change the image to a standard format.

openspeedtest/latest:openspeedtest is a non conventional format. Docker images should have their version as a tag. So for example: openspeedtest/openspeedtest:v1.2.3 or openspeedtest/openspeedtest:latest

@openspeedtest
Copy link

@githubsaturn When I started using docker, I was unaware of or fully understood this concept.
Now I don't want to break existing deployments by deleting them. Also, it will reset the pull count and star count.
No breaking changes will be introduced to this image, especially to the latest and speedtest tags. That is why I avoided versioning them. Still, if that is important from the next version (2.5.5), I will add a version number.
Thanks!

@githubsaturn
Copy link
Collaborator

Yea I definitely recommend using concrete version tags. Here is a snippet on why they are important.

Tivin-i pushed a commit to SelfHosted-Club/caprover-one-click-apps that referenced this pull request May 19, 2023
* added openspeedtest

* changed default version to speedtest

* suggested fixes

* add formatting

* fixed replacement issues
@nativeit
Copy link
Contributor

nativeit commented Apr 7, 2024

I was getting ready to open a PR for this app, I may link it here if I can confirm that I'm not breaking anything, or that I wasn't making a mistake in my initial setup. The problem as it currently exists is this:

When deployed as-is, the port is set to the https port 3001, but whether or not SSL is enabled under the app's HTTP settings, this results in the following Nginx error:

The plain HTTP request was sent to HTTPS port

It's my understanding that this is due to the way the reverse proxy is being handled. I'm not an expert with Nginx, so a second opinion would be good here, but I believe the app's port should be set to the http port 3000 instead, as Caprover will handle the secure connection, and the traffic to port 3000 will effectively be local proxy traffic.

I deployed v2.0.5 to my server, and with the HTTP port set to 3001 it produces the error with/without HTTPS enabled, but with 3000 set it works as expected with either HTTP/HTTPS enabled in the app's settings.

My PR was going to change the HTTP port to 3000, and the default version tag to v2.0.5. I'd welcome @openspeedtest to please advise, as well as anyone with better knowledge of the Nginx proxy to confirm that using 3000 with SSL enabled under the app settings achieves the same security as running OpenSpeedTest from a non-proxied web server on port 3001.

@nativeit
Copy link
Contributor

nativeit commented Apr 7, 2024

While reading on the Content-Length header issue posted above, I also saw that there were issues with http2/http3, and under the repo's Nginx configuration (link) it includes a block disabling http2.

Caprover's default Nginx config uses listen 443 ssl http2;

I don't think it's generally ideal for apps to require editing the default config (although it isn't unheard of). That said, I noticed if "Websocket Support" has been enabled, then this line is added to the default config: proxy_http_version 1.1;

@githubsaturn - Would the "Websocket Support" flag do anything to help with this, or is it only triggered when the $http_upgrade header is included with the client's request (otherwise all requests get passed to 443 ssl http2 as usual)?

It seems like running OpenSpeedTest behind a reverse proxy may just have some inherent issues. I am running it under port 3000 in a Caprover instance (Proxmox KVM) that's hosted on a bare metal server at OVH's Virginia datacenter (my nearest region) and it seems to be working normally, and providing realistic measurements for my current location.

I'll be glad to continue testing, if the http2 vs http1.1 topic is ultimately not relevant to the Caprover deployment, I'll move this particular issue to the OpenSpeedTest repo.

@nativeit
Copy link
Contributor

nativeit commented Apr 7, 2024

I attempted to work with both the http/1.1 vs http/2 and request_max_body_size issues, but in the end could not determine whether any of my changes to the Nginx configuration made an impact at all (assuming they didn't break something outright, which also happened in a few cases). No matter what I did, when I used my browser's Network Inspection it was always http/2, but I'm also fairly sure the Docker networking layer facilitates those connections. Correct me if I'm wrong, but in order to see the relevant stats I would need to inspect the traffic between the upstream server and reverse proxy.

Tldr; I don't have any suggestions with regard to the reverse proxy problems. But I believe I have fixed the port issue, and I added details in the deployment instructions regarding the limits for this implementation of OpenSpeedTest. I put my local branch up at https://github.com/nativeit/one-click-apps/tree/openspeedtest-dev - if you'd like me to open a PR, I certainly will.

See changes at: master...nativeit:one-click-apps:openspeedtest-dev

@githubsaturn
Copy link
Collaborator

but I believe the app's port should be set to the http port 3000 instead, as Caprover will handle the secure connection

100% correct!

RE: the rest of your questions, I can't say much since it's really dependent of how this app was built.
Looks like they have some guide here for reverse proxy:
https://github.com/openspeedtest/Docker-Image?tab=readme-ov-file#or-use-docker-composeyml

But looks like they require a lot of custom settings for nginx to work properly
https://github.com/openspeedtest/Nginx-Configuration/blob/main/OpenSpeedTest-Server.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants