Skip to content

Commit

Permalink
2.5.10
Browse files Browse the repository at this point in the history
  • Loading branch information
witersen committed Oct 6, 2024
1 parent 681cd5b commit 2724c71
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 61 deletions.
2 changes: 1 addition & 1 deletion 01.web/src/views/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<template>
<div class="login">
<div class="login-con">
<Card icon="log-in" title="SVNAdmin V2.5.9" :bordered="false">
<Card icon="log-in" title="SVNAdmin V2.5.10" :bordered="false">
<div class="form-con">
<Form
ref="formUserLogin"
Expand Down
2 changes: 1 addition & 1 deletion 01.web/src/views/setting/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@ export default {
* 版本信息
*/
version: {
current_verson: "2.5.9",
current_verson: "2.5.10",
php_version: "5.5+",
database: "MYSQL、SQLite",
github: "https://github.com/witersen/SvnAdminV2.0",
Expand Down
2 changes: 2 additions & 0 deletions 02.php/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

ini_set('pcre.recursion_limit', -1);

ini_set('pcre.jit_stack_limit', -1);

define('BASE_PATH', __DIR__);

define('IPC_SVNADMIN', BASE_PATH . '/server/svnadmind.socket');
Expand Down
2 changes: 1 addition & 1 deletion 02.php/app/service/Svnrep.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function CheckAuthz()
return message(200, 0, '未在 config/bin.php 文件中配置 svnauthz-validate 路径');
}

$result = funShellExec(sprintf("'%s' '%s'", '/usr/bin/svn-tools/svnauthz-validate', $this->configSvn['svn_authz_file'], $this->configBin['svnauthz-validate']));
$result = funShellExec(sprintf("'%s' '%s'", $this->configBin['svnauthz-validate'], $this->configSvn['svn_authz_file']));
if ($result['code'] != 0) {
return message(200, 2, '检测到异常', $result['error']);
} else {
Expand Down
2 changes: 1 addition & 1 deletion 02.php/config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
'lowest' => '5.5.0',
'highest' => ''
],
'version' => '2.5.9'
'version' => '2.5.10'
];
28 changes: 20 additions & 8 deletions 02.php/extension/Witersen/SVNAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1567,14 +1567,26 @@ public function GetUserAllPri($authzContent, $userName)

