1

プライベート ネットワーク上の Debian サーバーで Subversion (Apache2 + mod_dav) サーバーを実行しています。また、インターネットで公開されているサーバーで Redmine インストールを実行しています。これは変更できません。Subversion サーバーはローカル/プライベートのままにする必要があり、Redmine はパブリックのままにする必要があります。

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

Subversion リポジトリ全体 (または選択したもの) を複製またはミラーリングする方法を考えていましたが、それは本当に良い解決策でしょうか? Redmine にリンクしたいリポジトリは約 800MB 必要で、Redmine サーバーには十分なスペースがあります。

4

2 に答える 2

1

http://pagekite.net/を使用して、ローカル サーバーをパブリック Web に直接公開してみてください。(免責事項: PageKite を作成しました)

オプションを掘り下げると、パスワードまたはソース IP によってアクセスを制限することが可能であるため、必ずしも大きなセキュリティ リスクになるとは限りません (心配しているかどうかはわかりません)。これを試してみようと決心し、いくつかの指針が必要な場合は、お気軽に電子メールをお送りください。

注: Redmine はリモート リポジトリに接続できると想定しており、到達可能にするだけの問題です。簡単なGoogleはそれが可能であることを示唆していますが、私はまだ自分でやったことがないので、100%確信はありません.

于 2012-05-01T20:37:42.483 に答える
0

最後に、リポジトリの rsync を行う「ポストコミット」フックを設定しました。

/var/svn/myproject/hooks/post-commit :

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/hooks/post-commit :

#!/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" "$remoteUser@$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 ディレクトリにプッシュします。

于 2012-07-26T10:31:25.147 に答える