更新安装文档

This commit is contained in:
Easy 2022-01-18 12:32:00 +08:00
parent 10e4d3bb62
commit 637b1311fc
2 changed files with 102 additions and 2 deletions

View File

@ -1,6 +1,6 @@
# PushDeer
PushDeer开源版可以自行架设的无APP推送服务WIP当前项目只实现了后端API其他部分正在施工🚧
PushDeer开源版可以自行架设的无APP推送服务WIPAPI和iOS第一版本开发完成,其他部分正在施工🚧)
[🐙🐱 GitHub仓库](https://github.com/easychen/pushdeer) [🔮 中国大陆镜像仓库](https://gitee.com/easychen/pushdeer)
@ -14,11 +14,15 @@ PushDeer开源版可以自行架设的无APP推送服务WIP当前项目
|功能|领取人|预期完成时间|最低版本兼容|本周进度|
|-|-|-|-|-|
|iOS/MacApp+Clip开发|[Hext123](https://github.com/Hext123)|2022年1月20日|iOS14|主体功能开发完成,下周细节优化|
|iOS/MacApp+Clip开发|[Hext123](https://github.com/Hext123)|2022年1月20日|iOS14|第一版完成代码在iOS目录下|
|Android客户端|[WolfHugo](https://github.com/alone-wolf)|2022年2月24日|5.1|接入mipushdevice/key/message列表markdownpushtestdevice自动注册|
|快应用|[7YHong](https://github.com/7YHong)|2022年2月27日|-|完成快应用界面展示部分下周对接API|
|API完善和更新|[古俊杰](https://github.com/ilovintit)|配合客户端同步更新|-|添加自动生成swgger文档功能中|
## 安装文档
- 𐂂 [点此查看](doc/安装文档.md)
## 相关项目
- [Android客户端临时仓库](https://github.com/alone-wolf/pushdeer_for_android)

96
doc/安装文档.md Normal file
View File

@ -0,0 +1,96 @@
# PushDeer 安装文档
- ⚠️ 当前PushDeer依然在开发中API和安装文档均有可能调整。
- ⚠️ 当前安装文档仅 iOS 版可用
## API服务器的安装
默认的 `docker-compose` 是为开发准备的,不适合放置到线上,以下做调整:
1. 将`MySQL`服务独立出来,建议直接采用云厂商的数据库服务。
1. 设置环境变量,关闭调试信息和接口
1. 配置https
### STEP0clone 项目代码
`git clone https://github.com/easychen/pushdeer.git`
### STEP1 :编写线上环境的 docker-compose.yml
```yml
version: '2'
services:
app:
#image: 'webdevops/php-apache:8.0-alpine'
build: './docker/web/'
ports:
- '80:80'
- '443:443' // 开放 https 需要的接口
volumes:
- './:/app'
environment:
- DB_DATABASE=pushdeer
- DB_HOST=clouddb.com
- DB_PASSWORD=thep@ssw0rd
- DB_PORT=3306
- DB_TIMEZONE=+08:00
- DB_USERNAME=pushdeer
- APP_DEBUG=false
```
### STEP2配置 SSL 证书
#### 放置证书文件
申请域名对应的 SSL 证书,获得证书文件( `example.crt` )和私钥文件( `example.key`)。
在项目根目录下建立 `ssl` 目录,将证书文件重命名为 `server.crt` 和 私钥文件重命名为 `server.key`
如果你下载的证书中还包含根证书(root_crt),可将根证书文本追加到 `server.crt` 之后。
#### 修改虚拟host配置
修改 `docker/web/vhost.conf` 中被注释掉的[这三行](https://github.com/easychen/pushdeer/blob/10e4d3bb62d8d66d4739598a8f4af32eda4cceef/docker/web/vhost.conf#L27)。
```conf
<VirtualHost *:443>
ServerName yourdomain.com
ServerAlias *.vm docker.vm
DocumentRoot "/app/api/public"
<Directory /app/api/public>
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
SSLEngine on
SSLCertificateFile /app/ssl/server.crt
SSLCertificateKeyFile /app/ssl/server.key
</VirtualHost>
```
### STEP3配置推送证书
进入 push 目录,修改 `*.yml.sample``*.yml`。其中iOS应用和Clip使用两个分开的证书进行推送`ios.yml` 是APP的配置、`clip.yml` 是Clip的配置。注意根据开发和产品状态修改`yml`中的值`production`。
默认配置中,`c.p12` 是APP的推送证书、`cc.p12`是Clip的推送证书。
### STEP4构建并运行镜像
运行 `docker-compose up -d --build`启动API。访问 `https://yourdomain.com` 即可查看到API服务器默认网页。
## iOS客户端的编译
### 编译
参考 ios 目录下的[安装说明](https://github.com/easychen/pushdeer/tree/main/ios/PushDeer-iOS),配置项目
修改以下内容:
1. 更换项目中的名称和标识( 请勿直接使用PushDeer的名称和标识
1. 将项目中的 Bundle Identifier xcode.proj文件、General标签 )改为和通知证书响应的
1. 将项目中的 签名和team更换为用于上架的开发者的xcode.proj文件、Signing & Capabilities标签
1. 修改[API接口中的域名](https://github.com/easychen/pushdeer/blob/10e4d3bb62d8d66d4739598a8f4af32eda4cceef/ios/PushDeer-iOS/PushDeer/Service/PushDeerApi.swift#L37),替换为之前安装的服务