[SOLVED] Dump1090-fa v7.2 - Issue on Kali Linux 2022 amd64

@obj
@eric1tran

dump1090-fa v7.2 - Empty Aircrft Table on Right Side of Skyaware Map on Kali Linux amd64 2022

 

dump1090-mutability EB_VER - OK

 

Piaware Installs & Works OK

 

Other than for Map issue shown above, the dump 1090-fa works OK as decoder

Visit it in a browser that’s larger than a stamp?
Check for console log errors, standard stuff you should know after testing i don’t know how many obscure configurations :slight_smile:

1 Like

Please do not get wrong impression by screenshots I have posted. These are of the local browser of the Kali in VM.

I have also checked the Skyaware map in my Desktop’s full-sized Firefox & Google Chrome browsers at IP-of-Kali/skyaware/. The results were same, i.e. unpopulated aircraft table.

I have also several times cleared browser cache (Ctrl+Shift+Delete) and reloaded broser (Ctrl+F5), but problem persists in both the Firefox & Google Chrome on my Desktop as well as in VM.

Well then see if any errors are on the dev console (F12).

I just want to point out for general information that Kali Linux was designed to be booted from removable media such as a USB stick or optical drive and used by cybersecurity experts for penetration testing, security auditing, white hat hacking and forensics, particularly in secure environments where the security team isn’t allowed to bring in their own computers or have Internet access. It isn’t intended to be an installed daily-driver Linux distro. As such it may possibly lack some components that come with most normal desktop distros and that are needed to run some end-user software, Kali was only designed to be able to run the security tools that come preinstalled in the OS, not necessarily to be able to run added-on applications.

F12 on Google Chrome

You’re missing some javascript.

 

┌──(abcd㉿kali2022-2)-[~]
└─$ ls /usr/share/skyaware/html 

config.js    flags-tiny    index.html  noUiSlider      registrations.js  test
db           formatter.js  jquery      ol              script.js
dbloader.js  geojson       layers.js   planeObject.js  spinny.gif
flags.js     images        markers.js  README.md       style.css

 

┌──(abcd㉿kali2022-2)-[~]
└─$ cat /usr/share/skyaware/html/index.html  

<!DOCTYPE HTML>
<html>
        <head>
                <meta charset="utf-8"/>
                <link rel="stylesheet" type="text/css" href="style.css?v=8.0" />
                <link rel="stylesheet" href="jquery/jquery-ui-1.11.4-smoothness.css" />
                <script src="jquery/jquery-3.0.0.min.js"></script>
                <script src="jquery/jquery-ui-1.11.4.min.js"></script>
                <script src="jquery/plugins/jquery.validate.min.js"></script>

                <link rel="stylesheet" href="ol/v6.3.1/ol.css" type="text/css" />
                <script src="ol/v6.3.1/ol.js" type="text/javascript"></script>

                <link rel="stylesheet" href="ol/ol-layerswitcher.css" type="text/css"/>
                <script src="ol/ol-layerswitcher.js" type="text/javascript"></script>

                <script src="noUiSlider/distribute/nouislider.min.js"></script>
                <link rel="stylesheet" href="noUiSlider/distribute/nouislider.min.css"/>

                <script type="text/javascript" src="config.js?v=8.0"></script>
                <script type="text/javascript" src="markers.js?v=8.0"></script>
                <script type="text/javascript" src="dbloader.js?v=8.0"></script>
                <script type="text/javascript" src="registrations.js?v=8.0"></script>
                <script type="text/javascript" src="planeObject.js?v=8.0"></script>
                <script type="text/javascript" src="formatter.js?v=2?v=8.0"></script>
                <script type="text/javascript" src="flags.js?v=8.0"></script>
                <script type="text/javascript" src="layers.js?v=8.0"></script>
                <script type="text/javascript" src="script.js?v=8.0"></script>
                <title>PiAware SkyAware</title>
        </head>

 

This can happen due to some lighttpd stupidity even when the file exists.

Try http://127.0.0.1/skyaware/formatter.js

You see it in the html folder, so it should load.
My guess: you have lighttpd deflate enabled in the lighttpd config, it makes a mess of things.
lighttpd is completely buggy which is kinda sad.
I mean most of the time it mostly works … but the issues it causes are very spurious and annoying.

 

CLICK ON SCREENSHOT TO SEE LARGER SIZE

 

 

 

