Svn 公共Redmine访问私有/本地subversion服务器的可能解决方案?

Svn 公共Redmine访问私有/本地subversion服务器的可能解决方案?,svn,repository,redmine,Svn,Repository,Redmine,我有一个Subversion(Apache2+mod_dav)服务器,运行在我的专用网络上的Debian服务器上。 我还有一个Redmine安装,运行在一个Internet公共服务器上。 这是无法更改的:Subversion服务器必须保持本地/私有,Redmine必须保持公共 我想使用Redmine的SVN功能(将问题与提交联系起来),但我找不到一种方法让Redmine访问SVN存储库(没有subversion服务器的NAT/PAT) 我在想一种克隆或镜像整个Subversion(甚至是一系列)

我有一个Subversion(Apache2+mod_dav)服务器,运行在我的专用网络上的Debian服务器上。 我还有一个Redmine安装,运行在一个Internet公共服务器上。 这是无法更改的:Subversion服务器必须保持本地/私有,Redmine必须保持公共

我想使用Redmine的SVN功能(将问题与提交联系起来),但我找不到一种方法让Redmine访问SVN存储库(没有subversion服务器的NAT/PAT)

我在想一种克隆或镜像整个Subversion(甚至是一系列)存储库的方法,但这真的是一个好的解决方案吗?
我想链接到Redmine的存储库占用大约800MB的空间,Redmine服务器上有足够的空间。

您可以尝试使用将本地服务器直接公开给公共web。(免责声明:我创建了PageKite)

如果您深入研究这些选项,就可以通过密码或源IP限制访问,因此不一定会有巨大的安全风险(不确定您是否担心)。如果您决定尝试一下并需要一些提示,请随时发送电子邮件给我们


注意:我假设Redmine可以连接到远程存储库,只需使其可访问即可。一个快速的谷歌意味着这应该是可能的,但因为我自己还没有做过,所以我不是100%确定。

你可以尝试直接将你的本地服务器公开给公共网站使用。(免责声明:我创建了PageKite)

如果您深入研究这些选项,就可以通过密码或源IP限制访问,因此不一定会有巨大的安全风险(不确定您是否担心)。如果您决定尝试一下并需要一些提示,请随时发送电子邮件给我们

注意:我假设Redmine可以连接到远程存储库,只需使其可访问即可。一个快速的Google意味着这应该是可能的,但因为我自己还没有做过,所以我不能100%确定。

我最终设置了一个“post-commit”钩子,用于对存储库进行rsync

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

REPOS=“$1”
REV=“$2”
#“$REPOS”/hooks/mailer.py提交“$REPOS”$REV“$REPOS”/mailer.conf
如果[$#-ge 1];然后
/var/svn/.hooks/rsync到redmine“$REPOS”“$REV”
其他的
echo“错误:未提供存储库”
fi
/var/svn/myproject/hooks/post-commit:

#/bin/bash
#配置
rsyncExecutable=“/usr/bin/rsync”
localRepositoryBasePath=“/var/svn/”
remoteUser=“svnsync”
remoteHost=“redmine.mycompany.com”
remoteRepositoryBasePath=“/var/svn/”
privateKeyFilePath=“/var/svn/.hooks/rsync到redmine certFile”
#/配置
repositoryName=`basename“$1”`
如果[-z$repositoryName];然后#没有给出存储库名称
echo“错误:未提供存储库名称”
其他的
如果[-d“$localRepositoryBasePath$repositoryName/”];那么#给定的存储库名称似乎存在
repositoryDirectoryRealpath=`realpath“$localRepositoryBasePath$repositoryName”`/#计算realpath以验证目录(防止$1设置为“.”)
如果[“$repositoryDirectoryRealpath”!=“$localRepositoryBasePath”];那么#目录不是基本路径(否则我们将同步整个$localRepositoryBasePath目录)
#TODO:检查$repositoryDirectoryRealpath是否在$localRepositoryBasePath下
$rsyncExecutable-rltgoDvz-e“ssh-i$privateKeyFilePath”“$repositoryDirectoryRealpath”“$remoteUser@$remoteHost:$remoteRepositoryBasePath$repositoryName”
其他的
echo“错误:尝试重新同步整个“$localRepositoryBasePath”基目录”
fi
其他的
echo“错误:目录“$localRepositoryBasePath$repositoryName”不存在”
fi
fi
当有人在SVN存储库上提交时,rsync程序会将$remoteHost上的修改推送到$remoteRepositoryBasePath目录。

我最终设置了一个“提交后”钩子,对存储库进行rsync

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

REPOS=“$1”
REV=“$2”
#“$REPOS”/hooks/mailer.py提交“$REPOS”$REV“$REPOS”/mailer.conf
如果[$#-ge 1];则
/var/svn/.hooks/rsync到redmine“$REPOS”“$REV”
其他的
echo“错误:未提供存储库”
fi
/var/svn/myproject/hooks/post-commit:

!/bin/bash
#配置
rsyncExecutable=“/usr/bin/rsync”
localRepositoryBasePath=“/var/svn/”
remoteUser=“svnsync”
remoteHost=“redmine.mycompany.com”
remoteRepositoryBasePath=“/var/svn/”
privateKeyFilePath=“/var/svn/.hooks/rsync到redmine certFile”
#/配置
repositoryName=`basename“$1”`
如果[-z$repositoryName];则#未给出存储库名称
echo“错误:未提供存储库名称”
其他的
如果[-d“$localRepositoryBasePath$repositoryName/”];则#给定的存储库名称似乎存在
repositoryDirectoryRealpath=`realpath“$localRepositoryBasePath$repositoryName”`/#计算realpath以验证目录(防止$1设置为“.”)
如果[“$repositoryDirectoryRealpath”!=“$localRepositoryBasePath”];则#目录不是基本路径(否则我们将重新同步整个$localRepositoryBasePath目录)
#TODO:检查$repositoryDirectoryRealpath是否在$localRepositoryBasePath下
$rsyncExecutable-rltgoDvz-e“ssh-i$privateKeyFilePath”“$repositoryDirectoryRealpath”“$remoteUser@$remoteHost:$remoteRepositoryBasePath$repositoryName”
其他的
echo“错误:尝试重新同步整个“$localRepositoryBasePath”基目录”
fi
其他的
echo“错误:目录“$localRepositoryBasePath$repositoryName”不存在”
fi
fi
当有人犯了错