Code-side
src/lib/dev-login-config.ts — startup assertion: throws if NODE_ENV=production + ENABLE_DEV_LOGIN=true, scoped to runtime (skipped during next build).
Container
scripts/migrate.mjs — runs Drizzle migrations against DATABASE_URL.
deploy/docker-entrypoint.sh — runs migrations then exec node server.js. Skip with RUN_MIGRATIONS=false.
Dockerfile — copies drizzle/, scripts/migrate.mjs, entrypoint into runner stage; ENTRYPOINT now points at the script.
Compose
deploy/compose.yaml — famapp now image: ${FAMAPP_IMAGE:-ghcr.io/ginnoir/famapp:latest} (build still works locally as fallback). Authentik pinned via AUTHENTIK_IMAGE_TAG (default 2024.12.3). New RUN_MIGRATIONS env passed through.
.env.production.example — documents FAMAPP_IMAGE, AUTHENTIK_IMAGE_TAG, RUN_MIGRATIONS.
CI/CD
.github/workflows/ci.yml — push/PR: typecheck + lint + format:check + build.
.github/workflows/release.yml — v* tag: build + push ghcr.io/ginnoir/famapp:vX.Y.Z, :X.Y, :latest to GHCR.
Docs
deploy/README.md — full deploy/rollback/release runbook.
CHANGELOG.md — release log seeded with an Unreleased entry.
docs/tasks/09-pre-deploy-checklist.md — task 09 reframed from one-shot removal to a recurring pre-deploy checklist.
STATUS.md — updated.
Verified: pnpm typecheck, pnpm format, pnpm build, and docker compose config all clean.
This commit is contained in:
@@ -95,9 +95,7 @@ function ItemRow({
|
||||
)}
|
||||
<span className={`text-sm ${item.done ? "text-muted-foreground line-through" : ""}`}>
|
||||
{item.text}
|
||||
{item.qty && (
|
||||
<span className="ml-1 text-xs text-muted-foreground">×{item.qty}</span>
|
||||
)}
|
||||
{item.qty && <span className="ml-1 text-xs text-muted-foreground">×{item.qty}</span>}
|
||||
</span>
|
||||
</li>
|
||||
);
|
||||
|
||||
@@ -36,11 +36,7 @@ const manifest: ModuleManifest = {
|
||||
resolveUrl: (id) => `/lists/${id}`,
|
||||
loadForShare: (id) => loadListForShare(id),
|
||||
renderSharedView: ({ data, capabilities, token }) => (
|
||||
<ListSharedView
|
||||
data={data as ListShareData}
|
||||
canWrite={capabilities.write}
|
||||
token={token}
|
||||
/>
|
||||
<ListSharedView data={data as ListShareData} canWrite={capabilities.write} token={token} />
|
||||
),
|
||||
renderActivity: (entry) => {
|
||||
const name = entry.payload?.name as string | undefined;
|
||||
|
||||
@@ -47,7 +47,12 @@ export async function createList(input: z.input<typeof listInput>) {
|
||||
.returning();
|
||||
|
||||
if (!list) throw new Error("List was not created");
|
||||
await logActivity({ entityType: "lists.list", entityId: list.id, action: "create", payload: { name: list.name } });
|
||||
await logActivity({
|
||||
entityType: "lists.list",
|
||||
entityId: list.id,
|
||||
action: "create",
|
||||
payload: { name: list.name },
|
||||
});
|
||||
revalidatePath("/lists");
|
||||
return list;
|
||||
}
|
||||
@@ -57,7 +62,12 @@ export async function renameList(input: { id: string; name: string }) {
|
||||
const { household } = await getCurrentSession();
|
||||
await assertCanAccessList(parsed.id, household.id);
|
||||
await db.update(lists).set({ name: parsed.name }).where(eq(lists.id, parsed.id));
|
||||
await logActivity({ entityType: "lists.list", entityId: parsed.id, action: "update", payload: { name: parsed.name } });
|
||||
await logActivity({
|
||||
entityType: "lists.list",
|
||||
entityId: parsed.id,
|
||||
action: "update",
|
||||
payload: { name: parsed.name },
|
||||
});
|
||||
revalidatePath("/lists");
|
||||
revalidatePath(`/lists/${parsed.id}`);
|
||||
await notifyListChanged(parsed.id);
|
||||
@@ -98,7 +108,12 @@ export async function addItem(input: z.input<typeof itemInput>) {
|
||||
.returning();
|
||||
|
||||
if (!item) throw new Error("List item was not created");
|
||||
await logActivity({ entityType: "lists.item", entityId: item.id, action: "create", payload: { text: item.text } });
|
||||
await logActivity({
|
||||
entityType: "lists.item",
|
||||
entityId: item.id,
|
||||
action: "create",
|
||||
payload: { text: item.text },
|
||||
});
|
||||
revalidatePath(`/lists/${parsed.listId}`);
|
||||
await notifyListChanged(parsed.listId);
|
||||
return getList(parsed.listId);
|
||||
@@ -127,7 +142,12 @@ export async function toggleItem(input: { id: string; done?: boolean }) {
|
||||
.set({ done, updatedAt: new Date() })
|
||||
.where(eq(listItems.id, parsed.id));
|
||||
|
||||
await logActivity({ entityType: "lists.item", entityId: parsed.id, action: "toggle", payload: { done, text: existing.text } });
|
||||
await logActivity({
|
||||
entityType: "lists.item",
|
||||
entityId: parsed.id,
|
||||
action: "toggle",
|
||||
payload: { done, text: existing.text },
|
||||
});
|
||||
revalidatePath(`/lists/${existing.listId}`);
|
||||
await notifyListChanged(existing.listId);
|
||||
return getList(existing.listId);
|
||||
@@ -150,7 +170,12 @@ export async function updateItem(input: z.input<typeof updateItemInput>) {
|
||||
})
|
||||
.where(eq(listItems.id, parsed.id));
|
||||
|
||||
await logActivity({ entityType: "lists.item", entityId: parsed.id, action: "update", payload: { text: parsed.text ?? existing.text } });
|
||||
await logActivity({
|
||||
entityType: "lists.item",
|
||||
entityId: parsed.id,
|
||||
action: "update",
|
||||
payload: { text: parsed.text ?? existing.text },
|
||||
});
|
||||
revalidatePath(`/lists/${existing.listId}`);
|
||||
await notifyListChanged(existing.listId);
|
||||
return getList(existing.listId);
|
||||
@@ -160,7 +185,12 @@ export async function deleteItem(input: { id: string }) {
|
||||
const parsed = z.object({ id: z.string().uuid() }).parse(input);
|
||||
const { household } = await getCurrentSession();
|
||||
const existing = await getAuthorizedItem(parsed.id, household.id);
|
||||
await logActivity({ entityType: "lists.item", entityId: parsed.id, action: "delete", payload: { text: existing.text } });
|
||||
await logActivity({
|
||||
entityType: "lists.item",
|
||||
entityId: parsed.id,
|
||||
action: "delete",
|
||||
payload: { text: existing.text },
|
||||
});
|
||||
await db.delete(listItems).where(eq(listItems.id, parsed.id));
|
||||
revalidatePath(`/lists/${existing.listId}`);
|
||||
await notifyListChanged(existing.listId);
|
||||
|
||||
@@ -193,7 +193,10 @@ export async function listListsWithItems(): Promise<ListWithItemsDto[]> {
|
||||
.where(
|
||||
and(
|
||||
inArray(listItems.listId, listIds),
|
||||
or(eq(listItems.done, false), and(eq(listItems.done, true), gt(listItems.updatedAt, cutoff))),
|
||||
or(
|
||||
eq(listItems.done, false),
|
||||
and(eq(listItems.done, true), gt(listItems.updatedAt, cutoff)),
|
||||
),
|
||||
),
|
||||
)
|
||||
.orderBy(asc(listItems.done), asc(listItems.position), asc(listItems.createdAt));
|
||||
|
||||
@@ -41,10 +41,7 @@ export async function toggleShareListItem(rawToken: string, itemId: string): Pro
|
||||
if (!item) throw new Error("Item not found");
|
||||
|
||||
const done = !item.done;
|
||||
await db
|
||||
.update(listItems)
|
||||
.set({ done, updatedAt: new Date() })
|
||||
.where(eq(listItems.id, itemId));
|
||||
await db.update(listItems).set({ done, updatedAt: new Date() }).where(eq(listItems.id, itemId));
|
||||
|
||||
await logShareActivity({
|
||||
householdId: resolved.householdId,
|
||||
|
||||
Reference in New Issue
Block a user