// 从结果中过滤掉 ~user1=[rw]+
if (array_key_exists(0, $authzContentPreg[5])) {
if ($authzContentPreg[5][0] == "~$userName") {
} else {
$result[] = [
'repName' => $authzContentPreg[2][0],
'priPath' => $authzContentPreg[3][0],
'repPri' => $authzContentPreg[6][0],
// 'unique' => '' //兼容2.3.3及之前版本 从2.3.3.1版本开始无实际意义
];
// if ($authzContentPreg[5][0] == "~$userName") {
// } else {
// $result[] = [
// 'repName' => $authzContentPreg[2][0],
// 'priPath' => $authzContentPreg[3][0],
// 'repPri' => $authzContentPreg[6][0],
// // 'unique' => '' //兼容2.3.3及之前版本 从2.3.3.1版本开始无实际意义
// ];
// }
foreach ($authzContentPreg[5] as $key => $value) {
if ($value == "~$userName") {
// unset($authzContentPreg[5][$key]);
} else {
$result[] = [
'repName' => $authzContentPreg[2][$key],
'priPath' => $authzContentPreg[3][$key],
'repPri' => $authzContentPreg[6][$key],
// 'unique' => '' //兼容2.3.3及之前版本 从2.3.3.1版本开始无实际意义
];
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion 03.cicd/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pipeline {

GIT_MESSAGE = sh (script: 'git show -s --format=%s ${GIT_COMMIT}', returnStdout: true).trim()

TAG = '2.5.9'
TAG = '2.5.10'
}

stages {
Expand Down
2 changes: 1 addition & 1 deletion 03.cicd/local_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ for php_version in "${php_version_array[@]}"; do
sign=${TAG}-${php_version}-svn${svn_version}

cp -r 03.cicd/svnadmin_docker 03.cicd/${sign}
releasever='\$releasever' basearch='\$basearch' php_version=${php_version} svn_version=${svn_version} envsubst <03.cicd/${sign}/dockerfile >03.cicd/${sign}/dockerfile.temp
php_version=${php_version} svn_version=${svn_version} envsubst <03.cicd/${sign}/dockerfile >03.cicd/${sign}/dockerfile.temp
mv 03.cicd/${sign}/dockerfile.temp 03.cicd/${sign}/dockerfile

image_svnadmin="${MY_HARBOR_HOST}/${project_name}/svnadmin-${GIT_BRANCH}:${sign}"
Expand Down
62 changes: 23 additions & 39 deletions 03.cicd/svnadmin_docker/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ LABEL MAINTAINER "www.witersen.com 2023-07-23"
ENV TZ=Asia/Shanghai \
DEBIAN_FRONTEND=noninteractive

RUN ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone
ADD 01.web/ /root/svnadmin_web/
ADD 02.php/ /var/www/html/
ADD 03.cicd/svnadmin_docker/start.sh /root/start.sh
ADD 03.cicd/svnadmin_docker/data/ /home/svnadmin/

# 编码修改
RUN localedef -c -i en_US -f UTF-8 C.UTF-8 \
RUN ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone \
&& localedef -c -i en_US -f UTF-8 C.UTF-8 \
&& echo 'LANG="C.UTF-8"' >> /etc/sysconfig/i18n \
&& echo 'LC_ALL="C.UTF-8"' >> /etc/sysconfig/i18n \
&& echo 'export LANG="C.UTF-8"' >> /etc/profile \
&& echo 'export LC_ALL="C.UTF-8"' >> /etc/profile

RUN echo -e "[WandiscoSVN]\nname=Wandisco SVN Repo\nbaseurl=http://opensource.wandisco.com/centos/${releasever}/svn-${svn_version}/RPMS/${basearch}/\nenabled=1\ngpgcheck=0" > /etc/yum.repos.d/wandisco-svn.repo \
&& echo 'export LC_ALL="C.UTF-8"' >> /etc/profile\
&& curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo \
&& echo -e "[WandiscoSVN]\nname=Wandisco SVN Repo\nbaseurl=http://opensource.wandisco.com/centos/7/svn-${svn_version}/RPMS/x86_64/\nenabled=1\ngpgcheck=0" >/etc/yum.repos.d/wandisco-svn.repo \
&& yum clean all \
&& yum makecache \
&& yum install -y epel-release yum-utils \
&& rpm -Uvh https://mirrors.aliyun.com/remi/enterprise/remi-release-7.rpm \
&& yum-config-manager --enable remi-${php_version} \
Expand All @@ -25,50 +30,29 @@ RUN echo -e "[WandiscoSVN]\nname=Wandisco SVN Repo\nbaseurl=http://opensource.wa
&& yum install -y cyrus-sasl cyrus-sasl-lib cyrus-sasl-plain \
&& yum install -y which \
&& yum install -y cronie at \
&& yum clean all

# 配置文件
ADD 03.cicd/svnadmin_docker/data/ /home/svnadmin/
RUN cd /home/svnadmin/ \
&& yum clean all \
&& cd /home/svnadmin/ \
&& mkdir -p backup \
&& mkdir -p crond \
&& mkdir -p rep \
&& mkdir -p temp \
&& mkdir -p templete/initStruct/01/branches \
&& mkdir -p templete/initStruct/01/tags \
&& mkdir -p templete/initStruct/01/trunk
RUN chown -R apache:apache /home/svnadmin/ && mkdir -p /run/php-fpm/

# 关闭PHP彩蛋
RUN sed -i 's/expose_php = On/expose_php = Off/g' /etc/php.ini

# 前端处理

RUN curl -L -o /usr/local/node-v14.18.2-linux-x64.tar.gz https://registry.npmmirror.com/-/binary/node/latest-v14.x/node-v14.18.2-linux-x64.tar.gz \
&& mkdir -p templete/initStruct/01/trunk \
&& chown -R apache:apache /home/svnadmin/ && mkdir -p /run/php-fpm/ \
&& sed -i 's/expose_php = On/expose_php = Off/g' /etc/php.ini \
&& curl -L -o /usr/local/node-v14.18.2-linux-x64.tar.gz https://cdn.npmmirror.com/binaries/node/latest-v14.x/node-v14.18.2-linux-x64.tar.gz \
&& tar -xvf /usr/local/node-v14.18.2-linux-x64.tar.gz -C /usr/local/ \
&& ln -s /usr/local/node-v14.18.2-linux-x64/bin/node /usr/local/bin/node \
&& ln -s /usr/local/node-v14.18.2-linux-x64/bin/npm /usr/local/bin/npm \
&& npm config set registry https://registry.npm.taobao.org \

RUN mkdir /root/svnadmin_web

COPY 01.web/package.json /root/svnadmin_web/
COPY 01.web/package-lock.json /root/svnadmin_web/
RUN cd /root/svnadmin_web && npm install

COPY 01.web/ /root/svnadmin_web/

RUN cd /root/svnadmin_web/ \
&& npm config set registry https://registry.npmmirror.com \
&& cd /root/svnadmin_web \
&& npm install \
&& npm run build \
&& mv dist/* /var/www/html/ \
&& rm -rf /root/svnadmin_web \
&& rm -rf /usr/local/node-v14.18.2-linux-x64*

# 后端处理
ADD 02.php/ /var/www/html/

ADD 03.cicd/svnadmin_docker/start.sh /root/start.sh
RUN chmod +x /root/start.sh
&& rm -rf /usr/local/node-v14.18.2-linux-x64* \
&& chmod +x /root/start.sh

EXPOSE 80
EXPOSE 443
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ Subversion:1.8+
此方式可快速部署程序体验效果,数据不存储在宿主机,生产环境使用请看3.2

```
docker run -d --name svnadmintemp -p 80:80 -p 3690:3690 --privileged witersencom/svnadmin:2.5.9
docker run -d --name svnadmintemp -p 80:80 -p 3690:3690 --privileged witersencom/svnadmin:2.5.10
```

##### 3.2 适用于:新用户正式使用

- 启动一个临时的容器用于复制配置文件出来

```
docker run -d --name svnadmintemp --privileged witersencom/svnadmin:2.5.9 /usr/sbin/init
docker run -d --name svnadmintemp --privileged witersencom/svnadmin:2.5.10 /usr/sbin/init
```

- 把配置文件复制到本机的 `/home/svnadmin` 目录
Expand All @@ -82,7 +82,7 @@ docker run -d -p 80:80 -p 3690:3690 \
-v /home/svnadmin/sasl2/:/etc/sasl2/ \
--privileged \
--name svnadmin \
witersencom/svnadmin:2.5.9
witersencom/svnadmin:2.5.10
```

- 进入容器内进行文件授权
Expand All @@ -96,13 +96,13 @@ chown -R apache:apache /home/svnadmin

*ps: 2.4.3 及之前的用户要注意目录挂载多了 conf.d sasl2 升级之前要提前复制出来*

- 2.3.x和2.4.x和2.5.x升级到2.5.9 (可以联网的用户)
- 2.3.x和2.4.x和2.5.x升级到2.5.10 (可以联网的用户)
- 进入容器内
- yum install -y unzip
- cd /var/www/html/server && php install.php
- 退出容器
- 停止旧的容器,拉取新容器,挂载本地的数据目录到新版本的容器即可
- 2.3.x和2.4.x和2.5.x升级到2.5.9 (不可联网的用户)
- 2.3.x和2.4.x和2.5.x升级到2.5.10 (不可联网的用户)
- 在有网络的环境下下载升级包,注意下载 update.tar.gz 而不是 update.zip
- 提前下载好升级包并复制到容器中 /var/www/html/server/ 目录下
- cd /var/www/html/server/
Expand Down Expand Up @@ -162,9 +162,9 @@ crond
- 下载解压代码包

```
cd /var/www/html/ && wget https://gitee.com/witersen/SvnAdminV2.0/releases/download/2.5.9/2.5.9.zip
cd /var/www/html/ && wget https://gitee.com/witersen/SvnAdminV2.0/releases/download/2.5.10/2.5.10.zip
unzip 2.5.9.zip
unzip 2.5.10.zip
```

- 安装Subversion(如果你安装过Subversion,本步骤可以略过)(注意需要Subversion >= 1.8)
Expand Down Expand Up @@ -298,7 +298,7 @@ nohup php server/svnadmind.php start &

##### 4.4 适用于:旧用户升级

- 2.3.x和2.4.x和2.5.x升级到2.5.9
- 2.3.x和2.4.x和2.5.x升级到2.5.10
- yum install -y unzip
- cd /var/www/html/server && php install.php

Expand Down

0 comments on commit 2724c71

Please sign in to comment.