Coder Social home page Coder Social logo

paste's Introduction

Paste

How to deploy

An HTTPS environment is required due to the use of navigator.clipboard and window.crypto APIs.

Clone and cd into the repo

git clone https://github.com/eyenalxai/paste.git && cd paste

Nixpacks

Build the image

nixpacks build . \
-e NEXT_PUBLIC_FRONTEND_URL=https://my-domain.com \
-e DATABASE_URL=postgres://postgres:[email protected]:5432/postgres \
--name paste -t paste:latest

Optionally add NEXT_PUBLIC_OPENAI_SYNTAX_DETECTION=True and OPENAI_API_KEY=sk-abcdefg... to environment variables for OpenAI syntax detection

Run the container

docker run --name paste -p 3000:3000 -d paste:latest

Docker

Without compose

Build the image

docker build --build-arg NEXT_PUBLIC_FRONTEND_URL=https://my-domain.com -t paste:latest .

Run the container

docker run --name paste \
-e DATABASE_URL=postgres://postgres:[email protected]:5432/postgres \
-p 3000:3000 -d paste:latest

With compose

Edit the docker-compose.yml file

Run the container

docker-compose up -d

Additional configuration

For Nixpacks, all variables can be passed as environment variables during the build step and won't be required to run the container. Variables that do not start with NEXT_PUBLIC_ can be passed as environment variables later to the docker run command to override the ones passed during the build step.

For Docker, variables that start with NEXT_PUBLIC_ are passed as build arguments to the docker build command, others are passed as environment variables to the docker run command.


Port to run the app on

  • Don't forget to change the port mapping in the docker run command (-p 8000:8000)

PORT=8000

OpenAI Syntax Detection

NEXT_PUBLIC_OPENAI_SYNTAX_DETECTION=True and OPENAI_API_KEY=sk-abcdefg...

Force client-side encryption

NEXT_PUBLIC_CLIENT_SIDE_ENCRYPTION_ONLY=True

Maximum paste size

  • Defaults to 2 MiB, can be fractional (e.g. 1.5 for 1.5 MiB)

NEXT_PUBLIC_MAX_PAYLOAD_SIZE=10

paste's People

Contributors

eyenalxai avatar

Stargazers

Martin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.