MCPcopy Index your code
hub / github.com/anna-is-cute/paste

github.com/anna-is-cute/paste @v0.1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.1 ↗ · + Follow
1,620 symbols 4,484 edges 134 files 17 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

paste

A sensible, modern pastebin.

build status dependency status patreon paypal

Idea

Pretty much every pastebin sucks. When Gist removed anonymous pastes, I realised that the pastebins out there don't do what I want them to do. I made paste to remedy that problem.

There should be a pastebin that's easy-to-use and simple, supporting multiple files, syntax highlighting, anonymity, and secure authentication. Now there is.

Status

paste works in its current state. There may be heinous bugs, but I use it as my daily pastebin. It is not currently stable, meaning the API could change in a breaking way at any moment and that the web interface and routes may change at any moment, as well.

However, these changes are not without good reason (and are usually debated in depth) and are few and far between.

Using a pre-existing paste server

I host paste.gg. I am poor and can't afford a good machine (paste.gg is an AWS t2.micro – one core and low RAM), so please don't bombard it!

Setting up your own paste server (Docker)

You can run your own paste server by using docker-compose. You will need Docker, obviously.

The Docker image will build and run (in release mode) the server as it is in the repository. That is to say that whatever you have checked out will be built and run.

Edit configuration files

First, you'll need to set up your configuration. All configuration files are missing by default. You will need to copy over their examples files and edit those. The example files follow this pattern:

If you need ./Rocket.toml, the example file will be located at ./Rocket.example.toml.

  1. .docker/nginx/nginx.conf

    Change anything you deem necessary.

  2. .docker/nginx/sites

    Choose the file that is best for you. There are HTTP and HTTPS configurations. nginx will load anything that matches *.conf in that directory, so rename or copy whichever you want.

    File is commented with what changes are necessary and notes.

  3. Rocket.toml

    Read the comments. Set a secret key. The repo is included in this Docker container, so certs can be specified at .docker/nginx/run/certs.

  4. config.toml

    Change everything, basically. Read the comments.

  5. sidekiq.yml

    Probably fine, but change queue concurrency if you need to.

  6. sidekiq.sh

    This is a convenience script for you. Change the variables at the start for starting sidekiq properly to work with paste.

  7. .env

    Change this to the below.

    shell DATABASE_URL=postgres://paste:paste@postgres/paste REDIS_URL=redis://redis SIDEKIQ_URL=redis://redis/1 EMAIL_TEMPLATES=webserver/web/emails/*

Start the server

# from the repo root
docker-compose -f .docker/docker-compose.yml up

If everything is configured correctly, it should start up, and you should see Rocket has launched from https://0.0.0.0:8000. Note that this is not how the outside world will access paste.

nginx is set up to expose ports 80 and 443 on the host by default, but you can change docker-compose.yml (and you'll need to change nginx.conf as well) to change that.

Access paste by connecting to the host via HTTP or HTTPS, depending on how you set up nginx.

Done!

Setting up your own paste server (manual)

You will need

  • Rust
  • Ruby
  • modern postgres (9.x+ tested)
  • redis
  • sidekiq
  • nginx

Steps

  1. Clone the repo (--recursive for submodules)
  2. cargo install diesel_cli --no-default-features --features postgres
  3. Copy the example config files
    • cp Rocket{.example,}.toml; cp config{.example,}.toml; cp sidekiq{.example,}.yml
  4. Edit the config files
  5. cargo build --release
  6. Create a postgres database and user
  7. echo 'DATABASE_URL=postgres://username@/database' > .env
  8. diesel migration run --migration-dir=webserver/migrations
  9. Make sure a redis server is running and set the URL in .env
  10. Start sidekiq using sidekiq.sh edited to be correct
  11. Preferably use ROCKET_ENV=prod and set a secret key in Rocket.toml
  12. target/release/paste config.toml
  13. Reverse proxy and handle /static/ with a webserver and not the included route. nginx configuration below.

    nginx location /static/ { alias /path/to/repo/webserver/web/static/; }

Compiling

If you just want to compile paste, perhaps to test while making a contribution, there is a Docker image that has a set-up build environment.

# from repo root
docker run --rm -it -v "$(pwd)":/paste jkcclemens/paste

By default, that will build paste, but you can also append /bin/bash to the command to start a Bash shell in the working environment.

Contact

Join the Discord server!

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 1,285
Method 227
Class 90
Enum 16
Interface 2

Languages

TypeScript74%
Rust26%
Ruby1%

Modules by API surface

webserver/web/static/js/recaptcha/v1531117903872/recaptcha__en.js787 symbols
webserver/web/static/js/moment/moment-with-locales.js303 symbols
webserver/src/database/models/pastes.rs26 symbols
webserver/src/models/paste/mod.rs25 symbols
webserver/web/static/js/highlightjs/highlight.pack.js21 symbols
webserver/src/database/models/users.rs21 symbols
webserver/src/database/models/password_reset_attempts.rs17 symbols
webserver/src/database/models/login_attempts.rs17 symbols
webserver/web/static/js/editor.js15 symbols
webserver/src/routes/mod.rs15 symbols
webserver/web/src/js/editor.js14 symbols
webserver/src/database/models/files.rs14 symbols

Datastores touched

pasteDatabase · 1 repos

For agents

$ claude mcp add paste \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page