Merge pull request #15 from kha7iq/add-docs-in-repo

docs: move documentation to same repo
pull/19/head
Khaliq 4 years ago committed by GitHub
commit 7c53e727be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1 @@
pingme.lmno.pk

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

@ -0,0 +1,6 @@
<!-- docs/_sidebar.md -->
* [Home](/)
* [Installation](install.md)
* [Services & Usage](services.md)

@ -0,0 +1,77 @@
<h2 align="center">
<br>
<p align="center"><img width=20% src="https://raw.githubusercontent.com/kha7iq/pingme/master/.github/img/logo.png"></p>
</h2>
<h4 align="center">PingMe CLI</h4>
<p align="center">
<a href="https://github.com/kha7iq/pingme/releases">
<img alt="Release" src="https://img.shields.io/github/v/release/kha7iq/pingme">
<a href="#">
<img alt="Build" src="https://img.shields.io/github/workflow/status/kha7iq/pingme/goreleaser">
<a href="https://github.com/kha7iq/pingme/issues">
<img alt="GitHub issues" src="https://img.shields.io/github/issues/kha7iq/pingme?style=flat-square&logo=github&logoColor=white">
<a href="https://github.com/kha7iq/pingme/blob/master/LICENSE.md">
<img alt="License" src="https://img.shields.io/github/license/kha7iq/pingme">
<a href="#">
<img alt="Go Version" src="https://img.shields.io/github/go-mod/go-version/kha7iq/pingme">
<a href="https://pkg.go.dev/github.com/kha7iq/pingme">
<img alt="Go Dev Reference" src="https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat">
</p>
<p align="center">
<a href="#/?id=about">About</a>
<a href="#?id=supported-services">Supported Services</a>
<a href="#?id=demo">Demo</a>
<a href="#?id=contributing">Contributing</a>
<a href="#?id=show-your-support">Show Your Support</a>
</p>
---
## About
**PingMe** is a personal project to satisfy my needs of having alerts, most major platforms have integration to send alerts
but its not always useful, either you are stuck with one particular platform, or you have to do alot of integrations. I needed a small app
which i can just call from my backup scripts, cron jobs, CI/CD pipelines or from anywhere to send a message with particular information.
And i can ship it everywhere with ease.
Hence, the birth of PingMe.
Everything is configurable via environment variables, and you can simply export the logs or messages to a variable which will be sent
as message. And most of all this serves as a swiss army knife sort of tool which supports multiple platforms.
## Supported services
- *Discord*
- *Email*
- *Microsoft Teams*
- *RocketChat*
- *Slack*
- *Telegram*
- *Pushover*
- *Mattermost*
## Demo
![Demo](https://raw.githubusercontent.com/kha7iq/pingme/master/.github/img/pingme.gif)
## Contributing
Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/kha7iq/pingme/issues). You can also take a look at the [contributing guide](https://github.com/kha7iq/pingme/blob/master/CONTRIBUTING.md).
## Show your support
Give a ⭐️ if you like this project!
## Disclaimer
Any misuse of this utilify is your own liability and responsibility and cannot be attributed to the authors of this library. See [license](LICENSE) for more.
Spamming through the use of this library **may get you permanently banned** on most supported platforms.

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
<link
rel="stylesheet"
href="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/style.min.css"
title="docsify-darklight-theme"
type="text/css"
/>
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
homepage: 'home.md',
logo: '/_media/logo.png',
loadSidebar: true,
subMaxLevel: 2,
name: 'PingMe',
repo: 'https://github.com/kha7iq/pingme'
}
</script>
<!-- Docsify v4 -->
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
<script
src="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/index.min.js"
type="text/javascript">
</script>
</body>
</html>

