webserver on PIAWARE

does anybody know what webserver is running on PIaware?

1 Like

It is part of dump1090…

It is dump1090 – github.com/flightaware/dump1090_mr – on port 8080

I find that odd that the web server function didn’t get offloaded to a standard Apache install. Has anyone crashed the web interface by giving an incorrect URL? Try, server-ip:8080/test/anything-else-here . Killed the web server for me.

Putting a reverse proxy in front of it is certainly a sensible thing to do if you want to expose the web interface anywhere untrusted, yep.

Do you have a sample config you want to share?

Building a webserver into dump1090 was done by its original author, Salvatore Sanfilippo. While I wouldn’t have done it that way, dump1090 is a terrific piece of work that has been a cornerstone of the development of the ADS-B community, and I have great respect for him and what he has accomplished. (He’s also the author of redis, a prominent “nosql” key-value store.)

We’ve done some examination of dump1090’s webserver and have integrated a pull request that has a number of fixes including file existence checking and error handling. We’ve also committed to migrating dump1090 in the piaware package to a user other than root to decrease the impact of an exploit against the webserver. We will continue to examine the webserver aspect for problems and may add restrictions in the future such as limiting connections to coming from the local network. (A large majority of people already sit behind NAT firewalls that do not and even cannot allow inbound Internet connections to dump1090.)

One approach I have been debating is to limit dump1090 to only generate the json output and serve the static files from a conventional webserver. Would at least reduce the complexity of the dump1090 webserver code…

I took this one step further and made dump1090 write the json state to a file; now the entire map interface can be served by a conventional webserver and you can turn off the dump1090 webserver entirely.

Proof-of-concept at github.com/mutability/dump1090/ … json-files
It has a few rough edges, notably a race between the map refresh interval and the file write interval which means you only tend to see map updates once every 2 seconds.

I have it set up like this on my Pi now:

lighttpd serves everything under /var/www
dump1090 runs with “–write-json /var/run/dump1090/data”
/var/www/dump1090/ contains the static HTML/Javascript files
/var/www/dump1090/data/ is a symlink to /var/run/dump1090/data/
/var/run/dump1090/data/ is world-readable, and writable by the user running dump1090. This is on tmpfs so rewriting the data file all the time won’t hit the sdcard. (Remember to recreate it on boot)

Thank you all for the info. I was asking because I was making changes to the map and it was not updating. I was trying restart the webserver so I did not have to reboot. In the end I realized I was not editing the correct files. I have that sorted now.

Thanks

Thanks obj, big step to the right direction, the web server in dump1090 was totally overlapping and redundant piece of functionality.

I’m cloning the write-json-files branch, but need to make the day here, will be building and testing tomorrow.

-Paavo

What files did you change to get it to output the JSON file?

Github has a handy compare tool that will show you exactly what changed; see here: github.com/mutability/dump1090/ … json-files

Love IT!!!

thanks

I would hope that somewhere along the way there would be some details instructions on how to take advantage of some of these hacks. I know little or nothing about github. It predates my linux days (circa early '90’s.) I’m not teaching the old dog new tricks. I have been able to do somethings on my own (setup up FlightRadar24 to startup and run off the dump1090 feed) without an issue.

So… let us avgeeks know what we can do to take advantage of some of these things.

At the moment most of my changes are scratching my own itches, so packaging for general consumption is fairly far down the list.
(It is on there somewhere, just not very high up!)

That said, if you’re confident with building from source, it is fairly straightforward to get the source for a particular branch:

  • go to the github repository, copy the “https clone URL” on the righthand side e.g. “GitHub - mutability/dump1090: Dump1090 is a simple Mode S decoder for RTLSDR devices” in this case

  • on your Pi, “git clone ”, this will create a subdirectory (e.g. dump1090 in this case) and put the default “master” branch in it.

  • To switch to another branch: “cd dump1090; git checkout ” (e.g. this branch is called “write-json-files”). You can see all the available branches with “git branch -a”.

  • build from source as you usually would

Subsequently, you can “git pull” to fetch any new updates to the branch.

as a IT person whom not only does IT for work, but also for play I cannot leave anything alone.

I wanted to see my history for the day to see what goes by. So I decided to add the data to a MYSQL database.

For now I am using a external server before I try installing it on my PI

Basically I just read the JSON from the data.json url using PHP. Then input the data into the database if validposition=1. I script this file to run every X_num of seconds.
Then I have a second file read from the database and JSON_encodes the results in the same format. Then I just have the script.js read my php file.

It is very basic, but I am going to add time stamps etc… so I can see history.

I will post some screen shots once I work out the bugs, but the concept works well

Does the web server log anywhere so, for instance, we can see number and origin of hits, a la, Apache access log?

the external server that runs APACHE/MYSQL/PHP I do have logging enabled.

Sorry, I should have been more specific. I mean the server built into dump1090.

for development I am using an external web-server. I am only grabbing data from the PI. It needs to be optimized before I install it on the PI.