Skip to content

Commit

Permalink
feat: release v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zclaiqcc committed Apr 27, 2023
1 parent b25a575 commit 918f86a
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 31 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ SAFELINE-CE CHANGELOG

## [Unreleased]

- 仪表盘
- 告警

## [1.2.0] - 2023-04-27

### 新增
- 新增了数据统计页面,可以直观的看到流量大小
- 支持配置源 IP 提取方式,解决了源 IP 获取不对的问题
- 支持自定义检测策略,可以动态调整检测引擎

## [1.1.0] - 2023-04-20

### 新增
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,8 @@ sudo docker compose up -d

**WARN: SafeLine will be restarted and your traffic will be unavailable for a short period of time. You may need to choose a proper time for upgration.**

```
# check `IMAGE_TAG`
cat .env | grep IMAGE_TAG
# set IMAGE_TAG to `latest` or some specific version like `1.1.0`
sed -i "s/IMAGE_TAG=.*/IMAGE_TAG=latest/g" .env
# check `compose.yaml`
# image namespace has changed to `chaitin`
sed -i "s/chaitinops/chaitin/g" compose.yaml
```shell
curl -kfLsS https://waf-ce.chaitin.cn/release/latest/upgrade.sh | bash

# replace with `docker-compose` if necessary.
docker compose down && docker compose pull && docker compose up -d
Expand Down
11 changes: 2 additions & 9 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,8 @@ sudo docker compose up -d

**WARN: 雷池 SafeLine 服务会重启,流量会中断一小段时间,根据业务情况选择合适的时间来执行升级操作。**

```
# 查看 `IMAGE_TAG`
cat .env | grep IMAGE_TAG
# 把 IMAGE_TAG 修改为 latest 或者某个特定版本,比如 1.1.0
sed -i "s/IMAGE_TAG=.*/IMAGE_TAG=latest/g" .env
# 检查 `compose.yaml`
# docker 镜像的命名空间调整到了 `chaitin`,部分旧版本配置是使用的 `chaitinops`
sed -i "s/chaitinops/chaitin/g" compose.yaml
```shell
curl -kfLsS https://waf-ce.chaitin.cn/release/latest/upgrade.sh | bash

# 根据环境情况自行使用 `docker compose` 或者 `docker-compose`
docker compose down && docker compose pull && docker compose up -d
Expand Down
5 changes: 5 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ services:
image: postgres:15.2
volumes:
- ${SAFELINE_DIR}/resources/postgres/data:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro
environment:
- POSTGRES_USER=safeline-ce
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?postgres password required}
Expand Down Expand Up @@ -54,6 +55,7 @@ services:
volumes:
- ${SAFELINE_DIR}/resources/detector:/resources/detector
- ${SAFELINE_DIR}/logs/detector:/logs/detector
- /etc/localtime:/etc/localtime:ro
environment:
- LOG_DIR=/logs/detector
networks:
Expand All @@ -68,6 +70,7 @@ services:
volumes:
- ${SAFELINE_DIR}/resources/mario:/resources/mario
- ${SAFELINE_DIR}/logs/mario:/logs/mario
- /etc/localtime:/etc/localtime:ro
environment:
- LOG_DIR=/logs/mario
- GOGC=100
Expand All @@ -89,6 +92,8 @@ services:
- /etc/localtime:/etc/localtime:ro
- ${SAFELINE_DIR}/resources/cache:/usr/local/nginx/cache
- /etc/resolv.conf:/etc/resolv.conf
environment:
- MGT_ADDR=169.254.0.4:9002
ulimits:
nofile: 131072
network_mode: host
1 change: 1 addition & 0 deletions homepage/public/release/latest/upgrade.sh
29 changes: 29 additions & 0 deletions homepage/src/static/md/about_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,32 @@ weight: 3
---

# 版本更新记录

## [1.2.0] - 2023-04-27

### 新增
- 新增了数据统计页面,可以直观的看到流量大小
- 支持配置源 IP 提取方式,解决了源 IP 获取不对的问题
- 支持自定义检测策略,可以动态调整检测引擎

## [1.1.0] - 2023-04-20

### 新增
- 支持根据 IP 和 URL 特征配置黑白名单
- 默认开启高防模式

### 优化
- 支持在日志详情中展示响应报文
- 服务器时间不准导致 TOTP 无法登录时增加了提示语
- 修复了上游服务器填 HTTPS 时端口解析不正确的问题
- 优化了 SSL 上传逻辑,体验更好

## [1.0.0] - 2023-04-13

- 站点配置

## [0.9.0] - 2023-03-20

- OTP 登录
- 攻击检测日志
- 默认防护策略
11 changes: 2 additions & 9 deletions homepage/src/static/md/guide_upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@ weight: 6

**WARN: 雷池 SafeLine 服务会重启,流量会中断一小段时间,根据业务情况选择合适的时间来执行升级操作。**

```
# 查看 `IMAGE_TAG`
cat .env | grep IMAGE_TAG
# 把 IMAGE_TAG 修改为 latest 或者某个特定版本,比如 1.1.0
sed -i "s/IMAGE_TAG=.*/IMAGE_TAG=latest/g" .env
# 检查 `compose.yaml`
# docker 镜像的命名空间调整到了 `chaitin`,部分旧版本配置是使用的 `chaitinops`
sed -i "s/chaitinops/chaitin/g" compose.yaml
```shell
curl -kfLsS https://waf-ce.chaitin.cn/release/latest/upgrade.sh | bash

# 根据环境情况自行使用 `docker compose` 或者 `docker-compose`
docker compose down && docker compose pull && docker compose up -d
Expand Down
4 changes: 1 addition & 3 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ if [[ "x${compose_plugin}" = "xfalse" ]]; then
fi

COMPOSE_YAML="compose.yaml"
if [[ ! -f ${COMPOSE_YAML} ]]; then
wget https://waf-ce.chaitin.cn/release/latest/compose.yaml --no-check-certificate -O ${COMPOSE_YAML}
fi
wget https://waf-ce.chaitin.cn/release/latest/compose.yaml --no-check-certificate -O ${COMPOSE_YAML}

ENV_FILE=".env"
if [[ ! -f ${ENV_FILE} ]]; then
Expand Down
39 changes: 39 additions & 0 deletions upgrade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#! /bin/bash
set -eE

abort()
{
echo $1
exit 1
}

echo "
____ __ _ _
/ ___| __ _ / _| ___ | | (_) _ __ ___
\___ \ / _\` | | |_ / _ \ | | | | | '_ \ / _ \\
___) | | (_| | | _| | __/ | |___ | | | | | | | __/
|____/ \__,_| |_| \___| |_____| |_| |_| |_| \___|
"

if [[ "$#" -ne "0" ]]; then
echo "Usage: run "$0" to set up Safeline CE at current working directory."
exit 0
fi

command -v docker > /dev/null || abort "docker not found, unable to deploy"
compose_plugin=true
compose_command="docker compose"
docker --help | grep compose | grep v2 > /dev/null || compose_plugin=false || compose_command="docker-compose"

if [[ "x${compose_plugin}" = "xfalse" ]]; then
command -v docker-compose > /dev/null && docker-compose --version | grep v2 > /dev/null || abort "docker compose v2 not found, unable to deploy"
fi

COMPOSE_YAML="compose.yaml"
wget https://waf-ce.chaitin.cn/release/latest/compose.yaml --no-check-certificate -O ${COMPOSE_YAML}

ENV_FILE=".env"
sed -i "s/IMAGE_TAG=.*/IMAGE_TAG=latest/g" ${ENV_FILE}

$compose_command down && $compose_command pull && $compose_command up -d
echo "Upgrade success!"

0 comments on commit 918f86a

Please sign in to comment.