Home

Awesome

Rustypaste

rustypaste is a self-hosted and minimal file upload/pastebin service written in Rust.

Features

How to use this Makejail

Standalone

appjail makejail \
    -j rustypaste \
    -f gh+AppJail-makejails/rustypaste \
    -o virtualnet=":<random> default" \
    -o nat

Now you can run rpaste to upload some code.

$ rpaste -s http://rustypaste:8000 main.c
http://rustypaste:8000/enhanced-pika.c
$ curl http://rustypaste:8000/enhanced-pika.c
#include <stdio.h>
#include <stdlib.h>

int
main(void)
{
    printf("Hello!\n");
    return EXIT_SUCCESS;
}

Customization

This Makejail can process some environment variables best described in #environment.

appjail makejail \
    -j rustypaste \
    -f gh+AppJail-makejails/rustypaste \
    -o virtualnet=":<random> default" \
    -o nat \
    -V RUSTYPASTE_EXPOSE_VERSION=true \
    -V RUSTYPASTE_EXPOSE_LIST=true \
    -V RUSTYPASTE_AUTH_TOKENS_01=123 \
    -V RUSTYPASTE_AUTH_TOKENS_02=321 \
    -V RUSTYPASTE_DELETE_TOKENS_01=456 \
    -V RUSTYPASTE_DELETE_TOKENS_02=654 \
    -V RUSTYPASTE_DEFAULT_EXPIRY=1h \
    -V RUSTYPASTE_RANDOM_URL_TYPE=alphanumeric

Deploy using appjail-director

Using environment variables to deploy rustypaste is fine, but appjail-director is more suitable when we need to define many environment variables as in the example above.

options:
  - virtualnet: ':<random> default'
  - nat:

services:
  rustypaste:
    makejail: gh+AppJail-makejails/rustypaste
    name: rustypaste
    environment:
      - RUSTYPASTE_EXPOSE_VERSION: true
      - RUSTYPASTE_EXPOSE_LIST: true
      - RUSTYPASTE_AUTH_TOKENS_01: 123
      - RUSTYPASTE_AUTH_TOKENS_02: 321
      - RUSTYPASTE_DELETE_TOKENS_01: 456
      - RUSTYPASTE_DELETE_TOKENS_02: 654
      - RUSTYPASTE_DEFAULT_EXPIRY: 1h
      - RUSTYPASTE_RANDOM_URL_TYPE: alphanumeric

Arguments

Environment

Volumes

NameOwnerGroupPermTypeMountpoint
rustypaste-db498498--/var/db/rustypaste

Tags

TagArchVersionType
13.4amd6413.4-RELEASEthin
14.1amd6414.1-RELEASEthin

Notes

  1. You can change the landing page by overriding the /usr/local/etc/rustypaste/index.txt file.