Skip to content

Drivenote is a permission management system for Google Drive shared folders. Its goal is to assist students sharing their class notes securely, by granting access to a central shared folder only to verified students.

License

Notifications You must be signed in to change notification settings

magkopian/drivenote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description:

Drivenote is a permission management system for Google Drive shared folders. Its goal is to assist students sharing their class notes securely, by granting access to a central shared folder only to verified students.

How to Install:

To install Drivenote first download a stable release from the releases page and extract the contents of the zip/tar.gz archive to the directory you wish to install it e.g. /var/www/drivenote/.

For the next step you need to have installed composer in order to install the dependencies. If composer is not installed in your system you can download it and find installation instructions here.

After installing composer you'll need to cd to the directory where you have extracted the files e.g cd /var/www/drivenote/, and run composer install to install the dependencies.

Lastly, you'll need to rename src/config.template.php to src/config.php and edit it in order to reflect the setup of your own application, by filling your Google Web Application and Web Service account credentials, the credentials for your database, the pattern and the example for the academic email address, etc.

Configuration:

After installing the application you need to configure it by editing and renaming the file src/config.template.php to src/config.php.

Google API Setup

First go to the Google Developers Console and set up a new project.

After that, you'll need to enable the Drive API for the project you've just created.

Lastly, you'll have to generate two types of OAuth Client IDs for your application, one Service Account type and one Client ID for web application type. Fill the src/config.php file with the credentials you just generated and download the key file of the service account and place it inside the keys/ directory.

Adding the files

After generating the credentials for the Google API you will have to give the application access to the files you want to manage their permissions.

At first, you will have to make sure that all the files you want the application to manage are inside a specific folder in your Google Drive, the structure inside the folder doesn't matter. You will have to share this folder with the application and give it write access, but you don't have to make the application the owner.

The email of the application that you have to share the folder with, is the same email that was generated when you created the Google Service Account on the previous step.

After you give the application write access to the folder, you will have to find its ID and fill the appropriate field inside your config.php file. For this purpose create a PHP file with the following code and put it inside the public_html directory:

<?php require_once '../src/init.php';
$drive->listFiles();

When you run the script from your browser, it will list all the files and folders that the application manages. Now you just have to find the folder that you shared with the application in this list so you can find its ID. The record of the folder will be most likely near the top of the list. When you are done, delete the PHP file you created to find the ID of the folder.

Database Setup

The application needs a simple MySQL database in order to work. You can create an empty database and import the sql/drivenote.sql file in order to generate the right database schema. Also, create a user with access to the same database.

Next, fill the src/config.php file with the credentials of the database you just created.

SMTP Configuration

The application needs access to an SMTP server in order to be able to send account activation emails. Fill the src/config.php file with the credentials of your SMTP server. If don't have an SMTP server installed you can use a relay server like Mailgun.

Academic Email Verification

In order to be able to accept students only from a specific school the application uses a regular expression for validating the user's academic email address. You need to provide a regular expression that matches the academic email address format you want.

You'll also need to provide an academic email address example to indicate to your users which type of email addresses are accepted as valid.

Dependencies:

PHP 5.3
PHPMailer 5.*
Google APIs Client Library for PHP 1.*

About

Drivenote is a permission management system for Google Drive shared folders. Its goal is to assist students sharing their class notes securely, by granting access to a central shared folder only to verified students.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published