Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
#Unifile, unified access to cloud storage services.
Express middleware to provide web services for accessing cloud storage services with a common API.
Here is the API online documentation with code samples in Javascript, node.js, python...
Currently supported services
Example
GET /api/v1.0/dropbox/exec/ls/path/to/folder/ list a directory of the loggedin user
#Motivation
In 2013, team has developed the v2 of Silex, free and open source website builder for designers. Since Silex is a web app, running in the browser, we faced a choice: either we make people download and install Silex, or we host it in the cloud. But Silex Labs non profit organization can not afford paying hosting for our users.
So we have decided that Silex would edit the user's files on the user's Dropbox. It is not acceptable for a free project to force people to store their data on a service such as Dropbox, so we decided to make it an option. We have added the ability for Silex to edit files on the server on which it is installed. And then other services came to our minds.
We hope that other communities will benefit this way to use their cloud services before they install the web app locally.
#How to install
With node installed (download), install unifile in your project
$ npm install unifile
Then write a small node.js server like this and name it server.js
// node modules
var unifile = require('unifile');
var express = require('express');
var bodyParser = require('body-parser');
var cookieParser = require('cookie-parser');
var session = require('express-session');
var multipart = require('connect-multiparty');
// init express
var app = express();
// config
var options = unifile.defaultConfig;
// parse data for file upload
app.use(options.apiRoot, multipart({limit: '100mb'}));
// parse data for post and get requests
app.use(options.apiRoot, bodyParser.urlencoded({
extended: true,
limit: '10mb'
}));
app.use(options.apiRoot, bodyParser.json({limit: '10mb'}));
app.use(options.apiRoot, cookieParser());
// session management
app.use(options.apiRoot, session({
secret: options.sessionSecret,
resave: false,
saveUninitialized: false
}));
// use unifile as a middleware
app.use(options.apiRoot, unifile.middleware(express, app, options));
// server 'loop'
app.listen(6805); // 6805 is the date of sexual revolution started in paris france 8-)
Save this as server.js
and start it with
$ node server.js
Then start making calls with wget or your browser. For example...
http://localhost:6805/api/v1.0/services/list/
... will list the available services:
[
{
"name": "dropbox",
"display_name": "Dropbox",
"description": "Access files from your Dropbox.",
"isLoggedIn": true,
"isConnected": true,
"user": {
"display_name": "Alex Hoyau",
"quota_info": {
"available": 5234491392,
"used": 4528634951
}
}
},
{
"name": "ftp",
"display_name": "FTP",
"description": "Access files through FTP.",
"isLoggedIn": false,
"isConnected": false
"user": {
"display_name": "test",
}
},
{
"name": "www",
"display_name": "Web server",
"description": "Access files on the server where unifile is running.",
"isLoggedIn": false,
"isConnected": false
"user": {
"display_name": "admin",
}
}
]
#API calls
Let's take the example of the Dropbox service
Connect to the service
Basic login and such
GET /api/v1.0/dropbox/connect/ returns an URL, which you will open and authorize unifile to access the service (this is an oauth2 authorization mechanism)
GET /api/v1.0/dropbox/login/ now your have access to the service
GET /api/v1.0/dropbox/account/ Get your account info, with your display_name at least
GET /api/v1.0/dropbox/logout/ Log out from the service (connect and login will be required)
Execute commands
GET /api/v1.0/dropbox/exec/ls/path/to/folder/ list a directory
GET /api/v1.0/dropbox/exec/rm/path/to/folder-or-file/ remove a file or directory
GET /api/v1.0/dropbox/exec/mkdir/path/to/folder/ create a directory
GET /api/v1.0/dropbox/exec/cp/path/to/src/:/path/to/dst/ copy a file or directory
GET /api/v1.0/dropbox/exec/mv/path/to/src/:/path/to/dst/ move (rename) a file or directory
GET /api/v1.0/dropbox/exec/get/path/to/file.txt access a file
GET /api/v1.0/dropbox/exec/put/path/to/file.txt:{string} write data to a file
POST /api/v1.0/dropbox/exec/put/path/to/file.txt write data to a file
#License
license: MIT
#Developer guide
Here is how to contribute
##Add a service
The services in unifile are cloud storage services, e.g. Dropbox and google drive.
Each service is a Node.js class implementing a given set of functions, e.g. ls, rm, cp...
If you wish to add a service,
Here is a list of services which could be useful
##Notes / roadmap
unifile archi, tests and readme
to do
FAQs
Library to provide a unified API, mirroring Fs, for cloud storage services.
We found that unifile demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.