Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ This repository contains a static single-page application used as a front page f
- **autobrr**
- **OpenSpeedTest**
- **Muse** (Discord music bot)
- **AutoMorph**

The page is intentionally framework-free: plain HTML, CSS, and vanilla JavaScript.
That keeps it fast, portable, and easy to host on GitHub Pages or any static
Expand Down Expand Up @@ -78,6 +79,7 @@ server.
├── js/
│ └── app.js # UI logic, i18n, status polling
└── ops/
├── automorph-status/ # Caddy health-check snippet
└── muse-status/ # Host probe, systemd/Caddy templates, and tests
```

Expand All @@ -100,14 +102,25 @@ Service endpoints are defined in `js/app.js`:
- `https://autobrr.adiker.eu/api/healthz/liveness`
- `https://speedtest.adiker.eu/health`
- `https://muse.adiker.eu/health`
- `https://automorph.adiker.eu/health`

Service responses, including errors, advertise `Alt-Svc: h3=":8443"; ma=2592000`
The five existing service domains, including their error responses, advertise `Alt-Svc: h3=":8443"; ma=2592000`
for HTTP/3.
If that path becomes unavailable, use `Alt-Svc: clear` on all five service
domains, including error responses, and verify HTTPS over TCP. A browser that
cached the old alternative but cannot connect to receive an updated header may
need its network/alternative-service cache cleared or a fresh browser profile.

The AutoMorph health endpoint probes the local `/index-v2.json` and returns
only `200 {"status":"online"}` or `503 {"status":"offline"}`. It checks index
availability, not patching or scheduling. The panel remains behind Basic Auth;
the existing public index and APK paths remain available. Install the snippet as
`/etc/caddy/snippets/automorph-health.caddy` and import that absolute path inside
the AutoMorph site block before its other handlers. Validate the full Caddy
configuration and reload Caddy.
The snippet has its own error handler; merge it with an existing site error
handler if one is added later.

The Muse endpoint returns `200 {"status":"online"}` only when the local
container is running, has logged `Ready!` after its current start, and has an
established TCP connection to `gateway.discord.gg`. Otherwise it returns
Expand Down Expand Up @@ -219,6 +232,7 @@ główna dla:
- **autobrr**
- **OpenSpeedTest**
- **Muse** (bot muzyczny Discorda)
- **AutoMorph**

Strona celowo nie używa frameworków: to czysty HTML, CSS i vanilla JavaScript.
Dzięki temu pozostaje szybka, przenośna i łatwa w hostowaniu na GitHub Pages
Expand Down Expand Up @@ -258,6 +272,7 @@ albo dowolnym serwerze statycznym.
├── js/
│ └── app.js # Logika UI, i18n, odpytywanie statusów
└── ops/
├── automorph-status/ # Fragment Caddy dla statusu
└── muse-status/ # Sonda hosta, szablony systemd/Caddy i testy
```

Expand All @@ -280,14 +295,25 @@ Endpointy usług są zdefiniowane w `js/app.js`:
- `https://autobrr.adiker.eu/api/healthz/liveness`
- `https://speedtest.adiker.eu/health`
- `https://muse.adiker.eu/health`
- `https://automorph.adiker.eu/health`

Odpowiedzi usług, także błędy, ogłaszają dla HTTP/3
Odpowiedzi pięciu wcześniejszych usług, także błędy, ogłaszają dla HTTP/3
`Alt-Svc: h3=":8443"; ma=2592000`. Jeśli ta ścieżka przestanie działać, ustaw
`Alt-Svc: clear` dla wszystkich pięciu domen usług, również w odpowiedziach
błędów, i sprawdź HTTPS przez TCP. Jeśli przeglądarka zapamiętała poprzedni
adres i nie może połączyć się z usługą, aby odebrać nowy nagłówek, wyczyść jej
pamięć sieciową/alternatywnych usług albo użyj nowego profilu przeglądarki.

Endpoint AutoMorph sprawdza lokalny `/index-v2.json` i zwraca wyłącznie
`200 {"status":"online"}` albo `503 {"status":"offline"}`. Sprawdza dostępność
indeksu, a nie działanie patchowania lub harmonogramu. Panel nadal jest chroniony
Basic Auth; istniejące publiczne ścieżki indeksu i APK pozostają dostępne.
Zainstaluj fragment jako `/etc/caddy/snippets/automorph-health.caddy` i zaimportuj
tę ścieżkę wewnątrz bloku AutoMorph przed pozostałymi handlerami. Sprawdź całą
konfigurację i przeładuj Caddy.
Fragment zawiera obsługę błędów; jeśli później powstanie inna obsługa błędów
tej strony, połącz je.

