1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-05 15:57:23 +01:00

show the Mail-in-a-Box version in the control panel and a button to ping the MiaB website for the latest version

fixes #441
This commit is contained in:
Joshua Tauberer
2015-06-25 13:42:22 +00:00
parent 1367816b04
commit 7527b4dc27
5 changed files with 42 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ for fn in glob.glob("/var/log/nginx/access.log*"):
with f:
for line in f:
# Find lines that are GETs on /bootstrap.sh by either curl or wget.
# (Note that we purposely skip ...?ping=1 requests which is the admin panel querying us for updates.)
m = re.match(rb"(?P<ip>\S+) - - \[(?P<date>.*?)\] \"GET /bootstrap.sh HTTP/.*\" 200 \d+ .* \"(?:curl|wget)", line, re.I)
if m:
date, time = m.group("date").decode("ascii").split(":", 1)