Git Product home page Git Product logo

sharethis's Introduction

sharethis

Instantly host the current folder over HTTPS with a firejailed nginx.

Limitations

This script only works, when the to-be-shared path does not contain characters, that crash the sed command, from which the config gets generated (such as: ~\'"). Only use with sane paths. (The nginx config gets checked, before the server even starts.)

Usage

  • Check out the source code to somewhere on your disk
  • Navigate to the folder, that you want to share over your local network
  • run full/path/to/sharethis.sh
  • the first time, it will generate a HTTPS certificate
  • (you can force it to generate a new one by deleting ~/.cache/sharethis)
  • when it is hosting, point your browser to https://127.0.0.1:4443 to download the files (replace the IP accordingly for LAN)
  • firejail ensures, that nginx only has access to the shared folder, in case it gets exploited
  • sharethis.sh will show all access and error logs from nginx directly in the terminal
ollieparanoid@laptop ~ % cd ~/share
ollieparanoid@laptop ~/share % ~/code/sharethis/sharethis.sh
Starting sandbox
Generating a 4096 bit RSA private key
.......................
writing new private key to 'server.key'
-----

Port:
4443

Certificate SHA256:
6C:6E:FE:15:2D:94:F2:29:3F:A0:ED:B6:F5:AA:CE:7E:BB:6A:16:10:DC:0F:A3:20:16:10:4E:F8:C4:14:1F:95

Webroot:
/home/ollieparanoid/share

Press ^C to stop
^C
Sandbox stopped

TODO

Implement commandline arguments, that do the following:

  • host on custom port
  • disable autoindex
  • protect with password (another argument to generate a new one)
  • generate a new HTTPS certificate

sharethis's People

Stargazers

Zilvinas Pikelis avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.