Giter VIP home page Giter VIP logo

privateshare's Introduction

PrivateShare

PrivateShare is an opensource WeTransfer alternative running on PHP & OpenSSL and NO Database.

Requirements

  • PHP 5+
    • mod_rewrite
    • mod_auth_basic
  • OpenSSL

Change the .htaccess file in the www folder to set the max upload file of PHP. Default is set to 5GB.

Apache

Change the Apache VirtualHost to redirect some urls: /var/www/upload is just an example, change this to suit your webserver.

DocumentRoot /var/www/upload
<Directory /var/www/upload/>
    AllowOverride all
    Require all granted
</Directory>
<Directory /var/www/upload/priv>
    AllowOverride all
    Require all valid-user
</Directory>
RewriteEngine on
RewriteRule ^/f/(.*)$ /get.php?file=$1 [L]
RewriteRule ^/e/([^/]+)/(.*)$ /get.php?enc=$1&file=$2 [L]
RewriteRule ^/d/(.*)$ /priv/delete.php?file=$1 [L]

Nginx

Change the Nginx site config to redirect some urls: /var/www/upload is just an example, change this to suit your webserver.

root /var/www/upload/;

client_max_body_size 5G;

location / {
	index index.php;
	aio threads;
}
location /f/ {
	aio threads;
	directio 16M;
	output_buffers 2 1M;
	alias /var/www/upload/f/;
}

location ^~ /priv/ {
	auth_basic      "Login";
	auth_basic_user_file    /etc/nginx/passwd/.htpasswd;
}
rewrite ^/e/([^/]+)/(.*)$ /get.php?enc=$1&file=$2;
rewrite ^/d/(.*)$ /priv/delete.php?file=$1;

Demo

Demo

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.