Skip to content

Commit

Permalink
Merge pull request #3 from ss1917/master
Browse files Browse the repository at this point in the history
修复BUG 和优化用户体验
  • Loading branch information
ss1917 authored Aug 29, 2019
2 parents d4301c1 + 5e5dcda commit 3cc3aa7
Show file tree
Hide file tree
Showing 70 changed files with 5,177 additions and 2,180 deletions.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM nginx

MAINTAINER "shenshuo<[email protected]>"

VOLUME /var/log/nginx/
VOLUME /var/www/codo/

EXPOSE 80
EXPOSE 443

STOPSIGNAL SIGTERM

CMD ["nginx", "-g", "daemon off;"]
84 changes: 78 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,91 @@
## Install
```bush

```bash
// install dependencies
npm install --ignore-script
```
## Run
### Development
```bush

### Run

#### Development

```bash
npm run dev
```
### Production(Build)
```bush

#### Production(Build)

```bash
npm run build
```

### Docker 方式部署

**修改`CODO_VER`release为最新的版本,静态文件的最终路径为 `/var/www/codo/`**

```bash
echo -e "\033[32m [INFO]: codo(项目前端) Start install. \033[0m"
CODO_VER="codo-beta-0.3.4"
if ! which wget &>/dev/null; then yum install -y wget >/dev/null 2>&1;fi
[ ! -d /var/www ] && mkdir -p /var/www
cd /var/www && wget https://github.com/opendevops-cn/codo/releases/download/${CODO_VER}/${CODO_VER}.tar.gz
tar zxf ${CODO_VER}.tar.gz
if [ $? == 0 ];then
echo -e "\033[32m [INFO]: codo(项目前端) install success. \033[0m"
else
echo -e "\033[31m [ERROR]: codo(项目前端) install faild \033[0m"
exit -8
fi
```

**放置`nginx`配置文件,如果想使用https请自行修改nginx的配置文件,也可以参考项目下的`nginx_ops.conf`文件。**

**如果需要修改前端的访问域名可以直接修改配置文件中的server_name,proxy_pass对应的地址为网关地址,一定要和网关地址端口进行对应。**

```bash
mkdir -p /my/nginx/conf.d/
cat >/my/nginx/conf.d/codo-init.conf<<\EOF
server {
listen 80;
server_name demo-init.opendevops.cn;
access_log /var/log/nginx/codo-access.log;
error_log /var/log/nginx/codo-error.log;
location / {
root /var/www/codo;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api {
### ws 支持
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Origin' '*';
proxy_pass http://gw.opendevops.cn:8888;
}
location ~ /(.svn|.git|admin|manage|.sh|.bash)$ {
return 403;
}
}
EOF
```

```bash
#bulid 镜像
docker build . -t codo_image
#启动
docker-compose up -d
```

- 测试一下 `ls /var/www/codo/index.html` 看下前端文件是不是存在
- 测试一下 `ls /my/nginx/conf.d/codo-init.conf` 看下nginx配置文件是不是存在

## License

[MIT](http://opensource.org/licenses/MIT)

Copyright (c) 2016-present, iView
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
codo:
restart: unless-stopped
image: codo_image
volumes:
- /var/log/nginx/:/var/log/nginx/
- /var/www/codo/:/var/www/codo/
- /my/nginx/conf.d/:/etc/nginx/conf.d/
- /sys/fs/cgroup:/sys/fs/cgroup
ports:
- "80:80"
- "443:443"
70 changes: 70 additions & 0 deletions nginx_ops.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
server {
listen 80;
server_name demo-init.opendevops.cn;
access_log /var/log/nginx/codo-access.log;
error_log /var/log/nginx/codo-error.log;

location / {
root /var/www/codo;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api {
### ws 支持
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

add_header 'Access-Control-Allow-Origin' '*';
proxy_pass http://gw.opendevops.cn:8888;
}

location ~ /(.svn|.git|admin|manage|.sh|.bash)$ {
return 403;
}
}

### 下面是使用https,要注意放置证书
# server {
# listen 80;
# server_name demo-init.opendevops.cn;
# rewrite ^(.*)$ https://$host$1 permanent;
# }

# server {
# listen 443;
# server_name demo-init.opendevops.cn;
# access_log /var/log/nginx/codo-access.log;
# error_log /var/log/nginx/codo-error.log;
# ssl on;
# index index.html index.htm;
# ssl_certificate opendevops.crt;
# ssl_certificate_key opendevops.key;
# ssl_session_timeout 5m;
# ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:AES256-GCM-SHA384:AES256-SHA256:AES256-SHA:ECDHE-RSA-AES128-SHA256:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!DSS:!PKS;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_prefer_server_ciphers on;

# location / {
# root /var/www/codo;
# index index.html index.htm;
# try_files $uri $uri/ /index.html;
# }

# location /api {
# proxy_redirect off;
# proxy_read_timeout 600;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# add_header 'Access-Control-Allow-Origin' '*';
# proxy_pass http://gw.opendevops.cn:8888;
# }

# location ~ /(.svn|.git|admin|manage|.sh|.bash)$ {
# return 403;
# }
# }
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

160 changes: 80 additions & 80 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
{
"name": "codo",
"version": "1.0.0",
"author": "ss<[email protected]>",
"private": false,
"scripts": {
"dev": "vue-cli-service serve --open",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e"
},
"dependencies": {
"@riophae/vue-treeselect": "0.0.38",
"axios": "^0.18.0",
"babel-core": "^6.26.3",
"babel-loader": "^8.0.5",
"clipboard": "^2.0.0",
"clonedeep": "^2.0.0",
"codemirror": "^5.38.0",
"countup": "^1.8.2",
"cropperjs": "^1.2.2",
"dayjs": "^1.7.7",
"echarts": "^4.0.4",
"emmet": "git+https://github.com/yangmv/emmet-core.git",
"html2canvas": "^1.0.0-alpha.12",
"iview": "^3.2.2",
"iview-area": "^1.5.17",
"js-cookie": "^2.2.0",
"jwt-decode": "^2.2.0",
"qrcode": "^1.3.0",
"qrcodejs2": "0.0.2",
"simplemde": "^1.11.2",
"sortablejs": "^1.7.0",
"vue": "^2.5.10",
"vue-clipboard2": "^0.2.1",
"vue-i18n": "^7.8.0",
"vue-qart": "^2.2.0",
"vue-router": "^3.0.1",
"vue-websocket": "^0.2.3",
"vue2-ace-editor": "0.0.13",
"vuedraggable": "^2.16.0",
"vuex": "^3.0.1",
"vuex-persistedstate": "^2.5.4",
"wangeditor": "^3.1.1",
"xlsx": "^0.13.3",
"xterm": "^3.9.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.1",
"@vue/cli-plugin-eslint": "^3.0.1",
"@vue/cli-plugin-unit-mocha": "^3.0.1",
"@vue/cli-service": "^3.0.1",
"@vue/eslint-config-standard": "^3.0.0-beta.10",
"@vue/test-utils": "^1.0.0-beta.10",
"chai": "^4.1.2",
"eslint-plugin-cypress": "^2.0.1",
"less": "^2.7.3",
"less-loader": "^4.0.5",
"lint-staged": "^6.0.0",
"mockjs": "^1.0.1-beta3",
"vue-template-compiler": "^2.5.13"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.js": [
"vue-cli-service lint",
"git add"
"name": "codo",
"version": "1.0.0",
"author": "ss<[email protected]>",
"private": false,
"scripts": {
"dev": "vue-cli-service serve --open",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e"
},
"dependencies": {
"@riophae/vue-treeselect": "0.0.38",
"axios": "^0.18.1",
"babel-core": "^6.26.3",
"babel-loader": "^8.0.5",
"clipboard": "^2.0.0",
"clonedeep": "^2.0.0",
"codemirror": "^5.38.0",
"countup": "^1.8.2",
"cropperjs": "^1.2.2",
"dayjs": "^1.7.7",
"echarts": "^4.0.4",
"emmet": "git+https://github.com/yangmv/emmet-core.git",
"html2canvas": "^1.0.0-alpha.12",
"iview": "^3.2.2",
"iview-area": "^1.5.17",
"js-cookie": "^2.2.0",
"jwt-decode": "^2.2.0",
"qrcode": "^1.3.0",
"qrcodejs2": "0.0.2",
"simplemde": "^1.11.2",
"sortablejs": "^1.7.0",
"vue": "^2.5.10",
"vue-clipboard2": "^0.2.1",
"vue-i18n": "^7.8.0",
"vue-qart": "^2.2.0",
"vue-router": "^3.0.1",
"vue-websocket": "^0.2.3",
"vue2-ace-editor": "0.0.13",
"vuedraggable": "^2.16.0",
"vuex": "^3.0.1",
"vuex-persistedstate": "^2.5.4",
"wangeditor": "^3.1.1",
"xlsx": "^0.13.3",
"xterm": "^3.9.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.1",
"@vue/cli-plugin-eslint": "^3.0.1",
"@vue/cli-plugin-unit-mocha": "^3.0.1",
"@vue/cli-service": "^3.0.1",
"@vue/eslint-config-standard": "^3.0.0-beta.10",
"@vue/test-utils": "^1.0.0-beta.10",
"chai": "^4.1.2",
"eslint-plugin-cypress": "^2.0.1",
"less": "^2.7.3",
"less-loader": "^4.0.5",
"lint-staged": "^6.0.0",
"mockjs": "^1.0.1-beta3",
"vue-template-compiler": "^2.5.13"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"*.vue": [
"vue-cli-service lint",
"git add"
]
}
}
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.js": [
"vue-cli-service lint",
"git add"
],
"*.vue": [
"vue-cli-service lint",
"git add"
]
}
}
Binary file removed public/favicon-bak.ico
Binary file not shown.
Loading

0 comments on commit 3cc3aa7

Please sign in to comment.