myst/web/app/templates/setup.html
ZTatman a7a0d1aabb refactor(web): single-ink brand mark system + header and 404 polish
Full-color brand art (cream + red) is hero/dark-ground only; on light
ground the mark is a single-ink stamp that takes its context's text color.
This is the one treatment that survives a future ash-and-ember dark mode
with zero new assets — currentColor follows --color-foreground on flip.

- Add partials/_brand.html: one currentColor Firebreak mark, colored by a
  text-* utility at each call site.
- Header: mark + real-text wordmark in text-foreground (replaces the cold
  #17191C logo that clashed with the warm page); also fold the inline
  border style into border-b border-border.
- Complete the account-dropdown Alpine migration (same file): wire the
  panel id/aria-controls, drive the open-state highlight and focus-return
  through Alpine, drop the <details> cruft, add a transition.
- Setup: replace the invisible cream-on-light logo (and its compensating
  drop-shadow) with the ink mark.
- 404: "Outside the break" copy, token-driven watermark at 25%, and a
  guard so the duplicate detail line no longer renders.
- Delete 3 now-unused logo SVGs (black, red, brand).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 14:17:52 -04:00

127 lines
5.6 KiB
HTML

{% extends "base.html" %}
{% from "partials/_brand.html" import mark %}
{% block title %}{{ "Reconfigure" if reconfiguring else "Setup" }} — Firebreak{% endblock %}
{% block header_class %}hidden{% endblock %}
{% block main_class %}flex-1{% endblock %}
{% block content %}
<section class="flex min-h-dvh items-center justify-center px-6 py-20">
<div class="w-full max-w-lg">
<div class="mb-8 text-center">
{{ mark("mx-auto h-auto w-full max-w-20 text-foreground") }}
<h1 class="mt-6 text-2xl font-semibold text-foreground">
{{ "Reconfigure" if reconfiguring else "Setup" }}
</h1>
{% if reconfiguring %}
<p class="mt-2 text-sm leading-6 text-muted-foreground">
Update your Forgejo OAuth connection. Make sure the OAuth application
is registered in your Forgejo instance before continuing.
</p>
{% else %}
<p class="mt-2 text-sm leading-6 text-muted-foreground">
Connect Firebreak to your Forgejo instance. You'll need to
<a href="https://forgejo.org/docs/latest/user/oauth2-provider/"
target="_blank"
rel="noopener"
class="text-foreground/80 underline underline-offset-2 hover:text-foreground">register an OAuth application</a>
in Forgejo first.
</p>
{% endif %}
</div>
{% if not reconfiguring %}
<div class="mb-8 rounded-lg border border-border bg-card px-5 py-4 text-xs leading-5 text-muted-foreground">
<p class="mb-2.5 font-medium text-foreground">How to get your OAuth credentials:</p>
<ol class="list-decimal list-inside space-y-1.5">
<li>
In Forgejo, go to <strong class="text-foreground">Settings &rarr; Applications</strong>
</li>
<li>
Under <strong class="text-foreground">Manage OAuth2 Applications</strong>, create a new app
</li>
<li>
Set the redirect URI to
<br />
<code class="mono-chip mt-1 break-all">{{ oauth_callback_url }}</code>
</li>
<li>
Copy the <strong class="text-foreground">Client ID</strong> and <strong class="text-foreground">Client Secret</strong> into the form below
</li>
</ol>
</div>
{% endif %}
<form method="post" action="/setup" class="space-y-5">
{% if not reconfiguring %}
<div>
<label for="setup_token" class="form-label">Setup Token</label>
<input type="password"
id="setup_token"
name="setup_token"
class="form-input font-mono"
placeholder="Paste the token from your server logs"
autocomplete="off"
spellcheck="false"
required />
<p class="mt-1.5 text-xs text-muted-foreground">Printed to the server console on first boot.</p>
</div>
{% endif %}
<div>
<label for="forgejo_base_url" class="form-label">Forgejo Instance URL</label>
<input type="url"
id="forgejo_base_url"
name="forgejo_base_url"
class="form-input"
placeholder="https://git.example.com"
autocomplete="off"
value="{{ forgejo_base_url }}"
required />
</div>
<div>
<label for="forgejo_oauth_client_id" class="form-label">OAuth Client ID</label>
<input type="text"
id="forgejo_oauth_client_id"
name="forgejo_oauth_client_id"
class="form-input font-mono"
placeholder="c8ab3315-537d-44f3-…"
autocomplete="off"
spellcheck="false"
value="{{ forgejo_oauth_client_id }}"
required />
</div>
<div>
<label for="forgejo_oauth_client_secret" class="form-label">
OAuth Client Secret
{% if reconfiguring %}
<span class="ml-1 font-normal tracking-normal normal-case text-muted-foreground">(leave blank to keep current)</span>
{% endif %}
</label>
<input type="password"
id="forgejo_oauth_client_secret"
name="forgejo_oauth_client_secret"
class="form-input font-mono"
placeholder="gto_wkxxnv4ewa…"
autocomplete="off"
spellcheck="false"
{{ "" if reconfiguring else "required" }} />
</div>
<div>
<label for="firebreak_public_base_url" class="form-label">
Public Base URL
<span class="ml-1 font-normal tracking-normal normal-case text-muted-foreground">(optional)</span>
</label>
<input type="url"
id="firebreak_public_base_url"
name="firebreak_public_base_url"
class="form-input"
placeholder="https://share.example.com"
autocomplete="off"
value="{{ firebreak_public_base_url }}" />
<p class="mt-1.5 text-xs text-muted-foreground">
Your production domain for OAuth redirects. Leave blank on localhost &mdash; Firebreak will use <code class="font-mono">http://localhost:8000</code> automatically.
</p>
</div>
<button type="submit" class="btn btn-primary w-full mt-2">
{{ "Save Forgejo Settings" if reconfiguring else "Complete Setup" }}
</button>
</form>
</div>
</section>
{% endblock %}