Skip to content

JSPaste/Backend

Repository files navigation

Backend

Setup

Binary

  • Download the latest release and uncompress it to a new folder
  • Edit the .env.example file and rename it to .env
  • Run the binary...

Linux & macOS:

./backend

Windows:

powershell -c ".\backend.exe"

Container

  • Pull latest image and run the container:
docker pull ghcr.io/jspaste/backend:latest
docker run -e DOCS_ENABLED=true -d -p 127.0.0.1:4000:4000 \
  ghcr.io/jspaste/backend:latest

Validate

Important

All artifacts and images originate from GitHub JSPaste/Backend repository, no other artifacts or images built and distributed outside that repository are considered secure nor trusted by the JSPaste team.

Artifacts are attested and can be verified using the following command:

gh attestation verify backend.tar.gz \
  --owner JSPaste

Since container version 2024.05.06-e105023, images are attested and can be verified using the following command:

gh attestation verify oci://ghcr.io/jspaste/backend:latest \
  --owner JSPaste

You can verify the integrity and origin of an artifact and/or image using the GitHub CLI or manually at JSPaste Attestations.

Development

API

The API is documented under OpenAPI specification and can be found at the following path:

/:apipath/oas.json

There are several ways to interact with the API, we will cover its use with Scalar.

We recommend using the desktop application, however, you can also use the web-based environment. (you may need to disable the CORS Proxy)

Follow these steps to import the instance's oas.json to Scalar:

Maintenance

Over time, local repositories can become messy with untracked files, registered hooks, and temporary files in the .git folder. To clean up the repository (and possibly all your uncommitted work), run the following command:

bun run clean:git:all

License

This project is licensed under the EUPL License. See the LICENSE file for more details.