PushDeer Documentation
repository·main·Indexed 26 days ago
https://github.com/easychen/pushdeerPushDeer is an open-source push notification service (version 2.0.0) that supports both official online and self-hosted versions. It provides notifications via App Clips (iOS), native apps for iOS, macOS, and Android, and custom IoT devices such as ESP8266/ESP32. The Android client utilizes MiPush and supports Markdown rendering, image display, and text copying.
What's inside PushDeer
- gorush is a push notification micro server written in Go using the Gin framework. It acts as a centralized gateway to send push notifications to various platforms. It supports multiple protocols (HTTP/1.1, HTTP/2, gRPC) and provides a Web API for easy integration.
Explore Alamofire component libraries
mainTo keep the core library focused, additional functionality is provided via separate component libraries:
- AlamofireImage: Includes image response serializers,
UIImageandUIImageViewextensions, custom image filters, an auto-purging in-memory cache, and a priority-based image downloading system. - AlamofireNetworkActivityIndicator: Controls the visibility of the network activity indicator on iOS, featuring configurable delay timers to mitigate flicker and support for
URLSessioninstances not managed by Alamofire.
- AlamofireImage: Includes image response serializers,
Key Features of gorush
maingorush provides several advanced features for notification management:
- Multi-platform support: APNS, FCM, and HMS.
- Flexible Configuration: Supports YAML configuration.
- Scalability: Supports notification queues with multiple workers and various backends like NSQ, NATS, or Redis.
- Reliability: Supports retrying failed notifications and graceful shutdown.
- Observability: Exposes Prometheus metrics and system statistics via
/sys/stats. - Storage Options: App statistics can be stored in memory, Redis, BoltDB, BuntDB, LevelDB, or BadgerDB.
- Deployment: Ready for Docker, Kubernetes, and AWS Lambda.
PushDeer for Android Overview
mainPushDeer for Android is a client application designed to receive and manage push notifications. It supports features such as message lists, device/key management, and Markdown rendering.
Note: The official Android version may experience issues with interface permissions. The project is currently not actively maintained. For reliable service, it is recommended to use ServerChan³.
Hardware options for DeerESP IOT devices
mainDeerESP is an extension of PushDeer for IOT, using ESP8266/ESP32 chips to push messages to smart devices via MQTT. There are four main ways to obtain the hardware:
- Pre-assembled (Option 1): Fully assembled with a 3D-printed case (~60 RMB).
- DIY Kit (Option 2): Unsoldered components with a 3D-printed case (~50 RMB).
- Open Source PCB (Option 3): Self-printed PCB and components via open-source hardware designs (~25 RMB).
- Basic Components (Option 4): Direct purchase of an 8266 development board, screen, and buzzer for manual wiring (~35 RMB).
Option 1 and 4 require no soldering, while 2 and 3 require soldering skills.
Install Alamofire
mainAlamofire can be installed using several dependency managers depending on your project setup:
- CocoaPods: Supported.
- Carthage: Supported.
- Swift Package Manager: Supported.
- Manual: Supported.
Configure iOS Push Notifications
mainIf you are using the self-hosted version of the iOS client, you must configure push certificates:
- Navigate to the
pushdirectory. - Rename
*.yml.samplefiles to*.yml. - Configure
ios.ymlfor the main App andclip.ymlfor the Clip functionality. - Ensure the
productionvalue is set correctly based on your deployment state. - By default, the configuration expects
c.p12for the App certificate andcc.p12for the Clip certificate.
- Navigate to the
Compile the Android Client
mainWhen compiling the Android client, you must ensure thePackage Namein the source code matches exactly the package name registered in the Xiaomi Developer Console. Failure to do so will result in abad targeterror during push notification attempts.Build and run PushDeer Quick App
mainPrerequisites
- Node.js environment (v16.13.1 recommended)
- Quick App IDE
adb- Quick App Debugger
- An Android device
Setup and Execution
- Clone the source code.
- Install dependencies:
cd quickapp && yarn- Launch the Quick App IDE and open the
quickappfolder. The IDE will automatically compile and display the interface in the simulator.
cd quickapp && yarnRun gorush web server
maingorushcan run as a web server to handle incoming requests. It defaults to port8088.Start the server
Ensure a
config.ymlfile exists before running.# Start with default config gorush # Start with a custom config file gorush -c config.ymlCheck API server status
You can check the status of the API server using
httpie:http -v --verify=no --json GET http://localhost:8088/api/stat/go# for default config $ gorush # for custom config file $ gorush -c config.ymlSet up PushDeer development environment
mainTo run a self-hosted instance of the PushDeer API, follow these steps:
- Clone the repository:
git clone https://github.com/easychen/pushdeer.git - Start the API using Docker:
Run
docker-compose up -dfrom the repository root. The API will be accessible athttp://127.0.0.1:8800by default. You can modify the port in thedocker-compose.ymlfile.
git clone https://github.com/easychen/pushdeer.git docker-compose up -d- Clone the repository:
Configure and start the gorush service
mainBefore starting the service, you must create a configuration directory and a configuration file at
/etc/gorush/. You can use an existing configuration file as a template. Once configured, start the service using the init script.mkdir -p /etc/gorush cp config/testdata/config.yml /etc/gorush/ /etc/init.d/gorush start