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
Initial pull request for the speedest plugin #2298
Conversation
passes style tests, includes copyright licenses
public function testAction($serverid = 0) | ||
{ | ||
$backend = new Backend(); | ||
$response = trim($backend->configdRun("speedtest run ${serverid}")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can pass parameters using ->configdpRun()
e.g.
(new Backend())->configdpRun("speedtest run", [$serverid]);
This helps to make the distinction between commands and parameters more explicit and escapes parameters in the process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want me to refactor the controller for this release or schedule the changes for the next update? This jello works at the moment, I will create a new fork and start on optimization and refactoring.
just a small question, wouldn't it be simpler to control |
is there a good example of a plugin (or a core service) that I can look at? |
I'd probably go with |
btw, the CLI version of speedtest is sunsetting and slowly replaced by socket-based speedtest binary. That's why I included both... |
I would try to keep things simple. |
I would be happy to pull both speedtest binary and speedtest.py out from the plugin package and add them as an external dependencies - but I need some help here; how can I nudge pkg process to install py-speedtest-cli dependency (which is in ports but not in any of the default repositories) and how can I instruct pkg to install speedtest binary (which is available as a binary on ookla's site but not in any repo that I know)? With that, I can just declare dependencies and let BSD pkg installer handle the rest... From: https://www.speedtest.net/apps/cli#freebsd: |
py-speedtest-cli is already in repo ( https://pkg.opnsense.org/FreeBSD:12:amd64/21.1/MINT/21.1.3_3/OpenSSL/All/py37-speedtest-cli-2.1.2.txz ). When there is a pkg in any repo you can use plugin depends, otherwise you need to include it in the plugin, but this is highly unusual since noone can verify the real source if it. |
you named it py37-speedtest-cli? Gosh! OK, this one is resolved and I'll pull it out from the plugin. :-) How about Ookla's binary? |
I don't think we ship Ookla's binary, my advise is to stick to what's available first. |
the binary speedtest (that uses sockets) delivers different (better?) results. Don't ask me to rip it out from the plugin... |
If you plan to make it available in the OPNsense plugins repo, that's likely the question yes. We're not going to ship binaries. |
I started the question on OPNsense forum: what would be a process to fire |
It does not matter where the binary is from or if it is available as a package somewhere else. We need a FreeBSD port in source code to add as a dependency to be part of the whole build process. |
ok, I'll cut it out. Are you ok that I keep instructions on how users can swap out CLI and replace it with binary? |
This reverts commit f29f946.
This is a significant rewrite of the initial PR code:
|
Let's not waste time on this review as I already refactored some portions... |
passes style tests, includes copyright licenses.