Skip to content

Commit

Permalink
[add] READMME
Browse files Browse the repository at this point in the history
  • Loading branch information
saymagic committed Aug 27, 2016
1 parent 554bf7f commit d10e810
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
54 changes: 52 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[![Build Status](https://travis-ci.org/bluefinframework/bluefin-hook-client.svg?branch=master)](https://travis-ci.org/bluefinframework/bluefin-hook-client)

> Bluefin Hook Client 是 Bluefin Server的Hook 的客户端,以下简称为client.
目的是对接Bluefin Server 的hook服务,将Bluefin Server中的hook信息以邮件形式发送出去.

## 邮件模板
## 配置

Bluefin Hook Client 唯一需要配置的就是邮件模板信息,该模板正文为固定格式的json.结构如下:

```
{
Expand Down Expand Up @@ -29,4 +34,49 @@
}
}
}
```
```

其中,serverinfo配置邮件发送人信息,mail配置邮件内容,client会对`subject`, `text`, `html`中的某些关键字做替换,来达到个性化需求.关键字如下:

```
$PACKAGE_NAME -- package名称
$UPDATE_INFO -- 更新信息
$MIN_VERSION -- 最小版本号
$DOWNLOAD_URL -- apk下载链接
$UPDATE_TIME -- 上传时间
$FILE_MD5 -- apk文件的MD5
$VERSION_NAME -- 版本名称
$VERSION_CODE -- 版本号
$SIZE -- apk文件大小
$EXT_DATA -- apk附加信息
$IDENTITY -- apk唯一标识
$NAME -- apk名称
$ICON_URL -- icon图标链接
```

如上,配置好上述模板后,通过如下两种方式之一来指定模板文件的路径:

* 修改application.properties 中的参数:mail.template.path

* 添加系统变量:BLUEFIN_TEMPLATE_PATH

## 启动

client可以通过两种方式启动:

* maven

```
mvn spring-boot:run
```

* Docker

```
docker run -it -p 2557:2557 -v $(pwd):/root saymagic/bluefin-hook:v1.0.0
```


## Licence

[gpl-3.0](https://opensource.org/licenses/gpl-3.0.html)
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
@EnableAutoConfiguration
public class BluefinHookApplication {

private static final String TEMPLATE_PATH = System.getenv("BLUEFIN_TEMPLATE_PATH");

private static final Map<String, Object> configDefault = new HashMap<String, Object>() {{
put("server.address", getLocalHostIP());
put("server.port", getLocalHostPort());
put("mail.template.path", TEMPLATE_PATH);
}};

public static void main(String[] args) {
Expand Down

0 comments on commit d10e810

Please sign in to comment.