update readme

This commit is contained in:
C4illin
2024-05-25 15:56:34 +02:00
parent d81a3a6ab4
commit 10684a1f90
2 changed files with 13 additions and 11 deletions

View File

@@ -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 |
@@ -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

View File

@@ -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;");
}
@@ -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,
@@ -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() }) },