Below is the revised code for file /usr/share/dump1090-fa/html/gain.php.
With this code, the map will have a drop-down list (instead of text entry) for selecting desired gain setting. The current gain is displayed in red above drop-down.
.
Yes, but first you have to delete ALL existing code in file gain.php.
Keep pressed (Ctrl+k) till all code is deleted and the file is blank. Now copy-paste the new code and save file. That is all.
NOTE:
Full code is not directly visible in my post.
You have to scroll right to see some vey long lines.
You have to scroll down to see all line of code till you reach last line which is very short i.e. it is only ?>.
Dont miss any lines in copy-paste. Remember code’s first line is <html> and last line is ?>.
.
.
.
No, you dont have to restart piaware or dump1090 (fa or mut). Just select the gain value you want, click the “Set Gain” button, wait for few seconds, and that is all.
When you click the “Set Gain” button, it does three things in this sequence:
(1) Changes gain to desired value.
(2) Restarts dump1090 (fa or mut), implementing new gain value.
(3) Reads the current gain and displays it in red.
Giving a webinterface control over the pi might not be a good idea on every network.
Making it an option they would need to change the html files when restarting piaware. It’s a bit messy.
It might be possible in an elegant way but i’m not sure how.
Currently there is nothing in the web interface that has the potential to change the Pi’s configuration.
As soon as something like that is added, there is a large pile of associated security issues to sort out.
That’s not something we want to tackle right now.
(hint: giving passwordless sudo to www-data, or exposing the password so it’s effectively passwordless, is a bad idea)
The file gain.php is existing ONLY if you have already added gain setting feature to SkyView/Gmap.
If you have not added this feature already, then the file gain.php will not exist. In this case go to FIRST post of the thread, click on the link matching your install, and follow instructions.
If you want a drop-down menu (instead of a text box), then dont copy-paste the code for gain.php in those posts. Instead copy-paste from my today’s post.
I have a problem , I don’t know other people have it also
When I change the value of the gain , the proces to feed Planeplotter takes 100% CPU
(ppup1090)
Screenshot of top just very recent , but I saw it on graphs some hours a go something was different :
see also the rise in core temp, when I find out I did a reboot :
the Flightradar24’s web interface IP-OF-PI:8754/settings.html changes the Pi’s configuration.
I dont know the details how they do it, but they have been doing it since many years, and I never came across any mention or complaint about security issue caused by it.
Now anyone with access to www-data (or read access to that script, for that matter) can trivially get root.
The other security-related thing is that you don’t want something like this wide open in a standard image, so there would need to be some mechanism for authenticating, which has a whole lot of infrastructure associated with it (at a minimum, a way to set/change passwords and a HTTPS certificate to secure it all…)
For a one-off thing you do yourself it’s probably not a big deal - it’s unlikely to be attacked, you can probably juggle the HTTPS and password changes by hand, it’s a calculated risk.
For something where there are 18000 installs that are mostly maintained by users who aren’t familiar with any of this, though, it’s a completely different question and we have to be much much more careful.
Yep…I can see that. No need to know code. I was looking at the listing posted this afternoon. I did not see anything of the sort there, hence my question.
Something to keep in mind for sure. An individual user is free to do whatever he/she wants. I understand now why FA would not want to get into this.
I agree that the code I have used is not secure enough for mass scale distribution by Flightaware.
However the Flightradar24’s Web interface Settings page is in mass use by ALL their feeders for last many years. This means that there is a way to do it in a secure way, and as I am not an IT professional, I am not aware of its details.
You could make it secure forcing to ask for password at every change of gain, instead of having it in plain text. Annoying but, if someone is security oriented… will do it.