Code Monkey home page Code Monkey logo

fileshare's Introduction

fileshare

File sharing service with individual temporary link generation. Uses a simple basic auth, but blocks any brute force attack. It can receive payments for files with Yandex Money!

Simple usage

Usage: ./fileshare -c "./config.toml"

And now you must define settings in config.toml. See _example for example of config.toml

Before usage you can generate or store in cert.pem and key.pem a certificate for SSL/TLS.

For self-signed certificates you can run in app folder: openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout key.pem -out cert.pem

Then open browser with https://host:port/buy/files for see a page for buying files.

Service API:

GET /file.name?key=KEY - getting file with name and generated key (must be exists in store cache and not expired)

GET /newlink/upload - show page for upload a file with basic auth (admin:secret_param)

POST /newlink/upload - upload a file in part "file" of multipart body, and return a link, that expired after 1 day

GET /newlink/gen?file=file.name - generate new unique link for file.name (must be exists in store cache), that expired after 1 day

POST /yapayment - receive notification from Yandex.Money service, see below.

You can receive payment for files with Yandex.Money API and automatically send unique link by email. See https://tech.yandex.ru/money/doc/dg/reference/notification-p2p-incoming-docpage/

Do this with define the key for API and put it into config.toml: https://money.yandex.ru/myservices/online.xml

fileshare's People

Contributors

covrom avatar

Watchers

 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.