mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-19 09:53:02 -04:00
Merge pull request #288 from quietsy/swag-dashboard
This commit is contained in:
@@ -13,6 +13,7 @@ If adding multiple mods, enter them in an array separated by |, such as DOCKER_M
|
|||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
Navigate to `dashboard.domain.com` from your LAN to view the dashboard
|
Navigate to `dashboard.domain.com` from your LAN to view the dashboard
|
||||||
|
|
||||||
Note: The application discovery works best when the container names match the `proxy-conf` files
|
Note: The application discovery works best when the container names match the `proxy-conf` files
|
||||||
|
|
||||||
# Example
|
# Example
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ def find_apps():
|
|||||||
continue
|
continue
|
||||||
file = open(file_path, "r")
|
file = open(file_path, "r")
|
||||||
content = file.read()
|
content = file.read()
|
||||||
results = re.finditer(r"(\s+)set \$upstream_app (?P<name>\S+?);(\s+)set \$upstream_port (?P<port>\d+);\n(\s+)set \$upstream_proto (?P<proto>\w+);", content)
|
results = re.finditer(r"(\s+)set \$upstream_app (?P<name>\S+?);.*\n(\s+)set \$upstream_port (?P<port>\d+);.*\n(\s+)set \$upstream_proto (?P<proto>\w+);.*", content)
|
||||||
for result in results:
|
for result in results:
|
||||||
params = result.groupdict()
|
params = result.groupdict()
|
||||||
app = f"{params['proto']}://{params['name']}:{params['port']}"
|
app = f"{params['proto']}://{params['name']}:{params['port']}"
|
||||||
@@ -46,4 +46,4 @@ with concurrent.futures.ThreadPoolExecutor(max_workers=100) as executor:
|
|||||||
discovered_apps[app]["status"] = future.result()
|
discovered_apps[app]["status"] = future.result()
|
||||||
discovered_apps[app]["locations"] = list(apps[app])
|
discovered_apps[app]["locations"] = list(apps[app])
|
||||||
|
|
||||||
print(json.dumps(discovered_apps, sort_keys=True))
|
print(json.dumps(discovered_apps, sort_keys=True))
|
||||||
|
|||||||
@@ -81,7 +81,8 @@
|
|||||||
<div class="wrap-general">
|
<div class="wrap-general">
|
||||||
HTML;
|
HTML;
|
||||||
}
|
}
|
||||||
$access = shell_exec("cat /config/log/nginx/access.log | goaccess -a -o html --html-prefs='{\"theme\":\"darkGray\"}' --log-format COMBINED --geoip-database=/config/geoip2db/GeoLite2-City.mmdb -");
|
$geodb = file_exists('/config/geoip2db/GeoLite2-City.mmdb') ? '--geoip-database=/config/geoip2db/GeoLite2-City.mmdb' : '';
|
||||||
|
$access = shell_exec("cat /config/log/nginx/access.log | goaccess -a -o html --html-prefs='{\"theme\":\"darkGray\"}' --log-format COMBINED ".$geodb." -");
|
||||||
$status = GetStatus();
|
$status = GetStatus();
|
||||||
echo str_replace("<div class='wrap-general'>", $status, $access);
|
echo str_replace("<div class='wrap-general'>", $status, $access);
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -8,4 +8,9 @@ if [ ! -f /config/nginx/proxy-confs/dashboard.subdomain.conf ]; then
|
|||||||
cp /dashboard/dashboard.subdomain.conf.sample /config/nginx/proxy-confs/dashboard.subdomain.conf
|
cp /dashboard/dashboard.subdomain.conf.sample /config/nginx/proxy-confs/dashboard.subdomain.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# permissions
|
||||||
|
chown -R abc:abc \
|
||||||
|
/dashboard \
|
||||||
|
/config/nginx/proxy-confs/dashboard.subdomain.conf
|
||||||
|
|
||||||
echo "Applied the SWAG dashboard mod"
|
echo "Applied the SWAG dashboard mod"
|
||||||
|
|||||||
Reference in New Issue
Block a user