Skip to content

Commit aa3e0e2

Browse files
committed
Improve registry check messages
1 parent 5101317 commit aa3e0e2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/hex/registry/server.ex

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -420,19 +420,20 @@ defmodule Hex.Registry.Server do
420420
case result do
421421
{:error, :bad_signature} ->
422422
Hex.Shell.error(
423-
"Could not verify authenticity of fetched registry file. " <>
423+
"Could not verify authenticity of fetched registry file because signature verification failed. " <>
424424
"This may happen because a proxy or some entity is " <>
425425
"interfering with the download or because you don't have a " <>
426426
"public key to verify the registry.\n\nYou may try again " <>
427-
"later or check if a new public key has been released " <> public_key_message(repo)
427+
"later or check if a new public key has been released #{public_key_message(repo)}. " <>
428+
"Set HEX_UNSAFE_REGISTRY=1 to disable this check and allow insecure package downloads."
428429
)
429430

430431
{:error, :bad_repo_name} ->
431432
Hex.Shell.error(
432-
"Fetched deprecated registry record version from repo #{repo}. For security " <>
433-
"reasons this registry version is no longer supported. The repository " <>
434-
"you are using should update to fix the security reason. Set " <>
435-
"HEX_NO_VERIFY_REPO_ORIGIN=1 to disable this check."
433+
"The configured repository name for your dependency #{Hex.Utils.package_name(repo, package)} does not " <>
434+
"match the repository name in the registry. This could be because the repository name is incorrect or " <>
435+
"because the registry has not been updated to the latest registry format. " <>
436+
"Set HEX_NO_VERIFY_REPO_ORIGIN=1 to disable this check and allow insecure package downloads."
436437
)
437438

438439
_other ->

0 commit comments

Comments
 (0)