diff --git a/README.md b/README.md index 98a888c..af62864 100644 --- a/README.md +++ b/README.md @@ -206,16 +206,13 @@ PushDeer主要面向以下三类用户 ```git clone https://github.com/easychen/pushdeer.git``` -### 配置推送证书 - -进入 `push` 目录,修改 `*.yml.sample` 为 `*.yml`。其中iOS应用和Clip使用两个分开的证书进行推送,`ios.yml` 是APP的配置、`clip.yml`是Clip的配置。注意根据开发和产品状态,修改`yml`中的值`production`。 - -默认配置中,`c.p12` 是APP的推送证书、`cc.p12`是Clip的推送证书。 ### 启动docker环境 运行 `docker-compose up -d`,启动API。默认访问地址为`http://127.0.0.1:8800`。可修改`docker-compose.yml`调整端口。 +> 亦可运行 `docker-compose -f docker-compose.self-hosted.yml up --build -d` 启动已配置推送功能的版本 + ### API 说明 [在线文档(Swagger)](https://ilovintit.github.io/pushdeer-api-doc/#/) diff --git a/doc/安装文档.md b/doc/安装文档.md index effedbf..3f4ad4e 100644 --- a/doc/安装文档.md +++ b/doc/安装文档.md @@ -44,6 +44,8 @@ services: - DB_TIMEZONE=+08:00 - DB_USERNAME=pushdeer - APP_DEBUG=false + - GO_PUSH_IOS_TOPIC=com.pushdeer.self.ios + - GO_PUSH_IOS_CLIP_TOPIC=com.pushdeer.self.ios.Clip ``` ### STEP2:配置 SSL 证书 @@ -80,6 +82,10 @@ services: #### iOS 推送 +可直接使用`PushDeer·自架版`客户端。 + +如自行编译客户端,需生成APP和Clip的推送证书,并按以下方式配置: + 进入 push 目录,修改 `*.yml.sample` 为 `*.yml`。其中iOS应用和Clip使用两个分开的证书进行推送,`ios.yml` 是APP的配置、`clip.yml` 是Clip的配置。注意根据开发和产品状态,修改`yml`中的值`production`。 默认配置中,`c.p12` 是APP的推送证书、`cc.p12`是Clip的推送证书。 diff --git a/docker-compose.self-hosted.yml b/docker-compose.self-hosted.yml new file mode 100644 index 0000000..7bcd2f1 --- /dev/null +++ b/docker-compose.self-hosted.yml @@ -0,0 +1,35 @@ +version: '2' +services: + mariadb: + image: 'mariadb:10.5.8-focal' + volumes: + - 'mariadb_data:/var/lib/mysql' + environment: + - MYSQL_ROOT_PASSWORD=theVeryp@ssw0rd + - MYSQL_DATABASE=pushdeer + ports: + - '3306:3306' + redis: + image: 'bitnami/redis:6.0.16' + environment: + - ALLOW_EMPTY_PASSWORD=yes + app: + #image: 'webdevops/php-apache:8.0-alpine' + build: './docker/web/' + ports: + - '8800:80' + volumes: + - './:/app' + depends_on: + - mariadb + - redis + environment: + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=root + - DB_DATABASE=pushdeer + - DB_PASSWORD=theVeryp@ssw0rd + - GO_PUSH_IOS_TOPIC=com.pushdeer.self.ios + - GO_PUSH_IOS_CLIP_TOPIC=com.pushdeer.self.ios.Clip +volumes: + mariadb_data: \ No newline at end of file diff --git a/push/.gitignore b/push/.gitignore deleted file mode 100644 index 08039f1..0000000 --- a/push/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.yml -*.p12 -*.p8 \ No newline at end of file diff --git a/push/c.p12 b/push/c.p12 new file mode 100644 index 0000000..6cffff2 Binary files /dev/null and b/push/c.p12 differ diff --git a/push/cc.p12 b/push/cc.p12 new file mode 100644 index 0000000..3b98d88 Binary files /dev/null and b/push/cc.p12 differ diff --git a/push/clip.yml b/push/clip.yml new file mode 100755 index 0000000..c39e855 --- /dev/null +++ b/push/clip.yml @@ -0,0 +1,48 @@ +core: + enabled: true # enable httpd server + address: "127.0.0.1" # ip address to bind (default: any) + shutdown_timeout: 30 # default is 30 second + port: "8889" # ignore this port number if auto_tls is enabled (listen 443). + sync: false + max_notification: 1 + cert_path: "cc.p12" + key_path: "" + cert_base64: "" + key_base64: "" + http_proxy: "" + pid: + enabled: false + path: "gorush.pid" + override: true + +api: + push_uri: "/api/push" + stat_go_uri: "/api/stat/go" + stat_app_uri: "/api/stat/app" + config_uri: "/api/config" + sys_stat_uri: "/sys/stats" + metric_uri: "/metrics" + health_uri: "/healthz" + +ios: + enabled: true + key_path: "cc.p12" + key_base64: "" # load iOS key from base64 input + key_type: "p12" # could be pem, p12 or p8 type + password: "64wtMhU4mULj" # certificate password, default as empty string. + production: false + max_concurrent_pushes: 100 # just for push ios notification + max_retry: 0 # resend fail notification, default value zero is disabled + key_id: "66M7BD2GCV" # KeyID from developer account (Certificates, Identifiers & Profiles -> Keys) + team_id: "HUJ6HAE4VU" # TeamID from developer account (View Account -> Membership) + +log: + format: "string" # string or json + access_log: "stdout" # stdout: output to console, or define log path like "log/access_log" + access_level: "debug" + error_log: "stderr" # stderr: output to console, or define log path like "log/error_log" + error_level: "error" + hide_token: true + +stat: + engine: "memory" # support memory, redis, boltdb, buntdb or leveldb diff --git a/push/ios.yml b/push/ios.yml new file mode 100755 index 0000000..f6f7b81 --- /dev/null +++ b/push/ios.yml @@ -0,0 +1,48 @@ +core: + enabled: true # enable httpd server + address: "127.0.0.1" # ip address to bind (default: any) + shutdown_timeout: 30 # default is 30 second + port: "8888" # ignore this port number if auto_tls is enabled (listen 443). + sync: false + max_notification: 1 + cert_path: "c.p12" + key_path: "" + cert_base64: "" + key_base64: "" + http_proxy: "" + pid: + enabled: false + path: "gorush.pid" + override: true + +api: + push_uri: "/api/push" + stat_go_uri: "/api/stat/go" + stat_app_uri: "/api/stat/app" + config_uri: "/api/config" + sys_stat_uri: "/sys/stats" + metric_uri: "/metrics" + health_uri: "/healthz" + +ios: + enabled: true + key_path: "c.p12" + key_base64: "" # load iOS key from base64 input + key_type: "p12" # could be pem, p12 or p8 type + password: "64wtMhU4mULj" # certificate password, default as empty string. + production: false + max_concurrent_pushes: 100 # just for push ios notification + max_retry: 0 # resend fail notification, default value zero is disabled + key_id: "66M7BD2GCV" # KeyID from developer account (Certificates, Identifiers & Profiles -> Keys) + team_id: "HUJ6HAE4VU" # TeamID from developer account (View Account -> Membership) + +log: + format: "string" # string or json + access_log: "stdout" # stdout: output to console, or define log path like "log/access_log" + access_level: "debug" + error_log: "stderr" # stderr: output to console, or define log path like "log/error_log" + error_level: "error" + hide_token: true + +stat: + engine: "memory" # support memory, redis, boltdb, buntdb or leveldb