Sending line notifications using a binary, docker or Drone CI.

Overview

drone-line

drone-line

GoDoc Build Status codecov Go Report Card Docker Pulls microbadger Release Build status

Sending line notifications using a binary, docker or Drone CI.

Register Line BOT API Trial

Please refer to LINE Business Center.

Feature

  • Send multiple Message.
  • Send Text Message.
  • Send Video Message.
  • Send Audio Message.
  • Send Sticker Message.
  • Send Location Message.
  • Support prometheus metrics API.
  • Automatically install TLS certificates from Let's Encrypt.
  • Support Localtunnel for webhook tunnel.
  • Support Line Notify.

Localtunnel allows you to easily share a web service on your local development machine without messing with DNS and firewall settings.

Memory Usage:

Memory Usage

Notification Count Usage:

Notification Count Usage

Build or Download a binary

The pre-compiled binaries can be downloaded from release page. Support the following OS type.

  • Windows amd64/386
  • Linux amd64/386
  • Darwin amd64/386

With Go installed

go get -u -v github.com/appleboy/drone-line

or build the binary with the following command:

make build

Docker

Build the docker image with the following commands:

make docker

Usage

There are three ways to send notification.

Usage from binary

Setup Webhook service

Setup Webhook service as default port 8088.

drone-line \
  --secret xxxx \
  --token xxxx \
  webhook

Change default webhook port to 8089.

drone-line \
  --port 8089 \
  --secret xxxx \
  --token xxxx \
  webhook

Use localtunnel to tunnel your locally running bot so that Line can reach the webhook.

drone-line \
  -s secret \
  -t token \
  --tunnel \
  --port 2002 \
  webhook

Use Let's Encrypt. Please make sure you have permission to listen on 443 port.

drone-line \
  -s secret \
  -t token \
  -autotls \
  -host example.com \
  -cache /var/www/.cache \
  --port 443 \
  webhook

Tips: Another way to use ngrok to tunnel your locally running bot so that Line can reach the webhook.

Send Notification

Setup the --to flag after fetch user id from webhook service.

drone-line \
  --secret xxxx \
  --token xxxx \
  --to xxxx \
  --message "Test Message"

Send LINE Notify

If you connect your service with LINE Notify, LINE users can easily receive notifications from it. See the documentation.

drone-line \
  --token xxxx \
  --message "Test Message" \
  notify

Usage from docker

Setup Webhook service as default port 8088.

docker run --rm \
  -e LINE_CHANNEL_SECRET=xxxxxxx \
  -e LINE_CHANNEL_TOKEN=xxxxxxx \
  appleboy/drone-line webhook

Change default webhook port to 8089.

docker run --rm \
  -e LINE_CHANNEL_SECRET=xxxxxxx \
  -e LINE_CHANNEL_TOKEN=xxxxxxx \
  -e LINE_PORT=8089 \
  appleboy/drone-line webhook

Tips: Use ngrok to tunnel your locally running bot so that Line can reach the webhook.

Send Notification

docker run --rm \
  -e LINE_CHANNEL_SECRET=xxxxxxx \
  -e LINE_CHANNEL_TOKEN=xxxxxxx \
  -e LINE_TO=xxxxxxx \
  -e LINE_MESSAGE=test \
  -e LINE_IMAGES=https://example.com/1.png \
  -e LINE_VIDEOS=https://example.com/1.mp4 \
  -e LINE_AUDIOS=https://example.com/1.mp3::1000 \
  -e LINE_STICKERS=1::1 \
  -e LINE_LOCATIONS=title::address::latitude::longitude \
  -e LINE_DELIMITER=:: \
  appleboy/drone-line

Usage from drone ci

Execute from the working directory:

docker run --rm \
  -e PLUGIN_CHANNEL_SECRET=xxxxxxx \
  -e PLUGIN_CHANNEL_TOKEN=xxxxxxx \
  -e PLUGIN_TO=xxxxxxx \
  -e PLUGIN_MESSAGE=test \
  -e PLUGIN_IMAGES=https://example.com/1.png \
  -e PLUGIN_VIDEOS=https://example.com/1.mp4 \
  -e PLUGIN_AUDIOS=https://example.com/1.mp3::1000 \
  -e PLUGIN_STICKERS=1::1 \
  -e PLUGIN_LOCATIONS=title::address::latitude::longitude \
  -e PLUGIN_DELIMITER=:: \
  -e PLUGIN_ONLY_MATCH_EMAIL=false \
  -e DRONE_REPO_OWNER=appleboy \
  -e DRONE_REPO_NAME=go-hello \
  -e DRONE_COMMIT_SHA=e5e82b5eb3737205c25955dcc3dcacc839b7be52 \
  -e DRONE_COMMIT_BRANCH=master \
  -e DRONE_COMMIT_AUTHOR=appleboy \
  -e [email protected] \
  -e DRONE_COMMIT_MESSAGE=Test_Your_Commit \
  -e DRONE_BUILD_NUMBER=1 \
  -e DRONE_BUILD_STATUS=success \
  -e DRONE_BUILD_LINK=http://github.com/appleboy/go-hello \
  -e DRONE_JOB_STARTED=1477550550 \
  -e DRONE_JOB_FINISHED=1477550750 \
  -v $(pwd):$(pwd) \
  -w $(pwd) \
  appleboy/drone-line

