5 Commits
Author SHA1 Message Date
Mateusz PstruchaandClaude Opus 5.5 d225294ba8 Bump to 0.8.5
CI / build (push) Successful in 16s
Release / release (push) Successful in 12s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:50:32 +01:00
Mateusz PstruchaandClaude Opus 5.5 be8d97aa76 Ignore local Claude files
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:50:22 +01:00
mtps b8dccdd82f Merge pull request 'Publish straight to the bucket' (#1) from claude/static-publish into master
CI / build (push) Successful in 15s
2026-11-09 13:07:40 +01:00
Mateusz PstruchaandClaude Opus 5.5 9533392c81 🚀 publish straight to the bucket
CI / build (pull_request) Successful in 25s
The release builds and uploads with ygg/actions/static-publish, instead of
deploying static-server through kara.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:13:05 +01:00
Mateusz PstruchaandClaude Opus 5.5 29af920dfb Edit accounts from the Accounts screen
CI / build (push) Successful in 11s
Each account gets an Edit button opening the add form pre-filled with
its settings; the password field is optional ("unchanged") and only a
new value replaces the stored one. Editing no longer rewrites the hosts
or login from the address, so a working setup isn't silently changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 14:11:10 +02:00
7 changed files with 97 additions and 82 deletions

No files matched your search

+8 -23
View File
@@ -49,27 +49,12 @@ jobs:
tern-web-*.tgz
tern-web-*.tgz.sha256
# Deploys the release just published to tern.mtps.pl (deploy/static on
# the swarm; see deploy/static.yml).
deploy:
needs: release
runs-on: rocky-10
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Derive version
id: version
env:
TAG: ${{ gitea.ref_name }}
run: echo "version=${TAG#v}" >> "$GITHUB_OUTPUT"
- name: Deploy
uses: https://git.app.ygg/ygg/actions/deploy@v2
# Straight to the bucket, with a key that only reaches it. The bucket and
# the nginx site come from deployments/tern-web.yml in ygg/deployments.
- name: Publish
uses: https://git.app.ygg/ygg/actions/static-publish@v2
with:
type: static
dist-path: deploy/static.yml
extra-vars: |
version=${{ steps.version.outputs.version }}
ssh-key: ${{ secrets.DEPLOY_SSH_KEY }}
known-hosts: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
path: dist
bucket: tern.mtps.pl
access-key-id: ${{ secrets.STATIC_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.STATIC_SECRET_ACCESS_KEY }}
+4
View File
@@ -3,3 +3,7 @@ dist
.env
*.log
.DS_Store
# Local Claude Code files
CLAUDE.md
.claude/
-32
View File
@@ -1,32 +0,0 @@
# tern-web's deployment: a Swarm stack of ygg/static-server serving this
# version's release asset, on tern.mtps.pl (deploy/static in the ygg
# management repo). Run by this repo's release workflow through
# ygg/actions/deploy; `version` arrives as an extra var (the tag without
# its v) and is templated in by Ansible.
#
# The webapp talks to tern-server at tern-api.mtps.pl, baked in at build
# time (VITE_TERN_API in the release workflow).
static_stack_name: tern-web
domain: tern.mtps.pl
cert: mtps.pl
static_service:
name: static
image: git.app.ygg/ygg/static-server:latest
environment:
GITEA_REPOSITORY_URL: https://git.app.ygg/mtps/tern-web
GITEA_RELEASE: "v{{ version }}"
GITEA_ASSET_NAME: "tern-web-{{ version }}.tgz"
SSL_CERT_FILE: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
volumes:
- /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem:/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem:ro
ports:
- target: 8080
published: 11902
protocol: tcp
mode: ingress
replicas: 2
restart_policy:
condition: on-failure
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "tern-web",
"version": "0.8.4",
"version": "0.8.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "tern-web",
"version": "0.8.4",
"version": "0.8.5",
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@tsconfig/svelte": "^5.0.4",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "tern-web",
"private": true,
"version": "0.8.4",
"version": "0.8.5",
"type": "module",
"scripts": {
"dev": "vite",
+74 -24
View File
@@ -3,7 +3,7 @@
// the form to connect another. Only the server ever talks to the mail
// server (server-architecture-spec.md §2); this screen just hands it the
// settings and shows what it reports back.
import { createAccount, deleteAccount, listAccounts, type Account } from './api';
import { createAccount, deleteAccount, listAccounts, updateAccount, type Account } from './api';
import { formatFullDate } from './format';
let {
@@ -23,6 +23,8 @@
let loaded = $state(false);
let error = $state<string | null>(null);
let adding = $state(false);
/** The account being edited; the form is shared with adding. */
let editing = $state<Account | null>(null);
let saving = $state(false);
let formError = $state<string | null>(null);
@@ -81,28 +83,51 @@
formError = null;
}
async function add(event: SubmitEvent) {
function startEdit(a: Account) {
adding = false;
editing = a;
email = a.email_address ?? '';
displayName = a.display_name ?? '';
imapHost = a.imap_host;
imapPort = a.imap_port;
smtpHost = a.smtp_host;
smtpPort = a.smtp_port;
login = a.username;
password = '';
// Editing the address must not silently rewrite settings that work.
loginEdited = hostsEdited = true;
formError = null;
}
function closeForm() {
adding = false;
editing = null;
resetForm();
}
async function save(event: SubmitEvent) {
event.preventDefault();
saving = true;
formError = null;
const settings = {
name: editing?.name ?? (email.split('@')[1] || email),
imap_host: imapHost.trim(),
imap_port: Number(imapPort),
smtp_host: smtpHost.trim(),
smtp_port: Number(smtpPort),
username: login.trim(),
password,
email_address: email.trim() || null,
display_name: displayName.trim() || null,
};
try {
await createAccount({
name: email.split('@')[1] || email,
imap_host: imapHost.trim(),
imap_port: Number(imapPort),
smtp_host: smtpHost.trim(),
smtp_port: Number(smtpPort),
username: login.trim(),
password,
email_address: email.trim() || null,
display_name: displayName.trim() || null,
});
resetForm();
adding = false;
if (editing) await updateAccount(editing.id, settings);
else await createAccount(settings);
closeForm();
await load();
onChanged?.();
} catch (e) {
formError = e instanceof Error ? e.message : 'failed to add the account';
formError = e instanceof Error ? e.message : 'failed to save the account';
} finally {
saving = false;
}
@@ -144,7 +169,7 @@
<div class="accounts">
<header>
<h2>Accounts</h2>
{#if !adding}
{#if !adding && !editing}
<button class="primary" onclick={() => { resetForm(); adding = true; }}>Add account</button>
{/if}
</header>
@@ -170,15 +195,22 @@
{/if}
{#if a.sync}<span class="detail">Last update {formatFullDate(a.sync.updated_at)}</span>{/if}
</div>
<button onclick={() => remove(a)}>Remove</button>
<div class="row-actions">
<button onclick={() => startEdit(a)} disabled={editing?.id === a.id}>Edit</button>
<button onclick={() => remove(a)}>Remove</button>
</div>
</li>
{/each}
</ul>
{/if}
{#if adding}
<form onsubmit={add}>
<h3>{accounts.length === 0 ? 'Connect your first mailbox' : 'Add an account'}</h3>
{#if adding || editing}
<form onsubmit={save}>
<h3>
{#if editing}Edit {editing.email_address ?? editing.username}
{:else if accounts.length === 0}Connect your first mailbox
{:else}Add an account{/if}
</h3>
<label class="wide">Email address
<input type="email" bind:value={email} oninput={emailChanged} required autocomplete="email" />
</label>
@@ -201,8 +233,20 @@
<input bind:value={login} oninput={() => (loginEdited = true)} required autocomplete="username" />
</label>
<label class="wide">Password
<input type="password" bind:value={password} required autocomplete="current-password" />
<input
type="password"
bind:value={password}
required={!editing}
placeholder={editing ? 'unchanged — type a new one to replace it' : ''}
autocomplete={editing ? 'new-password' : 'current-password'}
/>
</label>
{#if editing}
<p class="hint wide">
Saving reconnects with the new settings. Mail already here stays as long as it's the same mailbox;
point it at a different one and it's synced afresh.
</p>
{/if}
<p class="hint wide">
Stored encrypted on your Tern server, never in this browser. Tern only reads your inbox and sends —
it never changes anything on the mail server.
@@ -210,9 +254,11 @@
{#if formError}<p class="error wide">{formError}</p>{/if}
<div class="actions wide">
{#if accounts.length > 0}
<button type="button" onclick={() => { adding = false; resetForm(); }}>Cancel</button>
<button type="button" onclick={closeForm}>Cancel</button>
{/if}
<button type="submit" class="primary" disabled={saving}>{saving ? 'Adding…' : 'Add account'}</button>
<button type="submit" class="primary" disabled={saving}>
{saving ? 'Saving…' : editing ? 'Save changes' : 'Add account'}
</button>
</div>
</form>
{/if}
@@ -264,6 +310,10 @@
border: 1px solid var(--secondary);
border-radius: 0.45rem;
}
.row-actions {
display: flex;
gap: 0.4rem;
}
.body {
flex: 1;
min-width: 0;
+8
View File
@@ -236,6 +236,14 @@ export function createAccount(account: NewAccount): Promise<Account> {
return request('/accounts', { method: 'POST', body: JSON.stringify(account) });
}
/**
* Replaces an account's settings. Leave `password` empty to keep the
* stored one. The server restarts the account's sync with the new settings.
*/
export function updateAccount(id: string, account: NewAccount): Promise<Account> {
return request(`/accounts/${id}`, { method: 'PUT', body: JSON.stringify(account) });
}
/** Removes the account and every message synced from it. */
export function deleteAccount(id: string): Promise<{ ok: boolean }> {
return request(`/accounts/${id}`, { method: 'DELETE' });