Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
11 kB · 361 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362<Layouts.app flash={@flash} current_operator={@current_operator} active_page={:connections}> <header class="gs-page-head"> <p class="gs-eyebrow">Forge access / configuration</p> <h1 class="gs-title">Connections</h1> <p class="gs-subtitle">Forges git-sync can read from and write to.</p> </header> <div class="gs-section-head"> <h2>Access points</h2> <p class="gs-muted">Connection health shown per provider</p> </div> <section class="connection gs-panel gs-section" id="forgejo" aria-labelledby="forgejo-title"> <div class="gs-section-head"> <div> <h3 id="forgejo-title">Forgejo</h3> <p class="gs-muted">Your primary instance and operator account.</p> </div> <.health id="forgejo-health" health={@forgejo_health} /> </div> <dl class="gs-form-grid"> <div class="gs-field min-w-0"> <dt class="gs-eyebrow">Instance</dt> <dd class="gs-mono break-all">{@connection.base_url}</dd> </div> <div class="gs-field min-w-0"> <dt class="gs-eyebrow">Operator</dt> <dd class="gs-mono break-all">{@connection.operator}</dd> </div> </dl> </section> <section class="connection gs-panel gs-section" id="github" data-signals={"{githubForm: #{@github_form_open}}"} aria-labelledby="github-title" > <div class="gs-section-head"> <div> <h3 id="github-title">GitHub</h3> <p class="gs-muted"> An OAuth application grants access to list repositories and mirror them to GitHub. </p> </div> <.health id="github-health" health={@github_health} /> </div> <p class="gs-muted"> Register an OAuth application on GitHub with <code class="gs-mono break-all">{GitSyncWeb.RedirectUri.github_callback(@conn)}</code> as its callback URL, then connect it here. </p> <%= if @github && @github.client_id do %> <dl class="gs-form-grid"> <div class="gs-field min-w-0"> <dt class="gs-eyebrow">Application</dt> <dd class="gs-mono break-all">{@github.client_id}</dd> </div> </dl> <div class="gs-actions"> <%= if @github.token do %> <.button id="disconnect-github" class="gs-button-danger" href={~p"/connections/github"} method="delete" > Disconnect GitHub </.button> <% else %> <.button id="connect-github" class="gs-button" href={~p"/auth/github"}>Connect GitHub</.button> <% end %> <.button id="edit-github" type="button" variant="secondary" class="gs-button-secondary" aria-controls="github-application" data-attr:aria-expanded="$githubForm ? 'true' : 'false'" data-on:click="$githubForm = !$githubForm" > Edit application </.button> </div> <% end %> <div id="github-application" data-show="$githubForm"> <.form for={@github_form} id="github-form" action={~p"/connections/github"} class="gs-form-grid" > <.input field={@github_form[:client_id]} label="Client ID" /> <.input field={@github_form[:client_secret]} type="password" label="Client secret" /> <.button id="save-github" class="gs-button" type="submit">Save application</.button> </.form> </div> </section> <section class="connection gs-panel gs-section" id="pushin" data-signals={"{pushinForm: #{@pushin_form_open}}"} aria-labelledby="pushin-title" > <div class="gs-section-head"> <div> <h3 id="pushin-title">Pushin.eu</h3> <p class="gs-muted"> Use a personal access token from Pushin.eu to list repositories and mirror over HTTPS. Git authentication uses the username <code class="gs-mono">git</code> automatically. </p> </div> <.health id="pushin-health" health={@pushin_health} /> </div> <dl class="gs-form-grid"> <div class="gs-field min-w-0"> <dt class="gs-eyebrow">Instance</dt> <dd class="gs-mono break-all">https://pushin.eu</dd> </div> <div class="gs-field"> <dt class="gs-eyebrow">Credentials</dt> <dd> {if @pushin && @pushin.token, do: "Personal access token configured", else: "No token configured"} </dd> </div> </dl> <div :if={@pushin && @pushin.token} class="gs-actions"> <.button id="disconnect-pushin" class="gs-button-danger" href={~p"/connections/pushin"} method="delete" > Disconnect Pushin.eu </.button> <.button id="edit-pushin" type="button" variant="secondary" class="gs-button-secondary" aria-controls="pushin-credentials" data-attr:aria-expanded="$pushinForm ? 'true' : 'false'" data-on:click="$pushinForm = !$pushinForm" > Replace token </.button> </div> <div id="pushin-credentials" data-show="$pushinForm"> <.form for={@pushin_form} id="pushin-form" action={~p"/connections/pushin"} method="post" class="gs-form-grid" > <.input field={@pushin_form[:token]} id="pushin-token" type="password" label="Personal access token" value="" autocomplete="new-password" required /> <.button id="save-pushin" class="gs-button" type="submit"> {if @pushin && @pushin.token, do: "Replace token", else: "Save token"} </.button> </.form> </div> </section> <section class="connection gs-panel gs-section" id="tangled" data-signals={"{tangledForm: #{@tangled_form_open}}"} aria-labelledby="tangled-title" > <div class="gs-section-head"> <div> <h3 id="tangled-title">Tangled</h3> <p class="gs-muted"> Repositories are public atproto records, so git-sync lists them from the account that owns them. Pushing needs a key each knot has been given. </p> </div> <.health id="tangled-health" health={@tangled_health} /> </div> <%= if @tangled do %> <dl class="gs-form-grid"> <div class="gs-field min-w-0"> <dt class="gs-eyebrow">Account</dt> <dd class="gs-mono break-all">{@tangled.handle}</dd> </div> <div class="gs-field min-w-0"> <dt class="gs-eyebrow">DID</dt> <dd class="gs-mono break-all">{@tangled.did}</dd> </div> <div class="gs-field min-w-0"> <dt class="gs-eyebrow">Appview</dt> <dd class="gs-mono break-all">{@tangled.base_url}</dd> </div> </dl> <div class="gs-actions"> <.button id="edit-tangled" type="button" variant="secondary" class="gs-button-secondary" aria-controls="tangled-account" data-attr:aria-expanded="$tangledForm ? 'true' : 'false'" data-on:click="$tangledForm = !$tangledForm" > Edit account </.button> </div> <% end %> <div id="tangled-account" data-show="$tangledForm"> <.form for={@tangled_form} id="tangled-form" action={~p"/connections/tangled"} method="post" class="gs-form-grid" > <.input field={@tangled_form[:handle]} label="Handle or DID" placeholder="alice.example.com" /> <.input field={@tangled_form[:base_url]} label="Appview URL" placeholder="https://tangled.org" /> <.button id="save-tangled" class="gs-button" type="submit">Save account</.button> </.form> </div> <%= if @tangled do %> <section class="gs-section" data-signals="{knotForm: false}" aria-labelledby="knot-keys-title" > <div class="gs-section-head"> <div> <p class="gs-eyebrow">Tangled / SSH access</p> <h3 id="knot-keys-title">Knot host keys</h3> <p class="gs-muted"> Check these against the fingerprints each knot's operator publishes. The host a knot is pushed to is worked out when it is first pinned; pin it again here to correct one. </p> </div> </div> <div :if={@tangled_knots == []} class="gs-muted"> No knot host keys pinned. Add a knot to configure SSH access. </div> <dl class="gs-form-grid"> <div :for={knot <- @tangled_knots} class="gs-field min-w-0"> <dt class="gs-mono break-all">{knot.host}</dt> <dd> <p class="gs-muted"> SSH host: <span class="gs-mono break-all">{knot.ssh_host}</span> </p> <p :for={fingerprint <- knot.fingerprints} class="gs-mono break-all"> {fingerprint} </p> </dd> </div> </dl> <div class="gs-actions"> <.button id="add-knot" type="button" variant="secondary" class="gs-button-secondary" aria-controls="knot-pin" data-attr:aria-expanded="$knotForm ? 'true' : 'false'" data-on:click="$knotForm = !$knotForm" > Add a knot </.button> </div> <div id="knot-pin" data-show="$knotForm"> <.form :let={f} for={%{}} as={:knot} action={~p"/connections/tangled/knots"} id="knot-form" class="gs-form-grid" > <.input field={f[:host]} type="text" label="Knot" placeholder="knot1.tangled.sh" /> <.input field={f[:ssh_host]} type="text" label="SSH host" placeholder="tangled.org" /> <.button class="gs-button" type="submit">Pin</.button> </.form> </div> </section> <section class="gs-section" aria-labelledby="public-key-title"> <div class="gs-section-head"> <div> <h3 id="public-key-title">Public key</h3> <p class="gs-muted">Add this to each knot so git-sync may push to it.</p> </div> </div> <pre :if={@tangled.public_key} id="tangled-public-key" data-ref="publicKey" class="gs-mono min-w-0 whitespace-pre-wrap break-all" phx-no-curly-interpolation ><%= @tangled.public_key %></pre> <div class="gs-actions"> <.button :if={@tangled.public_key} id="copy-tangled-public-key" type="button" variant="secondary" class="gs-button-secondary" data-on:click="navigator.clipboard.writeText($publicKey.textContent)" > Copy </.button> <.button id="generate-tangled-key" class={[ if(@tangled.public_key, do: "gs-button-danger", else: "gs-button") ]} href={~p"/connections/tangled/key"} method="post" > {if @tangled.public_key, do: "Replace key", else: "Generate key"} </.button> </div> </section> <% end %> </section></Layouts.app>