SVN client checkout errors - linux

I have a situation where I can checkout a repo through tortoise or Eclipse and a browser, but for the life of me cannot do it directly from the cygwin/ Linux command lines. These are the errors :
svn: E175002: Unable to connect to a repository at URL 'https://BLAH/project/trunk'
svn: E175002: OPTIONS of 'https://BLAH/project/trunk': could not connect to server (https://BLAH)
The command I use is :
svn checkout --username MYUN --password MYPASS https://BLAH/project/trunk
I have set the proxy too. Any ideas would be appreciated.
Regards

Try setting the proxy in ~/.subversion/servers.
On my corporate laptop behind a proxy that requires NTLM authentication I have to run the ntlmaps proxy and set:
Suppose you define them globally, add this at the end of the file:
http-proxy-host = localhost
http-proxy-port = 5865
I've configured the ntlmaps daemon to prompt me for my password but you could also add it to ~/.subversion/servers.
http-proxy-username = your account
http-proxy-password = your password
You can get ntlmaps from from http://ntlmaps.sourceforge.net/, extract it locally then edit ntlmaps-0.9.9\server.cfg
PARENT_PROXY:<server FQDN>
PARENT_PROXY_PORT:<proxy port>
NT_DOMAIN:<NT DOMAIN>
USER:<USERNAME>
PASSWORD:
Hope this helps.

Related

clone private git repository with HTTP in cpanel

I want to integrate Cpanel with GitLab instance which its repositories are private and I can't use SSH because I don't have any access to the configuration of this instance and the Cpanel server (except the ssh keys section in Cpanel itself).
In Cpanel, the git section doesn't accept HTTP URLs for private git repositories and it suggests using SSH URLs instead but I can not.
I tried to use HTTP URL with username and password in URL but it prevents me to do this. like this:
https://USER:PASS#gitlab-instance.com/username/repository.git
anyone can help me to access the private git repository with SSH?
You should:
Add an ssh key
https://docs.gitlab.com/ee/gitlab-basics/create-your-ssh-keys.html
Access the repo via ssh
git#gitlab-instance.com:username/repository.git

Not able to access git repo from jenkins

I have configured Jenkins on a Linux machine and my git repo is on an another Linux server. But when I try to give the URL of the repo to Jenkins I get the following error.
Failed to connect to repository : Command "git -c core.askpass=true ls-remote -h ssh://user#ip/~/export1 HEAD" returned status code 128:
stdout:
stderr: Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
What could be the cause for this?
I have seen that both the systems' rsa key is present in each other's .ssh/known_hosts folder.
I am able to pull or clone code from the repo to a folder in Jenkins system as well. So why is Jenkins not able to take it?
I have also tried the URL user#ip:/fullpath/to/repo
You need to make sure Jenkins is running as the right user (the one who has the keys in ~/.ssh/id_rsa(.pub)
That user might not be the same as the one used in the ssh url: user#ip means you are connecting to ip using an account which has your public key in ~user/.ssh/authorized_key.
So the Jenkins process must be run by an account which has the private and public key, whose public key is in ~user/.ssh/authorized_key on the git server side.
And that account should have done (only once) an ssh-keyscan -H ip >> ~account/.ssh/known_hosts before any ssh attempt, in order to record the git server ip as a known host.
Does it being a bare repo make any difference or change in the URL?
No. The .git at the end of the bare repo folder is optional when used as an url.
Further to #VonC's reply, you can also use the Credentials plugin to define a set of credentials on your Jenkins master that your Jenkins job uses to access your Git repo. This allows you to run Jenkins itself as a different user from there one that has access to the Git repo.
The main problem was the security of the systems. I hadnt checked the authentication mechanisms on my server. The password authentication to the git server was causing the problem because the jenkins machine tries to directly fire a ls-remote to the path. When you do the same thing on the terminal you will be prompted for a password and then itl accept. When I set the password authentication and UsePAM to no and enabled the RSA authentication, pubkey authentication and authorised key setting to yes in the sshd_config file, and restarted, it was able to access the repo and I dint get this error.

Tuleap - SVN checkout issue : error 500

I'm using the docker image of tuleap in version 8.3.
I setup an AD in /etc/tuleap/plugins/ldap/etc/ldap.inc and enable it in /etc/tuleap/conf/local.inc with
$sys_auth_type = 'ldap';
I then created a subversion project and add my user with the Add user button in using the autocompletion ==> my user get recognized, it was never added to tuleap before, so I think the connection with the AD is working.
But when I do a
svn list --username myuser http://tuleap/svnroot/toto, I get :
Redirecting to URL 'https://tuleap/svnroot/toto':
Authentication realm: <https://tuleap:443> LDAP Subversion Authorization (toto)
Password for 'myuser':
svn: E175002: Unable to connect to a repository at URL 'https://tuleap/svnroot/toto'
svn: E175002: Server sent unexpected return value (500 Internal Server Error) in response to OPTIONS request for 'https://tuleap/svnroot/toto'
I can't find any error in /var/log/httpd/error_log
Any ideas ?
Please make sure that you have appropriate access to checkout the code from repo. If you have access and getting error 500 then please navigate to %appdata%\subversion\auth\svn.simple in Windows
In linux run this command -
rm -f~/.subersion/auth/svn.simple/*
Let us know if this helps you .

GitLab username in URL for clone

How do I configure the GitLab URL username?
Why is the username in the Git clone URL always git#url?
Even if we create own user it still says git.
I have created my ssh key and added to the GitLab, but still it says git#url.
It does say git because it is the account under which GitLab server has been installed.
It is defined in the gitlab.yml config file.
# Uncomment and customize if you can't use the default user to run GitLab
(default: 'git')
# user: git
You will always contact GitLab ssh with that user 'git': that SSH session will use your public SSH key, and that will allow the GitLab server to authenticate you.
Since it is an SSH URL, you need to open a (non-interactive) ssh (secure shell) session always with the account git, which will have your public SSH key registered.

Using gitlab behind router and portforwarding?

My current setup is that I have an Ubuntu VM with gitlab installed (gitlabVM). Gitlab is running on nginx over port 8888
My router is configured as the following:
External 4322 -> gitlabVM:22
External 8888 -> gitlabVM:8888
If I am at a remote location, how do I connect back to do a git clone?
Ive tried git+ssh://myuseringitlab#routerip:4322/root/repo.git but i get an error that there are no repositories.
the url in gitlab is git#localhost:root/repo.git.
Did you try this ?
git+ssh://git#routerip:4322/root/repo.git
You have to provide the git user. Your Gitlab user credentials are asked at the next step (if you don't use SSH auth).

Resources