Meteor-files: Update S3 integration docs

Created on 13 Dec 2016  路  29Comments  路  Source: veliovgroup/Meteor-Files

knox is stale, looking forward Evaporate, read https://github.com/VeliovGroup/Meteor-Files/issues/285 and notes from: 1102cfa for more info

AWS S3 Documentation help wanted

Most helpful comment

I have it working with the aws-sdk, will create a PR and get the docs updated.

All 29 comments

Would love to get some help with this, I don't know where to start!

Has anyone been able to take a look at this?

Hello @Floriferous ,

Thank you for your interest.

I guess demo app has huge overhead just for S3 integration, and it's written on Coffee. So, it's better to take current S3 docs and replace knox with Evaporate.

Let me know if it helps. Thank you.

Hello @Floriferous ,

Have you got any progress on this one?
I'm going to put my hands on soon, so if you got something - it will be great if you share it.
Thank you.

Hi @dr-dimitru,

I tried and failed for a few days, as it requires a good understanding of AWS' authentication process. Time is more critical for me at this moment, so I went with Meteor-Slingshot.

I mainly wasn't able to get a single signature to get accepted on AWS, so wasn't able to upload anything with the v4 signing method (which I need to use Frankfurt's AWS servers).

Nothing to share, as that is the first thing you have to implement on your own once you copy Evaporate's basic examples. Quite sad hehe :)

Sorry I couldn't help more.

@Floriferous no worries. we good. Thank you for attempt to solve this.

Any progress on this?

So Evaporate vs oficial AWS S3 JS client?

Definitely +1 for official NPM aws-sdk package

I have it working with the aws-sdk, will create a PR and get the docs updated.

Cant wait!!

408 submitted a few days ago, can check it out if your interested now..

I was successful with the official aws-sdk

same here

Anybody got lucky with an http upload? DDP works like a charm but for some reasons http is stubborn

@dr-dimitru would you be interested to un-merge this so I can give it a cleanup on the new JS standards, you know ';', spaces etc. Though would be a good opportunity since I am now familiar with it as I just used it. I don't see a way to edit it otherwise. Any suggestions?

@paulincai I prefer spaces over tabs, and keep using ; at the end of the line.
@vtocco quick guess - "avoid ;" is the new standard?

@paulincai @vtocco
As we're dealing with Meteor package, I prefer to stick with Meteor's .eslint config

@paulincai i'm going to review #408 with minor text/comments/etc. changes.
Feel free to fork and send a PR with your suggestions, better to wait for final version from my end.

@dr-dimitru and @vtocco I am running in a bit of an issue. I think 'this.userId' has been used on the server side while this returns valid only under Meteor.publish() as far as I know. I'll do Meteor.userId() on my project, jFYI.

https://guide.meteor.com/accounts.html#current-user-server. I am able to access this.userId just fine.

I am not sure I get this right but I definitely fail to get the user Id and I am right to fail, unless this registers as a publication or a method, in which case I am doing something wrong:

'protected': function (fileObj) {
      console.log('Running protected mode - file download');
      //console.log('Protected file object: ', fileObj);

      //if we are not logged in, deny the file access
      if (!this.userId) {
        return false;
      }

      //if the logged in user owns the file, or an admin is trying to access it allow it
      if (this.userId === fileObj.userId || IsUserAdmin(this.userId, 'File Download')) {
        return true;
      }
      console.log('protected mode false - file download', this.userId, fileObj);
      return false;
    } 

Are you able to get a console log with a valid user Id there?

@paulincai doest it returns null or undefined?
All hooks where is this.userId and this.user() available in context listed in docs - here.

Here is how we use it in demo app - https://github.com/VeliovGroup/Meteor-Files-Demos/blob/master/demo/lib/files.collection.js#L70

localhost:3000 all ok, IP:3000 (even from the station where I run the server) NULL

@paulincai use this, to start meteor:

ROOT_URL=IP:3000 meteor

@dr-dimitru @vtocco :(. Ok, on 'onBeforeUpload' this is the photo object, I get this.userId from that object but not the Meteor this.userId... I was a little confused here...

In 'protected', this is http and it looks that both my Android 6.0 and IOS are not returning a userId under the HTTP object:

This is localhost, local but with ROOT_URL=IP:3000 meteor and production in Heroku.
...
params:
{ query: {},
_id: 'NdcJTnMyJ9jf8xDhu',
version: 'x320',
name: 'NdcJTnMyJ9jf8xDhu.jpeg'
},
user: [Function],
userId: null
}

@paulincai You've run into the #159

Good news everyone, new AWS:S3 docs is finally here, all thanks to @vtocco

@dr-dimitru @vtocco big thanks guys.

Was this page helpful?
0 / 5 - 0 ratings