mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-06-15 04:43:01 -04:00
Add ASN support
This commit is contained in:
@@ -32,6 +32,7 @@ Remove the allow/deny lines in `/config/nginx/proxy-confs/dashboard.subdomain.co
|
|||||||
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
|
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
|
||||||
```
|
```
|
||||||
- Either [Swag Maxmind mod](https://github.com/linuxserver/docker-mods/tree/swag-maxmind) or [Swag DBIP mod](https://github.com/linuxserver/docker-mods/tree/swag-dbip) are required to enable the geo location graph.
|
- Either [Swag Maxmind mod](https://github.com/linuxserver/docker-mods/tree/swag-maxmind) or [Swag DBIP mod](https://github.com/linuxserver/docker-mods/tree/swag-dbip) are required to enable the geo location graph.
|
||||||
|
- Either Maxmind's or DB-IP's ASN mmdb are required under `/config/geoip2db/asn.mmdb` to enable the ASN graph.
|
||||||
- To clear the dashboard stats, you must remove the logs (/config/log/nginx) and **recreate** the container.
|
- To clear the dashboard stats, you must remove the logs (/config/log/nginx) and **recreate** the container.
|
||||||
|
|
||||||
## Dashboard Support
|
## Dashboard Support
|
||||||
|
|||||||
@@ -280,6 +280,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function GetGoaccess() {
|
function GetGoaccess() {
|
||||||
|
$geodb = '';
|
||||||
$dbip = '/config/geoip2db/dbip-country-lite.mmdb';
|
$dbip = '/config/geoip2db/dbip-country-lite.mmdb';
|
||||||
$maxmind = '/config/geoip2db/GeoLite2-City.mmdb';
|
$maxmind = '/config/geoip2db/GeoLite2-City.mmdb';
|
||||||
if (file_exists($dbip) and file_exists($maxmind)):
|
if (file_exists($dbip) and file_exists($maxmind)):
|
||||||
@@ -288,12 +289,16 @@
|
|||||||
$geodb = '--geoip-database='.$dbip;
|
$geodb = '--geoip-database='.$dbip;
|
||||||
elseif (file_exists($maxmind)):
|
elseif (file_exists($maxmind)):
|
||||||
$geodb = '--geoip-database='.$maxmind;
|
$geodb = '--geoip-database='.$maxmind;
|
||||||
else:
|
endif;
|
||||||
$geodb = '';
|
|
||||||
|
$asndb = '';
|
||||||
|
$asn = '/config/geoip2db/asn.mmdb';
|
||||||
|
if (file_exists($asn)):
|
||||||
|
$asndb = '--geoip-database='.$asn;
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
$access_log = file_exists("/dashboard/logs") ? "/dashboard/logs/*.log" : "/config/log/nginx/access.log";
|
$access_log = file_exists("/dashboard/logs") ? "/dashboard/logs/*.log" : "/config/log/nginx/access.log";
|
||||||
$goaccess = shell_exec("cat $access_log | /usr/bin/goaccess -a -o html --config-file=/dashboard/goaccess.conf $geodb -");
|
$goaccess = shell_exec("cat $access_log | /usr/bin/goaccess -a -o html --config-file=/dashboard/goaccess.conf $geodb $asndb -");
|
||||||
$goaccess = str_replace("<title>Server Statistics", "<title>SWAG Dashboard", $goaccess);
|
$goaccess = str_replace("<title>Server Statistics", "<title>SWAG Dashboard", $goaccess);
|
||||||
$goaccess = str_replace("<h1 class='h-dashboard'>", "<h1>", $goaccess);
|
$goaccess = str_replace("<h1 class='h-dashboard'>", "<h1>", $goaccess);
|
||||||
$goaccess = str_replace("<i class='fa fa-tachometer'></i>", "<img src='/icon.svg' width='32' height='32'> SWAG ", $goaccess);
|
$goaccess = str_replace("<i class='fa fa-tachometer'></i>", "<img src='/icon.svg' width='32' height='32'> SWAG ", $goaccess);
|
||||||
|
|||||||
Reference in New Issue
Block a user