2012-04-30 27 views
1

プライベートネットワーク上のDebianサーバ上でSubversion(Apache2 + mod_dav)サーバを実行しています。 また、私はRedmineインストールをインターネット上に公開されているサーバー上で実行しています。 これは変更できません。Subversionサーバーはローカル/プライベートのままでなければならず、Redmineは公開されていなければなりません。公開Redmineがプライベート/ローカルのSubversionサーバーにアクセスするための可能な解決策はありますか?

私はRedmine(コミットとのリンク問題)のSVN機能を使用したいと思いますが、RedmineがSVNリポジトリにアクセスする方法を見つけることができません(SubversionサーバーのNAT/PATなし)。

私はクローンまたはミラー全体のSubversion(または偶数選択)リポジトリへの道を考えていたが、それは本当に良い解決策ですか? Redmineにリンクしたいリポジトリは約800MBで、Redmineサーバには十分なスペースがあります。

答えて

0

http://pagekite.net/を使用してローカルサーバーを公開Webに直接公開することができます。 (免責事項:PageKiteを作成しました)

オプションを調べると、パスワードや送信元IPによるアクセスを制限することができるため、セキュリティ上のリスクは必ずしも高くなりませんない)。これを試してみるためにいくつかの指針が必要な場合は、お気軽にEメールをお送りください!

メモ:私はRedmineがリモートリポジトリに接続できると仮定しており、それは到達可能にすることの問題です。クイックGoogleはそれが可能でなければならないことを意味しますが、私はまだそれをやっていないので、私は100%確実ではありません。

0

私は最終的にリポジトリのrsyncを行う "コミット後"フックを設定しました。

の/ var/SVN/MyProjectと/フック/コミット後

REPOS="$1" 
REV="$2" 

#"$REPOS"/hooks/mailer.py commit "$REPOS" $REV "$REPOS"/mailer.conf 

if [ $# -ge 1 ]; then 
    /var/svn/.hooks/rsync-to-redmine "$REPOS" "$REV" 
else 
    echo "ERROR: No repository given" 
fi 

の/ var/SVN/MyProjectと/フック/コミット後

#!/bin/bash 

# Configuration 
rsyncExecutable="/usr/bin/rsync" 

localRepositoryBasePath="/var/svn/" 

remoteUser="svnsync" 
remoteHost="redmine.mycompany.com" 
remoteRepositoryBasePath="/var/svn/" 
privateKeyFilePath="/var/svn/.hooks/rsync-to-redmine-certFile" 
# /Configuration 

repositoryName=`basename "$1"` 

if [ -z $repositoryName ]; then # No repository name given 
     echo "ERROR: No repository name given" 
else 
     if [ -d "$localRepositoryBasePath$repositoryName/" ]; then # Given repository name seems to exists 
       repositoryDirectoryRealpath=`realpath "$localRepositoryBasePath$repositoryName"`/ # Compute realpath to validate directory (to protect against $1 setted to ".") 
       if [ "$repositoryDirectoryRealpath" != "$localRepositoryBasePath" ]; then # Directory is not the base path (otherwise we would rsync the entire $localRepositoryBasePath directory 
         #TODO: Check that $repositoryDirectoryRealpath is under $localRepositoryBasePath 
         $rsyncExecutable -rltgoDvz -e "ssh -i $privateKeyFilePath" "$repositoryDirectoryRealpath" "[email protected]$remoteHost:$remoteRepositoryBasePath$repositoryName" 
       else 
         echo "ERROR: Trying to rsync the whole '$localRepositoryBasePath' base directory" 
       fi 
     else 
       echo "ERROR: Directory '$localRepositoryBasePath$repositoryName' doesn't exists" 
     fi 
fi 

誰かSVNリポジトリでコミットすると、rsyncプログラムは$ remoteHostの変更を$ remoteRepositoryBasePathディレクトリにプッシュします。

関連する問題