2023-08-13 16:05:20 +02:00
|
|
|
#! /bin/python3
|
2023-09-02 14:06:39 +02:00
|
|
|
import json,env
|
2023-08-13 16:05:20 +02:00
|
|
|
from uptime_kuma_api import UptimeKumaApi, MonitorType
|
|
|
|
|
|
|
|
descriptions = {
|
|
|
|
"Jellyfin":"Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media.",
|
|
|
|
"Element Web":"A secure communications platform built around the Matrix protocol.",
|
|
|
|
"Uptime Kuma":"Uptime Kuma is an easy-to-use self-hosted monitoring tool.",
|
|
|
|
"Jellyseerr":"Jellyseerr is a free and open source software application for managing requests for your media library.",
|
|
|
|
"Pixelfed":"Pixelfed is a free and open-source image sharing social network service.",
|
|
|
|
"EteSync":"Secure, end-to-end encrypted, and privacy respecting sync for your contacts, calendars, tasks and notes.",
|
|
|
|
"Gitea":"Gitea is a lightweight DevOps platform. It brings teams and developers high-efficiency but easy operations from planning to production.",
|
2023-08-27 12:32:51 +02:00
|
|
|
"IPFS Gateway":"A peer-to-peer hypermedia protocol designed to preserve and grow humanity's knowledge.",
|
2023-08-27 12:35:04 +02:00
|
|
|
"Calibre Web":"Calibre-Web is a web app that offers a clean and intuitive interface for browsing, reading, and downloading eBooks."}
|
2023-08-13 16:05:20 +02:00
|
|
|
|
|
|
|
exclude=('Synapse','Mailserver')
|
|
|
|
HTMLTEMPLATE='<a class="item" href="{link}"><div id="{item}" class="item"><h2 class="item">{item}</h2><p class="desc">{desc}</p></div></a>'
|
|
|
|
htmllist=[]
|
2023-09-02 14:06:39 +02:00
|
|
|
htmllist.append(HTMLTEMPLATE.format(link=UPTIME_KUMA_URL,item="Uptime Kuma",desc=descriptions["Uptime Kuma"]))
|
2023-08-13 16:05:20 +02:00
|
|
|
|
2023-09-02 14:06:39 +02:00
|
|
|
with UptimeKumaApi(UPTIME_KUMA_URL) as api:
|
|
|
|
api.login(UPTIME_KUMA_ADMIN_USER,UPTIME_KUMA_ADMIN_PASSWORD)
|
2023-08-13 16:05:20 +02:00
|
|
|
for item in api.get_monitors():
|
|
|
|
if item["name"] in exclude or item["type"] == MonitorType.GROUP:
|
|
|
|
continue
|
|
|
|
print(item["name"])
|
|
|
|
# save every formatted entry in a list
|
|
|
|
try:
|
|
|
|
htmllist.append(HTMLTEMPLATE.format(link=item["url"],item=item["name"],desc=descriptions[item["name"]]))
|
|
|
|
except Exception:
|
|
|
|
htmllist.append(HTMLTEMPLATE.format(link=item["url"],item=item["name"],desc=""))
|
|
|
|
|
|
|
|
|
2023-09-02 14:06:39 +02:00
|
|
|
with open(UPTIME_KUMA_OUT,"w") as htmlfile:
|
2023-08-13 16:05:20 +02:00
|
|
|
htmlfile.write("\n".join(htmllist))
|