mirror of
https://github.com/HirziDevs/PteroStats.git
synced 2026-03-31 06:24:10 -04:00
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@@ -0,0 +1,3 @@
|
||||
config.yml
|
||||
node_modules
|
||||
package-lock.json
|
||||
61
.github/workflows/docker-publish.yml
vendored
Normal file
61
.github/workflows/docker-publish.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
name: Docker
|
||||
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
# Publish semver tags as releases.
|
||||
tags: [ 'v*.*.*' ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
env:
|
||||
# Use docker.io for Docker Hub if empty
|
||||
REGISTRY: ghcr.io
|
||||
# github.repository as <account>/<repo>
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Login against a Docker registry except on PR
|
||||
# https://github.com/docker/login-action
|
||||
- name: Log into registry ${{ env.REGISTRY }}
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Extract metadata (tags, labels) for Docker
|
||||
# https://github.com/docker/metadata-action
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
# Build and push Docker image with Buildx (don't push on PR)
|
||||
# https://github.com/docker/build-push-action
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,5 +1,7 @@
|
||||
node_modules/
|
||||
config-dev.yml
|
||||
package-lock.json
|
||||
.vscode
|
||||
node_modules
|
||||
cache.json
|
||||
.env
|
||||
.env
|
||||
|
||||
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM node:20
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . /app
|
||||
|
||||
RUN npm install
|
||||
|
||||
CMD ["node", "index.js"]
|
||||
34
README.md
34
README.md
@@ -24,6 +24,10 @@ PteroStats is a Discord App/Bot designed to check Pterodactyl or Pelican Panel s
|
||||
- [Using Custom Emoji](#using-custom-emoji)
|
||||
- [Blacklist Nodes](#blacklist-nodes)
|
||||
- [Notifier](#notifier)
|
||||
- - [Docker](#docker)
|
||||
- [Installation](#installation-1)
|
||||
- [Docker Compose](#docker-compose)
|
||||
- [Docker Run](#docker-run)
|
||||
|
||||
### Starting the App/Bot
|
||||
1. [Create your Discord App/Bot](https://discordjs.guide/preparations/adding-your-bot-to-servers.html).
|
||||
@@ -126,11 +130,14 @@ PteroStats is a Discord App/Bot designed to check Pterodactyl or Pelican Panel s
|
||||
|
||||
<img alt="Blacklist Config" src="https://usercontent.catto.pictures/hirzi/7b5d6c7f-54d9-40ea-b5a6-9192325ba2a0.png" width="400"/>
|
||||
|
||||
## Links
|
||||
=======
|
||||
### Notifier
|
||||
Get a notification on Discord when your panel or specific nodes are currently down.
|
||||
|
||||
<img alt="Notifier Preview" src="https://usercontent.catto.pictures/hirzi/a2b8e36f-7448-4849-a14a-b1eb4ec8fb26.png" width="250"/>
|
||||
|
||||
|
||||
#### Enabling Notifier
|
||||
Open `config.yml` and set `enable` at the notifier configuration to `true`
|
||||
|
||||
@@ -159,6 +166,33 @@ Open `config.yml` and set `enable` at the notifier configuration to `true`
|
||||
|
||||
<img alt="Notifier Config" src="https://usercontent.catto.pictures/hirzi/2a4f7aba-9377-4722-bf19-3b7f0cc32772.png" width="300"/>
|
||||
|
||||
## Docker
|
||||
|
||||
This is a guide to run the bot using docker (alternative way to run the bot)
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
curl -fsSL https://get.docker.com | sh
|
||||
```
|
||||
|
||||
### Docker Compose
|
||||
|
||||
Copy the `docker-compose.yml` file to your server and run `docker compose pull`
|
||||
Copy the `config.yml` file at the same directory as the `docker-compose.yml` file and configure it (refer to the [installation](#installation) section)
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
docker compose logs -f pterostats
|
||||
```
|
||||
|
||||
### Docker Run
|
||||
|
||||
```bash
|
||||
docker run -d --name pterostats -v $(pwd)/config.yml:/app/config.yml ghcr.io/hirzidevs/pterostats:latest
|
||||
docker logs -f pterostats
|
||||
```
|
||||
|
||||
## Reporting a Bug
|
||||
Enable `log_error` in the `config.yml` file and check the console for the error message. After that, report it to our Discord server at [Support Server](https://discord.znproject.my.id).
|
||||
|
||||
|
||||
7
docker-compose.yml
Normal file
7
docker-compose.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
version: '3.3'
|
||||
services:
|
||||
pterostats:
|
||||
volumes:
|
||||
- ./config.yml:/app/config.yml
|
||||
container_name: pterostats
|
||||
image: ghcr.io/hirzidevs/pterostats:latest
|
||||
Reference in New Issue
Block a user