You can get more information about how to use scp plugin in drone.

Testing

Test the package with the following command:

make test
Issues
  • linebot: APIError 400 The property, 'to', in the request body is invalid (line: -, column: -)

    linebot: APIError 400 The property, 'to', in the request body is invalid (line: -, column: -)

    I usw win10 and download drone-line-v1.4.0-windows-386.exe When I get a secret and token I use this command to start webhook drone-line-v1.4.0-windows-386.exe --secret secret_key --token token_key webhook then i use this command to send message

    drone-line-v1.4.0-windows-386.exe --secret secret_key --token token_key --to windgo --message "test" or drone-line-v1.4.0-windows-386.exe --secret secret_key --token token_key --to @nle4159v --message "test"

    then i got a error mesage "2016/12/19 11:21:57 linebot: APIError 400 The property, 'to', in the request body is invalid (line: -, column: -)"

    could you give me a suggest?

    opened by windgo1019 6
  • Integrating with drone ci

    Integrating with drone ci

    Hi, How do I add this plugin to existing drone ci docker container? I deployed using docker-compose. Also, is it possible to store line developer credentials in the server itself not in drone.yml. And does your plugin supports sending to multiple LineUID?

    opened by panteparak 5
Releases(v1.5.1)
Owner
Bo-Yi Wu
I really believe committing every day on an open source project is the best practice.
Bo-Yi Wu
A dead simple Go library for sending notifications to various messaging services.

A dead simple Go library for sending notifications to various messaging services. About Notify arose from my own need for one of my api server running

Niko Köser 1.2k Aug 8, 2022
Golang tool to send notifications to LINE app

Golang tool to send notifications to LINE app

Muhammad Daffa 3 Dec 15, 2021
⚡ 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 Aug 5, 2022
Send slack notifications using Github action

Slack notification This is a simple Slack notification action which runs using a Bot token. Example Action A simple example on how to use this action:

Gergely Brautigam 12 Aug 9, 2021
API for sending sms through the connected modem using golang

SMS sender API API for making SMS sending from modem, by sending post request to route Request for Send SMS url method 127.0.0.1:8000/api/v1/send-mode

Muhammetberdi Jepbarov 0 Nov 5, 2021
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.

Beaver A Real Time Messaging Server. Beaver is a real-time messaging server. With beaver you can easily build scalable in-app notifications, realtime

Ahmed 1.4k Aug 12, 2022
Package notify provides an implementation of the Gnome DBus Notifications Specification.

go-notify Package notify provides an implementation of the Gnome DBus Notifications Specification. Examples Display a simple notification. ntf := noti

null 61 Jun 10, 2022
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 2.6k Aug 6, 2022
Bark is an iOS App which allows you to push customed notifications to your iPhone.

Bark is an iOS App which allows you to push customed notifications to your iPhone.

Feng 1.5k Aug 11, 2022
A simple microservice which accepts incoming notifications

Notifier A simple microservice which accepts incoming notifications, and questions and redirects them to notification sinks such as Telegram, Email et

Albert 7 May 21, 2022
graylog-golang is a full implementation for sending messages in GELF (Graylog Extended Log Format) from Go (Golang) to Graylog

graylog-golang is a full implementation for sending messages in GELF (Graylog Extended Log Format) from Go (Golang) to Graylog

Robert Kowalski 78 Aug 1, 2022
A single binary, simple, message queue.

MiniQueue A stupid simple, single binary message queue using HTTP/2. Most messaging workloads don't require enormous amounts of data, endless features

Tom Arrell 120 Aug 3, 2022
Kafka implemented in Golang with built-in coordination (No ZooKeeper, single binary install, Cloud Native)

Jocko Distributed commit log service in Go that is wire compatible with Kafka. Created by @travisjeffery, continued by nash. Goals: Protocol compatibl

Nash.io 104 Aug 9, 2021
🚀 Golang, Go Fiber, RabbitMQ, MongoDB, Docker, Kubernetes, GitHub Actions and Digital Ocean

Bookings Solução de cadastro de usuários e reservas. Tecnologias Utilizadas Golang MongoDB RabbitMQ Github Actions Docker Hub Docker Kubernetes Digita

Jailton Junior 7 Feb 18, 2022
Simple docker container to publish a fixed message to a specified queue. Created to be used with k8s CRON scheduling.

RabbitMQ Publish CRON Simple docker container to publish a fixed message to a specified rabbitmq exchange. Created to be used as part of a Kubernetes

Daniel Emery 0 Dec 20, 2021
Simple go app with RabbitMQ in docker-compose

Docker-compose stand with RabbitMQ and sender/reciever. About First app is a producer that sends messages (1 per second / while-true loop), the second

Dmitry Tolstoy 0 Jan 5, 2022
Chanify is a safe and simple notification tools. This repository is command line tools for Chanify.

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

Chanify 897 Aug 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 136 Aug 11, 2022
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