Code Monkey home page Code Monkey logo

doegox / forban Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adulau/forban

1.0 2.0 0.0 2.43 MB

Forban is a p2p application for link-local and local area network. Forban works independently from Internet and use only the local area capabilities to announce, discover, search or share files.Forban is a kind of p2p application for link-local and local area network. Forban works independently from Internet and use only the local area capabilities to announce, discover, search or share files. Forban relies on HTTP and he is opportunistic (meaning replicating any files seen in his proximity or interest). The name took his origins from the old French word (a forban is a kind of pirate). “Forban” can be also a play word in English at a time where government or corporate want to ban access to the Internet. The current implementation is written in Python. The Forban protocols are minimalistic to ease the accessibility to build independent Forban in any decent language or even in shell scripts (using tcpdump and wget for example).

Home Page: http://www.foo.be/forban/

Shell 0.59% Python 99.41%

forban's Introduction

Forban

Forban is a p2p application for link-local and local area network.

Forban works independently from Internet and use only the local area capabilities to announce, discover, search or share files. Forban relies on HTTP and he is opportunistic.

The name took his origins from the old French word : http://fr.wiktionary.org/wiki/forban

Forban name can be also a playword in English for banning an unwanted software or services on Internet.

Forban is free software licensed under the GNU Affero General Public License version 3. http://www.fsf.org/licensing/licenses/agpl-3.0.html

Installation

The setup is quite easy :

Clone the repository:

git clone [email protected]:adulau/Forban.git

Go to the cloned directory:

cd Forban

and starts Forban processes:

./bin/forbanctl start

Now you can open your favorite browser at the following location:

http://127.0.0.1:12555

To share some files, you'll just need to copy them in ./var/share/

Forban protocol

message format used for announce/discovery

announce message

ASCII encoded message using UDP on port 12555 with the following format:

forban;name;<nameoftheforban>;uuid;<identityoftheforban>;hmac;<hmacvaluecofindex>

The messages are flooded in broadcast (IPv4) and using ff02::1 (IPv6) at a regular interval.

Based on the source IP and the destination port used, a HTTP URL is build to get to default forban service.

HTTP services for Forban

The UDP port 12555 is there for announcing forban services. The TCP port 12555 is the HTTP server running for forban services.

base URL: [REQUIRED] http://:/

index URL where Forban stored his index: [REQUIRED] http://:/s/?g=forban/index

store URL where Forban stored his loot and how to get a file: [REQUIRED] http://:/s/?g=base64_urlsafe()&f=b64e

search URL: [OPTIONAL] http://:/q/?v=&r=

REQUIRED interfaces are required to have a full operational Forban protocol in all the modes. The OPTIONAL interfaces are not required for machine-to-machine interaction but used to ease the life of the users.

base64_urlsafe function (b64e)

'+' is replaced by '-'. '/' is replaced by '_'(underscore). '=' is replaced by '!'.

This is following the same approach of MIME::Base64::URLSafe or the python base64.urlsafe_b64encode with an addition to the equal sign being replaced by an exclamation mark.

Forban mode available

  • Opportunistic mode
  • Shared mode

The opportunistic mode and shared used all the REQUIRED components of the protocol. The only difference is the lack of automatic file fetching in the shared mode. The shared mode is usally used on fixed node content where the opportunistic fetching is not desired (e.g. a fixed bookshelf).

The opportunistic mode is working as a simple gossip (or epidemic) protocol to replicate the information from one local to another local Forban.

message format - notes about HMAC

The optional HMAC value has two purposes :

  • To know if the index has been updated
  • and to verify (if a PSK is set) if the index has been tampered.

When a PSK is not set, the default PSK value is 'Forban'.

The value is optional as other Forban can download any index when they want.

software required

  • Python (tested successfully with 2.5, 2.6 and 2.7) - 2.5 is required for the uuid library
  • There is no additional Python libraries required

forban's People

Contributors

adulau avatar

Stargazers

 avatar

Watchers

 avatar  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.