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:
@@ -443,7 +443,8 @@ export function CalendarShell({
|
||||
>
|
||||
<SelectTrigger id="event-calendar">
|
||||
<SelectValue>
|
||||
{calendarRows.find((c) => c.id === selectedEvent.calendarId)?.name ?? "Select a calendar"}
|
||||
{calendarRows.find((c) => c.id === selectedEvent.calendarId)?.name ??
|
||||
"Select a calendar"}
|
||||
</SelectValue>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
|
||||
@@ -50,9 +50,7 @@ export function CalendarSharedView({ data }: { data: CalendarShareData }) {
|
||||
<div className="mx-auto max-w-xl space-y-4 p-4">
|
||||
<header>
|
||||
<h1 className="text-2xl font-semibold">{data.name}</h1>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Upcoming events — next 90 days
|
||||
</p>
|
||||
<p className="text-sm text-muted-foreground">Upcoming events — next 90 days</p>
|
||||
</header>
|
||||
{data.events.length === 0 ? (
|
||||
<p className="text-sm text-muted-foreground">No upcoming events.</p>
|
||||
|
||||
@@ -18,12 +18,7 @@ const upcomingConfigSchema = z.object({
|
||||
|
||||
const monthConfigSchema = z.object({ calendarIds: calendarIdsSchema });
|
||||
|
||||
async function UpcomingEventsWidget({
|
||||
config,
|
||||
}: {
|
||||
config: unknown;
|
||||
ctx: WidgetContext;
|
||||
}) {
|
||||
async function UpcomingEventsWidget({ config }: { config: unknown; ctx: WidgetContext }) {
|
||||
const parsed = upcomingConfigSchema.parse(config);
|
||||
const now = new Date();
|
||||
const end = new Date(now.getTime() + parsed.days * 24 * 60 * 60 * 1000);
|
||||
@@ -65,7 +60,11 @@ async function MonthWidget({ config }: { config: unknown; ctx: WidgetContext })
|
||||
const now = new Date();
|
||||
const monthStart = new Date(now.getFullYear(), now.getMonth(), 1);
|
||||
const monthEnd = new Date(now.getFullYear(), now.getMonth() + 1, 0, 23, 59, 59);
|
||||
const events = await listEvents({ from: monthStart, to: monthEnd, calendarIds: parsed.calendarIds });
|
||||
const events = await listEvents({
|
||||
from: monthStart,
|
||||
to: monthEnd,
|
||||
calendarIds: parsed.calendarIds,
|
||||
});
|
||||
|
||||
const monthName = now.toLocaleDateString(undefined, { month: "long", year: "numeric" });
|
||||
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
import { sql } from "drizzle-orm";
|
||||
import {
|
||||
boolean,
|
||||
check,
|
||||
index,
|
||||
pgTable,
|
||||
text,
|
||||
timestamp,
|
||||
uuid,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { boolean, check, index, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
|
||||
import { households, users } from "../_core/schema";
|
||||
|
||||
export const calendars = pgTable(
|
||||
|
||||
@@ -58,7 +58,12 @@ export async function createCalendar(input: z.input<typeof calendarInput>) {
|
||||
.returning();
|
||||
|
||||
if (!calendar) throw new Error("Calendar was not created");
|
||||
await logActivity({ entityType: "calendar.calendar", entityId: calendar.id, action: "create", payload: { name: calendar.name } });
|
||||
await logActivity({
|
||||
entityType: "calendar.calendar",
|
||||
entityId: calendar.id,
|
||||
action: "create",
|
||||
payload: { name: calendar.name },
|
||||
});
|
||||
revalidatePath("/calendar");
|
||||
return calendar;
|
||||
}
|
||||
@@ -72,7 +77,12 @@ export async function renameCalendar(input: { id: string; name: string }) {
|
||||
.set({ name: parsed.name, updatedAt: new Date() })
|
||||
.where(eq(calendars.id, parsed.id));
|
||||
|
||||
await logActivity({ entityType: "calendar.calendar", entityId: parsed.id, action: "update", payload: { name: parsed.name } });
|
||||
await logActivity({
|
||||
entityType: "calendar.calendar",
|
||||
entityId: parsed.id,
|
||||
action: "update",
|
||||
payload: { name: parsed.name },
|
||||
});
|
||||
revalidatePath("/calendar");
|
||||
}
|
||||
|
||||
@@ -90,7 +100,12 @@ export async function setCalendarVisibility(input: {
|
||||
.set({ visibility: parsed.visibility, updatedAt: new Date() })
|
||||
.where(eq(calendars.id, parsed.id));
|
||||
|
||||
await logActivity({ entityType: "calendar.calendar", entityId: parsed.id, action: "update", payload: { visibility: parsed.visibility } });
|
||||
await logActivity({
|
||||
entityType: "calendar.calendar",
|
||||
entityId: parsed.id,
|
||||
action: "update",
|
||||
payload: { visibility: parsed.visibility },
|
||||
});
|
||||
revalidatePath("/calendar");
|
||||
}
|
||||
|
||||
@@ -149,7 +164,12 @@ export async function createEvent(input: z.input<typeof eventInput>) {
|
||||
}
|
||||
}
|
||||
|
||||
await logActivity({ entityType: "calendar.event", entityId: event.id, action: "create", payload: { title: event.title } });
|
||||
await logActivity({
|
||||
entityType: "calendar.event",
|
||||
entityId: event.id,
|
||||
action: "create",
|
||||
payload: { title: event.title },
|
||||
});
|
||||
revalidatePath("/calendar");
|
||||
return {
|
||||
...event,
|
||||
@@ -185,7 +205,12 @@ export async function updateEvent(input: { id: string } & Partial<z.input<typeof
|
||||
})
|
||||
.where(eq(calendarEvents.id, parsed.id));
|
||||
|
||||
await logActivity({ entityType: "calendar.event", entityId: parsed.id, action: "update", payload: parsed.title ? { title: parsed.title } : undefined });
|
||||
await logActivity({
|
||||
entityType: "calendar.event",
|
||||
entityId: parsed.id,
|
||||
action: "update",
|
||||
payload: parsed.title ? { title: parsed.title } : undefined,
|
||||
});
|
||||
revalidatePath("/calendar");
|
||||
}
|
||||
|
||||
|
||||
@@ -125,10 +125,7 @@ export async function searchCalendars(query: string, householdId: string) {
|
||||
.select({ id: calendars.id, name: calendars.name })
|
||||
.from(calendars)
|
||||
.where(
|
||||
and(
|
||||
eq(calendars.householdId, householdId),
|
||||
sql`${calendars.name} ilike ${`%${query}%`}`,
|
||||
),
|
||||
and(eq(calendars.householdId, householdId), sql`${calendars.name} ilike ${`%${query}%`}`),
|
||||
)
|
||||
.limit(10);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user