Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355114

Summary: Disable cloning from cgit
Product: Community Reporter: Brian de Alwis <bsd>
Component: GitAssignee: Eclipse Webmaster <webmaster>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Brian de Alwis CLA 2011-08-18 12:12:47 EDT
I was trying some of the examples in the Git guide:

   http://wiki.eclipse.org/Git

The examples using ssh: or git: don't work:

   git clone ssh://bdealwis@git.eclipse.org/gitroot/babel/org.eclipse.babel.server.git
   git clone git://git.eclipse.org/gitroot/babel/org.eclipse.babel.server.git

I also tried with /c/platform/eclipse.platform.ui.git, where I should have access:

  $ git clone git://git.eclipse.org/c/platform/eclipse.platform.ui.git/
  Initialized empty Git repository in /Users/bsd/Manumitting/Projects/e4/eclipse.platform.ui/.git/
  fatal: The remote end hung up unexpectedly

I've tried git 1.7.3.4 and 1.6.1.

(I'm trying these URLs as compared to the http: URLs because of bug 355112)
Comment 1 Denis Roy CLA 2011-08-18 13:48:08 EDT
>    git clone
> ssh://bdealwis@git.eclipse.org/gitroot/babel/org.eclipse.babel.server.git
>    git clone git://git.eclipse.org/gitroot/babel/org.eclipse.babel.server.git

I've removed those examples, since that repo doesn't exist anymore.

 
> I also tried with /c/platform/eclipse.platform.ui.git, where I should have
> access:

I'm renaming this bug to disable cloning from cgit (the web front-end).  cgit doesn't support the smart server.  If you clone using the clone URLs at the bottom of each repo page, you'll notice the http URLs support the smart server.
Comment 2 Brian de Alwis CLA 2011-08-18 15:22:29 EDT
(In reply to comment #1)
> I'm renaming this bug to disable cloning from cgit (the web front-end).  cgit
> doesn't support the smart server.  If you clone using the clone URLs at the
> bottom of each repo page, you'll notice the http URLs support the smart server.

That's a pity (for me) since bzr-git doesn't yet support smart-server over http.  Oh well. Thanks Denis.
Comment 3 Denis Roy CLA 2011-10-24 16:29:10 EDT
Our current version of cgit doesn't (easily) allow me to disable cloning directly from cgit, so I've put these rewrite rules which do just that:

# Prevent people from cloning from cgit
RewriteRule ^/c/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$          /c/  [F,L]
RewriteRule ^/c/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /c/  [F,L]
Comment 4 Denis Roy CLA 2012-03-23 11:16:58 EDT
This has been fixed.