Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3Adapter returning incorrect url #392

Closed
nathan-charles opened this issue Feb 13, 2016 · 7 comments
Closed

S3Adapter returning incorrect url #392

nathan-charles opened this issue Feb 13, 2016 · 7 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@nathan-charles
Copy link

I was getting incorrect urls for my files stored in S3. I'm using parse-server 2.0.8

I had to modify the following line in S3Adapter.js

From: return 'https://' + this.bucket + '._s3Client.amazonaws.com' + '/' + this._bucketPrefix + filename;

To: return 'https://' + this._bucket + '.s3.amazonaws.com' + '/' + this._bucketPrefix + filename;

@nlutsenko
Copy link
Contributor

(-‸ლ) Nice catch, fixing in a moment.

@nlutsenko nlutsenko self-assigned this Feb 13, 2016
@nlutsenko nlutsenko added type:bug Impaired feature or lacking behavior that is likely assumed pr-submitted labels Feb 13, 2016
@chriscborg
Copy link
Contributor

not sure if it is related to this issue, but from my iOS and Android apps and since version 2.1.4, I am getting a URL for my S3 Parse Files that are pointing to my server instead of to S3. Had to revert back to 2.1.3 for the URL to show correctly.

@flovilmart
Copy link
Contributor

Did you use directAccess = true?

@chriscborg
Copy link
Contributor

Hi @flovilmart thanks for the reply - no I hadn't. seems like it was a new configuration that I missed. but I added the new config and went back to parse 2.1.4 and still no luck so far; still getting the url to my server

@flovilmart
Copy link
Contributor

How do you launch parse-server?

@chriscborg
Copy link
Contributor

I have parse-server as part of another project so I had it installed through npm, added

var S3Adapter = require('parse-server').S3Adapter;
var s3Adapter = new S3Adapter('xxx', 'xxx', "xx", {directAccess: true});

// Specify the connection string for your mongodb database
// and the location to your Parse cloud code
var api = new ParseServer({
  databaseURI: 'xxx',
  cloud: appRoot + '/parse_cloud/main.js', // Provide an absolute path
  appId: 'xxx',
  masterKey: 'xxx',
  clientKey: 'xxx',
  filesAdapter: s3Adapter,
  serverURL: 'http://localhost:1337/parse',
  push: {
    android: {
      senderId: 'xxx',
      apiKey: 'xxx'
    },
    ios: [
      {
        pfx: appRoot + '/apns_cert/apns-dev-key.p12', // Dev PFX or P12
        bundleId: 'xxx',
        production: false // Dev
      },
      {
        pfx: appRoot + '/apns_cert/apns-pro-key.p12', // Prod PFX or P12
        bundleId: 'xxx',
        production: true // Prod
      }
    ]
  }
});

app.use('/parse', api);

to my app.js and then run with node app.js. You think having parse as part of another project can interfere?

@flovilmart
Copy link
Contributor

We had a problem with the AdapterLoader in 2.1.4, 2.1.5 will be out soon and should resolve that issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

4 participants