https://github.com/ndren/redbean-onionshare Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] # * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} ndren / redbean-onionshare * Notifications * Star 20 * Fork 0 OnionShare; no Flask, just redbean. GPL-3.0 License 20 stars 0 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights main 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 1 branch 0 tags Code Clone HTTPS GitHub CLI [https://github.com/n] Use Git or checkout with SVN using the web URL. [gh repo clone ndren/] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @ndren ndren Fix formatting v2 ... edef7ee May 7, 2021 Fix formatting v2 edef7ee Git stats * 4 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time LICENSE Initial commit May 7, 2021 README.md Fix formatting v2 May 7, 2021 dump Initial guide May 7, 2021 tor.sh Initial guide May 7, 2021 torrc Initial guide May 7, 2021 View code README.md redbean-onionshare OnionShare; no Flask, just redbean. Actually Portable Executables are very cool. Not least because they are the same binary compatible with 6 Operating Systems at the same time, from NetBSD to Linux to Windows, but also because they do so while taking up less than a megabyte of space. Of particular interest here is redbean, a file server that is also a zip archive and also implements Lua support. Now, I am not an expert, and a minute ago I was wondering how to remove files from redbean after adding them with zip (zip -d, confirms the manual page). But I do love doing things minimally without ever touching the root user (maybe except for installing the tor package, but nothing is preventing this from working from a prebuilt archive), and I will try to present this as simply as possible by reimplementing the primary feature in OnionShare - file sharing. Can I guarantee security? No. Can you delete this trivially afterwards since the root user is never touched? Definitely. See the repository for the files after completion. Before starting, my personal thanks to Justine for inviting me to 'spread the word'. Your word of encouragement has brought me here :) Step 0: Set up a folder for your server. mkdir onionshare-but-not-really Step 1: Get redbean. curl https://justine.lol/redbean/redbean-latest.com >redbean.com chmod +x redbean.com Step 2: Copy the default Tor configuration. cp /etc/tor/torrc . Step 3: Disable logging in as tor, and use $USER instead. (Prevents the need for access to the root user, in OnionShare fashion.) #User tor Step 4: Set up directories for hidden services. Optionally replace $HOME with an absolute path. HiddenServiceDir $HOME/onionshare-but-not-really/hidden_service/ HiddenServicePort 80 127.0.0.1:8080 # redbean uses port 8080. HTTP uses port 80. DataDirectory $HOME/onionshare-but-not-really/tor/ Step 5: (Optional, Recommended) Disable SOCKS. (Does not affect the server.) SOCKSPort 0 Step 6: (Optional) Run tor as daemon. (Requires absolute paths instead of $HOME.) RunAsDaemon 1 # Could also use --runasdaemon 1. Step 6: Add the relevant files to redbean. zip redbean.com dump zip -d dump redbean.com # To remove dump. Step 7: Run the server! ./redbean -vv tor -f torrc Step 8: See if it worked! torbrowser-launcher # Open the URL stored in hidden_service/hostname. Is OnionShare simpler? Probably. Could I have used a Pomf instance? Certainly. But it seems there is some beauty in self-hosting and self-doing that cannot be attained otherwise, so here I am :) About OnionShare; no Flask, just redbean. Resources Readme License GPL-3.0 License Releases No releases published Packages 0 No packages published Languages * Shell 100.0% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. 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.