Skip to content

bilyboy785/nixstatswh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Nixstats Webhook

Nixstats Webhook Docker based on Alpine 3.17 & PHP 8.1

Maintenance Docker Pulls Docker Image Size Github last-commit Build & Push

Description

This Webhook wrote in PHP allow telegram notifications when Nixstats monitor's status changes.

  • Customize servers and domains notifications in the functions.php file
  • Check the downtime intervall when the domain's close notification is sent
  • Enable or disable the Bitly API function to minimize URLs

Monitor Notification

Monitor Notification

Server Notification

Server Notification

Prepatation

  • First, you need to start a conversation with @BotFather and create a BOT in Telegram, choose a Name, a Nickname and get your Bot Token :

Create Bot Token

  • Start a conversation now with @MyIdBot to get your Telegram User ID :

Get your Chat User ID

Docker Image Utilization

  • Now you can pull image
docker pull martinbouillaud/nixstatswh:latest

Define environnement variables

  • HTTP_SERVER_NAME (a server name, defaults to www.example.com)
  • LOG_LEVEL (a log level, defaults to info)
  • TZ (a timezone, defaults to UTC)
  • PHP_MEMORY_LIMIT (a memory-limit, defaults to 256M)
  • PHP_UPLOAD_MAX_FILESIZE (a upload_max_filesize, defaults to 8M)
  • PHP_POST_MAX_SIZE (a post_max_size, defaults to 8M)
  • TELEGRAM_BOT_TOKEN (Your Telegram Bot Token)
  • TELEGRAM_CHATID(Your Telegram Chat ID)

Build

Replace nixstatswh and tags with whatever you want when building your own image.

docker build -t nixstatswh:latest .

Run

docker run -d --name nixstatswh -e TELEGRAM_BOT_TOKEN=XXXX -e TELEGRAM_CHATID=XXXX -p 80:80 martinbouillaud/nixstatswh:latest

Customized run

docker run -d \
    --name nixstatswh \
    -e HTTP_SERVER_NAME="www.example.xyz" \
    -e TZ="Europe/Paris" \
    -e PHP_MEMORY_LIMIT="512M" \
    -e TELEGRAM_BOT_TOKEN="XXXX" \
    -e TELEGRAM_CHATID="XXXX" \
    --publish 80:80 \
    --restart unless-stopped \
    martinbouillaud/nixstatswh:latest

Docker-compose Stack

version: "3.3"
nixstatswh:
    container_name: nixstatswh
    image: martinbouillaud/nixstatswh:latest
    ports:
        - "8080:80"
    environment:
        - HTTP_SERVER_NAME=nixstatswh.example.com
        - TZ=Europe/Paris
        - PHP_MEMORY_LIMIT=256M
        - TELEGRAM_BOT_TOKEN=XXXXXX
        - TELEGRAM_CHATID=XXXXXX

Thank's to