feat: add semantic-release for automated versioning and help dialog

- Set up semantic-release with zero-touch CI pipeline on push to main
- Add version sync script to keep all package.json files and APP_VERSION
  constant in sync automatically
- Consolidate Docker publishing into single tag-triggered workflow that
  pushes to both Docker Hub and ghcr.io with semver tags
- Add help dialog with keyboard shortcuts, getting started guide, and
  resource links
- Sync all versions to 0.2.1 to match Docker Hub latest
This commit is contained in:
Siddharth Kumar Sah
2026-03-22 21:25:14 +08:00
parent fb1d366d5f
commit 4807bd2726
22 changed files with 2359 additions and 82 deletions
+16 -2
View File
@@ -401,8 +401,22 @@ export async function authMiddleware(app: FastifyInstance): Promise<void> {
app.addHook(
"preHandler",
async (request: FastifyRequest, reply: FastifyReply) => {
// Skip if auth is disabled
if (!env.AUTH_ENABLED) return;
// When auth is disabled, attach the first admin user so requireAuth/requireAdmin pass
if (!env.AUTH_ENABLED) {
const adminUser = db
.select()
.from(schema.users)
.where(eq(schema.users.role, "admin"))
.get();
if (adminUser) {
(request as FastifyRequest & { user?: AuthUser }).user = {
id: adminUser.id,
username: adminUser.username,
role: "admin",
};
}
return;
}
const isPublic = isPublicRoute(request.url);
@@ -55,7 +55,7 @@ export function registerRemoveBackground(app: FastifyInstance) {
const resultBuffer = await removeBackground(
fileBuffer,
join(workspacePath, "output"),
{ model: settings.model },
{ model: settings.model, backgroundColor: settings.backgroundColor },
);
// Save output