seba:ufs-wabs

v0.1.0Published 9 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

seba:ufs-wabs

NOTE: This package is under active development right now (2016-04-10). It has bugs and the API may continue to change. Please help test it and fix bugs, but don't use in production yet.

A Meteor package that adds Windows Azure Blob Storage (WABS) for UploadFS.

Installation

Install using Meteor. When in a Meteor app directory, enter:

$ meteor add seba:ufs-wabs

Usage

Put the necessary information into your WABSStore options, like so:

1
2const Photos = new Mongo.Collection('photos');
3
4const photosStore = new UploadFS.store.WABS({
5    collection: Photos,
6    name: 'photos',
7    chunkSize: 1024 * 255,
8    container: "myContainer", //required
9  	storageAccountOrConnectionString: "account or connection string", // WABS storage account or connection string; required if not set in environment variables
10  	storageAccessKey: "secret", //WABS storage access key; required if using a storage account and not set in environment variables
11  	folder: "folder/in/bucket", //optional, which folder (key prefix) in the container to use
12});

### Client, Server, and WABS credentials

There are two approaches to safely storing your WABS credentials:

1. As system environment variables (See: https://github.com/Azure/azure-storage-node [recommended approach]).
2. As given in the above code but located in a directory named `server` (note: wrapping in `Meteor.isServer` is **NOT**
secure).

**For Step 2:**

You need to define your store in two files: one located in a `server` director and one located in a `client` directory. In the client-side-only file, simply don't define any options when creating your Store.