Changeset 7a235bc in Klonkt for src/views


Ignore:
Timestamp:
06/25/2026 05:56:08 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
f0c3f83
Parents:
6a51968
Message:

feat(updates): make the in-app updater GitHub/upstream-aware for self-hosters

The Updates page checked a hardcoded bare repo (KLONKT_GIT_DIR) that only exists on
Robin's VPS fleet, so a GitHub-clone install logged 'fatal: not a git repository' and
couldn't show its version. Now it auto-detects topology: a git CHECKOUT (app dir has
.git, origin=GitHub) checks origin/<branch> (fetched on view); the BARE-repo fleet is
unchanged. git stderr is ignored so a foreign/missing repo never spams the console.
External installs can't self-update in-app (klonkt-update needs root for systemd), so
the page shows the 'sudo klonkt-update' command instead of a button. Fleet keeps the
detached-script button.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/admin-updates.ejs

    r6a51968 r7a235bc  
    3838    </div>
    3939
    40     <% if (canCheck) { %>
     40    <% if (canCheck && canSelfUpdate) { %>
    4141    <form method="post" action="/admin/updates/run" class="set-form"
    4242          onsubmit="return confirm('<%= t('aupd.run_confirm') %>');">
     
    4545      </button>
    4646    </form>
     47    <% } else if (typeof manualCommand !== 'undefined' && manualCommand && !upToDate) { %>
     48    <p class="set-help" style="margin:.2rem 0 .45rem"><%= t('aupd.manual_hint') %></p>
     49    <pre class="upd-cmd"><code><%= manualCommand %></code></pre>
    4750    <% } %>
    4851
     
    7679.upd-desc { color: var(--ink-muted); }
    7780.upd-status { margin: 1.1rem 0; }
     81.upd-cmd { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: .6rem .8rem; margin: 0; overflow-x: auto; }
     82.upd-cmd code { font-size: .9em; }
    7883.upd-badge { font-size: .8rem; font-weight: 700; padding: .25rem .7rem; border-radius: 20px; }
    7984.upd-badge.ok { background: #d1fae5; color: #065f46; }
Note: See TracChangeset for help on using the changeset viewer.