fix(builds): repair inventar settings import and add skilltree storage service

- inventar-web: fix mangled icon import in settings page
- skilltree-web: create missing lib/services/storage.ts for export/import
- startup.sh: add umami/synapse DB creation + synapse user setup with C locale

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-03-31 16:56:37 +02:00
parent e5ca208cd8
commit 7bc4db7e63
3 changed files with 43 additions and 2 deletions

View file

@ -3,7 +3,8 @@
import { authStore } from '$lib/stores/auth.svelte';
import { userSettings } from '$lib/stores/user-settings.svelte';
import { APP_VERSION } from '$lib/version';
import { Info, SignOut, Tag, User, import { Envelope } from '@manacore/shared-icons';
import { Envelope, Info, SignOut, Tag, User } from '@manacore/shared-icons';
import {
SettingsPage,
SettingsSection,
SettingsCard,

View file

@ -0,0 +1,32 @@
import { skillCollection, activityCollection, achievementCollection } from '$lib/data/local-store';
export async function exportData() {
const [skills, activities, achievements] = await Promise.all([
skillCollection.getAll(),
activityCollection.getAll(),
achievementCollection.getAll(),
]);
return { skills, activities, achievements, exportedAt: new Date().toISOString() };
}
export async function importData(data: {
skills?: unknown[];
activities?: unknown[];
achievements?: unknown[];
}) {
if (Array.isArray(data.skills)) {
for (const skill of data.skills) {
await skillCollection.insert(skill as never).catch(() => null);
}
}
if (Array.isArray(data.activities)) {
for (const activity of data.activities) {
await activityCollection.insert(activity as never).catch(() => null);
}
}
if (Array.isArray(data.achievements)) {
for (const achievement of data.achievements) {
await achievementCollection.insert(achievement as never).catch(() => null);
}
}
}

View file

@ -131,8 +131,16 @@ log "Containers running: $RUNNING"
# ─── Create missing databases ───
log "Ensuring databases exist..."
for db in mana_auth mana_credits chat todo calendar clock contacts storage; do
for db in mana_auth mana_credits chat todo calendar clock contacts storage umami; do
docker exec mana-infra-postgres psql -U postgres -c "CREATE DATABASE $db;" 2>/dev/null || true
done
# Matrix Synapse: needs its own user and C-locale database
docker exec mana-infra-postgres psql -U postgres -c \
"DO \$\$ BEGIN IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname='synapse') THEN CREATE USER synapse WITH PASSWORD 'synapse-secure-password'; END IF; END \$\$;" \
2>/dev/null || true
docker exec mana-infra-postgres psql -U postgres -c \
"CREATE DATABASE matrix OWNER synapse ENCODING UTF8 LC_COLLATE='C' LC_CTYPE='C' TEMPLATE template0;" \
2>/dev/null || true
log "=== Startup Complete ($RUNNING containers running) ==="