Skip to content

Commit

Permalink
Merge pull request #310 from VeliovGroup/dev
Browse files Browse the repository at this point in the history
v1.7.6
 - NPM dependencies update
 - Support for updated *Buffer* API on node >= 6.*
 - Methods `addFile`, `write` and `load` now supports `userId` option, see #305
 - Fix for unfinished uploads, now files is removed by upload TTL. See #267, thanks to @ck23onGithub
 - Better FS-stream management on server. Less memory and CPU consumption. Only one descriptor per upload. Fix FS-permissions
 - `.unlink()` method now supports callback
 - Docs for [MUP/Docker integration](https://github.com/VeliovGroup/Meteor-Files/wiki/MeteorUp-(MUP)-Usage)
 - Fix #293
 - Fix #299
 - BEtter AWS dos, see #282
 - `storagePath` now always is function, if *String* is passed - it will be wrapped into function
 - Please participate at [this thread](#309) to give a right path for Meteor-Files v2.0
  • Loading branch information
dr-dimitru authored Dec 15, 2016
2 parents e2600d0 + 083ad67 commit 076f5e0
Show file tree
Hide file tree
Showing 16 changed files with 328 additions and 229 deletions.
154 changes: 52 additions & 102 deletions .npm/package/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .versions
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ [email protected]
[email protected]
[email protected]
ostrio:[email protected]
ostrio:[email protected].5
ostrio:[email protected].6
[email protected]
[email protected]
[email protected]
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Support:

Support Meteor-Files project:
========
- Try [ostr.io](https://ostr.io) project, it will help you to sleep well. And will give us funds to serve Open Source projects
- [Donate via PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FVDSXRFW9VGA2)
- Star on [GitHub](https://github.com/VeliovGroup/Meteor-Files)
- Star on [Atmosphere](https://atmospherejs.com/ostrio/files)
Expand Down Expand Up @@ -98,11 +99,11 @@ import { FilesCollection } from 'meteor/ostrio:files';
FAQ:
========
1. __Where are files stored by default?__: by default if `config.storagePath` isn't passed into [*Constructor*](https://github.com/VeliovGroup/Meteor-Files/wiki/Constructor) it's equals to `assets/app/uploads` and relative to running script:
* On `development` stage: `yourDevAppDir/.meteor/local/build/programs/server`
> __Note: All files will be removed as soon as your application rebuilds__ or you run `meteor reset`. To keep your storage persistent during development use an absolute path *outside of your project folder*, e.g. `/data` directory.
* On `production`: `yourProdAppDir/programs/server`
* On `development` stage: `yourDevAppDir/.meteor/local/build/programs/server`. __Note: All files will be removed as soon as your application rebuilds__ or you run `meteor reset`. To keep your storage persistent during development use an absolute path *outside of your project folder*, e.g. `/data` directory.
* On `production`: `yourProdAppDir/programs/server`. __Note: If using MeteorUp (MUP), Docker volumes must to be added to__ `mup.json`, see [MUP usage](https://github.com/VeliovGroup/Meteor-Files/wiki/MeteorUp-(MUP)-Usage)
2. __How to pause/continue upload and get progress/speed/remaining time?__: see *Object* returned from [`insert` method](https://github.com/VeliovGroup/Meteor-Files/wiki/Insert-(Upload))
3. When using any of `accounts` packages - package `accounts-base` must be explicitly added to `.meteor/packages` above `ostrio:files`
4. __cURL/POST uploads__ -Take a look on [POST-Example](https://github.com/noris666/Meteor-Files-POST-Example) by [@noris666](https://github.com/noris666)

API overview (*[full API](https://github.com/VeliovGroup/Meteor-Files/wiki)*)
========
Expand Down
1 change: 1 addition & 0 deletions docs/addFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- `opts.meta` {*Object*} - Object with custom meta-data
- `opts.type` {*String*} - Mime-type, like `image/png`
- `opts.size` {*Number*} - File size in bytes, if not set - size will be calculated from file
- `opts.userId` {*String*} - UserId, default *null*
- `callback` {*Function*} - Triggered after new record is added to Collection. With `error`, and `fileRef`, where `fileRef` is a new record from DB
- proceedAfterUpload {*Boolean*} - Proceed `onAfterUpload` hook (*if defined*) after local file is added to `FilesCollection`
- Returns {*FilesCollection*} - Current FilesCollection instance
Expand Down
13 changes: 10 additions & 3 deletions docs/aws-s3-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ Example below shows how to store and serve uploaded file via S3. This example al

See [real, production code](https://github.com/VeliovGroup/Meteor-Files-Demos/blob/master/demo/lib/files.collection.coffee)

*Please note - this docs is a bit outdated. As knox package is not maintained well. New docs is coming soon. Meanwile take a look on "Evaporate" S3 client.* Related issues: [#285](https://github.com/VeliovGroup/Meteor-Files/issues/285), [#273](https://github.com/VeliovGroup/Meteor-Files/issues/273), [#280](https://github.com/VeliovGroup/Meteor-Files/issues/280). __If you're experienced with any of up-to-date AWS:S3 clients, please - contribute.__

Prepare: install [knox](https://github.com/Automattic/knox):
```shell
npm install --save knox
```
Or:
```shell
meteor npm install knox
meteor npm install --save knox
```

Important notice about [supported regions in knox](https://github.com/Automattic/knox#region) package:
Expand All @@ -28,7 +30,12 @@ As of this writing, valid values for the `region` option are:
Prepare: Get access to AWS S3:
- Go to http://aws.amazon.com/s3/ (*Sign(in|up) if required*)
- Click on [Create Bucket](https://console.aws.amazon.com/s3/home)
- Follow steps __1-3__ from [this docs](https://github.com/Lepozepo/S3#create-your-amazon-s3)
- Follow steps __1-4__ from [this docs](https://github.com/Lepozepo/S3#create-your-amazon-s3)
* Create an S3 bucket in your preferred region (currently only `eu-west-1` is supported)
* Get an "Access Key Id" and "Secret Key"
* "Enable Website Hosting" in bucket "Properties"
* Setup CORS at bucket "Permissions" tab
* For detailed info read [this docs](https://github.com/Lepozepo/S3#create-your-amazon-s3)
- Create new [CloudFront Distribution](https://console.aws.amazon.com/cloudfront/home)
* Select __Web__ as delivery method
* In __Origin Domain Name__ select your previously created S3 Bucket
Expand Down Expand Up @@ -144,4 +151,4 @@ if (Meteor.isServer) {
_origRemove.call(this, search);
};
}
```
```
3 changes: 2 additions & 1 deletion docs/constructor.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
Note: When running in development mode files stored at a relative path (within the Meteor project) are silently removed when Meteor is restarted.<br /><br />
To preserve files in development mode store them outside of the Meteor application, e.g. <code>/data/Meteor/uploads/</code><br /><br />
The Meteor-Files package operates on the host filesystem, unlike Meteor Assets. When a relative path is specified for <code>config.storagePath</code> (path starts with ./ or no slash) files will be located relative to the assets folder.<br /><br /> When an absolute path is used (path starts with /) files will be located starting at the root of the filesystem.
<br /><br />If using <a href="https://github.com/kadirahq/meteor-up">MeteorUp</a>, Docker volumes has to be created in <code>mup.json</code>, see <a href="https://github.com/bryanlimy/Meteor-Files/blob/master/docs/constructor.md#example-on-using-meteorup">Usage on MeteorUp</a>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -884,4 +885,4 @@ var Images = new FilesCollection({
return false;
}
});
```
```
2 changes: 1 addition & 1 deletion docs/gridfs-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ npm install --save gridfs-stream
```
Or:
```shell
meteor npm install gridfs-stream
meteor npm install --save gridfs-stream
```

##### Create collection
Expand Down
1 change: 1 addition & 0 deletions docs/load.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- `opts.meta` {*Object*} - Object with custom meta-data
- `opts.type` {*String*} - Mime-type, like `image/png`, if not set - mime-type will be taken from response headers
- `opts.size` {*Number*} - File size in bytes, if not set - file size will be taken from response headers
- `opts.userId` {*String*} - UserId, default *null*
- `callback` {*Function*} - Triggered after first byte is received. With `error`, and `fileRef`, where `fileRef` is a new record from DB
- proceedAfterUpload {*Boolean*} - Proceed `onAfterUpload` hook (*if defined*) after external source is loaded to FS
- Returns {*FilesCollection*} - Current FilesCollection instance
Expand Down
Loading

0 comments on commit 076f5e0

Please sign in to comment.