From 2741cb00179fb037a71ae0309f2ecd65c251da97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nard=20Th=C3=A9o?= <58373303+PandeoF1@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:34:13 +0200 Subject: [PATCH 1/3] fix: Add environment variables and volumes --- README.md | 11 ++++++----- docker-compose.yml | 10 ++++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 03c89fe..4d2e557 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ 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](#docker) + - [Installation](#installation) - [Docker Compose](#docker-compose) - [Docker Run](#docker-run) @@ -179,7 +179,8 @@ 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) +Copy the `config.yml` file at the same directory as the `docker-compose.yml` file and configure it +Fill the environment variables in the `docker-compose.yml` file and run the bot using `docker compose up -d` ```bash docker compose up -d @@ -189,7 +190,7 @@ 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 run -d --name pterostats -e PanelURL= -e PanelKEY= -e DiscordBotToken= -e DiscordChannel= -v $(pwd)/config.yml:/app/config.yml ghcr.io/hirzidevs/pterostats:latest docker logs -f pterostats ``` @@ -199,4 +200,4 @@ Enable `log_error` in the `config.yml` file and check the console for the error ## Links - [Pterodactyl Discord Server](https://discord.gg/pterodactyl) - [Pelican Discord Server](https://discord.gg/pelican-panel) -- [Support Server](https://discord.znproject.my.id) \ No newline at end of file +- [Support Server](https://discord.znproject.my.id) diff --git a/docker-compose.yml b/docker-compose.yml index 99a83ae..d0176f4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,13 @@ version: '3.3' services: pterostats: - volumes: - - ./config.yml:/app/config.yml container_name: pterostats image: ghcr.io/hirzidevs/pterostats:latest + restart: always + volumes: + - ./config.yml:/app/config.yml + environment: + - PanelURL= + - PanelKEY= + - DiscordBotToken= + - DiscordChannel= From ab65824d11c8ef45c8f3c82c1d988a6f03fb4ba9 Mon Sep 17 00:00:00 2001 From: Nard Theo Date: Tue, 17 Sep 2024 09:09:14 +0200 Subject: [PATCH 2/3] HARD reset README before change --- README.md | 176 ++++-------------------------------------------------- 1 file changed, 12 insertions(+), 164 deletions(-) diff --git a/README.md b/README.md index 4d2e557..1c4dd79 100644 --- a/README.md +++ b/README.md @@ -14,186 +14,34 @@ PteroStats is a Discord App/Bot designed to check Pterodactyl or Pelican Panel s PteroStats Console Preview -PteroStats GIF Preview - ## Guide - [Starting the App/Bot](#starting-the-appbot) -- [Changing Env Configuration](#changing-env-configuration) -- [Getting an Panel API key](#getting-panel-api-key) -- [Getting a Channel ID](#getting-channel-id) -- [Using Custom Emoji](#using-custom-emoji) -- [Blacklist Nodes](#blacklist-nodes) -- [Notifier](#notifier) -- [Docker](#docker) - - [Installation](#installation) - - [Docker Compose](#docker-compose) - - [Docker Run](#docker-run) +- [Changing Env Configuration](https://github.com/HirziDevs/PteroStats/blob/main/guide/changing-env-configuration.md) +- [Getting an Panel API key](https://github.com/HirziDevs/PteroStats/blob/main/guide/getting-panel-api-key.md) +- [Getting a Channel ID](https://github.com/HirziDevs/PteroStats/blob/main/guide/getting-channel-id.md) +- [Using Custom Emoji](https://github.com/HirziDevs/PteroStats/blob/main/guide/using-custom-emoji.md) +- [Blacklist Nodes](https://github.com/HirziDevs/PteroStats/blob/main/guide/blacklist-specific-nodes.md) +- [Notifier](https://github.com/HirziDevs/PteroStats/blob/main/guide/notifier.md) +- [Docker](https://github.com/HirziDevs/PteroStats/blob/main/guide/docker.md) ### Starting the App/Bot 1. [Create your Discord App/Bot](https://discordjs.guide/preparations/adding-your-bot-to-servers.html). 2. [Invite your Discord App/Bot to your Discord server](https://discordjs.guide/preparations/adding-your-bot-to-servers.html). 3. Download this repository: - - [Download this repository](https://github.com/HirziDevs/PteroStats/archive/refs/heads/main.zip) and extract it. + - Manually: [Download this repository](https://github.com/HirziDevs/PteroStats/archive/refs/heads/main.zip) and extract it. - Using Git: Run `git clone https://github.com/HirziDevs/PteroStats.git` in the command line. 4. Run `npm install` in the root directory of the app/bot files. -5. Run `node index` and answer the prompted questions to set up the app/bot. +5. Run `node index.js` and answer the prompted questions to set up the app/bot. Setup - - [Getting Panel API Key](#getting-panel-api-key) - - [Getting a Channel ID](#getting-channel-id) + - [Getting an Panel API key](https://github.com/HirziDevs/PteroStats/blob/main/guide/getting-panel-api-key.md) + - [Getting a Channel ID](https://github.com/HirziDevs/PteroStats/blob/main/guide/getting-channel-id.md) -6. Run `node index` if you want to start the app/bot again, and you're done! +6. Run `node index.js` if you want to start the app/bot again, and you're done! Console Logging -### Changing Env Configuration -> [!TIP] -> You can change other configuration at the `config.yml` file. - -1. Run `node setup` in the root directory of the app/bot files. -2. Enter `2` to change configuration. - - Change Configuration - -3. Answer the provided question to set up the app/bot. -4. Run `node index` if you want to start the app/bot again, and you're done! - -### Getting Panel API Key -> [!WARNING] -> The use of Application API keys is **deprecated**; you should use **Client API keys**. - -> [!TIP] -> Make sure the owner of the Client API key has access to the administrator panel. - -1. Go to your `Pterodactyl` or `Pelican` Panel and navigate to the `Account Page`. - - Home - -2. Click on the `API Credentials` button. - - Account Page - -3. Fill in the `Description` and click the `Create` button. - - Create Client API Key - -4. Copy the API key. - - API Key - -### Getting Channel ID -1. Enable Developer Mode in your Discord settings. - - Discord User Settings - -2. Right-click the text channel and select `Copy ID`. - - Right Click Channel - -### Using Custom Emoji -1. Type `\` in the server that has the custom emoji you want. - - Type \ on the chat - -2. Select the custom emoji you want. - - Select Custom Emoji - -3. Copy the text! - - Copy Emoji ID - -4. Paste the emoji ID into the config. - - Status Config - -### Blacklist Nodes -1. Select a node from the node list on the admin page. - - Pterodactyl Nodes List - - Pelican Nodes List - -2. Check the URL and copy the node ID. - - Pterodactyl Node ID - - Pelican Node ID - -3. Paste the ID into the blacklist in the config. - - Blacklist Config - -> [!TIP] -> You can add more than one node to the blacklist. - -Blacklist Config - -## Links -======= -### Notifier -Get a notification on Discord when your panel or specific nodes are currently down. - -Notifier Preview - - -#### Enabling Notifier -Open `config.yml` and set `enable` at the notifier configuration to `true` - -Notifier Config - -#### Getting Discord Webhook URL -1. Go to the channel settings of the channel you want to set for the notifier. - - Notifier Config - -2. Go to integrations and select `View Webhooks` or `Create Webhook`. - - Notifier Config - -3. Create a new webhook and copy the Webhook URL - - Notifier Config - -4. Paste the Webhook URL on the webhook notifier configuration. - - Notifier Config - - -> [!TIP] -> You can change the webhook icon and username on the webhook settings. - -Notifier Config - -## 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 -Fill the environment variables in the `docker-compose.yml` file and run the bot using `docker compose up -d` - -```bash -docker compose up -d -docker compose logs -f pterostats -``` - -### Docker Run - -```bash -docker run -d --name pterostats -e PanelURL= -e PanelKEY= -e DiscordBotToken= -e DiscordChannel= -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). From 28194fe900984caf9149f8297f2297d7dae8fa82 Mon Sep 17 00:00:00 2001 From: Nard Theo Date: Tue, 17 Sep 2024 09:16:58 +0200 Subject: [PATCH 3/3] Fix docker doc using new docs --- guide/docker.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/guide/docker.md b/guide/docker.md index 15a65cd..cc7e0c5 100644 --- a/guide/docker.md +++ b/guide/docker.md @@ -1,6 +1,6 @@ ## Docker -This is a guide to run the bot using docker (alternative way to run the bot). +This is a guide to run the bot using docker (alternative way to run the bot) ### Installation @@ -11,16 +11,20 @@ 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 [Starting the App/Bot](https://github.com/HirziDevs/PteroStats#starting-the-appbot) section) +- Copy the `config.yml` file at the same directory as the `docker-compose.yml` file and configure it +- Fill the environment variables in the `docker-compose.yml` file and run the bot using `docker compose up -d` - ```bash - docker compose up -d - docker compose logs -f pterostats - ``` +```bash +docker compose up -d +docker compose logs -f pterostats +``` ### Docker Run +- Replace the ``, ``, ``, and `` with your own values in the command below +- Copy the `config.yml` file at the same directory where you run the command and configure it + ```bash -docker run -d --name pterostats -v $(pwd)/config.yml:/app/config.yml ghcr.io/hirzidevs/pterostats:latest +docker run -d --name pterostats -e PanelURL= -e PanelKEY= -e DiscordBotToken= -e DiscordChannel= -v $(pwd)/config.yml:/app/config.yml ghcr.io/hirzidevs/pterostats:latest docker logs -f pterostats -``` \ No newline at end of file +```