Skip to content

Improve warning when an untrusted user is using an untrusted substituter#7461

Merged
thufschmitt merged 3 commits intoNixOS:masterfrom
rapenne-s:improve_messaging_untrusted_sub_user
Jan 26, 2023
Merged

Improve warning when an untrusted user is using an untrusted substituter#7461
thufschmitt merged 3 commits intoNixOS:masterfrom
rapenne-s:improve_messaging_untrusted_sub_user

Conversation

@rapenne-s
Copy link
Member

This change brings a huge warning message with explanations when
an untrusted user (wrt nix) is trying to use a substituter that isn't
trusted in nix.conf, this is a very common case nowadays with flakes
containing substituter informations.

The point is to help the user by giving the following information:

  • why is this happening
  • what are the solutions to fix it
  • what are the risks
  • how to learn more about the explanation

fix #6672

Release Notes

Does it deserve an entry in release notes?

Testing

All the tests are still passing.

Priorities

Add 👍 to pull requests you find important.

@rapenne-s rapenne-s marked this pull request as ready for review December 14, 2022 13:09
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/what-would-you-like-to-see-improved-in-nix-cli-experience/24012/1

@edolstra
Copy link
Member

Rather than having a long warning message, it might be better to link to some section in the manual.

@jonringer
Copy link
Contributor

Rather than having a long warning message, it might be better to link to some section in the manual.

Or go the route of the rustc compiler, in which you get a short message, and a link to a long explanation.

@rapenne-s rapenne-s force-pushed the improve_messaging_untrusted_sub_user branch from e94b26d to 4303db8 Compare December 16, 2022 08:30
@rapenne-s
Copy link
Member Author

I'm convinced it's important to get immediate information, that doesn't even require Internet or a web browser to read, I think we could add a link to an deeper explanation (if we had it), but we should keep a local explanation.

@rapenne-s rapenne-s force-pushed the improve_messaging_untrusted_sub_user branch from 4303db8 to 08eb59e Compare December 20, 2022 11:17
@rapenne-s
Copy link
Member Author

@fricklerhandwerk I made the changes, however I don't know if we want to make a standardized wording to refer to documentation. I don't think we have any at the moment, but it would be practical for further similar changes.

@rapenne-s rapenne-s force-pushed the improve_messaging_untrusted_sub_user branch 2 times, most recently from 8de4a59 to 5ac9a41 Compare December 20, 2022 11:20
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/tweag-nix-dev-update-42/24204/1

@thufschmitt thufschmitt added error-messages Confusing messages and better diagnostics and removed error-messages Confusing messages and better diagnostics labels Jan 2, 2023
@rapenne-s rapenne-s force-pushed the improve_messaging_untrusted_sub_user branch from 3fc30a0 to f6d1e96 Compare January 20, 2023 08:47
Solène Rapenne and others added 2 commits January 26, 2023 09:34
@rapenne-s rapenne-s closed this Jan 26, 2023
@rapenne-s rapenne-s force-pushed the improve_messaging_untrusted_sub_user branch from f6d1e96 to aa61ae0 Compare January 26, 2023 08:56
Co-authored-by: Théophane Hufschmitt <theophane.hufschmitt@tweag.io>
@rapenne-s rapenne-s reopened this Jan 26, 2023
@thufschmitt thufschmitt merged commit ed479aa into NixOS:master Jan 26, 2023
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/tweag-nix-dev-update-43/25185/1

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nix-team-report-2022-10-2023-03/27486/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

error-messages Confusing messages and better diagnostics

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

when a substituter is untrusted, give a solution in the warning message

8 participants