Endpoint Muse zwraca `200 {"status":"online"}` tylko wtedy, gdy lokalny
kontener działa, po bieżącym uruchomieniu zalogował `Ready!` i ma aktywne
połączenie TCP z `gateway.discord.gg`. W przeciwnym razie zwraca
Expand Down
42 changes: 41 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ <h1 id="title">adiker.eu</h1>
<button aria-controls="section-muse" aria-selected="false" class="tab" id="tab-muse" role="tab"
type="button"><span class="tab-label-full">Muse</span><span aria-hidden="true"
class="tab-label-compact">Muse</span></button>
<button aria-controls="section-am" aria-selected="false" class="tab" id="tab-automorph" role="tab"
type="button"><span class="tab-label-full">AutoMorph</span><span aria-hidden="true"
class="tab-label-compact">AutoMorph</span></button>
</nav>
<div class="client-info" id="client-info" role="group" aria-labelledby="client-title">
<div class="client-heading">
Expand All @@ -79,7 +82,7 @@ <h2 id="dash-title">Service status</h2>
<p class="tag" id="dash-sub">Live measurements from this browser</p>
</div>
<div class="dashboard-grid">
<span class="pill" id="dash-overall" aria-live="polite">0/5 online</span>
<span class="pill" id="dash-overall" aria-live="polite">0/6 online</span>
<span class="pill" id="dash-lastcheck" aria-live="polite">Last update: --</span>
</div>
</div>
Expand Down Expand Up @@ -114,6 +117,12 @@ <h2 id="dash-title">Service status</h2>
<span class="dashboard-service-state" id="dash-mu-text">Checking…</span>
<span class="dashboard-service-latency" id="dash-mu-latency">-- ms</span>
</div>
<div class="dashboard-service" id="dash-am-status">
<span class="dot" aria-hidden="true"></span>
<span class="dashboard-service-name" id="dash-am-name">AutoMorph</span>
<span class="dashboard-service-state" id="dash-am-text">Checking…</span>
<span class="dashboard-service-latency" id="dash-am-latency">-- ms</span>
</div>
</div>
<details class="status-history" id="status-history">
<summary id="history-title">Recent measurements</summary>
Expand Down Expand Up @@ -163,6 +172,14 @@ <h2 id="dash-title">Service status</h2>
</div>
<span class="history-avg" id="history-mu-avg">Avg: -- ms</span>
</div>
<div class="history-row">
<div class="history-meta">
<span class="history-name" id="history-am-name">AutoMorph</span>
<span class="history-summary" id="history-am-summary">No data yet</span>
</div>
<div class="history-line" id="history-am-line" role="img" aria-label="AutoMorph: no data yet"></div>
<span class="history-avg" id="history-am-avg">Avg: -- ms</span>
</div>
</div>
</details>
</section>
Expand Down Expand Up @@ -281,6 +298,29 @@ <h2 id="mu-title">Muse</h2>
</div>
</section>

<section class="card service-section service-section-link" id="section-am" role="tabpanel" aria-labelledby="tab-automorph" hidden>
<div class="j-wrap">
<div class="j-left">
<div aria-hidden="true" class="j-icon">
<svg viewBox="0 0 64 64" fill="none"><rect x="6" y="6" width="52" height="52" rx="14" stroke="currentColor" stroke-width="4"/><path d="M18 43 32 19l14 24M23 35h18" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>
</div>
<div>
<h2 id="am-title">AutoMorph</h2>
<p class="tag" id="am-sub" style="margin:0">Android app patching</p>
<div class="service-meta" style="margin-top:8px">
<span class="pill service-status status-checking" id="am-pill" aria-label="AutoMorph: Checking…">
<span class="dot" id="am-dot"></span><span id="am-text">Checking…</span>
</span>
<span class="pill service-latency" id="am-latency">Latency: -- ms</span>
</div>
<p class="service-source" id="am-source">Measured from this browser</p>
</div>
</div>
</div>
<a aria-label="Open AutoMorph in a new tab" aria-describedby="am-sub am-pill am-latency"
class="service-card-link" href="https://automorph.adiker.eu" id="am-btn" rel="noopener" target="_blank"></a>
</section>

