https://github.com/JLCarveth/nutty Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} JLCarveth / nutty Public * Notifications * Fork 0 * Star 20 A very simple HTTP server, and a paste server implementation. paste.jlcarveth.dev/api 20 stars 0 forks Activity Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights JLCarveth/nutty This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 2 branches 12 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/J] Use Git or checkout with SVN using the web URL. [gh repo clone JLCarv] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @JLCarveth JLCarveth Merge pull request #12 from JLCarveth/dev ... c34fe0e Oct 6, 2023 Merge pull request #12 from JLCarveth/dev Dev c34fe0e Git stats * 72 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time static/css Login form October 6, 2023 14:19 templates Fix old form action url used from testing October 6, 2023 14:54 .gitignore Check content-length header September 22, 2023 11:03 README.md README.md September 26, 2023 09:21 auth.ts Added email to User accounts, modified login/register logic accordingly April 18, 2023 10:58 client.sh Additional usage information April 18, 2023 14:24 paste.ts Modified POST-/api/login, better parameter handling October 6, 2023 14:19 server.ts Better templating / layout for webpages September 26, 2023 08:53 test.ts Updated test functions April 18, 2023 11:23 types.ts Added ability to serve CSS files September 21, 2023 10:18 View code Nutty A simple HTTP paste server Features Installation Environment Usage README.md Nutty A simple HTTP paste server Nutty is a self-hostable paste server, allowing you to easily upload and share text files instantly. Features * A simple HTTP interface * A simple Web interface (WIP) * Public and private pastes * Low memory footprint Installation 1. Make sure you have Deno installed on your system. If not, you can install it by following the instructions on the Deno website. 2. Clone the repository by running git clone https://github.com/ JLCarveth/nutty.git. 3. Change into the cloned directory by running cd nutty. 4. Run the paste.ts file with Deno by running deno run -A --unstable paste.ts. A simple systemd service can also be setup to handle stopping/ starting Nutty: [Unit] Description=File pasting API [Service] ExecStart=/home/jlcarveth/.deno/bin/deno run -A --unstable paste.ts Restart=always User=jlcarveth Group=jlcarveth WorkingDirectory=/opt/paste EnvironmentFile=/opt/paste/.env StandardOutput=/var/log/paste/out.log StandardError=/var/log/paste/error.log [Install] WantedBy=multi-user.target Environment Nutty depends on a couple of environment variables to be established before running. Variable Name Description Example Values The directory where TARGET_DIR pastes will be /opt/paste/data stored. The base URL at BASE_URL which the API can be https://paste.mysite.com/api accessed. Used for signing JWTs. A secret key GDZ1FzBF18dtAk2enanqqxskVf5hptmPjy SECRET_KEY can be generated /pcBm384M= with openssl rand -base64 32 PORT The port to listen 5335 to. Default is 5335 Whether to allow PUBLIC_PASTES users to create 1,0,true,false pastes without an access token. Logs incoming DEBUG requests for 1,0,true,false debugging purposes. DOMAIN The domain used for paste.jlcarveth.dev the HTTP cookie Usage There is a simple client bash script which provides a simple example of using Nutty. export TOKEN=$(curl https://paste.jlcarveth.dev/api/login -X POST -H "Content-Type: application/json" -d '{"email":"jlcarveth@gmail.com","password":"notmypassword"}') export EMAIL="jlcarveth@gmail.com" # Email is used for signing PGP messages uuid=$(cat file.txt | bash client.sh) If the client runs successfully, a UUID associated with the new paste is returned. This paste can then be retrieved with a simple GET request: curl $API_URL/$UUID -H "X-Access-Token: $TOKEN" About A very simple HTTP server, and a paste server implementation. paste.jlcarveth.dev/api Topics pastebin http-server plaintext Resources Readme Activity Stars 20 stars Watchers 2 watching Forks 0 forks Report repository Releases 12 tags Packages 0 No packages published Languages * TypeScript 91.7% * CSS 6.8% * Shell 1.5% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time.