@ -0,0 +1,45 @@
## Linux & MacOs
```bash
brew install kha7iq/tap/pingme
```
## Go Get
```bash
go get -u github.com/kha7iq/pingme
```
## Windows
```powershell
scoop bucket add pingme https://github.com/kha7iq/scoop-bucket.git
scoop install pingme
```
Alternatively you can head over to [release pages](https://github.com/kha7iq/pingme/releases) and download the binary for windows & all other supported platforms.
## Docker
Docker container is also available on both dockerhub and github container registry.
`latest` tage will always pull the latest version avaialbe, you can also download specific version.
Checkout [release](https://github.com/kha7iq/pingme/releases) page for available versions.
- Docker Registry
```bash
docker pull khaliq/pingme:latest
```
- Github Registry
```bash
docker pull ghcr.io/kha7iq/pingme:latest
```
- Run
```bash
docker run ghcr.io/kha7iq/pingme:latest
```
## Github Action
A github action is also available now for this app, you can find it on [Github Market Place](https://github.com/marketplace/actions/pingme-action) or from this [repository](https://github.com/kha7iq/pingme-action) on github.
Usage examples for workflow are available in the repo.

@ -0,0 +1,358 @@
### Configuration
All the flags have crosponding enviornment variables assosiated with it. You can either provide the value with flags
or export to a variable. You can view the crosponding variable to each with --help flag.
*Flags* take presedance over *variables*
*Default* value for message title is current *time*
## Telegram
Telegram uses bot token to authenticate & send messages to defined channels.
Multiple channel ids can be used separated by comma ','.
```bash
pingme telegram --token "0125:AAFHvnYf_ABC" --msg "This is a new message ✈" --channel="-1001001001,-1002002001"
```
- Github Action
```yaml
on: [push]
jobs:
pingme-job:
runs-on: ubuntu-latest
name: PingMe
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Ping me On
uses: kha7iq/pingme-action@v1
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_CHANNELS: ${{ secrets.TELEGRAM_CHANNELS }}
TELEGRAM_TITLE: 'Refrence: ${{ github.ref }}'
TELEGRAM_MESSAGE: 'Event is triggerd by ${{ github.event_name }}'
with:
# Chose the messaging platform.
# slack / telegram / rocketchat / teams / pushover / discord / email
service: telegram
```
- **Variables**
| Variables | Default Value |
| -------------------------- | :----------------: |
| TELEGRAM_MSG_TITLE | "" |
| TELEGRAM_TOKEN | "" |
| TELEGRAM_CHANNELS | "" |
| TELEGRAM_MESSAGE | "" |
| TELEGRAM_MSG_TITLE | "" |
## RocketChat
RocketChat uses token & userID to authenticate and send messages to defined channels.
Multiple channel ids can be used separated by comma ','.
```bash
pingme rocketchat --channel "general,Pingme" --msg ":wave: rocketchat from cli" --userid "123" --token "abcxyz" \
--url 'localhost:3000' --scheme "http"
```
- Github Action
```yaml
on:
release:
types: [published]
jobs:
pingme-job:
runs-on: ubuntu-latest
name: PingMe
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Ping me On
uses: kha7iq/pingme-action@v1
env:
ROCKETCHAT_USERID: ${{ secrets.ROCKETCHAT_USERID }}
ROCKETCHAT_TOKEN: ${{ secrets.ROCKETCHAT_TOKEN }}
ROCKETCHAT_SERVER_URL: ${{ secrets.ROCKETCHAT_SERVER_URL }}
ROCKETCHAT_CHANNELS: ${{ secrets.ROCKETCHAT_CHANNELS }}
ROCKETCHAT_URL_SCHEME: "https"
ROCKETCHAT_TITLE: 'Refrence: ${{ github.ref }}'
ROCKETCHAT_MESSAGE: 'Event is triggerd by ${{ github.event_name }}'
with:
# Chose the messaging platform.
# slack / telegram / rocketchat / teams / pushover / discord / email / mattermost
service: rocketchat
```
- **Variables**
| Variables | Default Value |
| -------------------------- | :----------------: |
| ROCKETCHAT_USERID | "" |
| ROCKETCHAT_TOKEN | "" |
| ROCKETCHAT_SERVER_URL | "" |
| ROCKETCHAT_URL_SCHEME | "https" |
| RTOCKETCHAT_MESSAGE | "" |
| ROCKETCHAT_TITLE | "" |
| ROCKETCHAT_CHANNELS | "" |
## Pushover
```bash
pingme pushover --token '123' --user '12345567' --title 'some title' --message 'some message'
```
- Github Action
```yaml
on: [push]
jobs:
pingme-job:
runs-on: ubuntu-latest
name: PingMe
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Ping me On
uses: kha7iq/pingme-action@v1
env:
PUSHOVER_TOKEN: ${{ secrets.PUSHOVER_TOKEN }}
PUSHOVER_USER: ${{ secrets.PUSHOVER_USER }}
PUSHOVER_TITLE: 'Refrence: ${{ github.ref }}'
PUSHOVER_MESSAGE: 'Event is triggerd by ${{ github.event_name }}'
with:
# Chose the messaging platform.
# slack / telegram / rocketchat / teams / pushover / discord / email
service: pushover
```
- **Variables**
| Variables | Default Value |
| -------------------------- | :----------------: |
| PUSHOVER_TOKEN | "" |
| PUSHOVER_USER | "" |
| PUSHOVER_MESSAGE | "" |
| PUSHOVER_TITLE | "" |
## Mattermost
Mattermost uses token to authenticate and channel ids for targets.
Destination server can be specified as 'example.com' by default the 'https' is used, you
can change this with --scheme flag and set it to 'http'.
Latest api version 4 is used for interacting with server, this can also be changes with --api flag.
You can specify multiple channels by separating the value with ','.
```bash
pingme mattermost --token '123' --channel '12345,567' --url 'localhost' --scheme 'http' --message 'some message'
```
- Github Action
```yaml
on:
release:
types: [published]
jobs:
pingme-job:
runs-on: ubuntu-latest
name: PingMe
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Ping me On
uses: kha7iq/pingme-action@v1
env:
MATTERMOST_TOKEN: ${{ secrets.MATTERMOST_TOKEN }}
ROCKETCHAT_SERVER_URL: ${{ secrets.ROCKETCHAT_SERVER_URL }}
MATTERMOST_CHANNELS: ${{ secrets.MATTERMOST_CHANNELS }}
MATTERMOST_CHANNELS: ${{ secrets.MATTERMOST_CHANNELS }}
MATTERMOST_TITLE: 'Refrence: ${{ github.ref }}'
MATTERMOST_MESSAGE: 'Event is triggerd by ${{ github.event_name }}'
with:
# Chose the messaging platform.
# slack / telegram / rocketchat / teams / pushover / discord / email / mattermost
service: mattermost
```
- **Variables**
| Variables | Default Value |
| -------------------------- | :----------------: |
| MATTERMOST_API_URL | "/api/v4/posts" |
| MATTERMOST_TOKEN | "" |
| MATTERMOST_SERVER_URL | "" |
| MATTERMOST_SCHEME | "https" |
| MATTERMOST_MESSAGE | "" |
| MATTERMOST_TITLE | "" |
| MATTERMOST_CHANNELS | "" |
## Slack
Slack uses token to authenticate and send messages to defined channels.
Multiple channel ids can be used separated by comma ','.
```bash
pingme slack --token '123' --channel '1234567890' --message 'some message'
```
- Github Action
```yaml
on:
release:
types: [published]
jobs:
pingme-job:
runs-on: ubuntu-latest
name: PingMe
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Ping me On
uses: kha7iq/pingme-action@v1
env:
PUSHOVER_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNELS: ${{ secrets.SLACK_CHANNELS }}
SLACK_MSG_TITLE: 'Refrence: ${{ github.ref }}'
SLACK_MESSAGE: 'Event is triggerd by ${{ github.event_name }}'
with:
# Chose the messaging platform.
# slack / telegram / rocketchat / teams / pushover / discord / email
service: slack
```
- **Variables**
| Variables | Default Value |
| -------------------------- | :----------------: |
| SLACK_TOKEN | "" |
| SLACK_CHANNELS | "" |
| SLACK_MESSAGE | "" |
## Discord
Discord uses bot token to authenticate & send messages to defined channels.
Multiple channel ids can be used separated by comma ','.
```bash
pingme discord --token '123' --channel '1234567890' --message 'some message'
```
- Github Action
```yaml
on:
release:
types: [published]
jobs:
pingme-job:
runs-on: ubuntu-latest
name: PingMe
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Ping me On
uses: kha7iq/pingme-action@v1
env:
DISCORD_CHANNELS: ${{ secrets.DISCORD_CHANNELS }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DISCORD_TITLE: 'Refrence: ${{ github.ref }}'
DISCORD_MESSAGE: 'Event is triggerd by ${{ github.event_name }}'
with:
# Chose the messaging platform.
# slack / telegram / rocketchat / teams / pushover / discord / email / mattermost
service: discord
```
- **Variables**
| Variables | Default Value |
| -------------------------- | :----------------: |
| DISCORD_TOKEN | "" |
| DISCORD_CHANNELS | "" |
| DISCORD_MESSAGE | "" |
| DISCORD_MSG_TITLE | "" |
## Microsoft Teams
Teams uses webhooks to send messages, you can add multiple webhooks separated by comma ',' or
you can add permissions for multiple channels to single webhook.
```bash
pingme teams --webhook 'https://example.webhook.office.com/xx' --message 'some message'
```
- Github Action
```yaml
on: [push]
jobs:
pingme-job:
runs-on: ubuntu-latest
name: PingMe
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Ping me On
uses: kha7iq/pingme-action@v1
env:
TEAMS_WEBHOOK: ${{ secrets.TEAMS_WEBHOOK }}
TELEGRAM_CHANNELS: ${{ secrets.TELEGRAM_CHANNELS }}
TEAMS_MSG_TITLE: 'Refrence: ${{ github.ref }}'
TEAMS_MESSAGE: 'Event is triggerd by ${{ github.event_name }}'
with:
# Chose the messaging platform.
# slack / telegram / rocketchat / teams / pushover / discord / email / mattermost
service: teams
```
- **Variables**
| Variables | Default Value |
| -------------------------- | :----------------: |
| TEAMS_WEBHOOK | "" |
| TEAMS_MESSAGE | "" |
| TEAMS_MSG_TITLE | "" |
## Email
Email uses username & password to authenticate for sending emails.
SMTP hostname i.e smtp.gmail.com and port i.e (587) should be provided as well for the server.
Multiple email ids can be used separated by comma ',' as receiver email address.
All configuration options are also available via environment variables check configuration section.
```bash
pingme email --rec "example@gmail.com,example@outlook.com" --msg "This is an email from PingMe CLI" --sub "Email from PingMe CLI" \
--sender "sender@gmail.com" --host "smtp.gmail.com" --port "587" --pass "secretPassword"
```
- **Variables**
| Variables | Default Value |
| -------------------------- | :----------------: |
| EMAIL_SENDER | "" |
| EMAIL_PASSWORD | "" |
| EMAIL_RECEIVER | "" |
| EMAIL_IDENTITY | "" |
| EMAIL_HOST | "smtp.gmail.com" |
| EMAIL_PORT | "587" |
| EMAIL_MESSAGE | "" |
| EMAIL_SUBJECT | "" |
Loading…
Cancel
Save