Skip to content

Conversation

@khassel
Copy link
Collaborator

@khassel khassel commented Jan 1, 2026

No description provided.

@sdetweil
Copy link
Collaborator

sdetweil commented Jan 2, 2026

What is the xxxxx NPM_TOKEN=npm_xxxxx
I generate a token but it doesn’t give me the value, only allows me to set the name

@khassel
Copy link
Collaborator Author

khassel commented Jan 2, 2026

it is the new token, e.g.:

grafik

@rejas
Copy link
Collaborator

rejas commented Jan 2, 2026 via email

@khassel
Copy link
Collaborator Author

khassel commented Jan 2, 2026

I dont like bypassing 2FA

I described only one way to get npm publish running. I'm not involved in this topic and the only use case where I have to login and publish something is ~ once a year here.

Please consider that I have no node/npm stuff on my working system (windows) so I have to do this per command line in a linux container which has no browser. Let me know how to do this with 2FA. Or better change the content of Collaboration.md in this PR.

@sdetweil
Copy link
Collaborator

sdetweil commented Jan 2, 2026

I also have no npm content other than MM,

@rejas
Copy link
Collaborator

rejas commented Jan 5, 2026

Please consider that I have no node/npm stuff on my working system (windows) so I have to do this per command line in a linux container which has no browser. Let me know how to do this with 2FA. Or better change the content of Collaboration.md in this PR.

Without a browser it indeed could be tricky. When I publish on npm (via console), it does open a brwoser for me and I can enter my 2fa code there.

Maybe add your setup (with the NPM_TOKEN instrcutions) as a secondary way for publishing (one with brwoser, one without brwoser)?

@khassel
Copy link
Collaborator Author

khassel commented Jan 5, 2026

as I already mentioned: I know only the method I wrote down in Collaboration.md.

If you prefer a method with 2fa write it down and commit it into this PR. Leaving my method as secondary would be helpful if the 2fa-method is not usable in headless setups.

- Method 1 (recommended): npm login with browser and 2FA
- Method 2 (fallback): token-based for headless environments
- Add security warning for token method that bypasses 2FA
@KristjanESPERANTO
Copy link
Collaborator

I've just added a commit (b73aa21) with both methods for npm publishing.

This should address both @rejas' security concerns and @khassel's headless setup requirements. The 2FA method is clearly marked as recommended, while the token method remains available as a documented fallback for environments without browser access.

What do you think? 🙂

@khassel
Copy link
Collaborator Author

khassel commented Jan 7, 2026

Thanks @KristjanESPERANTO , can't approve (because I created this PR) but I'm fine with this.

@sdetweil
Copy link
Collaborator

sdetweil commented Jan 7, 2026

npm login worked for me just now

@KristjanESPERANTO
Copy link
Collaborator

npm login worked for me just now

Because you probably chose the "bypass 2FA option" and saved the token.


The problem with the bypass is that if one of those systems with bypass are getting compromised, malicious code could be easily published via npm. There have already been npm dependency chain attacks, so it's not entirely unrealistic.

@khassel
Copy link
Collaborator Author

khassel commented Jan 7, 2026

The problem with the bypass is that if one of those systems with bypass are getting compromised, malicious code could be easily published via npm. There have already been npm dependency chain attacks, so it's not entirely unrealistic.

I know about the npm problems.

When I do the npm publish using a container this container only lives for the ~ 5 min. doing this. I revoke the used token after the container is destroyed.

@sdetweil
Copy link
Collaborator

sdetweil commented Jan 7, 2026

It asked me to login with my passkey

@rejas rejas merged commit b847dd7 into MagicMirrorOrg:develop Jan 8, 2026
9 checks passed
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 this pull request may close these issues.

4 participants