<section class="card projects-section" id="projects" aria-labelledby="projects-title">
<div class="projects-heading">
<div>
Expand Down
30 changes: 22 additions & 8 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ const SERVICE_STATE = {
fb: { status: 'checking', online: false, latency: null, failCount: 0, nextDelay: 5000, warmedUp: false, latencySamples: [], history: [] },
ab: { status: 'checking', online: false, latency: null, failCount: 0, nextDelay: 5000, warmedUp: false, latencySamples: [], history: [] },
st: { status: 'checking', online: false, latency: null, failCount: 0, nextDelay: 5000, warmedUp: false, latencySamples: [], history: [] },
mu: { status: 'checking', online: false, latency: null, failCount: 0, nextDelay: 5000, warmedUp: false, latencySamples: [], history: [] }
mu: { status: 'checking', online: false, latency: null, failCount: 0, nextDelay: 5000, warmedUp: false, latencySamples: [], history: [] },
am: { status: 'checking', online: false, latency: null, failCount: 0, nextDelay: 5000, warmedUp: false, latencySamples: [], history: [] }
};

const SERVICES = [
{ key: 'jf', url: 'https://jellyfin.adiker.eu/health' },
{ key: 'fb', url: 'https://files.adiker.eu/health' },
{ key: 'ab', url: 'https://autobrr.adiker.eu/api/healthz/liveness' },
{ key: 'st', url: 'https://speedtest.adiker.eu/health' },
{ key: 'mu', url: 'https://muse.adiker.eu/health' }
{ key: 'mu', url: 'https://muse.adiker.eu/health' },
{ key: 'am', url: 'https://automorph.adiker.eu/health' }
];

