FileShare/Server

This is a simple python script that allows the file share activity to save files on the jabber server.

This optional server is for the FileShare Activity.

Code
The code can be found in the FileShare Activity's git repo

Features

 * Maintains a file list
 * Files can be uploaded to the server
 * All users can view file list and download any file they wish.
 * Maintains user list
 * Keeps user key (hash of public key), Nickname, and access level.
 * Users can be given 3 access levels.
 * Level 0: Download only
 * Level 1: Download, Upload and Remove
 * Level 2: Download, Upload and Remove, Administer User Levels

Future Plans

 * Allow users to have private upload/download files.
 * Would allow user to upload file to a private folder for them/admins to access (example, student turning in an assignment)

Network Policy
This is the network policy in place by the FileShare system.

Connecting
All clients must check version and announce themselves if they with to have more then download rights
 * 1) When the client first connects it sends a GET request to /version.
 * 2) * Version must return the protocol version. The current version is 2.
 * 3) Then if the version is 2 or greater, it makes a POST request to /announce_user
 * 4) * Announce user expects id and ''nick'
 * 5) * This tells the server about the user list.
 * 6) * Returns the permission string (0 download only, 1 add/remove, 2 administer)

Downloading

 * 1) Any user can GET request /fileList.
 * 2) * File list returns a JSON object in the format the xo is expecting.
 * 3) To download a file a GET request of the file id will return the file.

Uploading/Removing

 * 1) To upload a file, just POST the file to /upload.
 * 2) * Expects id, jdata, and file
 * 3) To remove a file, POST file id to /remove
 * 4) * Expects id and fid

Administer Users

 * 1) Admin can request user list by POST to /user_list.
 * 2) * Expects id (must have admin permission)
 * 3) Modify User level by POST to /user_mod.
 * 4) * Expects id, userId, and level.