I did NOT make any changes to lighttpd config. These are Default ones, given below:

 

(1/5) File lighttpd.conf

┌──(abcd㉿kali2022-2)-[~]
└─$ cat /etc/lighttpd/lighttpd.conf 

server.modules = (
        "mod_indexfile",
        "mod_access",
        "mod_alias",
        "mod_redirect",
)

server.document-root        = "/var/www/html"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80

# features
#https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_feature-flagsDetails
server.feature-flags       += ("server.h2proto" => "enable")
server.feature-flags       += ("server.h2c"     => "enable")
server.feature-flags       += ("server.graceful-shutdown-timeout" => 5)
#server.feature-flags       += ("server.graceful-restart-bg" => "enable")

# strict parsing and normalization of URL for consistency and security
# https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_http-parseoptsDetails
# (might need to explicitly set "url-path-2f-decode" = "disable"
#  if a specific application is encoding URLs inside url-path)
server.http-parseopts = (
  "header-strict"           => "enable",# default
  "host-strict"             => "enable",# default
  "host-normalize"          => "enable",# default
  "url-normalize-unreserved"=> "enable",# recommended highly
  "url-normalize-required"  => "enable",# recommended
  "url-ctrls-reject"        => "enable",# recommended
  "url-path-2f-decode"      => "enable",# recommended highly (unless breaks app)
 #"url-path-2f-reject"      => "enable",
  "url-path-dotseg-remove"  => "enable",# recommended highly (unless breaks app)
 #"url-path-dotseg-reject"  => "enable",
 #"url-query-20-plus"       => "enable",# consistency in query string
)

