Dockerized version of Panamo's PasteServer
1.4K
PasteServer to upload text or code. Demo: https://just-paste.it
You can use this Docker Image out of the box with the file storage:
version: "3"
services
pasteserver:
image: einsarsum/pasteserver
ports:
- 5000:5000
Or with Redis as database:
version: "3"
services:
pasteserver:
image: einsarsum/pasteserver
ports:
- 5000:5000
depends_on:
- database
environment:
- STORAGE_TYPE=redis
- STORAGE_HOST=database
- STORAGE_PASSWORD=password
database:
image: redis:alpine
entrypoint: redis-server --appendonly yes --requirepass password
Or with ArangoDB as database
version: "3"
services:
pasteserver:
image: einsarsum/pasteserver
ports:
- 5000:5000
depends_on:
- database
environment:
- STORAGE_TYPE=arango
- STORAGE_HOST=database
- STORAGE_PORT=8529
- STORAGE_USER=pasteServer
- STORAGE_PASSWORD=password
- STORAGE_DATABASE=pasteServer
database:
image: arangodb
environment:
- ARANGO_ROOT_PASSWORD=password
Docker environment variables
To configure the server itself
To configure the document-storage
STORAGE_TYPE: The type of the storage. ("file", "redis" or "arangodb")
STORAGE_HOST: The Host of the storage-type.
STORAGE_PORT: The Port of the storage-type.
STORAGE_PASSWORD: The Password of the storage-type.
STORAGE_USER: The user to use for the authentication. (only ArangoDB)
STORAGE_DATABASE: The database to store the documents in. (only ArangoDB)
DOCUMENT_EXPIRE: The time in milliseconds after a document will be deleted when unused. (only Redis or ArangoDB)
STORAGE_PATH: The path of the folder the document-files should be saved in. (only file-storage)
To configure the rateLimits of creating and deleting documents
To configure documents
To configure the creation of the document-keys
You can use the API of the PasteServer to create, read and delete documents. All API requests can be made to the /documents-route (for example https://just-paste.it/documents).
Send a POST-request and as the body, the text the paste should have as plaintext.
If everything succeeded, you'll get the following response:
key and deleteSecret for the key and secret of the document.If the text is missing, the following:
If the text you want to save is too long, you'll get the following back:
If there was an error while saving the document, you'll get this:
The last three all contain this:
message for a short description of the issue while saving.Send a GET-request to the /documents-route + the key of the wanted document (for example https://just-paste.it/documents/$key).
If the document exists, you'll get the following response:
text for the text of the document.If not, this:
message for a short description of the issue while getting.Send a GET-request to the /documents/delete-route + the key of the wanted document + the deleteSecret (for example https://just-paste.it/documents/delete/$key/$deleteSecret).
If everything succeeded, you'll get the following response:
If the deleteSecret is missing, the following:
If the secret or the key is wrong, this:
Every response contains this:
message for a short description of what happened.There are rateLimits on creating and deleting documents to prevent attacks that might cause a crash.
The amount of allowed requests per time per ip can be changed in the config.js.
Once the rateLimit is reached, you'll get the following response:
message for a short description of what happened.Content type
Image
Digest
Size
43.6 MB
Last updated
over 5 years ago
docker pull einsarsum/pasteserver