simpleDrive is a private cloud software to be run on your own server.
It puts you in charge of your data - the way it's meant to be.
The following packages are required to run simpleDrive (for Debian-based machines):
$ sudo apt install apache2 php libapache2-mod-php php-gd php-mysql php-zip php-curl php-xml mysql-server
Note: simpleDrive also runs on nginx. Simply replace "apache2" with "nginx"
Just fork this git or download as zip to your server directory
Enable htaccess by setting AllowOverride All in your /etc/apache2/apache2.conf
Enable mod_rewrite by executing:
$ sudo a2enmod rewrite
$ sudo a2enmod headers
$ sudo service apache2 restart
In case you run on an nginx-server, please add the following to the html-section of your nginx.conf Remember to change server_name and root to match your setup and to use the version of php*-fpm that is installed on your system (uncomment accordingly inside "location ~ .php$ {")
server {
listen 80;
server_name localhost;
root /var/www/html/simpledrive;
index index.php;
location ~ ^/(?:\.htaccess|docs|config|logs){
deny all;
}
location ~* \.(?:css|js|woff|ico)$ {
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Content-Security-Policy "default-src 'self'; img-src 'self'; script-src 'self'; style-src 'self'; font-src 'self'";
add_header Content-Security-Policy "default-src 'self'; img-src 'self'; script-src 'self'; style-src 'self'; font-src 'self'";
}
location / {
try_files $uri $uri/ @w;
}
location @w {
rewrite ^/api/(.*)$ /index.php?request=$1&api=1 last;
rewrite ^/(.*)$ /index.php?request=$1&render=1 last;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php5-fpm.sock;
# or fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
Then, in your browser, navigate to the simpledrive/setup, fill out the required fields and you are good to go. simpleDrive is made to be highly intuitive, so if you ever used any file manager, you should be comfortable right away.
Call structure: [server]/api/[endpoint]/[action]
All values are returned as JSON-Array ('msg' => $msg)
params: username
password
returns: auth token
params: username
password
database username
database password
database server (opt)
database name (opt)
mail (opt)
mail password (opt)
returns: null
desc: returns directory content or shares from database
params: auth token
target -> array of relative path and share id (if any)
mode -> accepted values: files | sharedbyme | sharedwithme | trash
returns: list of files/directories
desc: creates file/folder
params: auth token
target -> ID of directory to create in
type -> accepted values: file | folder
filename (opt) -> default given if not set
returns: null
desc: renames file(s)
params: auth token
target -> ID
newFilename
returns: null
desc: copies file(s)
params: auth token
target -> ID of directory to copy to
source -> ID(s) of element(s) to copy
returns: null
desc: moves file(s)
params: auth token
target -> ID of directory to move to
source -> ID(s) of element(s) to move
trash -> true if restore from trash
returns: status message including number of moved files
desc: deletes files/directories or moves them to trash
params: auth token
target -> ID(s) of element(s) to delete
returns: null
desc: creates a zip archive
params: auth token
target -> ID of directory to zip to
source -> ID(s) of element(s) to zip
returns: destination of zipped file
desc: shares an element with another user and/or via link
params: auth token
target -> ID of element to share
userto -> user to share with
mail (opt) -> mail for notification
write -> true for write permission
pubAcc -> true for public access
key (opt) -> to protect share with password
returns: null or public link
desc: removes the share entry
params: token
target -> ID of element to unshare
returns: null
desc: returns the public link of an element
params: token
target -> ID of shared element
returns: link
desc: returns a file or zipped directory
params: token
target -> ID(s) of requested element(s)
width (opt) -> If file is an image
height (opt) -> If file is an image
returns: file
desc: uploads file(s)
params: token
target -> ID of directory to upload to
file array
returns: null
desc: grants access to public share
params: hash -> share hash of public element
key (opt)
returns: token
desc: returns info for audio file
params: token
target -> File ID
returns: artist and title
desc: saves content to odf file
params: token
target -> File ID
data -> content
returns: null
desc: saves content to text file
params: token
target -> File ID
data -> content
returns: null
desc: loads content from text file
params: token
target -> File ID
returns: text file content
desc: used for the windows sync client
params: token
target -> ID of directory to sync
source -> list of client files
lastsync -> timestamp of last sync
returns: list of files to upload | download | delete
desc: scans the filesystem and synchronizes cache-db
params: token
target -> Directory ID
returns: null
All settings regarding the entire server;
desc: Deletes system log from database
Requires admin
params: token
returns: null
desc: Downloads plugin-zip from server and extracts it to plugins/
Requires admin
params: token
plugin name
returns: null or error
desc: Returns system log from database
Requires admin
params: token
returns: log
desc: Deletes plugin folder
Requires admin
params: token
plugin name
returns: null or error
desc: Returns server info
Requires admin
params: token
returns: Various server infos
desc: Returns current and recent version of simpledrive-server
params: Auth token
returns: Client version
Most recent version (if internet available)
desc: Sets max upload limit
param: Auth token
value -> upload-limit
returns: null
desc: Enables/disables Force-SSL
param: Auth token
enabled -> whether or not to force SSL
returns: null
desc: Sets server domain (used for public-share-link)
param: Auth token
domain -> domain name
returns: null
Uploads (encrypted) files to Google Drive
desc: Returns status of the backup connection
params: token
returns: enabled and running status
desc: Sets the auth token provided by google
params: token
code -> google auth token
returns: null
desc: Returns an authentification url for google drive
params: token
pass (opt) -> password to encrypt files
enc -> true if encryption requested
returns: Auth url
desc: Starts backup
params: token
returns: null
desc: Cancels backup by removing lock file
params: token
returns: null
desc: Disables backup by deleting token file
params: token
returns: null
All settings regarding one ore more user(s)
desc: Returns user
params: Auth token
user -> username
returns: user
desc: Returns all users
Requires admin
params: token
returns: List of all users
desc: Creates a user
Requires admin
params: token
user -> username of to be created user
pass
mode -> accepted values: admin | user
returns: null or error
desc: Deletes user
Requires admin
params: token
user
returns: null or error
desc: Returns max, used and free quota
params: Auth token
user -> username
returns: array of max, used and free quota
desc: Changes password for user
params: Auth token
currpass -> current password
newpass -> new password
returns: null
desc: Removes user's .tmp-folder
params: token
returns: null
desc: Returns color and fileview
params: auth token
returns: array of color and fileview
desc: Returns user's admin status
params: auth token
returns: admin status
desc: Sets user's max quota
Requires admin
params: auth token
returns: null
desc: Changes user's admin status
Requires admin
params: auth token
returns: null
desc: Enables/disables autoscan
params: auth token
returns: null
desc: Sets fileview
params: auth token
returns: null
desc: Sets theme-color
params: auth token
returns: null
If you want to help to improve simpleDrive, contact me!
simpleDrive is released under the Affero General Public License