11 Commits

Author SHA1 Message Date
urania 7ec85dea4f v0.8.2
release / release (push) Failing after 4s
2026-08-24 22:54:21 +02:00
urania a9d661370e fixed the auth update breaking db migration 2026-08-24 22:54:21 +02:00
urania 9969daf489 v0.8.1
release / release (push) Failing after 6s
2026-08-24 22:49:30 +02:00
urania 6392875eb3 fixed the auth update breaking db migration 2026-08-24 22:49:30 +02:00
urania 74d4952102 fixed package.json 2026-08-24 22:47:15 +02:00
urania f606c3ba80 v0.8.0
release / release (push) Successful in 4s
2026-08-24 22:42:32 +02:00
urania c95d2397a0 fixed the auth update breaking db migration 2026-08-24 22:42:32 +02:00
urania 25499ba97d v0.7.6
release / release (push) Failing after 3s
2026-08-24 21:17:56 +02:00
urania 7bc0aea1b3 fixed 2026-08-24 21:17:56 +02:00
urania 3ac43cd014 v0.7.5
release / release (push) Failing after 4s
2026-08-24 10:45:59 +02:00
urania 78f10aeb87 updated 2026-08-24 10:45:59 +02:00
12 changed files with 1360 additions and 385 deletions
+1
View File
@@ -26,6 +26,7 @@ src/lib/paraglide
project.inlang/cache/
# SQLite
*.db
*.sqlite
CONTEXT.md
build.sh
.claude
+9 -3
View File
@@ -5,6 +5,14 @@ FROM base AS install
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
# Runtime deps only: build/ already inlines svelte, kit, drizzle-orm & co, so the
# devDependencies were ~640MB of dead weight per arch. drizzle-kit and its libsql
# driver are the exception — `db:migrate` runs them at startup.
FROM base AS runtime-deps
COPY package.json bun.lock ./
RUN bun install --production --frozen-lockfile \
&& bun add --no-save drizzle-kit@1.0.0-beta.22 @libsql/client@0.17.3
FROM base AS build
ENV NODE_ENV=production
COPY --from=install /app/node_modules node_modules
@@ -31,15 +39,13 @@ ENV NODE_ENV=production \
PORT=3000 \
ORIGIN=http://localhost:3000 \
REPOSITORY_URL=https://tea.urania.dev/api/v1/repos/urania/nadir-agent/releases/latest
# full node_modules: drizzle-kit (devDep) is needed for `drizzle-kit migrate` at startup
WORKDIR /app
COPY --from=install /app/node_modules node_modules
COPY --from=runtime-deps /app/node_modules node_modules
COPY --from=build /app/build build
COPY --from=build /app/config config
COPY drizzle drizzle
COPY drizzle.config.ts package.json ./
RUN mkdir -p /app/data
COPY drizzle.config.ts package.json ./
RUN bun run db:migrate
VOLUME /app/data
EXPOSE 3000
+251 -241
View File
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,83 @@
ALTER TABLE `two_factor` ADD `failed_verification_count` integer DEFAULT 0;--> statement-breakpoint
ALTER TABLE `two_factor` ADD `locked_until` integer;--> statement-breakpoint
PRAGMA foreign_keys=OFF;--> statement-breakpoint
CREATE TABLE `__new_account` (
`access_token` text,
`access_token_expires_at` integer,
`account_id` text NOT NULL,
`created_at` integer DEFAULT (cast(unixepoch('subsecond') * 1000 as integer)) NOT NULL,
`id` text PRIMARY KEY,
`id_token` text,
`issuer` text NOT NULL,
`password` text,
`provider_id` text NOT NULL,
`refresh_token` text,
`refresh_token_expires_at` integer,
`scope` text,
`updated_at` integer NOT NULL,
`user_id` text NOT NULL,
CONSTRAINT `fk_account_user_id_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE
);
--> statement-breakpoint
INSERT INTO `__new_account`(`access_token`, `access_token_expires_at`, `account_id`, `created_at`, `id`, `id_token`, `issuer`, `password`, `provider_id`, `refresh_token`, `refresh_token_expires_at`, `scope`, `updated_at`, `user_id`) SELECT `access_token`, `access_token_expires_at`, `account_id`, `created_at`, `id`, `id_token`, CASE `provider_id` WHEN 'credential' THEN 'local:credential' WHEN 'google' THEN 'https://accounts.google.com' WHEN 'facebook' THEN 'https://www.facebook.com' WHEN 'apple' THEN 'https://appleid.apple.com' ELSE 'local:oauth:' || `provider_id` END, `password`, `provider_id`, `refresh_token`, `refresh_token_expires_at`, `scope`, `updated_at`, `user_id` FROM `account`;--> statement-breakpoint
DROP TABLE `account`;--> statement-breakpoint
ALTER TABLE `__new_account` RENAME TO `account`;--> statement-breakpoint
PRAGMA foreign_keys=ON;--> statement-breakpoint
PRAGMA foreign_keys=OFF;--> statement-breakpoint
CREATE TABLE `__new_session` (
`created_at` integer DEFAULT (cast(unixepoch('subsecond') * 1000 as integer)) NOT NULL,
`expires_at` integer NOT NULL,
`id` text PRIMARY KEY,
`impersonated_by` text,
`ip_address` text,
`token` text NOT NULL UNIQUE,
`updated_at` integer NOT NULL,
`user_agent` text,
`user_id` text NOT NULL,
CONSTRAINT `fk_session_user_id_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE
);
--> statement-breakpoint
INSERT INTO `__new_session`(`created_at`, `expires_at`, `id`, `impersonated_by`, `ip_address`, `token`, `updated_at`, `user_agent`, `user_id`) SELECT `created_at`, `expires_at`, `id`, `impersonated_by`, `ip_address`, `token`, `updated_at`, `user_agent`, `user_id` FROM `session`;--> statement-breakpoint
DROP TABLE `session`;--> statement-breakpoint
ALTER TABLE `__new_session` RENAME TO `session`;--> statement-breakpoint
PRAGMA foreign_keys=ON;--> statement-breakpoint
PRAGMA foreign_keys=OFF;--> statement-breakpoint
CREATE TABLE `__new_user` (
`ban_expires` integer,
`banned` integer DEFAULT false,
`ban_reason` text,
`created_at` integer DEFAULT (cast(unixepoch('subsecond') * 1000 as integer)) NOT NULL,
`display_username` text,
`email` text NOT NULL UNIQUE,
`email_verified` integer DEFAULT false NOT NULL,
`id` text PRIMARY KEY,
`image` text,
`name` text NOT NULL,
`role` text,
`two_factor_enabled` integer DEFAULT false,
`updated_at` integer DEFAULT (cast(unixepoch('subsecond') * 1000 as integer)) NOT NULL,
`username` text UNIQUE
);
--> statement-breakpoint
INSERT INTO `__new_user`(`ban_expires`, `banned`, `ban_reason`, `created_at`, `display_username`, `email`, `email_verified`, `id`, `image`, `name`, `role`, `two_factor_enabled`, `updated_at`, `username`) SELECT `ban_expires`, `banned`, `ban_reason`, `created_at`, `display_username`, `email`, `email_verified`, `id`, `image`, `name`, `role`, `two_factor_enabled`, `updated_at`, `username` FROM `user`;--> statement-breakpoint
DROP TABLE `user`;--> statement-breakpoint
ALTER TABLE `__new_user` RENAME TO `user`;--> statement-breakpoint
PRAGMA foreign_keys=ON;--> statement-breakpoint
PRAGMA foreign_keys=OFF;--> statement-breakpoint
CREATE TABLE `__new_verification` (
`created_at` integer DEFAULT (cast(unixepoch('subsecond') * 1000 as integer)) NOT NULL,
`expires_at` integer NOT NULL,
`id` text PRIMARY KEY,
`identifier` text NOT NULL,
`updated_at` integer DEFAULT (cast(unixepoch('subsecond') * 1000 as integer)) NOT NULL,
`value` text NOT NULL
);
--> statement-breakpoint
INSERT INTO `__new_verification`(`created_at`, `expires_at`, `id`, `identifier`, `updated_at`, `value`) SELECT `created_at`, `expires_at`, `id`, `identifier`, `updated_at`, `value` FROM `verification`;--> statement-breakpoint
DROP TABLE `verification`;--> statement-breakpoint
ALTER TABLE `__new_verification` RENAME TO `verification`;--> statement-breakpoint
PRAGMA foreign_keys=ON;--> statement-breakpoint
CREATE UNIQUE INDEX `account_issuer_accountId_uidx` ON `account` (`issuer`,`account_id`);--> statement-breakpoint
CREATE INDEX `account_userId_idx` ON `account` (`user_id`);--> statement-breakpoint
CREATE INDEX `session_userId_idx` ON `session` (`user_id`);--> statement-breakpoint
CREATE INDEX `verification_identifier_idx` ON `verification` (`identifier`);
@@ -0,0 +1,851 @@
{
"version": "7",
"dialect": "sqlite",
"id": "318d902d-7167-4d9e-a3d1-6abf4ab35a0a",
"prevIds": [
"208e7c97-0071-4c2f-bc0c-7c4cbf18af2e"
],
"ddl": [
{
"name": "machines",
"entityType": "tables"
},
{
"name": "settings",
"entityType": "tables"
},
{
"name": "account",
"entityType": "tables"
},
{
"name": "session",
"entityType": "tables"
},
{
"name": "two_factor",
"entityType": "tables"
},
{
"name": "user",
"entityType": "tables"
},
{
"name": "verification",
"entityType": "tables"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": "'http://127.0.0.1:9999'",
"generated": null,
"name": "address",
"entityType": "columns",
"table": "machines"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "id",
"entityType": "columns",
"table": "machines"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "name",
"entityType": "columns",
"table": "machines"
},
{
"type": "integer",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "order",
"entityType": "columns",
"table": "machines"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "token",
"entityType": "columns",
"table": "machines"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "key",
"entityType": "columns",
"table": "settings"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "updated_at",
"entityType": "columns",
"table": "settings"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "value",
"entityType": "columns",
"table": "settings"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "access_token",
"entityType": "columns",
"table": "account"
},
{
"type": "integer",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "access_token_expires_at",
"entityType": "columns",
"table": "account"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "account_id",
"entityType": "columns",
"table": "account"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "(cast(unixepoch('subsecond') * 1000 as integer))",
"generated": null,
"name": "created_at",
"entityType": "columns",
"table": "account"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "id",
"entityType": "columns",
"table": "account"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "id_token",
"entityType": "columns",
"table": "account"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "issuer",
"entityType": "columns",
"table": "account"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "password",
"entityType": "columns",
"table": "account"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "provider_id",
"entityType": "columns",
"table": "account"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "refresh_token",
"entityType": "columns",
"table": "account"
},
{
"type": "integer",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "refresh_token_expires_at",
"entityType": "columns",
"table": "account"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "scope",
"entityType": "columns",
"table": "account"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "updated_at",
"entityType": "columns",
"table": "account"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "user_id",
"entityType": "columns",
"table": "account"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "(cast(unixepoch('subsecond') * 1000 as integer))",
"generated": null,
"name": "created_at",
"entityType": "columns",
"table": "session"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "expires_at",
"entityType": "columns",
"table": "session"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "id",
"entityType": "columns",
"table": "session"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "impersonated_by",
"entityType": "columns",
"table": "session"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "ip_address",
"entityType": "columns",
"table": "session"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "token",
"entityType": "columns",
"table": "session"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "updated_at",
"entityType": "columns",
"table": "session"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "user_agent",
"entityType": "columns",
"table": "session"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "user_id",
"entityType": "columns",
"table": "session"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "backup_codes",
"entityType": "columns",
"table": "two_factor"
},
{
"type": "integer",
"notNull": false,
"autoincrement": false,
"default": "0",
"generated": null,
"name": "failed_verification_count",
"entityType": "columns",
"table": "two_factor"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "id",
"entityType": "columns",
"table": "two_factor"
},
{
"type": "integer",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "locked_until",
"entityType": "columns",
"table": "two_factor"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "secret",
"entityType": "columns",
"table": "two_factor"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "user_id",
"entityType": "columns",
"table": "two_factor"
},
{
"type": "integer",
"notNull": false,
"autoincrement": false,
"default": "true",
"generated": null,
"name": "verified",
"entityType": "columns",
"table": "two_factor"
},
{
"type": "integer",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "ban_expires",
"entityType": "columns",
"table": "user"
},
{
"type": "integer",
"notNull": false,
"autoincrement": false,
"default": "false",
"generated": null,
"name": "banned",
"entityType": "columns",
"table": "user"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "ban_reason",
"entityType": "columns",
"table": "user"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "(cast(unixepoch('subsecond') * 1000 as integer))",
"generated": null,
"name": "created_at",
"entityType": "columns",
"table": "user"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "display_username",
"entityType": "columns",
"table": "user"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "email",
"entityType": "columns",
"table": "user"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "false",
"generated": null,
"name": "email_verified",
"entityType": "columns",
"table": "user"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "id",
"entityType": "columns",
"table": "user"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "image",
"entityType": "columns",
"table": "user"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "name",
"entityType": "columns",
"table": "user"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "role",
"entityType": "columns",
"table": "user"
},
{
"type": "integer",
"notNull": false,
"autoincrement": false,
"default": "false",
"generated": null,
"name": "two_factor_enabled",
"entityType": "columns",
"table": "user"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "(cast(unixepoch('subsecond') * 1000 as integer))",
"generated": null,
"name": "updated_at",
"entityType": "columns",
"table": "user"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "username",
"entityType": "columns",
"table": "user"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "(cast(unixepoch('subsecond') * 1000 as integer))",
"generated": null,
"name": "created_at",
"entityType": "columns",
"table": "verification"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "expires_at",
"entityType": "columns",
"table": "verification"
},
{
"type": "text",
"notNull": false,
"autoincrement": false,
"default": null,
"generated": null,
"name": "id",
"entityType": "columns",
"table": "verification"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "identifier",
"entityType": "columns",
"table": "verification"
},
{
"type": "integer",
"notNull": true,
"autoincrement": false,
"default": "(cast(unixepoch('subsecond') * 1000 as integer))",
"generated": null,
"name": "updated_at",
"entityType": "columns",
"table": "verification"
},
{
"type": "text",
"notNull": true,
"autoincrement": false,
"default": null,
"generated": null,
"name": "value",
"entityType": "columns",
"table": "verification"
},
{
"columns": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "NO ACTION",
"onDelete": "CASCADE",
"nameExplicit": false,
"name": "fk_account_user_id_user_id_fk",
"entityType": "fks",
"table": "account"
},
{
"columns": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "NO ACTION",
"onDelete": "CASCADE",
"nameExplicit": false,
"name": "fk_session_user_id_user_id_fk",
"entityType": "fks",
"table": "session"
},
{
"columns": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "NO ACTION",
"onDelete": "CASCADE",
"nameExplicit": false,
"name": "fk_two_factor_user_id_user_id_fk",
"entityType": "fks",
"table": "two_factor"
},
{
"columns": [
"id"
],
"nameExplicit": false,
"name": "machines_pk",
"table": "machines",
"entityType": "pks"
},
{
"columns": [
"key"
],
"nameExplicit": false,
"name": "settings_pk",
"table": "settings",
"entityType": "pks"
},
{
"columns": [
"id"
],
"nameExplicit": false,
"name": "account_pk",
"table": "account",
"entityType": "pks"
},
{
"columns": [
"id"
],
"nameExplicit": false,
"name": "session_pk",
"table": "session",
"entityType": "pks"
},
{
"columns": [
"id"
],
"nameExplicit": false,
"name": "two_factor_pk",
"table": "two_factor",
"entityType": "pks"
},
{
"columns": [
"id"
],
"nameExplicit": false,
"name": "user_pk",
"table": "user",
"entityType": "pks"
},
{
"columns": [
"id"
],
"nameExplicit": false,
"name": "verification_pk",
"table": "verification",
"entityType": "pks"
},
{
"columns": [
{
"value": "issuer",
"isExpression": false
},
{
"value": "account_id",
"isExpression": false
}
],
"isUnique": true,
"where": null,
"origin": "manual",
"name": "account_issuer_accountId_uidx",
"entityType": "indexes",
"table": "account"
},
{
"columns": [
{
"value": "user_id",
"isExpression": false
}
],
"isUnique": false,
"where": null,
"origin": "manual",
"name": "account_userId_idx",
"entityType": "indexes",
"table": "account"
},
{
"columns": [
{
"value": "user_id",
"isExpression": false
}
],
"isUnique": false,
"where": null,
"origin": "manual",
"name": "session_userId_idx",
"entityType": "indexes",
"table": "session"
},
{
"columns": [
{
"value": "secret",
"isExpression": false
}
],
"isUnique": false,
"where": null,
"origin": "manual",
"name": "twoFactor_secret_idx",
"entityType": "indexes",
"table": "two_factor"
},
{
"columns": [
{
"value": "user_id",
"isExpression": false
}
],
"isUnique": false,
"where": null,
"origin": "manual",
"name": "twoFactor_userId_idx",
"entityType": "indexes",
"table": "two_factor"
},
{
"columns": [
{
"value": "identifier",
"isExpression": false
}
],
"isUnique": false,
"where": null,
"origin": "manual",
"name": "verification_identifier_idx",
"entityType": "indexes",
"table": "verification"
},
{
"columns": [
"order"
],
"nameExplicit": false,
"name": "machines_order_unique",
"entityType": "uniques",
"table": "machines"
},
{
"columns": [
"token"
],
"nameExplicit": false,
"name": "session_token_unique",
"entityType": "uniques",
"table": "session"
},
{
"columns": [
"email"
],
"nameExplicit": false,
"name": "user_email_unique",
"entityType": "uniques",
"table": "user"
},
{
"columns": [
"username"
],
"nameExplicit": false,
"name": "user_username_unique",
"entityType": "uniques",
"table": "user"
}
],
"renames": []
}
+41 -41
View File
@@ -1,12 +1,12 @@
{
"name": "clean",
"private": true,
"version": "0.7.4",
"version": "0.8.2",
"type": "module",
"scripts": {
"dev:types": "bun run type:generate && bun --bun vite dev --host",
"dev": "bun --bun vite dev --host",
"build": "vite build",
"build": "bun --bun vite build",
"preview": "vite preview",
"prepare": "svelte-kit sync || echo ''",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
@@ -20,73 +20,73 @@
"db:studio": "drizzle-kit studio"
},
"devDependencies": {
"@better-svelte-email/cli": "^2.1.1",
"@better-svelte-email/cli": "^2.1.3",
"@eslint/js": "^10.0.1",
"@fontsource-variable/geist": "^5.2.9",
"@inlang/paraglide-js": "^2.20.2",
"@internationalized/date": "^3.12.0",
"@libsql/client": "^0.17.3",
"@lucide/svelte": "^1.21.0",
"@sveltejs/adapter-node": "^5.5.4",
"@sveltejs/kit": "^2.63.0",
"@sveltejs/vite-plugin-svelte": "^7.1.2",
"@tailwindcss/vite": "^4.3.0",
"@fontsource-variable/geist": "^5.3.0",
"@inlang/paraglide-js": "^2.24.1",
"@internationalized/date": "^3.12.3",
"@libsql/client": "^0.17.4",
"@lucide/svelte": "^1.33.0",
"@sveltejs/adapter-node": "^5.5.7",
"@sveltejs/kit": "^2.70.3",
"@sveltejs/vite-plugin-svelte": "^7.3.0",
"@tailwindcss/vite": "^4.3.3",
"@tanstack/table-core": "^8.21.3",
"@types/bun": "^1.3.14",
"@types/node": "^24",
"@types/bun": "^1.4.0",
"@types/node": "^24.13.3",
"@types/nodemailer": "^8.0.1",
"@types/ssh2": "^1.15.5",
"@types/ws": "^8.18.1",
"bits-ui": "^2.16.3",
"bits-ui": "^2.19.0",
"clsx": "^2.1.1",
"drizzle-kit": "^1.0.0-beta.22",
"drizzle-orm": "^1.0.0-beta.22",
"embla-carousel-svelte": "^8.6.0",
"eslint": "^10.4.1",
"eslint": "^10.9.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-perfectionist": "^5.9.1",
"eslint-plugin-svelte": "^3.19.0",
"eslint-plugin-perfectionist": "^5.10.1",
"eslint-plugin-svelte": "^3.23.0",
"formsnap": "^2.0.1",
"globals": "^17.6.0",
"globals": "^17.11.0",
"layerchart": "2.0.0-next.48",
"mode-watcher": "^1.1.0",
"openapi-typescript": "^7.13.0",
"paneforge": "^1.0.2",
"prettier": "^3.8.3",
"prettier-plugin-svelte": "^4.1.0",
"prettier-plugin-tailwindcss": "^0.8.0",
"shadcn-svelte": "^1.3.0",
"svelte": "^5.56.1",
"prettier": "^3.9.6",
"prettier-plugin-svelte": "^4.1.1",
"prettier-plugin-tailwindcss": "^0.8.1",
"shadcn-svelte": "^1.5.0",
"svelte": "^5.56.10",
"svelte-adapter-bun": "^1.0.1",
"svelte-check": "^4.6.0",
"svelte-sonner": "^1.1.0",
"sveltekit-superforms": "^2.30.0",
"tailwind-merge": "^3.5.0",
"tailwind-variants": "^3.2.2",
"tailwindcss": "^4.3.0",
"svelte-check": "^4.7.6",
"svelte-sonner": "^1.2.1",
"sveltekit-superforms": "^2.30.2",
"tailwind-merge": "^3.6.0",
"tailwind-variants": "^3.3.1",
"tailwindcss": "^4.3.3",
"tw-animate-css": "^1.4.0",
"typescript": "^6.0.3",
"typescript-eslint": "^8.60.1",
"typescript-eslint": "^8.67.0",
"vaul-svelte": "^1.0.0-next.7",
"vite": "^8.0.16",
"ws": "^8.21.0"
"vite": "^8.2.2",
"ws": "^8.21.3"
},
"dependencies": {
"@better-auth/infra": "^0.2.14",
"@better-svelte-email/components": "^2.1.1",
"@better-svelte-email/server": "^2.1.1",
"@better-auth/infra": "^0.4.2",
"@better-svelte-email/components": "^2.1.3",
"@better-svelte-email/server": "^2.1.3",
"@xterm/addon-attach": "^0.12.0",
"@xterm/addon-fit": "^0.11.0",
"@xterm/xterm": "^6.0.0",
"better-auth": "^1.6.20",
"nodemailer": "^9.0.1",
"drizzle-orm": "^1.0.0-beta.22",
"better-auth": "^1.7.1",
"nodemailer": "^9.0.5",
"ogl": "^1.0.11",
"openapi-fetch": "^0.17.0",
"runed": "^0.37.1",
"ssh2": "^1.17.0",
"swapy": "^1.0.5",
"undici": "^8.5.0",
"undici": "^8.10.0",
"uqr": "^0.1.3",
"valibot": "^1.4.1"
"valibot": "^1.4.2"
}
}
+1 -3
View File
@@ -5,7 +5,6 @@ import { env } from '$env/dynamic/public';
import { createAuthClient } from 'better-auth/client';
import {
adminClient,
genericOAuthClient,
inferAdditionalFields,
twoFactorClient,
usernameClient
@@ -19,13 +18,12 @@ export const getAuthClient = () =>
},
plugins: [
adminClient(),
genericOAuthClient(),
twoFactorClient({
onTwoFactorRedirect: async () => {
await goto(resolve('/auth/2fa'));
}
}),
usernameClient(),
inferAdditionalFields<Auth>()
inferAdditionalFields<Auth>(),
]
});
+1 -5
View File
@@ -1,12 +1,11 @@
import { dash } from '@better-auth/infra';
import { getRequestEvent } from '$app/server';
import { m } from '$lib/paraglide/messages';
import { getConfig } from '$lib/server/config';
import { db } from '$lib/server/db';
import * as schema from '$lib/server/db/schema';
import { emailer } from '$lib/server/emails';
import { betterAuth } from 'better-auth';
import { drizzleAdapter } from 'better-auth/adapters/drizzle';
import { betterAuth } from 'better-auth/minimal';
import { admin, twoFactor, username } from 'better-auth/plugins';
import { genericOAuth, type GenericOAuthConfig } from 'better-auth/plugins/generic-oauth';
import { sveltekitCookies } from 'better-auth/svelte-kit';
@@ -60,7 +59,6 @@ function build() {
},
plugins: [
admin(),
dash(),
genericOAuth({ config: oauthConfig }),
twoFactor({
issuer: m.appname(),
@@ -106,8 +104,6 @@ function build() {
});
}
// ponytail: single-slot cache, rebuilt on config edits via invalidateAuth().
// In-flight rate-limit counters and 2FA flow state reset on invalidation.
let cached: null | ReturnType<typeof build> = null;
export type Auth = ReturnType<typeof build>;
+3 -3
View File
@@ -134,11 +134,11 @@ export const disableTwoFactor = command(v.string(), async (password) => {
});
export const unlinkAccount = command(
v.object({ accountId: v.string(), providerId: v.string() }),
async ({ accountId, providerId }) => {
v.object({ accountId: v.string() }),
async ({ accountId }) => {
const { headers } = ctx();
try {
await getAuth().api.unlinkAccount({ body: { accountId, providerId }, headers });
await getAuth().api.unlinkAccount({ body: { accountId }, headers });
} catch (e) {
fail(e);
}
+117 -87
View File
@@ -1,100 +1,130 @@
import { index, integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';
import { sql } from "drizzle-orm/sql";
import {
index,
integer,
sqliteTable,
text,
uniqueIndex,
} from "drizzle-orm/sqlite-core";
export const user = sqliteTable('user', {
banExpires: integer('ban_expires', { mode: 'timestamp_ms' }),
banned: integer('banned', { mode: 'boolean' }).default(false),
banReason: text('ban_reason'),
createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(),
displayUsername: text('display_username'),
email: text('email').notNull().unique(),
emailVerified: integer('email_verified', { mode: 'boolean' }).default(false).notNull(),
id: text('id').primaryKey(),
image: text('image'),
name: text('name').notNull(),
role: text('role'),
twoFactorEnabled: integer('two_factor_enabled', { mode: 'boolean' }).default(false),
updatedAt: integer('updated_at', { mode: 'timestamp_ms' })
.$onUpdate(() => new Date())
.notNull(),
username: text('username').unique()
export const user = sqliteTable("user", {
banExpires: integer("ban_expires", { mode: "timestamp_ms" }),
banned: integer("banned", { mode: "boolean" }).default(false),
banReason: text("ban_reason"),
createdAt: integer("created_at", { mode: "timestamp_ms" })
.default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`)
.notNull(),
displayUsername: text("display_username"),
email: text("email").notNull().unique(),
emailVerified: integer("email_verified", { mode: "boolean" })
.default(false)
.notNull(),
id: text("id").primaryKey(),
image: text("image"),
name: text("name").notNull(),
role: text("role"),
twoFactorEnabled: integer("two_factor_enabled", { mode: "boolean" }).default(
false,
),
updatedAt: integer("updated_at", { mode: "timestamp_ms" })
.default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`)
.$onUpdate(() => /* @__PURE__ */ new Date())
.notNull(),
username: text("username").unique(),
});
export const session = sqliteTable(
'session',
{
createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(),
expiresAt: integer('expires_at', { mode: 'timestamp_ms' }).notNull(),
id: text('id').primaryKey(),
impersonatedBy: text('impersonated_by'),
ipAddress: text('ip_address'),
token: text('token').notNull().unique(),
updatedAt: integer('updated_at', { mode: 'timestamp_ms' })
.$onUpdate(() => new Date())
.notNull(),
userAgent: text('user_agent'),
userId: text('user_id')
.notNull()
.references(() => user.id, { onDelete: 'cascade' })
},
(table) => [index('session_userId_idx').on(table.userId)]
"session",
{
createdAt: integer("created_at", { mode: "timestamp_ms" })
.default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`)
.notNull(),
expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull(),
id: text("id").primaryKey(),
impersonatedBy: text("impersonated_by"),
ipAddress: text("ip_address"),
token: text("token").notNull().unique(),
updatedAt: integer("updated_at", { mode: "timestamp_ms" })
.$onUpdate(() => /* @__PURE__ */ new Date())
.notNull(),
userAgent: text("user_agent"),
userId: text("user_id")
.notNull()
.references(() => user.id, { onDelete: "cascade" }),
},
(table) => [index("session_userId_idx").on(table.userId)],
);
export const account = sqliteTable(
'account',
{
accessToken: text('access_token'),
accessTokenExpiresAt: integer('access_token_expires_at', {
mode: 'timestamp_ms'
}),
accountId: text('account_id').notNull(),
createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(),
id: text('id').primaryKey(),
idToken: text('id_token'),
password: text('password'),
providerId: text('provider_id').notNull(),
refreshToken: text('refresh_token'),
refreshTokenExpiresAt: integer('refresh_token_expires_at', {
mode: 'timestamp_ms'
}),
scope: text('scope'),
updatedAt: integer('updated_at', { mode: 'timestamp_ms' })
.$onUpdate(() => new Date())
.notNull(),
userId: text('user_id')
.notNull()
.references(() => user.id, { onDelete: 'cascade' })
},
(table) => [index('account_userId_idx').on(table.userId)]
"account",
{
accessToken: text("access_token"),
accessTokenExpiresAt: integer("access_token_expires_at", {
mode: "timestamp_ms",
}),
accountId: text("account_id").notNull(),
createdAt: integer("created_at", { mode: "timestamp_ms" })
.default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`)
.notNull(),
id: text("id").primaryKey(),
idToken: text("id_token"),
issuer: text("issuer").notNull(),
password: text("password"),
providerId: text("provider_id").notNull(),
refreshToken: text("refresh_token"),
refreshTokenExpiresAt: integer("refresh_token_expires_at", {
mode: "timestamp_ms",
}),
scope: text("scope"),
updatedAt: integer("updated_at", { mode: "timestamp_ms" })
.$onUpdate(() => /* @__PURE__ */ new Date())
.notNull(),
userId: text("user_id")
.notNull()
.references(() => user.id, { onDelete: "cascade" }),
},
(table) => [
uniqueIndex("account_issuer_accountId_uidx").on(
table.issuer,
table.accountId,
),
index("account_userId_idx").on(table.userId),
],
);
export const verification = sqliteTable(
'verification',
{
createdAt: integer('created_at', { mode: 'timestamp_ms' }).notNull(),
expiresAt: integer('expires_at', { mode: 'timestamp_ms' }).notNull(),
id: text('id').primaryKey(),
identifier: text('identifier').notNull(),
updatedAt: integer('updated_at', { mode: 'timestamp_ms' })
.$onUpdate(() => new Date())
.notNull(),
value: text('value').notNull()
},
(table) => [index('verification_identifier_idx').on(table.identifier)]
"verification",
{
createdAt: integer("created_at", { mode: "timestamp_ms" })
.default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`)
.notNull(),
expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull(),
id: text("id").primaryKey(),
identifier: text("identifier").notNull(),
updatedAt: integer("updated_at", { mode: "timestamp_ms" })
.default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`)
.$onUpdate(() => /* @__PURE__ */ new Date())
.notNull(),
value: text("value").notNull(),
},
(table) => [index("verification_identifier_idx").on(table.identifier)],
);
export const twoFactor = sqliteTable(
'two_factor',
{
backupCodes: text('backup_codes').notNull(),
id: text('id').primaryKey(),
secret: text('secret').notNull(),
userId: text('user_id')
.notNull()
.references(() => user.id, { onDelete: 'cascade' }),
verified: integer('verified', { mode: 'boolean' }).default(true)
},
(table) => [
index('twoFactor_secret_idx').on(table.secret),
index('twoFactor_userId_idx').on(table.userId)
]
);
"two_factor",
{
backupCodes: text("backup_codes").notNull(),
failedVerificationCount: integer("failed_verification_count").default(0),
id: text("id").primaryKey(),
lockedUntil: integer("locked_until", { mode: "timestamp_ms" }),
secret: text("secret").notNull(),
userId: text("user_id")
.notNull()
.references(() => user.id, { onDelete: "cascade" }),
verified: integer("verified", { mode: "boolean" }).default(true),
},
(table) => [
index("twoFactor_secret_idx").on(table.secret),
index("twoFactor_userId_idx").on(table.userId),
],
);
+1 -1
View File
@@ -279,7 +279,7 @@
title={account.accounts.length < 2 ? m.account_unlink_last_hint() : undefined}
onclick={() =>
run(
() => unlinkAccount({ accountId: acc.accountId, providerId: acc.providerId }),
() => unlinkAccount({ accountId: acc.accountId }),
m.account_unlinked()
)}
>
+1 -1
View File
@@ -1,7 +1,7 @@
import { paraglideVitePlugin } from '@inlang/paraglide-js';
import adapter from '@sveltejs/adapter-node';
import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from '@tailwindcss/vite';
import adapter from 'svelte-adapter-bun';
import { defineConfig } from 'vite';
export default defineConfig({