feat(onboarding): add Docker label discovery during init
Port label-based container discovery from config-portability and wire it into the onboarding integrations step. Labeled containers take priority over image matching, sync into category sections, and preserve board layout when placing integration widgets.
This commit is contained in:
26 files changed
+1630
-58
No files matched your search
@@ -536,6 +536,33 @@ export const cronJobConfigurations = sqliteTable("cron_job_configuration", {
|
||||
isEnabled: int({ mode: "boolean" }).default(true).notNull(),
|
||||
});
|
||||
|
||||
export const dockerAppSources = sqliteTable(
|
||||
"docker_app_source",
|
||||
{
|
||||
host: text().notNull(),
|
||||
containerId: text().notNull(),
|
||||
externalId: text().notNull(),
|
||||
appId: text()
|
||||
.notNull()
|
||||
.references(() => apps.id, { onDelete: "cascade" }),
|
||||
boardId: text()
|
||||
.notNull()
|
||||
.references(() => boards.id, { onDelete: "cascade" }),
|
||||
itemId: text().references(() => items.id, { onDelete: "set null" }),
|
||||
integrationId: text().references(() => integrations.id, { onDelete: "set null" }),
|
||||
updatedAt: int({ mode: "timestamp" })
|
||||
.$onUpdateFn(() => new Date())
|
||||
.notNull()
|
||||
.$defaultFn(() => new Date()),
|
||||
},
|
||||
(table) => ({
|
||||
compoundKey: primaryKey({
|
||||
columns: [table.host, table.containerId],
|
||||
}),
|
||||
externalIdIdx: index("docker_app_source__external_id_idx").on(table.host, table.externalId),
|
||||
}),
|
||||
);
|
||||
|
||||
export const accountRelations = relations(accounts, ({ one }) => ({
|
||||
user: one(users, {
|
||||
fields: [accounts.userId],
|
||||
@@ -815,3 +842,22 @@ export const customWidgetSecretRelations = relations(customWidgetSecrets, ({ one
|
||||
references: [customWidgetDefinitions.id],
|
||||
}),
|
||||
}));
|
||||
|
||||
export const dockerAppSourceRelations = relations(dockerAppSources, ({ one }) => ({
|
||||
app: one(apps, {
|
||||
fields: [dockerAppSources.appId],
|
||||
references: [apps.id],
|
||||
}),
|
||||
board: one(boards, {
|
||||
fields: [dockerAppSources.boardId],
|
||||
references: [boards.id],
|
||||
}),
|
||||
item: one(items, {
|
||||
fields: [dockerAppSources.itemId],
|
||||
references: [items.id],
|
||||
}),
|
||||
integration: one(integrations, {
|
||||
fields: [dockerAppSources.integrationId],
|
||||
references: [integrations.id],
|
||||
}),
|
||||
}));
|
||||
Reference in new issue
Block a user