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

s3ForcePathStyle works for publishing but not installation #607

Open
jared-duo opened this issue Sep 22, 2021 · 0 comments · May be fixed by #650
Open

s3ForcePathStyle works for publishing but not installation #607

jared-duo opened this issue Sep 22, 2021 · 0 comments · May be fixed by #650

Comments

@jared-duo
Copy link

I am using LocalStack for a local S3 for verification, integration tests etc., so I am using localhost and other domains not part of the normal production AWS forms.

I have followed the configuration instructions here and publishing works perfectly, but the hosted_path property in the lib/utils/versioning.js doesn't take this parameter into account (we can see in the PR that introduces the s3ForcePathStyle parameter that the evaluate method in versioning.js accepts the parameter, but never uses it.)

I believe the opts.hosted_path needs to be altered to account for the bucket name being part of the path so that installation may also occur from a non-standard AWS path.

Example:

Given a

package.json

{
  ...
    "binary": {
    "module_name": "my-module",
    "module_path": "<some_path>",
    "remote_path": "/npm/{module_name}/addon/",
    "package_name": "{module_name}.tar.gz",
    "host": "https://localhost.localstack.cloud:4566",
    "region": "us-east-1",
    "bucket": "my-packages",
    "s3ForcePathStyle": true
  }
 ...
}

and an S3 bucket available at https://localhost.localstack.cloud:4566/my-packages an invocation of node-pre-gyp publish will place the tarball correctly in https://localhost.localstack.cloud:4566/my-packages/npm/my-module/addon/my-module.tar.gz, but an invocation of node-pre-gyp install will try to download the tarball from https://localhost.localstack.cloud:4566/npm/my-module/addon/my-module.tar.gz - notably without the bucket in the path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant