{"id":16378941,"url":"https://github.com/juliarn/pasteserver","last_synced_at":"2025-09-04T09:47:10.732Z","repository":{"id":42658999,"uuid":"165122393","full_name":"juliarn/PasteServer","owner":"juliarn","description":"PasteServer to upload text or code","archived":false,"fork":false,"pushed_at":"2024-07-19T19:41:17.000Z","size":348,"stargazers_count":37,"open_issues_count":5,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T19:46:49.403Z","etag":null,"topics":["arangodb","autoupdates","code","paste","ratelimits","redis","server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juliarn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-10T19:58:15.000Z","updated_at":"2025-01-31T21:10:22.000Z","dependencies_parsed_at":"2023-01-28T16:15:14.175Z","dependency_job_id":null,"html_url":"https://github.com/juliarn/PasteServer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliarn%2FPasteServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliarn%2FPasteServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliarn%2FPasteServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliarn%2FPasteServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliarn","download_url":"https://codeload.github.com/juliarn/PasteServer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244721506,"owners_count":20498965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arangodb","autoupdates","code","paste","ratelimits","redis","server"],"created_at":"2024-10-11T03:47:01.188Z","updated_at":"2025-03-21T01:32:32.087Z","avatar_url":"https://github.com/juliarn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PasteServer\nPasteServer to upload text or code.\nDemo: https://just-paste.it\n\n# Usage\nTo use the server, just download this repo and install [Node.js](http://www.nodejs.org/) and [Redis](http://www.redis.io/) or\n[ArangoDB](http://www.arangodb.com/) for the document-storage. If you don't want to use one of these options, the server also supports a file-storage.\nNow you can edit the ``config.js`` the way you want to. \n\nAfter you did that, you have to install the dependencies the server needs. Just execute this:\n\n```bash\nnpm install\n```\n\nNow you can start the server with the following:\n\n```bash\nnpm start\n```\n\n# Config\n\n## Server-section\nTo configure the server itself\n\n*  **port**: The port where the server will run on.\n\n## autoUpdate-section\nTo configure the updating of the server\n\n* **enabled**: If the server should perform autoUpdates before starting.\n* **packageJsonURL**: The URL of the package.json file of the remote pasteServer.\n* **zipURL**: The URL of the zip-archive with the files in it.\n* **keepFiles**: The files which shouldn't be replaced when installing an update. Works too for files in dirs.\n(use for example: ``static/index.html``).\n* **devPackageJsonURL**: The URL of the package.json file of the remote development pasteServer.\n* **devZipURL**: The URL of the development zip-archive with the files in it.\n\nThe last two options are only being used for the ``checkUpdate -dev`` and ``installUpdate -dev`` commands, which are not recommended. \nThe dev-updates contain the newest features, but might have errors and might not be fully completed.\n\n## Storage-section\nTo configure the document-storage\n\n*  **type**: The type of the storage. (\"file\", \"redis\" or \"arangodb\")\n*  **host**: The Host of the storage-type.\n*  **port**: The Port of the storage-type.\n*  **password**: The Password of the storage-type.\n\n*  **user**: The user to use for the authentication. (only ArangoDB)\n*  **database**: The database to store the documents in. (only ArangoDB)\n\n*  **documentExpireInMs**: The time in milliseconds after a document will be deleted when unused. (only Redis)\n\n*  **path**: The path of the folder the document-files should be saved in. (only file-storage)\n\n## RateLimit-section\nTo configure the rateLimits of creating and deleting documents\n\n*  **timeInMs**: The time in milliseconds in which a certain amount of requests are allowed per IP.\n*  **maxRequestsPerTime**: The allowed amount of requests per IP per time.\n\n## Document-section\nTo configure documents\n\n*  **dataLimit**: The max. size the data of a creation-request is allowed to have.\n*  **maxLength**: The max. characters a document is allowed to have.\n\n## KeyGenerator-section\nTo configure the creation of the document-keys\n\n*  **keyLength**: The length of a key.\n*  **keyChars**: The characters that will be used to create a key.\n*  **withToUpperCase**: When set to true, the keyChars will be duplicated and added to the current \nkeyChars but with all letters in uppercase.\n\n\n# API\n\nYou can use the API of the PasteServer to create, read and delete documents. All API requests can be made \nto the /documents-route (for example https://just-paste.it/documents).\n\n## Create a document\n\nSend a POST-request and as the body, the text the paste should have as plaintext.\n\nIf everything succeeded, you'll get the following response:\n\n* **Status-Code**: 201 Created\n* **Body**: A JSON containing the key ``key`` and ``deleteSecret`` for the key and secret of the document.\n\nIf the text is missing, the following:\n\n* **Status-Code**: 400 Bad Request\n\nIf the text you want to save is too long, you'll get the following back:\n\n* **Status-Code**: 413 Payload Too Large\n\nIf there was an error while saving the document, you'll get this:\n\n* **Status-Code**: 500 Internal Server Error\n\nThe last three all contain this:\n\n* **Body**: A JSON containing the key ```message``` for a short description of the issue while saving.\n\n## Read a document\n\nSend a GET-request to the /documents-route + the key of the wanted document\n(for example https://just-paste.it/documents/$key).\n\nIf the document exists, you'll get the following response:\n\n* **Status-Code**: 200 OK\n* **Body**: A JSON containing the key ``text`` for the text of the document.\n\nIf not, this:\n\n* **Status-Code**: 404 Not Found\n* **Body**: A JSON containing the key ```message``` for a short description of the issue while getting.\n\n## Delete a document\n\nSend a GET-request to the /documents/delete-route + the key of the wanted document + the deleteSecret\n(for example https://just-paste.it/documents/delete/$key/$deleteSecret). \n\nIf everything succeeded, you'll get the following response:\n\n* **Status-Code**: 200 OK\n\nIf the deleteSecret is missing, the following:\n\n* **Status-Code**: 400 Bad Request\n\nIf the secret or the key is wrong, this:\n\n* **Status-Code**: 403 Forbidden\n\nEvery response contains this:\n\n * **Body**: A JSON containing the key ```message``` for a short description of what happened.\n \n## RateLimits\n\nThere are rateLimits on creating and deleting documents to prevent attacks that might cause a crash.\nThe amount of allowed requests per time per ip can be changed in the ``config.js``.\nOnce the rateLimit is reached, you'll get the following response:\n\n* **Status-Code**: 429 Too Many Requests\n* **Body**: A JSON containing the key ```message``` for a short description of what happened.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliarn%2Fpasteserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliarn%2Fpasteserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliarn%2Fpasteserver/lists"}