const STR = {
Expand All @@ -37,14 +39,16 @@ const STR = {
filebrowser: 'Filebrowser',
autobrr: 'Autobrr',
openspeedtest: 'OpenSpeedTest',
muse: 'Muse'
muse: 'Muse',
automorph: 'AutoMorph'
},
navCompact: {
jellyfin: 'Jellyfin',
filebrowser: 'Files',
autobrr: 'autobrr',
openspeedtest: 'Speed',
muse: 'Muse'
muse: 'Muse',
automorph: 'AutoMorph'
},
subtitle: 'My Playground',
availability: 'Usually available: 9:00 AM – 1:00 AM CEST',
Expand Down Expand Up @@ -83,6 +87,7 @@ const STR = {
ab: { title: 'autobrr', sub: 'Automated torrent management', open: 'Open autobrr in a new tab', short: 'autobrr' },
st: { title: 'OpenSpeedTest', sub: 'Network speed test', open: 'Open OpenSpeedTest in a new tab', short: 'OpenSpeedTest' },
mu: { title: 'Muse', sub: 'Discord music bot', note: 'Status only · no web interface', short: 'Muse' },
am: { title: 'AutoMorph', sub: 'Android app patching', open: 'Open AutoMorph in a new tab', short: 'AutoMorph' },
projects: {
eyebrow: 'OPEN SOURCE / GITHUB',
title: 'Selected projects',
Expand Down Expand Up @@ -144,14 +149,16 @@ const STR = {
filebrowser: 'Filebrowser',
autobrr: 'Autobrr',
openspeedtest: 'OpenSpeedTest',
muse: 'Muse'
muse: 'Muse',
automorph: 'AutoMorph'
},
navCompact: {
jellyfin: 'Jellyfin',
filebrowser: 'Pliki',
autobrr: 'autobrr',
openspeedtest: 'Speed',
muse: 'Muse'
muse: 'Muse',
automorph: 'AutoMorph'
},
subtitle: 'Mój plac zabaw',
availability: 'Zwykle dostępny: 09:00 – 01:00 CEST',
Expand Down Expand Up @@ -190,6 +197,7 @@ const STR = {
ab: { title: 'autobrr', sub: 'Automatyzacja torrentów', open: 'Otwórz autobrr w nowej karcie', short: 'autobrr' },
st: { title: 'OpenSpeedTest', sub: 'Test prędkości sieci', open: 'Otwórz OpenSpeedTest w nowej karcie', short: 'OpenSpeedTest' },
mu: { title: 'Muse', sub: 'Bot muzyczny Discorda', note: 'Tylko status · brak interfejsu WWW', short: 'Muse' },
am: { title: 'AutoMorph', sub: 'Modyfikowanie aplikacji Android', open: 'Otwórz AutoMorph w nowej karcie', short: 'AutoMorph' },
projects: {
eyebrow: 'OPEN SOURCE / GITHUB',
title: 'Wybrane projekty',
Expand Down Expand Up @@ -598,6 +606,8 @@ function applyLang(lang) {
setText('mu-title', L.mu.title);
setText('mu-sub', L.mu.sub);
setText('mu-note', L.mu.note);
setText('am-title', L.am.title);
setText('am-sub', L.am.sub);

setText('projects-eyebrow', L.projects.eyebrow);
setText('projects-title', L.projects.title);
Expand Down Expand Up @@ -625,16 +635,19 @@ function applyLang(lang) {
const fbBtn = document.getElementById('fb-btn');
const abBtn = document.getElementById('ab-btn');
const stBtn = document.getElementById('st-btn');
const amBtn = document.getElementById('am-btn');
if (jfBtn) jfBtn.setAttribute('aria-label', L.jf.open);
if (fbBtn) fbBtn.setAttribute('aria-label', L.fb.open);
if (abBtn) abBtn.setAttribute('aria-label', L.ab.open);
if (stBtn) stBtn.setAttribute('aria-label', L.st.open);
if (amBtn) amBtn.setAttribute('aria-label', L.am.open);

setTabLabel('tab-jellyfin', L.nav.jellyfin, L.navCompact.jellyfin);
setTabLabel('tab-filebrowser', L.nav.filebrowser, L.navCompact.filebrowser);
setTabLabel('tab-autobrr', L.nav.autobrr, L.navCompact.autobrr);
setTabLabel('tab-speedtest', L.nav.openspeedtest, L.navCompact.openspeedtest);
setTabLabel('tab-muse', L.nav.muse, L.navCompact.muse);
setTabLabel('tab-automorph', L.nav.automorph, L.navCompact.automorph);

const tabsNav = document.querySelector('nav.tabs');
if (tabsNav) tabsNav.setAttribute('aria-label', L.ui.sections);
Expand Down Expand Up @@ -791,13 +804,14 @@ async function refreshService(service) {
}

function initTabs() {
const tabIds = ['tab-jellyfin', 'tab-filebrowser', 'tab-autobrr', 'tab-speedtest', 'tab-muse'];
const tabIds = ['tab-jellyfin', 'tab-filebrowser', 'tab-autobrr', 'tab-speedtest', 'tab-muse', 'tab-automorph'];
const map = {
'tab-jellyfin': 'section-jf',
'tab-filebrowser': 'section-fb',
'tab-autobrr': 'section-ab',
'tab-speedtest': 'section-st',
'tab-muse': 'section-muse'
'tab-muse': 'section-muse',
'tab-automorph': 'section-am'
};

const tabs = tabIds.map((id) => document.getElementById(id)).filter(Boolean);
Expand Down
37 changes: 37 additions & 0 deletions ops/automorph-status/health.caddy
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Import inside the existing automorph.adiker.eu site block, before other handles.
@automorph_health {
path /health
method GET HEAD
}
handle @automorph_health {
header Access-Control-Allow-Origin "https://adiker.eu"
header Cache-Control "no-store"
header Content-Type "application/json; charset=utf-8"
reverse_proxy 127.0.0.1:8081 {
method GET
rewrite /index-v2.json
@healthy status 200
handle_response @healthy {
respond `{"status":"online"}` 200
}
handle_response {
respond `{"status":"offline"}` 503
}
}
}
handle_errors {
@automorph_health_error {
path /health
method GET HEAD
expression {http.error.status_code} == 502
}
handle @automorph_health_error {
header Access-Control-Allow-Origin "https://adiker.eu"
header Cache-Control "no-store"
header Content-Type "application/json; charset=utf-8"
respond `{"status":"offline"}` 503
}
handle {
respond "{http.error.status_code} {http.error.status_text}" {http.error.status_code}
}
}
Loading