chore: ⬆️ Upgrade Bun to 1.2.0

This commit is contained in:
Jesse Wierzbinski 2025-01-23 15:28:16 +01:00
parent e32b6f9f8e
commit c4339e64bd
No known key found for this signature in database
7 changed files with 17 additions and 8 deletions

View file

@ -1,5 +1,5 @@
# Bun doesn't run well on Musl but this seems to work # Bun doesn't run well on Musl but this seems to work
FROM oven/bun:1.1.42-alpine as base FROM oven/bun:1.2.0-alpine as base
# Switch to Bash by editing /etc/passwd # Switch to Bash by editing /etc/passwd
RUN apk add --no-cache libstdc++ git bash curl openssh cloc && \ RUN apk add --no-cache libstdc++ git bash curl openssh cloc && \

View file

@ -10,7 +10,7 @@ Versia Server `0.8.0` is fully backwards compatible with `0.7.0`.
- Added an administration UI for managing the queue. - Added an administration UI for managing the queue.
- Media processing is now also handled by a queue system. - Media processing is now also handled by a queue system.
- Added [Push Notifications](https://docs.joinmastodon.org/methods/push) support. - Added [Push Notifications](https://docs.joinmastodon.org/methods/push) support.
- Upgraded Bun to `1.1.42`. - Upgraded Bun to `1.2.0`.
- Implemented support for the [**Instance Messaging Extension**](https://versia.pub/extensions/instance-messaging) - Implemented support for the [**Instance Messaging Extension**](https://versia.pub/extensions/instance-messaging)
- Implement [**Shared Inboxes**](https://versia.pub/federation#inboxes) support. - Implement [**Shared Inboxes**](https://versia.pub/federation#inboxes) support.
- Allowed `<div>` and `<span>` tags in Markdown. - Allowed `<div>` and `<span>` tags in Markdown.

View file

@ -26,7 +26,7 @@ RUN bun run build
WORKDIR /temp/dist WORKDIR /temp/dist
# Copy production dependencies and source code into final image # Copy production dependencies and source code into final image
FROM oven/bun:1.1.42-alpine FROM oven/bun:1.2.0-alpine
# Install libstdc++ for Bun and create app directory # Install libstdc++ for Bun and create app directory
RUN apk add --no-cache libstdc++ && \ RUN apk add --no-cache libstdc++ && \

View file

@ -26,7 +26,7 @@ RUN bun run build:worker
WORKDIR /temp/dist WORKDIR /temp/dist
# Copy production dependencies and source code into final image # Copy production dependencies and source code into final image
FROM oven/bun:1.1.42-alpine FROM oven/bun:1.2.0-alpine
# Install libstdc++ for Bun and create app directory # Install libstdc++ for Bun and create app directory
RUN apk add --no-cache libstdc++ && \ RUN apk add --no-cache libstdc++ && \

View file

@ -29,6 +29,9 @@ describe("DiskMediaDriver", () => {
media: { media: {
local_uploads_folder: "/test/uploads", local_uploads_folder: "/test/uploads",
}, },
http: {
base_url: "http://localhost:3000",
},
} as Config; } as Config;
mockMediaHasher = mock(() => Promise.resolve("testhash")); mockMediaHasher = mock(() => Promise.resolve("testhash"));

View file

@ -80,6 +80,12 @@ export class DiskMediaDriver implements MediaDriver {
*/ */
public async deleteFileByUrl(url: string): Promise<void> { public async deleteFileByUrl(url: string): Promise<void> {
const urlObj = new URL(url); const urlObj = new URL(url);
// Check if URL is from the local uploads folder
if (urlObj.host !== new URL(this.config.http.base_url).host) {
return Promise.resolve();
}
const hash = urlObj.pathname.split("/").at(-2); const hash = urlObj.pathname.split("/").at(-2);
if (!hash) { if (!hash) {
throw new Error("Invalid URL"); throw new Error("Invalid URL");

View file

@ -2,15 +2,15 @@
## Requirements ## Requirements
- The [Bun Runtime](https://bun.sh), version 1.1.25 or later (usage of the latest version is recommended) - The [Bun Runtime](https://bun.sh), version 1.2.0 or later (usage of the latest version is recommended)
- Versia Server will not work on lower versions than 1.1.25. - Versia Server will not work on lower versions than 1.2.0.
- A PostgreSQL database - A PostgreSQL database
- (Optional but recommended) A Linux-based operating system - (Optional but recommended) A Linux-based operating system
- (Optional if you want search) A working [Sonic](https://github.com/valeriansaliou/sonic) instance - (Optional if you want search) A working [Sonic](https://github.com/valeriansaliou/sonic) instance
> [!WARNING] > [!WARNING]
> Versia Server has not been tested on Windows or macOS. It is recommended to use a Linux-based operating system to run Versia Server. > Versia Server has not been tested on Windows or macOS. It is recommended to use a Linux-based operating system to run Versia Server.
> >
> We will not be offering support to Windows or macOS users. If you are using one of these operating systems, please use a virtual machine or container to run Versia Server. > We will not be offering support to Windows or macOS users. If you are using one of these operating systems, please use a virtual machine or container to run Versia Server.
## With Docker/Podman ## With Docker/Podman
@ -92,4 +92,4 @@ Updating the server is as simple as pulling the latest changes from the reposito
For Docker, you can run `docker-compose pull` to update the Docker images. For Docker, you can run `docker-compose pull` to update the Docker images.
Sometimes, new configuration options are added to `config.example.toml`. If you see a new option in the example file, you should add it to your `config.toml` file. Sometimes, new configuration options are added to `config.example.toml`. If you see a new option in the example file, you should add it to your `config.toml` file.