diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..7d20f3c --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +pingme.lmno.pk \ No newline at end of file diff --git a/docs/_media/logo.png b/docs/_media/logo.png new file mode 100644 index 0000000..df85f54 Binary files /dev/null and b/docs/_media/logo.png differ diff --git a/docs/_sidebar.md b/docs/_sidebar.md new file mode 100644 index 0000000..aee2dc3 --- /dev/null +++ b/docs/_sidebar.md @@ -0,0 +1,6 @@ + + +* [Home](/) +* [Installation](install.md) +* [Services & Usage](services.md) + \ No newline at end of file diff --git a/docs/home.md b/docs/home.md new file mode 100644 index 0000000..cd24cdc --- /dev/null +++ b/docs/home.md @@ -0,0 +1,77 @@ +

+
+

+

+ +

PingMe CLI

+ +

+ + Release + + Build + + GitHub issues + + License + + Go Version + + Go Dev Reference +

+ +

+ About • + Supported Services • + Demo • + Contributing • + Show Your Support • +

+ +--- + +## 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!
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. diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..cd5a827 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,36 @@ + + + + + Document + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/docs/install.md b/docs/install.md new file mode 100644 index 0000000..63a2870 --- /dev/null +++ b/docs/install.md @@ -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. diff --git a/docs/services.md b/docs/services.md new file mode 100644 index 0000000..4bf5be8 --- /dev/null +++ b/docs/services.md @@ -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 | "" | \ No newline at end of file