mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user