sonatype / nexus-ruby-support

26 stars 7 forks source link

Gemcutter (rubygems.org) push compatibility? #62

Closed vzamanillo closed 7 years ago

vzamanillo commented 7 years ago

Hi,

are the nexus ruby hosted repositories compatible with gemcutter? I mean, could I push a gem with the common 'gem push' command without using the nexus gem?

mkristian commented 7 years ago

yes, you can use the gem push. make a copy of ~/.gem/credentials and delete it. then gem push will go through the sign up. but there are no API-keys nexus will use the Basic authentication schema, i.e. Basic .... with your username:password base-64 encoded.

I never understood how to use gem push when you need to sign up for a new host - that is why the deletion of the credentials file. so any hint how to do is welcome. it works but the setup might now be straightforward and stores your credentials more or less plain text locally.

vzamanillo commented 7 years ago

I am actually getting a HTTP 400 (Bad Request) when doing the

gem push --host http://gems.mydomain.com/repository/rubygems-hosted/

This is the output log

user@hell:~/dev/mygem$ gem push --host http://gems.mydomain.com/repository/rubygems-hosted/
Enter your http://gems.mydomain.com/repository/rubygems-hosted/ credentials.
Don't have an account yet? Create one at http://gems.mydomain.com/repository/rubygems-hosted//sign_up
   Email:   vzamanillo
Password:   

<!DOCTYPE html>
<html>
<head>
  <title>400 - Nexus Repository Manager</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

  <!--[if lt IE 9]>
  <script>(new Image).src="http://gems.mydomain.com/favicon.ico?3.1.0-04"</script>
  <![endif]-->
  <link rel="icon" type="image/png" href="http://gems.mydomain.com/favicon-32x32.png?3.1.0-04" sizes="32x32">
  <link rel="mask-icon" href="http://gems.mydomain.com/safari-pinned-tab.svg?3.1.0-04" color="#5bbad5">
  <link rel="icon" type="image/png" href="http://gems.mydomain.com/favicon-16x16.png?3.1.0-04" sizes="16x16">
  <link rel="shortcut icon" href="http://gems.mydomain.com/favicon.ico?3.1.0-04">
  <meta name="msapplication-TileImage" content="http://gems.mydomain.com/mstile-144x144.png?3.1.0-04">
  <meta name="msapplication-TileColor" content="#00a300">

  <link rel="stylesheet" type="text/css" href="http://gems.mydomain.com/static/css/nexus-content.css?3.1.0-04"/>
</head>
<body>
<div class="nexus-header">
  <a href="http://gems.mydomain.com">
    <div class="product-logo">
      <img src="http://gems.mydomain.com/static/images/nexus.png?3.1.0-04"/>
    </div>
    <div class="product-id">
      <div class="product-id__line-1">
        <span class="product-name">Nexus Repository Manager</span>
      </div>
      <div class="product-id__line-2">
        <span class="product-spec">OSS 3.1.0-04</span>
      </div>
    </div>
  </a>
</div>

<div class="nexus-body">
  <div class="content-header">
    <img src="http://gems.mydomain.com/static/rapture/resources/icons/x32/exclamation.png?3.1.0-04"/>
    <span class="title">Error 400</span>
    <span class="description">Bad Request</span>
  </div>
  <div class="content-body">
    <div class="content-section">
      Bad Request
    </div>
      </div>
</div>
</body>
</html>

I don't know if I missed something.

mkristian commented 7 years ago

may I ask which nexus version you are using - the url suggest it is nexus3 but this plugin is for nexus2. just want to be on the right track.

vzamanillo commented 7 years ago

Yep I am on nexus 3

mkristian commented 7 years ago

@vzamanillo I copied your issue over to https://issues.sonatype.org/projects/NEXUS/issues/NEXUS-11850 - I am sure nexus3 will address it. it is implemented but the authentication phase might be missing at our integration tests and slipped through.

vzamanillo commented 7 years ago

Thank you very much @mkristian

peterlynch commented 7 years ago

@vzamanillo please create an account at https://issues.sonatype.org or tell me the user id of your existing account there. Then we will make you the reporter of NEXUS-11850.

Note: The nexus.log will print a message about the 400 response. Have you checked it? Also what is the deployment policy for the rubygems hosted repo

vzamanillo commented 7 years ago

@peterlynch, thank you, I am trying to see the issue 11850 but seems like does not exists, my id is vzamanillo, I am already registered. I will take a look at the log (I can't do a new test right now)

The deployment policy for the hosted repo is set to 'Disable redeploy'

peterlynch commented 7 years ago

@vzamanillo you are now the reporter of https://issues.sonatype.org/projects/NEXUS/issues/NEXUS-11850 and should be able to see it if you are logged into that system. please upload any more pertinent info there.