{"id":21396850,"url":"https://github.com/posixpascal/pasteid-server","last_synced_at":"2025-06-30T09:38:30.017Z","repository":{"id":142927076,"uuid":"134182793","full_name":"posixpascal/pasteid-server","owner":"posixpascal","description":"paste.id — encrypted paste service — server —","archived":false,"fork":false,"pushed_at":"2018-05-29T08:18:17.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-24T18:02:43.433Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://paste.id","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posixpascal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-20T20:07:30.000Z","updated_at":"2018-07-23T16:35:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"a09687ad-2e98-4e61-a072-7b0ade460cd1","html_url":"https://github.com/posixpascal/pasteid-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/posixpascal/pasteid-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posixpascal%2Fpasteid-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posixpascal%2Fpasteid-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posixpascal%2Fpasteid-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posixpascal%2Fpasteid-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posixpascal","download_url":"https://codeload.github.com/posixpascal/pasteid-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posixpascal%2Fpasteid-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262749422,"owners_count":23358405,"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":[],"created_at":"2024-11-22T14:29:39.845Z","updated_at":"2025-06-30T09:38:29.996Z","avatar_url":"https://github.com/posixpascal.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔐 paste.id — api\n\n`paste.id` is an encrypted paste storage server built using JS\n\nThis is the server/api repository. If you are looking for the client repository click [here](https://github.com/posixpascal/pasteid-web)\n\n## Installation\n\npaste.id is a very very very basic server built using NodeJS. \nTo install paste.id clone this repository and run:\n\n```bash\nnpm install .\n```\n\nOnce npm runs through successfully add a .env file within the root directory which contains your mySQL credentials as well as the port we're running on:\n\n```\nMYSQL_HOST=127.0.0.1\nMYSQL_USER=root\nMYSQL_PASS=root\nMYSQL_DB=pasteid\n\nPORT=3002\n```\n\n## Running\nRunning paste.id server is as easy as executing a few npm scripts. \nIf you are curious what scripts can be launched take a look at `package.json`.\n\n### DB migration:\nOnce your `.env` file is ready and your npm dependencies are installed,\njust execute `node migrate.js` to create the necessary database tables.\n\n### In Development\nTo run paste.id server in development mode run:\n```\nnpm run start-dev\n```\n\nThis command will automatically start nodemon which will continously watch for file changes and reload paste.id server accordingly.\n\n### In Production\n\nRunning on production requires an intermediate step where you build and compile your application. \n\n```bash\nnpm run build # only on code change\nnpm run production\n```\n\nI'm using `forever` which will start your app and restart it automatically if it should crash.\n\n## Dependencies\n\npaste.id server has only a handful of production dependencies these being:\n\n- mysql (node module)\n- dotenv\n- express\n\n## How it works\nSince the main logic is happening on paste.id frontend I can explain this server with just a few words:\n\nBasically this server has 2 endpoints:\n\n- `POST /storage` which will accept a `content` property and store it in a mySQL DB\n- `GET /:id` will output a JSON payload which contains a `content` property which itself contains the message you stored before.\n\nSo all in all, paste.id server is just a stupid simple text storage over HTTP.\nThe encryption layer is provided by the paste.id frontend application.\n\n## License\n\n```\nDO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\nVersion 2, December 2004\n\nCopyright (C) 2004 Sam Hocevar \u003csam@hocevar.net\u003e\n\nEveryone is permitted to copy and distribute verbatim or modified\ncopies of this license document, and changing it is allowed as long\nas the name is changed.\n\nDO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\nTERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n0. You just DO WHAT THE FUCK YOU WANT TO.\n```\n\n## Contribution\nContribution is generally appreciated. Here are a few things you can do to extend paste.id server:\n\n- Add unit tests\n- Replace mySQL in pasteRepository.js with an ORM so we can hook up other DBs\n- Extract the DB storage mechanism in a different class so we later add storage to textfiles as well by injecting the required `StorageMechanism`\n- Add better error handling\n- Add support to \"verify\" a pgp encrypted paste without outputting the content by accepting a public key via variable.\n- Add scripts to auto-remove logfiles etc.\n- Add expiration to pastes.\n- Add option to generate a more \"random\" ID rather than using the SQL autoincrement ID.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposixpascal%2Fpasteid-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposixpascal%2Fpasteid-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposixpascal%2Fpasteid-server/lists"}