move cname + slugs from status -> pages
This commit is contained in:
parent
22d62d0df5
commit
b1ad8f513b
|
|
@ -17,7 +17,7 @@ process.on("uncaughtException", (err) => console.error("[uncaughtException]"
|
||||||
|
|
||||||
const eta = new Eta({ views: resolve(import.meta.dir, "./views"), cache: true, defaultExtension: ".ejs", rmWhitespace: true });
|
const eta = new Eta({ views: resolve(import.meta.dir, "./views"), cache: true, defaultExtension: ".ejs", rmWhitespace: true });
|
||||||
|
|
||||||
const PUBLIC_BASE = process.env.STATUS_BASE_URL ?? "https://status.pingql.com";
|
const PUBLIC_BASE = process.env.STATUS_BASE_URL ?? "https://pages.pingql.com";
|
||||||
|
|
||||||
// Hash the static assets so their URLs change whenever their bytes change.
|
// Hash the static assets so their URLs change whenever their bytes change.
|
||||||
// Used as cache-busting query strings on the <link>/<script> tags so visitors
|
// Used as cache-busting query strings on the <link>/<script> tags so visitors
|
||||||
|
|
@ -88,7 +88,7 @@ function isAuthorised(page: { id: string; password_hash: string | null }, req: R
|
||||||
// Memoirist (Elysia's router) treats `:slug.json` as a single parameter named
|
// Memoirist (Elysia's router) treats `:slug.json` as a single parameter named
|
||||||
// "slug.json" and refuses to coexist with `:slug`. Instead, use one `:slug`
|
// "slug.json" and refuses to coexist with `:slug`. Instead, use one `:slug`
|
||||||
// route and dispatch on the suffix in the handler.
|
// route and dispatch on the suffix in the handler.
|
||||||
const STATUS_HOST = process.env.STATUS_HOST || "status.pingql.com";
|
const STATUS_HOST = process.env.STATUS_HOST || "pages.pingql.com";
|
||||||
|
|
||||||
function isCustomDomain(request: Request): string | null {
|
function isCustomDomain(request: Request): string | null {
|
||||||
const host = new URL(request.url).hostname;
|
const host = new URL(request.url).hostname;
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,7 @@ Content-Type: application/json
|
||||||
<!-- Status Pages -->
|
<!-- Status Pages -->
|
||||||
<div id="status-pages" class="section">
|
<div id="status-pages" class="section">
|
||||||
<h2>Status Pages</h2>
|
<h2>Status Pages</h2>
|
||||||
<p>Create public status pages that display live uptime, heartbeat bars, and incidents for your monitors. Each page gets a unique slug and is publicly accessible at <code>status.pingql.com/{slug}</code>.</p>
|
<p>Create public status pages that display live uptime, heartbeat bars, and incidents for your monitors. Each page gets a unique slug and is publicly accessible at <code>pages.pingql.com/{slug}</code>.</p>
|
||||||
|
|
||||||
<h3>List pages</h3>
|
<h3>List pages</h3>
|
||||||
<div class="endpoint"><span class="method get">GET</span><span class="path">/pages</span></div>
|
<div class="endpoint"><span class="method get">GET</span><span class="path">/pages</span></div>
|
||||||
|
|
@ -336,7 +336,7 @@ Content-Type: application/json
|
||||||
<p class="endpoint-desc">Permanently removes the page and all associated groups and monitor links.</p>
|
<p class="endpoint-desc">Permanently removes the page and all associated groups and monitor links.</p>
|
||||||
|
|
||||||
<h3>Public endpoints</h3>
|
<h3>Public endpoints</h3>
|
||||||
<p>Each published page is available at <code>status.pingql.com/{slug}</code> in multiple formats:</p>
|
<p>Each published page is available at <code>pages.pingql.com/{slug}</code> in multiple formats:</p>
|
||||||
<table>
|
<table>
|
||||||
<thead><tr><th>URL</th><th>Description</th></tr></thead>
|
<thead><tr><th>URL</th><th>Description</th></tr></thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
|
||||||
|
|
@ -420,7 +420,7 @@
|
||||||
<div class="text-center mb-12">
|
<div class="text-center mb-12">
|
||||||
<h2 class="text-3xl sm:text-4xl font-bold tracking-tight mb-4">Beautiful status pages, out of the box</h2>
|
<h2 class="text-3xl sm:text-4xl font-bold tracking-tight mb-4">Beautiful status pages, out of the box</h2>
|
||||||
<p class="text-gray-400 text-lg max-w-2xl mx-auto">Give your users a branded status page with live uptime, heartbeat history, and incident timelines. Password protection, custom CSS, RSS feeds, and embeddable badges included.</p>
|
<p class="text-gray-400 text-lg max-w-2xl mx-auto">Give your users a branded status page with live uptime, heartbeat history, and incident timelines. Password protection, custom CSS, RSS feeds, and embeddable badges included.</p>
|
||||||
<p class="mt-4"><a href="https://status.pingql.com/ping" target="_blank" rel="noopener" class="text-blue-400 hover:text-blue-300 text-sm font-medium">See a live demo →</a></p>
|
<p class="mt-4"><a href="https://pages.pingql.com/ping" target="_blank" rel="noopener" class="text-blue-400 hover:text-blue-300 text-sm font-medium">See a live demo →</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="rounded-2xl border border-border-subtle overflow-hidden" style="background:#111114; box-shadow:0 0 60px rgba(59,130,246,0.06), 0 20px 50px rgba(0,0,0,0.5)">
|
<div class="rounded-2xl border border-border-subtle overflow-hidden" style="background:#111114; box-shadow:0 0 60px rgba(59,130,246,0.06), 0 20px 50px rgba(0,0,0,0.5)">
|
||||||
|
|
@ -428,7 +428,7 @@
|
||||||
<div style="width:12px;height:12px;border-radius:50%;background:#ff5f57"></div>
|
<div style="width:12px;height:12px;border-radius:50%;background:#ff5f57"></div>
|
||||||
<div style="width:12px;height:12px;border-radius:50%;background:#ffbd2e"></div>
|
<div style="width:12px;height:12px;border-radius:50%;background:#ffbd2e"></div>
|
||||||
<div style="width:12px;height:12px;border-radius:50%;background:#28c840"></div>
|
<div style="width:12px;height:12px;border-radius:50%;background:#28c840"></div>
|
||||||
<span class="ml-3 text-xs text-gray-500 font-mono">status.pingql.com/your-app</span>
|
<span class="ml-3 text-xs text-gray-500 font-mono">pages.pingql.com/your-app</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-6 sm:p-8">
|
<div class="p-6 sm:p-8">
|
||||||
<div class="text-lg font-semibold text-white mb-4">Acme Corp Status</div>
|
<div class="text-lg font-semibold text-white mb-4">Acme Corp Status</div>
|
||||||
|
|
|
||||||
|
|
@ -41,14 +41,14 @@
|
||||||
<label class="block text-sm text-gray-400 mb-1.5">Slug</label>
|
<label class="block text-sm text-gray-400 mb-1.5">Slug</label>
|
||||||
<input name="slug" type="text" required value="<%= p.slug || '' %>" placeholder="my-app" pattern="^[a-z0-9][a-z0-9-]*$"
|
<input name="slug" type="text" required value="<%= p.slug || '' %>" placeholder="my-app" pattern="^[a-z0-9][a-z0-9-]*$"
|
||||||
class="w-full bg-surface-solid border border-border-subtle rounded-lg px-4 py-2.5 text-gray-100 placeholder-gray-600 focus:outline-none focus:border-blue-500 font-mono text-sm">
|
class="w-full bg-surface-solid border border-border-subtle rounded-lg px-4 py-2.5 text-gray-100 placeholder-gray-600 focus:outline-none focus:border-blue-500 font-mono text-sm">
|
||||||
<p class="text-xs text-gray-600 mt-1">Public URL: <span class="text-blue-400 font-mono">status.pingql.com/<your-slug></span></p>
|
<p class="text-xs text-gray-600 mt-1">Public URL: <span class="text-blue-400 font-mono">pages.pingql.com/<your-slug></span></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-sm text-gray-400 mb-1.5">Custom domain <span class="text-gray-600">(optional)</span></label>
|
<label class="block text-sm text-gray-400 mb-1.5">Custom domain <span class="text-gray-600">(optional)</span></label>
|
||||||
<input name="custom_domain" type="text" value="<%= p.custom_domain || '' %>" placeholder="status.example.com"
|
<input name="custom_domain" type="text" value="<%= p.custom_domain || '' %>" placeholder="status.example.com"
|
||||||
class="w-full bg-surface-solid border border-border-subtle rounded-lg px-4 py-2.5 text-gray-100 placeholder-gray-600 focus:outline-none focus:border-blue-500 font-mono text-sm">
|
class="w-full bg-surface-solid border border-border-subtle rounded-lg px-4 py-2.5 text-gray-100 placeholder-gray-600 focus:outline-none focus:border-blue-500 font-mono text-sm">
|
||||||
<p class="text-xs text-gray-600 mt-1">Point a CNAME to <span class="text-blue-400 font-mono">status.pingql.com</span> and enter the domain here. SSL is automatic.</p>
|
<p class="text-xs text-gray-600 mt-1">Point a CNAME to <span class="text-blue-400 font-mono">pages.pingql.com</span> and enter the domain here. SSL is automatic.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
<% if (!it.pages || it.pages.length === 0) { %>
|
<% if (!it.pages || it.pages.length === 0) { %>
|
||||||
<section class="card-static p-6 text-sm text-gray-500">
|
<section class="card-static p-6 text-sm text-gray-500">
|
||||||
No status pages yet. Create one to get a public URL like <code class="text-blue-400">status.pingql.com/your-slug</code>.
|
No status pages yet. Create one to get a public URL like <code class="text-blue-400">pages.pingql.com/your-slug</code>.
|
||||||
</section>
|
</section>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<% it.pages.forEach(function(p) { %>
|
<% it.pages.forEach(function(p) { %>
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
<% if (p.custom_domain) { %>
|
<% if (p.custom_domain) { %>
|
||||||
<a href="https://<%= p.custom_domain %>" target="_blank" class="text-xs text-blue-400 hover:text-blue-300 font-mono break-all"><%= p.custom_domain %></a>
|
<a href="https://<%= p.custom_domain %>" target="_blank" class="text-xs text-blue-400 hover:text-blue-300 font-mono break-all"><%= p.custom_domain %></a>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<a href="https://status.pingql.com/<%= p.slug %>" target="_blank" class="text-xs text-blue-400 hover:text-blue-300 font-mono break-all">status.pingql.com/<%= p.slug %></a>
|
<a href="https://pages.pingql.com/<%= p.slug %>" target="_blank" class="text-xs text-blue-400 hover:text-blue-300 font-mono break-all">pages.pingql.com/<%= p.slug %></a>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (p.description) { %><p class="text-xs text-gray-500 mt-1"><%= p.description %></p><% } %>
|
<% if (p.description) { %><p class="text-xs text-gray-500 mt-1"><%= p.description %></p><% } %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ cat > /etc/caddy/Caddyfile << 'EOF'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
status.pingql.com {
|
pages.pingql.com {
|
||||||
import common
|
import common
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,5 +137,5 @@ REMOTE
|
||||||
|
|
||||||
echo "[setup] Done. Don't forget to:"
|
echo "[setup] Done. Don't forget to:"
|
||||||
echo " 1. Create .env at /opt/pingql/apps/status/.env with DATABASE_URL and SECRET"
|
echo " 1. Create .env at /opt/pingql/apps/status/.env with DATABASE_URL and SECRET"
|
||||||
echo " 2. Point status.pingql.com DNS to 46.225.155.167"
|
echo " 2. Point pages.pingql.com DNS to 46.225.155.167"
|
||||||
echo " 3. Update deploy.sh STATUS_HOST"
|
echo " 3. Update deploy.sh STATUS_HOST"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue