"""Website en broncode per app: opzoeken, controleren en in het sjabloon zetten. Het infovenster van een app toont een link naar de website en naar de broncode. Die staan in `metadata.links` van elk sjabloon: "links": {"website": "https://…", "source": "https://github.com/…"} Hieronder staat per app een kandidaat. Alleen links die echt antwoorden (HTTP < 400, of 403/429 van een botbeveiliging) komen in het sjabloon; een link die 404 geeft of niet bestaat, blijft weg. Het infovenster valt dan terug op de image-pagina (Docker Hub, GHCR), die het zelf uit het image afleidt. python3 tools/app_links.py # controleren en schrijven python3 tools/app_links.py --droog # alleen controleren Opnieuw draaien kan altijd: bestaande links worden overschreven met wat nu klopt. """ from __future__ import annotations import concurrent.futures import json import re import sys import time import urllib.error import urllib.request from pathlib import Path APPS = Path(__file__).resolve().parent.parent / "apps" GH = "https://github.com/" # app-map: (website, broncode). None = niet bekend. KANDIDATEN: dict[str, tuple[str | None, str | None]] = { "2fauth": ("https://docs.2fauth.app", GH + "Bubka/2FAuth"), "activepieces": ("https://www.activepieces.com", GH + "activepieces/activepieces"), "actual-budget": ("https://actualbudget.org", GH + "actualbudget/actual"), "adguard-home": ("https://adguard.com/adguard-home/overview.html", GH + "AdguardTeam/AdGuardHome"), "adminer": ("https://www.adminer.org", GH + "vrana/adminer"), "alertmanager": ("https://prometheus.io/docs/alerting/latest/alertmanager/", GH + "prometheus/alertmanager"), "alloy": ("https://grafana.com/oss/alloy-opentelemetry-collector/", GH + "grafana/alloy"), "anythingllm": ("https://anythingllm.com", GH + "Mintplex-Labs/anything-llm"), "appdaemon": ("https://appdaemon.readthedocs.io", GH + "AppDaemon/appdaemon"), "apprise": ("https://appriseit.com", GH + "caronc/apprise"), "arr-stack": ("https://wiki.servarr.com", GH + "Sonarr/Sonarr"), "audiobookshelf": ("https://www.audiobookshelf.org", GH + "advplyr/audiobookshelf"), "authelia": ("https://www.authelia.com", GH + "authelia/authelia"), "authentik": ("https://goauthentik.io", GH + "goauthentik/authentik"), "autopulse": (None, GH + "dan-online/autopulse"), "baby-buddy": ("https://docs.baby-buddy.net", GH + "babybuddy/babybuddy"), "backrest": (None, GH + "garethgeorge/backrest"), "baikal": ("https://sabre.io/baikal/", GH + "sabre-io/Baikal"), "bambuddy": (None, GH + "maziggy/bambuddy"), "baserow": ("https://baserow.io", "https://gitlab.com/baserow/baserow"), "bazarr": ("https://www.bazarr.media", GH + "morpheus65535/bazarr"), "beszel": ("https://beszel.dev", GH + "henrygd/beszel"), "bookstack": ("https://www.bookstackapp.com", GH + "BookStackApp/BookStack"), "byparr": (None, GH + "ThePhaseless/Byparr"), "caddy": ("https://caddyserver.com", GH + "caddyserver/caddy"), "cadvisor": (None, GH + "google/cadvisor"), "cal-com": ("https://cal.com", GH + "calcom/cal.com"), "calibre-web": (None, GH + "janeczku/calibre-web"), "changedetection-io": ("https://changedetection.io", GH + "dgtlmoon/changedetection.io"), "chaptarr": ("https://wiki.chaptarr.com", GH + "Chaptarr/chaptarr"), "cleanuparr": ("https://cleanuparr.github.io/Cleanuparr/", GH + "Cleanuparr/Cleanuparr"), "cloudflared": ("https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/", GH + "cloudflare/cloudflared"), "code-server": ("https://coder.com/docs/code-server", GH + "coder/code-server"), "collabora": ("https://www.collaboraonline.com", GH + "CollaboraOnline/online"), "comfyui": ("https://www.comfy.org", GH + "comfyanonymous/ComfyUI"), "configarr": ("https://configarr.raydak.de", GH + "raydak-labs/configarr"), "consul": ("https://www.consul.io", GH + "hashicorp/consul"), "convertx": (None, GH + "C4illin/ConvertX"), "crafty": ("https://craftycontrol.com", "https://gitlab.com/crafty-controller/crafty-4"), "cross-seed": ("https://www.cross-seed.org", GH + "cross-seed/cross-seed"), "crowdsec": ("https://www.crowdsec.net", GH + "crowdsecurity/crowdsec"), "cryptpad": ("https://cryptpad.org", GH + "cryptpad/cryptpad"), "cyberchef": ("https://gchq.github.io/CyberChef/", GH + "gchq/CyberChef"), "dashy": ("https://dashy.to", GH + "Lissy93/dashy"), "dawarich": ("https://dawarich.app", GH + "Freika/dawarich"), "decluttarr": (None, GH + "ManiMatter/decluttarr"), "deluge": ("https://deluge-torrent.org", GH + "deluge-torrent/deluge"), "dockge": ("https://dockge.kuma.pet", GH + "louislam/dockge"), "docmost": ("https://docmost.com", GH + "docmost/docmost"), "docuseal": ("https://www.docuseal.com", GH + "docusealco/docuseal"), "domoticz": ("https://www.domoticz.com", GH + "domoticz/domoticz"), "donetick": ("https://donetick.com", GH + "donetick/donetick"), "double-take": (None, GH + "jakowenko/double-take"), "dozzle": ("https://dozzle.dev", GH + "amir20/dozzle"), "dsmr-reader": ("https://dsmr-reader.readthedocs.io", GH + "dsmrreader/dsmr-reader"), "duplicati": ("https://duplicati.com", GH + "duplicati/duplicati"), "element": ("https://element.io", GH + "element-hq/element-web"), "emby": ("https://emby.media", None), "emqx": ("https://www.emqx.com", GH + "emqx/emqx"), "ersatztv": ("https://ersatztv.org", GH + "ErsatzTV/legacy"), "esphome": ("https://esphome.io", GH + "esphome/esphome"), "espocrm": ("https://www.espocrm.com", GH + "espocrm/espocrm"), "evcc": ("https://evcc.io", GH + "evcc-io/evcc"), "excalidraw": ("https://excalidraw.com", GH + "excalidraw/excalidraw"), "exportarr": (None, GH + "onedr0p/exportarr"), "filebrowser": ("https://filebrowserquantum.com", GH + "gtsteffaniak/filebrowser"), "filestash": ("https://www.filestash.app", GH + "mickael-kerjean/filestash"), "firefly-iii": ("https://www.firefly-iii.org", GH + "firefly-iii/firefly-iii"), "fittrackee": ("https://docs.fittrackee.org", GH + "SamR1/FitTrackee"), "flaresolverr": (None, GH + "FlareSolverr/FlareSolverr"), "flowise": ("https://flowiseai.com", GH + "FlowiseAI/Flowise"), "fluidd": ("https://docs.fluidd.xyz", GH + "fluidd-core/fluidd"), "focalboard": ("https://www.focalboard.com", GH + "mattermost-community/focalboard"), "forgejo-mcp": (None, GH + "ronmi/forgejo-mcp"), "forgejo": ("https://forgejo.org", "https://codeberg.org/forgejo/forgejo"), "formbricks": ("https://formbricks.com", GH + "formbricks/formbricks"), "freescout": ("https://freescout.net", GH + "freescout-help-desk/freescout"), "freshrss": ("https://freshrss.org", GH + "FreshRSS/FreshRSS"), "frigate": ("https://frigate.video", GH + "blakeblackshear/frigate"), "gameyfin": ("https://gameyfin.org", GH + "gameyfin/gameyfin"), "gatus": ("https://gatus.io", GH + "TwiN/gatus"), "ghost": ("https://ghost.org", GH + "TryGhost/Ghost"), "ghostfolio": ("https://ghostfol.io", GH + "ghostfolio/ghostfolio"), "gitea": ("https://about.gitea.com", GH + "go-gitea/gitea"), "glance": (None, GH + "glanceapp/glance"), "gluetun": (None, GH + "qdm12/gluetun"), "go2rtc": (None, GH + "AlexxIT/go2rtc"), "gotify": ("https://gotify.net", GH + "gotify/server"), "grafana": ("https://grafana.com/oss/grafana/", GH + "grafana/grafana"), "graylog": ("https://graylog.org", GH + "Graylog2/graylog2-server"), "grimmory": (None, GH + "grimmory-tools/grimmory"), "grocy": ("https://grocy.info", GH + "grocy/grocy"), "guacamole": ("https://guacamole.apache.org", GH + "apache/guacamole-server"), "headscale": ("https://headscale.net", GH + "juanfont/headscale"), "healthchecks": ("https://healthchecks.io", GH + "healthchecks/healthchecks"), "hedgedoc": ("https://hedgedoc.org", GH + "hedgedoc/hedgedoc"), "homarr": ("https://homarr.dev", GH + "homarr-labs/homarr"), "home-assistant": ("https://www.home-assistant.io", GH + "home-assistant/core"), "homeassistant-mcp": (None, GH + "tevonsb/homeassistant-mcp"), "homebox": ("https://homebox.software", GH + "sysadminsmedia/homebox"), "homebridge": ("https://homebridge.io", GH + "homebridge/homebridge"), "homepage": ("https://gethomepage.dev", GH + "gethomepage/homepage"), "immich": ("https://immich.app", GH + "immich-app/immich"), "infisical": ("https://infisical.com", GH + "Infisical/infisical"), "influxdb": ("https://www.influxdata.com", GH + "influxdata/influxdb"), "invidious": ("https://invidious.io", GH + "iv-org/invidious"), "invoiceninja": ("https://invoiceninja.com", GH + "invoiceninja/invoiceninja"), "it-tools": ("https://it-tools.tech", GH + "CorentinTh/it-tools"), "jackett": (None, GH + "Jackett/Jackett"), "janitorr": (None, GH + "Schaka/janitorr"), "jellyfin": ("https://jellyfin.org", GH + "jellyfin/jellyfin"), "jellystat": (None, GH + "CyferShepard/Jellystat"), "jitsi": ("https://jitsi.org", GH + "jitsi/docker-jitsi-meet"), "kanboard": ("https://kanboard.org", GH + "kanboard/kanboard"), "kapowarr": ("https://casvt.github.io/Kapowarr/", GH + "Casvt/Kapowarr"), "karakeep": ("https://karakeep.app", GH + "karakeep-app/karakeep"), "kavita": ("https://www.kavitareader.com", GH + "Kareadita/Kavita"), "keycloak": ("https://www.keycloak.org", GH + "keycloak/keycloak"), "kimai": ("https://www.kimai.org", GH + "kimai/kimai"), "kiwix": ("https://kiwix.org", GH + "kiwix/kiwix-tools"), "kometa": ("https://kometa.wiki", GH + "Kometa-Team/Kometa"), "komga": ("https://komga.org", GH + "gotson/komga"), "kopia": ("https://kopia.io", GH + "kopia/kopia"), "languagetool": ("https://languagetool.org", GH + "languagetool-org/languagetool"), "leantime": ("https://leantime.io", GH + "Leantime/leantime"), "lemmy": ("https://join-lemmy.org", GH + "LemmyNet/lemmy"), "librechat": ("https://www.librechat.ai", GH + "danny-avila/LibreChat"), "librespeed": ("https://librespeed.org", GH + "librespeed/speedtest"), "libretranslate": ("https://libretranslate.com", GH + "LibreTranslate/LibreTranslate"), "lidarr": ("https://lidarr.audio", GH + "Lidarr/Lidarr"), "lingarr": ("https://lingarr.com", GH + "lingarr-translate/lingarr"), "linkding": ("https://linkding.link", GH + "sissbruecker/linkding"), "linkwarden": ("https://linkwarden.app", GH + "linkwarden/linkwarden"), "listmonk": ("https://listmonk.app", GH + "knadh/listmonk"), "litellm": ("https://www.litellm.ai", GH + "BerriAI/litellm"), "lldap": (None, GH + "lldap/lldap"), "localai": ("https://localai.io", GH + "mudler/LocalAI"), "loki": ("https://grafana.com/oss/loki/", GH + "grafana/loki"), "lychee": ("https://lycheeorg.dev", GH + "LycheeOrg/Lychee"), "mailpit": ("https://mailpit.axllent.org", GH + "axllent/mailpit"), "mainsail": ("https://docs.mainsail.xyz", GH + "mainsail-crew/mainsail"), "maintainerr": ("https://maintainerr.info", GH + "Maintainerr/Maintainerr"), "manyfold": ("https://manyfold.app", GH + "manyfold3d/manyfold"), "mastodon": ("https://joinmastodon.org", GH + "mastodon/mastodon"), "matomo": ("https://matomo.org", GH + "matomo-org/matomo"), "matter-hub": (None, GH + "RiDDiX/home-assistant-matter-hub"), "matter-server": (None, GH + "matter-js/matterjs-server"), "mattermost": ("https://mattermost.com", GH + "mattermost/mattermost"), "mealie": ("https://mealie.io", GH + "mealie-recipes/mealie"), "memos": ("https://usememos.com", GH + "usememos/memos"), "meshcentral": ("https://meshcentral.com", GH + "Ylianst/MeshCentral"), "metabase": ("https://www.metabase.com", GH + "metabase/metabase"), "metube": (None, GH + "alexta69/metube"), "minecraft": ("https://docker-minecraft-server.readthedocs.io", GH + "itzg/docker-minecraft-server"), "miniflux": ("https://miniflux.app", GH + "miniflux/v2"), "minio": ("https://pigsty.io/docs/minio/", GH + "pgsty/minio"), "mkdocs-material": ("https://squidfunk.github.io/mkdocs-material/", GH + "squidfunk/mkdocs-material"), "mosquitto": ("https://mosquitto.org", GH + "eclipse-mosquitto/mosquitto"), "mumble": ("https://www.mumble.info", GH + "mumble-voip/mumble"), "music-assistant": ("https://www.music-assistant.io", GH + "music-assistant/server"), "mylar3": (None, GH + "mylar3/mylar3"), "n8n": ("https://n8n.io", GH + "n8n-io/n8n"), "navidrome": ("https://www.navidrome.org", GH + "navidrome/navidrome"), "netalertx": ("https://netalertx.com", GH + "jokob-sk/NetAlertX"), "netbird": ("https://netbird.io", GH + "netbirdio/netbird"), "netbox": ("https://netboxlabs.com/oss/netbox/", GH + "netbox-community/netbox"), "netdata": ("https://www.netdata.cloud", GH + "netdata/netdata"), "neutarr": (None, GH + "I-am-PUID-0/NeutArr"), "newt": ("https://docs.pangolin.net", GH + "fosrl/newt"), "nextcloud-aio": ("https://nextcloud.com", GH + "nextcloud/all-in-one"), "nextcloud-managed": ("https://nextcloud.com", GH + "nextcloud/server"), "nginx-proxy-manager": ("https://nginxproxymanager.com", GH + "NginxProxyManager/nginx-proxy-manager"), "nocodb": ("https://nocodb.com", GH + "nocodb/nocodb"), "node-exporter": ("https://prometheus.io/docs/guides/node-exporter/", GH + "prometheus/node_exporter"), "node-red": ("https://nodered.org", GH + "node-red/node-red"), "nomad-server": ("https://www.nomadproject.io", GH + "hashicorp/nomad"), "notifiarr": ("https://notifiarr.com", GH + "Notifiarr/notifiarr"), "ntfy": ("https://ntfy.sh", GH + "binwiederhier/ntfy"), "nzbget": ("https://nzbget.com", GH + "nzbgetcom/nzbget"), "nzbhydra2": (None, GH + "theotherp/nzbhydra2"), "octoprint": ("https://octoprint.org", GH + "OctoPrint/OctoPrint"), "odoo": ("https://www.odoo.com", GH + "odoo/odoo"), "ollama": ("https://ollama.com", GH + "ollama/ollama"), "omada": ("https://www.omadanetworks.com", GH + "mbentley/docker-omada-controller"), "onlyoffice": ("https://www.onlyoffice.com", GH + "ONLYOFFICE/DocumentServer"), "open-webui": ("https://openwebui.com", GH + "open-webui/open-webui"), "openbao": ("https://openbao.org", GH + "openbao/openbao"), "opencloud": ("https://opencloud.eu", GH + "opencloud-eu/opencloud"), "opengist": ("https://opengist.io", GH + "thomiceli/opengist"), "openhab": ("https://www.openhab.org", GH + "openhab/openhab-core"), "openobserve": ("https://openobserve.ai", GH + "openobserve/openobserve"), "openwakeword": (None, GH + "rhasspy/wyoming-openwakeword"), "outline": ("https://www.getoutline.com", GH + "outline/outline"), # Installeert sinds de samenvoeging Seerr; zie tools/arr_sjablonen.py. "owncast": ("https://owncast.online", GH + "owncast/owncast"), "owntracks": ("https://owntracks.org", GH + "owntracks/recorder"), "pairdrop": ("https://pairdrop.net", GH + "schlagmichdoch/PairDrop"), "pangolin": ("https://pangolin.net", GH + "fosrl/pangolin"), "paperless-ngx": ("https://docs.paperless-ngx.com", GH + "paperless-ngx/paperless-ngx"), "passbolt": ("https://www.passbolt.com", GH + "passbolt/passbolt_api"), "peertube": ("https://joinpeertube.org", GH + "Chocobozzz/PeerTube"), "pelican": ("https://pelican.dev", GH + "pelican-dev/panel"), "penpot": ("https://penpot.app", GH + "penpot/penpot"), "pgadmin": ("https://www.pgadmin.org", GH + "pgadmin-org/pgadmin4"), "photoprism": ("https://www.photoprism.app", GH + "photoprism/photoprism"), "pihole": ("https://pi-hole.net", GH + "pi-hole/pi-hole"), "pinchflat": (None, GH + "kieraneglin/pinchflat"), "pinepods": ("https://www.pinepods.online", GH + "madeofpendletonwool/PinePods"), "pingvin-share": (None, GH + "smp46/pingvin-share-x"), "piper": (None, GH + "rhasspy/wyoming-piper"), "piwigo": ("https://piwigo.org", GH + "Piwigo/Piwigo"), "pixelfed": ("https://pixelfed.org", GH + "pixelfed/pixelfed"), "planka": ("https://planka.app", GH + "plankanban/planka"), "plausible": ("https://plausible.io", GH + "plausible/analytics"), "plex": ("https://www.plex.tv", None), "pocket-id": ("https://pocket-id.org", GH + "pocket-id/pocket-id"), "portainer": ("https://www.portainer.io", GH + "portainer/portainer"), "posterizarr": (None, GH + "fscorrupt/Posterizarr"), "prefetcharr": (None, GH + "p-hueber/prefetcharr"), "privatebin": ("https://privatebin.info", GH + "PrivateBin/PrivateBin"), "profilarr": ("https://dictionarry.dev", GH + "Dictionarry-Hub/profilarr"), "prometheus": ("https://prometheus.io", GH + "prometheus/prometheus"), "protonmail-bridge": ("https://proton.me/mail/bridge", GH + "dancwilliams/protonmail-bridge-docker"), "prowlarr": ("https://prowlarr.com", GH + "Prowlarr/Prowlarr"), "pulsarr": ("https://jamcalli.github.io/Pulsarr/", GH + "jamcalli/Pulsarr"), "qbittorrent": ("https://www.qbittorrent.org", GH + "qbittorrent/qBittorrent"), "radarr": ("https://radarr.video", GH + "Radarr/Radarr"), "radicale": ("https://radicale.org", GH + "Kozea/Radicale"), "rallly": ("https://rallly.co", GH + "lukevella/rallly"), "readeck": ("https://readeck.org", "https://codeberg.org/readeck/readeck"), "recyclarr": ("https://recyclarr.dev", GH + "recyclarr/recyclarr"), "registry": ("https://distribution.github.io/distribution/", GH + "distribution/distribution"), "requestrr": (None, GH + "thomst08/requestrr"), "romm": ("https://romm.app", GH + "rommapp/romm"), "roundcube": ("https://roundcube.net", GH + "roundcube/roundcubemail"), "rsshub": ("https://docs.rsshub.app", GH + "DIYgod/RSSHub"), "rtl433": (None, GH + "merbanan/rtl_433"), "rustdesk-server": ("https://rustdesk.com", GH + "rustdesk/rustdesk-server"), "sabnzbd": ("https://sabnzbd.org", GH + "sabnzbd/sabnzbd"), "scrutiny": (None, GH + "AnalogJ/scrutiny"), "scrypted": ("https://www.scrypted.app", GH + "koush/scrypted"), "seafile": ("https://www.seafile.com", GH + "haiwen/seafile"), "searxng": ("https://docs.searxng.org", GH + "searxng/searxng"), "seerr": ("https://docs.seerr.dev", GH + "seerr-team/seerr"), "semaphore": ("https://semaphoreui.com", GH + "semaphoreui/semaphore"), "shlink": ("https://shlink.io", GH + "shlinkio/shlink"), "silverbullet": ("https://silverbullet.md", GH + "silverbulletmd/silverbullet"), "slash": (None, GH + "yourselfhosted/slash"), "slskd": (None, GH + "slskd/slskd"), "snapserver": (None, GH + "badaix/snapcast"), "snipe-it": ("https://snipeitapp.com", GH + "grokability/snipe-it"), "sonarr": ("https://sonarr.tv", GH + "Sonarr/Sonarr"), "soularr": (None, GH + "mrusse/soularr"), "speaches": ("https://speaches.ai", GH + "speaches-ai/speaches"), "speedtest-tracker": ("https://docs.speedtest-tracker.dev", GH + "alexjustesen/speedtest-tracker"), "spoolman": (None, GH + "Donkie/Spoolman"), "stalwart": ("https://stalw.art", GH + "stalwartlabs/stalwart"), "stirling-pdf": ("https://www.stirlingpdf.com", GH + "Stirling-Tools/Stirling-PDF"), "suggestarr": (None, GH + "giuseppe99barchetta/SuggestArr"), "sure": ("https://sure.am", GH + "we-promise/sure"), "synapse": ("https://element-hq.github.io/synapse/", GH + "element-hq/synapse"), "syncthing": ("https://syncthing.net", GH + "syncthing/syncthing"), "tailscale": ("https://tailscale.com", GH + "tailscale/tailscale"), "tandoor": ("https://tandoor.dev", GH + "TandoorRecipes/recipes"), "tautulli": ("https://tautulli.com", GH + "Tautulli/Tautulli"), "tdarr": ("https://tdarr.io", GH + "HaveAGitGat/Tdarr"), "technitium-dns": ("https://technitium.com/dns/", GH + "TechnitiumSoftware/DnsServer"), "teslamate": ("https://docs.teslamate.org", GH + "teslamate-org/teslamate"), "traccar": ("https://www.traccar.org", GH + "traccar/traccar"), "traefik": ("https://traefik.io/traefik/", GH + "traefik/traefik"), "trailarr": (None, GH + "nandyalu/trailarr"), "transmission": ("https://transmissionbt.com", GH + "transmission/transmission"), "trilium": ("https://triliumnotes.org", GH + "TriliumNext/Trilium"), "trivy": ("https://trivy.dev", GH + "aquasecurity/trivy"), "tubearchivist": ("https://www.tubearchivist.com", GH + "tubearchivist/tubearchivist"), "umami": ("https://umami.is", GH + "umami-software/umami"), "unbound": ("https://nlnetlabs.nl/projects/unbound/about/", GH + "NLnetLabs/unbound"), "unifi-network": ("https://ui.com", GH + "linuxserver/docker-unifi-network-application"), "unpackerr": (None, GH + "Unpackerr/unpackerr"), "uptime-kuma": ("https://uptime.kuma.pet", GH + "louislam/uptime-kuma"), "vaultwarden": (None, GH + "dani-garcia/vaultwarden"), "verdaccio": ("https://verdaccio.org", GH + "verdaccio/verdaccio"), "victoriametrics": ("https://victoriametrics.com", GH + "VictoriaMetrics/VictoriaMetrics"), "vikunja": ("https://vikunja.io", GH + "go-vikunja/vikunja"), "wallabag": ("https://wallabag.org", GH + "wallabag/wallabag"), "wallos": ("https://wallosapp.com", GH + "ellite/Wallos"), "watchtower": ("https://watchtower.nickfedor.com", GH + "nicholas-fedor/watchtower"), "wekan": ("https://wekan.fi", GH + "wekan/wekan"), "wg-easy": ("https://wg-easy.github.io/wg-easy/", GH + "wg-easy/wg-easy"), "wger": ("https://wger.de", GH + "wger-project/wger"), "whisparr": ("https://wiki.servarr.com/whisparr", GH + "Whisparr/Whisparr"), "whisper": (None, GH + "rhasspy/wyoming-faster-whisper"), "wikijs": ("https://js.wiki", GH + "requarks/wiki"), "windmill": ("https://www.windmill.dev", GH + "windmill-labs/windmill"), "wireguard": ("https://www.wireguard.com", GH + "linuxserver/docker-wireguard"), "wizarr": ("https://docs.wizarr.dev", GH + "wizarrrr/wizarr"), "woodpecker": ("https://woodpecker-ci.org", GH + "woodpecker-ci/woodpecker"), "zabbix": ("https://www.zabbix.com", GH + "zabbix/zabbix"), "zigbee2mqtt": ("https://www.zigbee2mqtt.io", GH + "Koenkk/zigbee2mqtt"), "zoraxy": ("https://zoraxy.aroz.org", GH + "tobychui/zoraxy"), "zwave-js-ui": ("https://zwave-js.github.io/zwave-js-ui/", GH + "zwave-js/zwave-js-ui"), } _UA = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0 Safari/537.36" def _status(url: str) -> int: """HTTP-status van een link; 0 als er niets antwoordt.""" for methode in ("HEAD", "GET"): req = urllib.request.Request(url, method=methode, headers={"User-Agent": _UA}) try: with urllib.request.urlopen(req, timeout=20) as r: return r.status except urllib.error.HTTPError as e: if e.code in (405, 501) and methode == "HEAD": continue # sommige sites kennen geen HEAD if e.code == 429: time.sleep(5) continue return e.code except Exception: # noqa: BLE001 — DNS, TLS, timeout if methode == "HEAD": continue return 0 return 0 def _geldig(code: int) -> bool: # 403 en 429 zijn bot- of snelheidsbeveiliging: de pagina bestaat. return 200 <= code < 400 or code in (403, 429) def _schrijf(app: str, links: dict) -> bool: """Zet `links` in metadata, tekstueel na `categories`, zodat de rest van het bestand byte voor byte gelijk blijft.""" f = APPS / app / "template.json" tekst = f.read_text(encoding="utf-8") doc = json.loads(tekst) if doc.get("metadata", {}).get("links") == links: return False tekst = re.sub(r',\n "links": \{[^}]*\}', "", tekst, count=1) m = re.search(r'\n "categories": \[[^\]]*\]', tekst) if not m: raise SystemExit(f"{app}: geen categories in metadata") inhoud = ", ".join(f'"{k}": {json.dumps(v)}' for k, v in links.items()) tekst = tekst[:m.end()] + ',\n "links": {' + inhoud + '}' + tekst[m.end():] assert json.loads(tekst)["metadata"]["links"] == links f.write_text(tekst, encoding="utf-8") return True def main(argv: list[str]) -> int: droog = "--droog" in argv apps = sorted(p.name for p in APPS.iterdir() if (p / "template.json").exists()) zonder = [a for a in apps if a not in KANDIDATEN] if zonder: print("Geen kandidaat voor:", ", ".join(zonder)) urls = sorted({u for a in apps for u in KANDIDATEN.get(a, (None, None)) if u}) with concurrent.futures.ThreadPoolExecutor(max_workers=8) as pool: codes = dict(zip(urls, pool.map(_status, urls))) afgekeurd = {u: c for u, c in codes.items() if not _geldig(c)} for u, c in sorted(afgekeurd.items()): print(f" afgekeurd ({c}): {u}") geschreven = 0 for a in apps: website, bron = KANDIDATEN.get(a, (None, None)) links = {k: u for k, u in (("website", website), ("source", bron)) if u and _geldig(codes.get(u, 0))} if links and not droog and _schrijf(a, links): geschreven += 1 print(f"{len(urls)} links gecontroleerd, {len(afgekeurd)} afgekeurd, " f"{geschreven} sjablonen bijgewerkt{' (droog)' if droog else ''}.") return 0 if __name__ == "__main__": raise SystemExit(main(sys.argv[1:]))