Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
C4illin committed May 25, 2024
1 parent d81a3a6 commit 10684a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
![ConvertX](images/logo.png)
# ConvertX

A self-hosted online file converter. Supports 808 different formats.
A self-hosted online file converter. Supports 808 different formats. Written with Bun and Elysia.

## Features

- Convert files to different formats
- Password protection
- Multiple accounts


## Converters supported

| Converter | Use case | Converts from | Converts to |
|----------------|---------------|---------------|-------------|
| Sharp | Images (fast) | 7 | 6 |
| Vips | Images (fast) | 45 | 23 |
| Pandoc | Documents | 43 | 65 |
| GraphicsMagick | Images | 166 | 133 |
| FFmpeg | Video | ~473 | ~280 |
Expand Down Expand Up @@ -45,7 +45,7 @@ docker run ghcr.io/c4illin/convertx:master -p 3000:3000 -e ACCOUNT_REGISTRATION=
Then visit `http://localhost:3000` in your browser and create your account. Don't leave it unconfigured and open, as anyone can register the first account.

## Todo
- [ ] Add messages for errors in converters
- [x] Add messages for errors in converters
- [ ] Add options for converters
- [ ] Add more converters
- [ ] Divide index.tsx into smaller components
Expand Down
16 changes: 9 additions & 7 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ const dbVersion = (
db.query("PRAGMA user_version").get() as { user_version?: number }
).user_version;
if (dbVersion === 0) {
db.exec("ALTER TABLE file_names ADD COLUMN status TEXT DEFAULT 'not started';");
db.exec(
"ALTER TABLE file_names ADD COLUMN status TEXT DEFAULT 'not started';",
);
db.exec("PRAGMA user_version = 1;");
}

Expand Down Expand Up @@ -213,27 +215,27 @@ const app = new Elysia()
};
}
const savedPassword = await Bun.password.hash(body.password);

db.query("INSERT INTO users (email, password) VALUES (?, ?)").run(
body.email,
savedPassword,
);

const user = (await db
.query("SELECT * FROM users WHERE email = ?")
.get(body.email)) as IUser;

const accessToken = await jwt.sign({
id: String(user.id),
});

if (!auth) {
set.status = 500;
return {
message: "No auth cookie, perhaps your browser is blocking cookies.",
};
}

// set cookie
auth.set({
value: accessToken,
Expand All @@ -242,7 +244,7 @@ const app = new Elysia()
maxAge: 60 * 60 * 24 * 7,
sameSite: "strict",
});

return redirect("/");
},
{ body: t.Object({ email: t.String(), password: t.String() }) },
Expand Down

0 comments on commit 10684a1

Please sign in to comment.