index-file.names            = ( "index.php", "index.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.conf.pl"
include "/etc/lighttpd/conf-enabled/*.conf"

#server.compat-module-load   = "disable"
server.modules += (
        "mod_dirlisting",
        "mod_staticfile",
)
                                                                                  

 

 

(2/5) Contents of Folder conf-enabled

┌──(abcd㉿kali2022-2)-[~]
└─$ ls /etc/lighttpd/conf-enabled     
                    
88-dump1090-fa-statcache.conf  89-skyaware.conf  90-javascript-alias.conf
                                                                                  

 

 

(3/5) File 88-dump1090-fa-statcache.conf

┌──(abcd㉿kali2022-2)-[~]
└─$ cat /etc/lighttpd/conf-enabled/88-dump1090-fa-statcache.conf

# The stat cache must be disabled, as aircraft.json changes
# frequently and lighttpd's stat cache often ends up with the
# wrong content length.
server.stat-cache-engine    = "disable"
                                          

 

 

(4/5) File 89-skyaware.conf

──(abcd㉿kali2022-2)-[~]
└─$ cat /etc/lighttpd/conf-enabled/89-skyaware.conf

# Allows access to the static files that provide the dump1090 map view,
# and also to the dynamically-generated json parts that contain aircraft
# data and are periodically written by the dump1090 daemon.

# Enable alias module
#
## This module is normally already enabled in lighttpd, so you should not
## need to uncommment this line.
## There are some cases (e.g. when installing this on a Raspberry Pi
## that runs PiHole) in which the module has been removed from the
## default configuration, and the dump1090-fa web interface no longer
## loads properly.
## If this is what you are experiencing, or if you see messages in your
## error log like:
## (server.c.1493) WARNING: unknown config-key: alias.url (ignored)
## then uncommenting this line and then restarting lighttpd could fix
## the issue.
## This is not enabled by default as standard lighttpd will not start if
## modules are loaded multiple times.
#
# server.modules += ( "mod_alias" )

alias.url += (
  "/skyaware/data/" => "/run/dump1090-fa/",
  "/skyaware/data-978/" => "/run/skyaware978/",
  "/skyaware/" => "/usr/share/skyaware/html/"
)

# redirect the slash-less URL
url.redirect += (
  "^/skyaware$" => "/skyaware/"
)

# Listen on port 8080 and serve the map there, too.
$SERVER["socket"] == ":8080" {
  alias.url += (
    "/data/" => "/run/dump1090-fa/",
    "/data-978/" => "/run/skyaware978/",
    "/" => "/usr/share/skyaware/html/"
  )
}

# Add CORS header
server.modules += ( "mod_setenv" )
$HTTP["url"] =~ "^/skyaware/data/.*\.json$" {
  setenv.set-response-header = ( "Access-Control-Allow-Origin" => "*" )
}

# Uncomment this section to enable SSL traffic (HTTPS) - especially useful
# for .dev domains
## Listen on 8443 for SSL connections
#server.modules += ( "mod_openssl" )
#$HTTP["host"] == "piaware.example.com" {
#  $SERVER["socket"] == ":8443" {
#    ssl.engine = "enable"
#    ssl.pemfile = "/etc/ssl/certs/combined.pem"
#    ssl.ca-file =  "/etc/ssl/certs/fullchain.cer"
#    ssl.honor-cipher-order = "enable"
#    ssl.cipher-list = "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"
#    ssl.use-sslv2 = "disable"
#    ssl.use-sslv3 = "disable"
#
#  alias.url += (
#    "/data/" => "/run/dump1090-fa/",
#    "/" => "/usr/share/skyware/html/"
#  )
#  }
#}
#
## Redirect HTTP to HTTPS
#$HTTP["scheme"] == "http" {
#  $HTTP["host"] =~ ".*" {
#    url.redirect = (".*" => "https://%0$0")
#  }
#}
                                                                                  

 

 

(5/5) File 90-javascript-alias.conf

┌──(abcd㉿kali2022-2)-[~]
└─$ cat /etc/lighttpd/conf-enabled/90-javascript-alias.conf

alias.url += ("/javascript" => "/usr/share/javascript")
                                                                                  

 

 

Well, try again and see if it loads formatter.js now.
Check the F12 network tab and see what happens with the formatter.js loading.

Google Chrome, F12, Network, Reload → formatter.js = 404

CLICK ON SCREENSHOT TO SEE LARGER SIZE

Found Kali Linux fresh install has apache2 and nginx pre-installed, but both are disabled.

Please note that in Kali Linux, many pre-installed packages are disabled by default.
Also ALL user installed packages are disabled by default and user has to explicitly enable these after installation. I have installed lighttpd alongwith dump1090-fa and had to enable both manually.

CLICK ON SCREENSHOT TO SEE LARGER SIZE

 

 

Here is the strange part:

Although apache2 is disabled right from writing the iso to hard drive, and lighttpd is installed & enabled, the placeholder page is that of apache2, and not that of lighttpd :astonished:

CLICK ON SCREENSHOT TO SEE LARGER SIZE

Yeah they use the same directory, it doesn’t matter what the default page shows.

Have you right clicked copied the link?
Clicking on the entry before making the screenshot will help providing more info.

Edit: nevermind, found the issue.

@eric1tran might be the the two query strings causing issues?

                <script type="text/javascript" src="formatter.js?v=2?v=8.0"></script>

Yes that’s the issue, lighttpd gives a 404 if you add two query strings (which isn’t proper html to be fair.)
(i suppose it might depend on the lighttpd version … and the 404 isn’t present for all versions)

@abcd567 you can change the index.html, remove ?v=2 from that line.

1 Like

Doh. I’ll get that fixed and committed. Thanks for looking into that guys.

I’ve heard some of the same. Been considering trying out nginx next time I get to SkyAware stuff.

1 Like

@obj
@eric1tran

Thank you for the help. It worked.

┌──(abcd㉿kali2022-2)-[~]
└─$ sudo nano /usr/share/skyaware/html/index.html

Removed ?v=2 from this line:

                <script type="text/javascript" src="formatter.js?v=2?v=8.0"></script>   

So it became:

                <script type="text/javascript" src="formatter.js?v=8.0"></script>    

 

Saved file index.html, cleared browser cache and reloaded browser

It is working now :slightly_smiling_face:

CLICK ON SCREENSHOT TO SEE LARGER SIZE

 

1 Like

The issue is, even installing it as a dependency will cause issues if something like lighttpd exists.
Would be great if there was a way to just install the binary and then be able to add a service yourself, serve on some other port.
8080 is very crowded btw, who chose that for skyaware? :slight_smile:

lighttpd is sadly the defacto standard … so it’s gonna remain the lesser evil to use it unless it becomes completely unusable.

Why not to have an integral web server as part of dump1090-fa binary?

Because then we have to maintain a bunch of web server code.

If there was an actively maintained, easy-to-embed library that could provide this then it’d be another question, but I don’t know of anything that fits at the moment.

1 Like