🔒 Repository is read-only – file editing is disabled.
123456789101112131415161718192021222324252627282930313233343536373839
import re
from app import app
def show(tag, path, host, c=None, need=()):
cc = c or app.test_client()
r = cc.get(path, headers={"Host": host})
h = r.data.decode("utf-8", "replace")
miss = [m for m in need if m not in h]
print(r.status_code, tag.ljust(11), path, "| BRAK:" + (",".join(miss) if miss else "-"))
admin = app.test_client()
with admin.session_transaction() as s:
s["username"] = "admin"
s["is_admin"] = True
s["csrf_token"] = "X"
show("main", "/", "paganlinux.eu", need=['class="flg"', "nav-admin"])
show("about", "/about?lang=pl", "paganlinux.eu", need=['flg" data-lang="pl"'])
show("docs", "/", "docs.paganlinux.eu", need=['flg" data-lang=', "PL"])
show("doc", "/docs/getting-started?lang=pl", "docs.paganlinux.eu", need=['flg" data-lang='])
show("git", "/", "git.paganlinux.eu")
show("repo", "/", "repo.paganlinux.eu")
show("admin", "/admin", "paganlinux.eu", c=admin, need=["<svg"])
show("build", "/build/", "build.paganlinux.eu", c=admin)
# szczegoly: ikona zębatki w nav-admin i linku settings
h = app.test_client().get("/", headers={"Host": "paganlinux.eu"}).data.decode()
print("gear w base (nav-admin):", '<a href="/admin" class="nav-admin"' in h and "<svg" in h[h.find("nav-admin"):h.find("nav-admin")+400])
c2 = app.test_client()
r = c2.get("/", headers={"Host": "git.paganlinux.eu"})
h2 = r.data.decode()
print("git index:", r.status_code, "| settings svg:", "settings" in h2 and "<svg" in h2)
# sprawdz statystyki builda (te wartosci z panelu)
r = admin.get("/build/api/stats", headers={"Host": "build.paganlinux.eu"})
import json
d = json.loads(r.data)
print("stats:", {k: d[k] for k in ("total", "ok", "fail", "ok_rate", "last24h", "last7d", "last30d")})
print("avg_ok_secs:", d.get("avg_ok_secs"), "| longest[0]:", (d.get("longest") or [None])[0] and (d.get("longest") or [{}])[0].get("name"))
print("top_fail[:1]:", (d.get("top_fail") or [None])[0])