D
D
Dmitry2016-03-08 05:04:15
subversion
Dmitry, 2016-03-08 05:04:15

SVN how to configure not to enter a password?

Perhaps I misunderstand the essence of SVN, but here is the scheme:
On a remote server (Debian 6.10) raised Subversion. Imported a web project there.
Now you need to work with files from home. I installed TurtoiseSVN, I do Checkout to the directory using the svn + ssh protocol, it asks for a password twice, well, God bless him. The files are uploaded to the directory. I make edits, commit changes, again asks for a password for a commit. So far it's not too annoying.
Question. And how now to upload these changes to the DocumentRoot directory of the web server?
I imagine it like this: checkout to this directory:
# svn co "svn+ssh://[email protected]/path/to/repo" .
But then again asks for the password, and twice. How to avoid it? Or maybe there are other schemes so that the committed changes are uploaded to the web server directory?
(Initially I thought to somehow do svn update to the documentroot directory with cron. Already confusion in my head. Is there a solution for this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vapaamies, 2016-03-09
@vapaamies

I use RapidSVN, I'm not familiar with the features of TortoiseSVN. The base SVN client is responsible for the connection and passwords. If everything is correct, it should store the preferred props in %AppData%\Subversion. Perhaps there configyou need to enable the appropriate setting, like store-auth-creds = yes. Working settings at my house...
I also think that it is not necessary to specify the username in the connection string so that it is requested and stored along with the password.
On the server, you need to make your working copy in the DocumentRoot ( svn co), then commit in the usual order to the main repository, and on the server, do it svn upto receive changes to the DocumentRoot.

A
Alex, 2016-03-17
@ALexhha

Given that the svn repository and the web server are on the same server, you can do something like this

<VirtualHost *:80>
    ServerName www.example.com
    DocumentRoot /vhosts/www.example.com/public_html

    DirectoryIndex index.html index.php
  
    # Закрываем доступ к служебным папкам VCS
    RedirectMatch 404 /\\.(svn|git|hg|bzr|cvs)(/|$)

    <Directory /vhosts/www.example.com/public_html>
        Options -Indexes
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

</VirtualHost>

Perform initialization
# cd /vhosts/www.example.com/public_html
# svn co file:///var/lib/svn/repos/project1/trunk ./
# chown -R svn:apache /vhosts/www.example.com/public_html
# chmod -R 770 /vhosts/www.example.com/public_html

In this example, the svn repository is running as the svn user
# id svn
uid=497(svn) gid=48(apache) groups=48(apache),497(svn)

Create a simple post commit hook
# cat /var/lib/svn/repos/project1/hooks/post-commit
#!/bin/sh

umask 002
cd /vhosts/www.example.com/public_html && svn up

After that, when you commit to the repository, the data in the /vhosts/www.example.com/public_html folder will be automatically updated.
As for the constant password request in TurtoiseSVN, it is enough to set up key authentication, since ssh is used. To do this, it is enough to create a session in putty with the same name as the server name
And in the Auth section specify the path to the private key by converting the key using puttygen
VwxVOz0.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question