Skip to content

docs: troubleshooting install issues #8

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

Merged
merged 3 commits into from
May 7, 2024
Merged

Conversation

oli-hivemq
Copy link
Collaborator

Add a troubleshooting section for authorization issues when trying to install this library from another repo.

@oli-hivemq oli-hivemq added the documentation Improvements or additions to documentation label May 3, 2024
@oli-hivemq oli-hivemq self-assigned this May 3, 2024
@oli-hivemq oli-hivemq requested review from antpaw and h2xd as code owners May 3, 2024 08:05
Copy link

@tolumq tolumq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @oli-hivemq,
Thank you for adding this, it definitely would save a lot of new users some time.

However, I think using .npmc might expose the user's token into git unless it is used through an environment variable (which might complicate things) for the CI build, or removed from git which is another using too.
Saving the token in their .bashrc or .zshrc might be another option
What do you think?

@antpaw
Copy link
Collaborator

antpaw commented May 3, 2024

If this meant to solve issues on CI/Jenkins side:

  • we should not store plain tokens in open files
  • usually our internal systems already have access tokens, at least that's how it was in hivemq-enterprise
  • I've build a system that allows to set the token securely, it used gradle (it is hivemq-enterpise main build tool anyway) hit me up if you need more details

@oli-hivemq
Copy link
Collaborator Author

Thanks @tolumq & @antpaw, I updated the README based on your comments

Copy link
Collaborator

@antpaw antpaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last minute request:
can we rename NPM_TOKEN to GH_NPM_TOKEN (GH stands for github) because there could be more package hosting repos down the road and it makes it more clear.

@oli-hivemq oli-hivemq requested a review from tolumq May 6, 2024 09:40
@tolumq
Copy link

tolumq commented May 6, 2024

Last minute request: can we rename NPM_TOKEN to GH_NPM_TOKEN (GH stands for github) because there could be more package hosting repos down the road and it makes it more clear.

@antpaw Can you kindly clarify what you mean by this?
I think having one token to handle access to our Github registry should be enough, since they would all be on Github (unless we have plans of moving the private libraries from Github which I don't see us doing anytime soon).

Copy link

@tolumq tolumq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oli-hivemq
Copy link
Collaborator Author

@antpaw what about splitting step 2 (currently about saving the token in an env variable) into 2 paths:

  • locally -> NPM_TOKEN
  • for CI -> GH_NPM_TOKEN
    ?

@antpaw
Copy link
Collaborator

antpaw commented May 6, 2024

@tolumq @oli-hivemq what I essentially mean is that NPM_TOKEN could refer to different registries (eg github.com or npmjs.com or somewhere else). Putting a GH prefix makes it more clear, locally and on ci.

https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#considering-cross-repository-access gihub refers to it as GITHUB_TOKEN which is also confusing in a setup with different technologies

@oli-hivemq
Copy link
Collaborator Author

oli-hivemq commented May 6, 2024

@tolumq @oli-hivemq what I essentially mean is that NPM_TOKEN could refer to different registries (eg github.com or npmjs.com or somewhere else). Putting a GH prefix makes it more clear, locally and on ci.

https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#considering-cross-repository-access gihub refers to it as GITHUB_TOKEN which is also confusing in a setup with different technologies

I see. That's a good point. In this case, what the doc could say is:

  1. save your token in an environment variable (e.g. in your ~/.bashrc or ~/.zshrc):
UI_THEME_NPM_TOKEN=YOUR_GENERATED_TOKEN
  1. add a line to .npmrc:
//npm.pkg.github.com/:_authToken=${UI_THEME_NPM_TOKEN}

Or keep it as it is and add a note to the doc mentioning your point @antpaw

@antpaw
Copy link
Collaborator

antpaw commented May 6, 2024

We will have more packages that are shared, UIShell has a package, XSD-Forms is a package. Creating the same token with different var names feels "off," i rather keep it as is.

@oli-hivemq oli-hivemq merged commit a583b8d into main May 7, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants