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

medplum aws update-app hard coded to use public npm registry #4655

Closed
dbryant4-cj opened this issue Jun 11, 2024 · 2 comments · Fixed by #4812
Closed

medplum aws update-app hard coded to use public npm registry #4655

dbryant4-cj opened this issue Jun 11, 2024 · 2 comments · Fixed by #4812
Labels
good first issue Good for newcomers

Comments

@dbryant4-cj
Copy link

dbryant4-cj commented Jun 11, 2024

Background

In our environment, access to the public Internet is very restrictive, meaning access to the public npm registry is not allowed. Instead, we have a Nexus artifact server that serves as the npm registry. This is a requirement of our security posture that we cannot easily change.

Issue

It appears as though the public npm registry is hard coded in the file below which causes the medplum aws update-app to fail. Can this be changed to be configurable, perhaps by an environment variable or a CLI option?

async function getNpmPackageMetadata(packageName: string, version: string): Promise<any> {
const url = `https://registry.npmjs.org/${packageName}/${version}`;
const response = await fetch(url);
return response.json();
}

@dbryant4-cj
Copy link
Author

dbryant4-cj commented Jun 11, 2024

Upon further investigation, it seems as though simply replacing https://registry.npmjs.org/ with our Nexus URL might not work since Nexus does not seem to support latest as a version string. This may only be an issue with Nexus.

As an alternative approach, perhaps it makes more sense to allow users a way to provide the path to the extracted tar for the @medplum/app package. I can easily configure our CI to download and extract a tar from our Nexus server.

https://github.com/medplum/medplum/blob/main/packages/cli/src/aws/update-app.ts#L40

@codyebberson
Copy link
Member

Hi @dbryant4-cj - thanks for filing, this is a good issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants