Chanify is a safe and simple notification tools. This repository is command line tools for Chanify.

Overview

Chanify

Docker Release iTunes App Store WebStore Workflow CodeQL Codecov Total alerts Go Report Card GitHub Docker pull Downloads Users

English | 简体中文

Chanify is a safe and simple notification tools. For developers, system administrators, and everyone can push notifications with API.

Table of Contents

  1. Features
  2. Getting Started
  3. Installation
  4. Usage
  5. HTTP API
  6. Configuration
  7. Security
  8. Chrome Extension
  9. Contributing
  10. License

Features

Chanify is include these features:

  • Customize channel for notifications.
  • Deploy your own node server.
  • Distributed architecture design.
  • Design for privacy protection.

Getting Started

  1. Install iOS App(1.0.0 version and above).
  2. Get send token, more detail.
  3. Send message.

Installation

Precompiled binary

Download precompiled binary from this.

Docker

$ docker pull wizjin/chanify:latest

From source

$ go install github.com/chanify/chanify

Usage

As Sender Client

Use chanify to send message.

# Text message
$ chanify send --endpoint=http://<address>:<port> --token=<token> --text=<message>

# URL message
$ chanify send --endpoint=http://<address>:<port> --token=<token> --link=<web url>

# Image message
$ chanify send --endpoint=http://<address>:<port> --token=<token> --image=<image file path>

# File message
$ chanify send --endpoint=http://<address>:<port> --token=<token> --file=<file path> --text=<file description>

endpoint default value is https://api.chanify.net, and notification will send by default server. If you have own node server, please set endpoint to your node server url.

As Serverless node

Chanify run in stateless mode, no device token will be stored in node.

All device token will be stored in api.chanify.net.

Message will send to apple apns server by api.chanify.net.

Send message workflow:

Start => node server => api.chanify.net => Apple server => iOS client
# Start chanify
$ chanify serve --host=<ip address> --port=<port> --secret=<secret key> --name=<node name> --endpoint=http://<address>:<port>

# Docker
$ docker run -it wizjin/chanify:latest serve --secret=<secret key> --name=<node name> --endpoint=http://<address>:<port>

As Serverful node

Chanify run in stateful mode, device token will be stored in node.

Message will send to apple apns server direct.

Send message workflow:

Start => node server => Apple server => iOS client

Start server

# Start chanify
$ chanify serve --host=<ip address> --port=<port> --name=<node name> --datapath=~/.chanify --endpoint=http://<address>:<port>

# Docker
$ docker run -it -v /my/data:/root/.chanify wizjin/chanify:latest serve --name=<node name> --endpoint=http://<address>:<port>

Use MySQL as a backend

--dburl=mysql://<user>:<password>@tcp(<ip address>:<port>)/<database name>?charset=utf8mb4&parseTime=true&loc=Local

Chanify will not create database.

Add New Node

  • Start node server
  • iOS client can scan QRCode(http://
    :/) to add node.

Send message

Command Line

# Text message
$ curl --form-string "text=hello" "http://
:/v1/sender/" # Text file $ cat message.txt | curl -H "Content-Type: text/plain" --data-binary @- "http://
:/v1/sender/"

Python 3

from urllib import request, parse

data = parse.urlencode({ 'text': 'hello' }).encode()
req = request.Request("http://
:/v1/sender/", data=data) request.urlopen(req)

Ruby

require 'net/http'

uri = URI('http://
:/v1/sender/') res = Net::HTTP.post_form(uri, 'text' => 'hello') puts res.body

NodeJS

const https = require('https')
const querystring = require('querystring');

const data = querystring.stringify({ text: 'hello' })
const options = {
    hostname: '
:', port: 80, path: '/v1/sender/', method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': data.length } } var req = https.request(options, (res) => { res.on('data', (d) => { process.stdout.write(d); }); }); req.write(data); req.end();

PHP

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL           => 'http://
:/v1/sender/', CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => [ 'text' => 'hello' ], ]); $response = curl_exec($curl); curl_close($curl); echo $response;

HTTP API

Send Text

  • GET
http://
:/v1/sender//
  • POST
http://
:/v1/sender/

Content-Type:

  • text/plain: Body is text message
  • multipart/form-data: The block of data("text") is text message
  • application/x-www-form-urlencoded: text=
  • application/json; charset=utf-8: The fields are optional
{
    "token": "",
    "title": "",
    "text": "",
    "copy": "",
    "autocopy": 1,
    "sound": 1,
    "priority": 10,
}

Additional params

Key Default Description
title None The title for notification message.
copy None The copy text for text notification.
autocopy 0 Enable autocopy text for text notification.
sound 0 1 enable sound, otherwise disable sound.
priority 10 10 normal, 5 lower level.

E.g.

http://
:/v1/sender/?sound=1&priority=10&title=hello©=123&autocopy=1

Send Link

$ curl --form "link=@" "http://
:/v1/sender/"
{
    "link": "",
    "sound": 1,
    "priority": 10,
}

Send Image

Send image only support POST method used serverful node.

  • Content-Type: image/png OR image/jpeg
cat <jpeg image path> | curl -H "Content-Type: image/jpeg" --data-binary @- "http://
:/v1/sender/"
  • Content-Type: multipart/form-data
$ curl --form "image=@" "http://
:/v1/sender/"

Send File

Send file only support POST method used serverful node.

  • Content-Type: multipart/form-data
$ curl --form "file=@" "http://
:/v1/sender/"

Configuration

Chanify can be configured with a yml format file, and the default path is ~/.chanify.yml.

server:
    host: 0.0.0.0   # Listen ip address
    port: 8080      # Listen port
    endpoint: http://my.server/path # Endpoint URL
    name: Node name # Name for node server
    secret:  # key for serverless node server
    datapath:  # data storage path for serverful node server
    dburl: mysql://root:[email protected](127.0.0.1:3306)/chanify?charset=utf8mb4&parseTime=true&loc=Local # database dsn for serverful node server
    register:
        enable: false # Disable user register
        whitelist: # whitelist for user register
            - 
            - 

client: # configuration for sender client
    sound: 1    # enable sound
    endpoint: 
    token: 

Security

Node server can be disabled user registration and become a private server.

chanify serve --registerable=false --whitelist=<user1 id>,<user2 id>
  • --registerable=false: used to disable user registration
  • whitelist: list users can be add into node server

Chrome Extension

Download the extension for Chrome web store.

Extension features:

  • Send select text/image/url message to Chanify
  • Send page url to Chanify

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Change to dev Branch (git checkout dev)
  3. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  4. Commit your Changes (git commit -m 'Add some AmazingFeature')
  5. Push to the Branch (git push origin feature/AmazingFeature)
  6. Open a Pull Request (merge to chanify:dev branch)

License

Distributed under the MIT License. See LICENSE for more information.

Comments
  • Init service failed: In serverless mode, secret is required

    Init service failed: In serverless mode, secret is required

    使用配置文件的方式,会一直提示标题这个错误,要怎么解决啊?

    chanify serve --config=/opt/chanify.yml

    server:
        host: 0.0.0.0
        port: 10000
        endpoint: https://xxx.xxx.fun
        name: apple
    
    

    配置文件增加 serverless: false 也不行

    question 
    opened by Jonnyan404 14
  • feat: 感谢大佬的Chanify

    feat: 感谢大佬的Chanify

    终于把Chanify在群晖上配置成功。

    比较小白,使用群晖自带的Docker界面配置的,然后 http://192.168.1.100:9070/ 确实也打开了二维码的图片,在与群晖同一个局域网里使用手机端扫描二维码图片的时候,提示:无法连接服务器。查看日志有一处显示: endpoint=http://0.0.0.0:9070。

    后来使用Portainer执行了一下 command: serve --name= --endpoint=http://192.168.100.1:9070 才算成功。😂

    不太懂代码,若是方便的话,希望大佬在Docker的环境变量里能预留出一个配置内网IP地址的地方,要不然像我这类小白真的要钻研很久很久。😂 也算是方便更多后来人使用Chanify啦,再次感谢大佬~~

    enhancement 
    opened by i-iooi-i 8
  • connect node server failed

    connect node server failed

    ./chanify serve --host=0.0.0.0 --port=15000 --name=xxx --datapath=~/.chanify
    2021/03/21 22:36:01 Launching service...
    2021/03/21 22:36:01 Open sqlite database: /root/.chanify/chanify.db
    2021/03/21 22:36:01 Node server name: xxx, version: unknown-version, serverless: false, node-id: XXX
    2021/03/21 22:36:01 Launch service 0.0.0.0:15000
    2021/03/21 22:36:01 Node server endpoint: http://0.0.0.0:15000
    

    iOS 扫描报错 "connect node server failed"

    version 1.0.0

    求助,Thanks,

    opened by kzh125 6
  • bug: Special characters give

    bug: Special characters give "invalid content" message

    Describe the bug When I try to use characters like á, õ, , Chanify responds with { res: 400, msg: 'invalid content' }

    To Reproduce Steps to reproduce the behavior:

    1. Create a POST request to api.chanify.net with a special character (á, õ, ) in it's content
    2. See error

    Expected behavior I should recieve a notification with those characters

    iOS info

    • Device: iPhone 12
    • OS: iOS 15.5
    • Version: 1.3.11
    bug 
    opened by bernzrdo 4
  • bug:  Macos not receiving msg

    bug: Macos not receiving msg

    issue 1 Login with QR code with macos app (downloaded today)

    Send message to any channels using curl

    curl --form-string "text=hello" https://api.chanify.net/v1/sender/code
    

    Only IOS receive the message, macos didn't.


    Issue 2

    1. Create channel in IOS
    2. Login with QR code in MacOS

    New channel is not shown in macos

    bug wontfix 
    opened by daveteu 2
  • bug: SSL 证书过期

    bug: SSL 证书过期

    curl: (60) SSL certificate problem: certificate has expired More details here: https://curl.se/docs/sslcerts.html

    curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.

    bug 
    opened by dluffymonkey 2
  • go install Installation error

    go install Installation error

    go install: version is required when current directory is not in a module Try 'go install github.com/chanify/[email protected]' to install the latest version Is there no version number? For example: @1.0

    bug 
    opened by BigLight-H 2
  • 无状态服务器发送消息返回401

    无状态服务器发送消息返回401

    浏览器访问http://ip:port/v1/sender/?text=hellp返回{"msg":"invalid token","res":401} 换成postman访问之后仍然返回{"msg":"invalid token","res":401}

    question 
    opened by liudaolunboluo 2
  • feat:

    feat:

    Is your feature request related to a problem? Please describe. I'm always frustrated when I delete messages

    Describe the solution you'd like Add a select all button

    Describe alternatives you've considered

    Additional context

    enhancement 
    opened by Noahsarker 1
  • Init service failed: in serverless mode, secret is required

    Init service failed: in serverless mode, secret is required

    ./chanify serve --host=10.10.10.200 --port=55879 --name=11111 --datapath=~/.chanify --endpoint=http://10.10.10.200:55879 报错

    Init service failed: in serverless mode, secret is required

    question 
    opened by h605290713 1
  • feat: support message list for apple watch

    feat: support message list for apple watch

    Is your feature request related to a problem? Please describe. It's awesome if we can read messages from apple watch (for now I guess messages can only show in watch notification list, not in the chanify watch app).

    enhancement 
    opened by jukanntenn 1
  • feat: Add standalone message TITLE and HTML/Markdown content support

    feat: Add standalone message TITLE and HTML/Markdown content support

    Is your feature request related to a problem? Please describe. Nope.

    Describe the solution you'd like

    • Send Markdown/HTML to API. (Server)
    • Display message title in message list (App)
    • Display HTML (or translated from Markdown) content in a detail page (App)

    Describe alternatives you've considered Like what ServerChan did for Wechat.

    enhancement 
    opened by cuteribs 0
Releases(v1.4.2)
ntfy is a super simple pub-sub notification service. It allows you to send desktop notifications via scripts.

ntfy ntfy (pronounce: notify) is a super simple pub-sub notification service. It allows you to send desktop and (soon) phone notifications via scripts

Philipp C. Heckel 8.9k Jan 9, 2023
Simple push notification system (android/fcm, apns/slideshow) written by Golang

Golang Push Notification Simple system push notification for android/fcm and apn

Hoàng Hải 0 Dec 20, 2021
Arjuns-urgent-notification-backend - A simple Golang app that handles form JSON POST requests

Arjun's Urgent Notification Backend This is intended to let people urgently noti

Kome Fumi 0 Jan 7, 2022
Vivasoft Limited 7 May 11, 2023
⚡ HTTP/2 Apple Push Notification Service (APNs) push provider for Go — Send push notifications to iOS, tvOS, Safari and OSX apps, using the APNs HTTP/2 protocol.

APNS/2 APNS/2 is a go package designed for simple, flexible and fast Apple Push Notifications on iOS, OSX and Safari using the new HTTP/2 Push provide

Adam Jones 2.7k Jan 1, 2023
Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices.

Homepage Download Blog/News @uniqush Introduction Uniqush (\ˈyü-nə-ku̇sh\ "uni" pronounced as in "unified", and "qush" pronounced as in "cushion") is

Uniqush 1.5k Jan 9, 2023
cisasntyi: check iphone stock and send notification to your iphone

for buy iphone 13 notification cisasntyi: check iphone stock and send notification to your iphone install Bark app in your iphone first before you run

seaZhang 45 Aug 3, 2022
A push notification server written in Go (Golang).

gorush A push notification micro server using Gin framework written in Go (Golang) and see the demo app. Contents gorush Contents Support Platform Fea

Bo-Yi Wu 6.7k Jan 8, 2023
Namecoin calendar notification daemon (ICS, CalDAV)

nccald nccald is a simple daemon to provide calendar notifications for Namecoin name expirations. The daemon periodically queries a Namecoin Core inst

Hugo Landau 0 Dec 11, 2021
An little library to create notification files with golang.

notifile With this no library you can easily create notification files for your Go projects. These must then be stored in the directory you specify so

echGo 1 Oct 5, 2022
🔥 A fast and beautiful command line tool to build API requests.

Poodle A fast and beautiful command line tool to build API requests ?? Check out the full Demo! Poodle is an interactive command line tool to build an

Ahmed 135 Aug 23, 2022
A lightweight, thread-safe FIFO queue with fixed capacity.

FIFO Queue Thread-safe, lightweight, tested FIFO queue with fixed size, which is built upon list for performance ;-) This implement is inspired by htt

jhin 0 Dec 16, 2021
ZenQ - A low-latency thread-safe queue in golang implemented using a lock-free ringbuffer

ZenQ A low-latency thread-safe queue in golang implemented using a lock-free ringbuffer Features Much faster than native channels in both SPSC (single

Anish Mukherjee 551 Jan 8, 2023
An opinionated package that helps you print user-friendly output messages from your Go command line applications.

github.com/eth-p/clout (Command Line Output) clout is a package that helps you print user-friendly output messages from your Go command line applicati

Ethan P. 4 Jan 15, 2022
Sim - Command-line tool to manage program symlinks in $XDG_BIN_HOME.

Sim Sim is a command-line tool that manages program symlinks in $XDG_BIN_HOME. Get started Run make install. Make sure your PATH contains $XDG_BIN_HOM

Mitchell Kember 0 Jan 3, 2022
Topictool - Batch replace, add or remove Github repository topic labels

Topictool CLI Tool to manage topic labels on Github repositories Installation go

Christian Bargmann 0 Feb 3, 2022
Sending line notifications using a binary, docker or Drone CI.

drone-line Sending line notifications using a binary, docker or Drone CI. Register Line BOT API Trial Please refer to LINE Business Center. Feature Se

Bo-Yi Wu 78 Sep 27, 2022
Golang tool to send notifications to LINE app

Golang tool to send notifications to LINE app

Muhammad Daffa 2 Nov 9, 2022
Asynq: simple, reliable, and efficient distributed task queue in Go

Asynq Overview Asynq is a Go library for queueing tasks and processing them asynchronously with workers. It's backed by Redis and is designed to be sc

Ken Hibino 5k Dec 30, 2022