Skip to content
Snippets Groups Projects
README.md 14.8 KiB
Newer Older
[![docker-Curseforge-Bot](https://i.griefed.de/images/2021/01/21/docker-Curseforge-Bot_header.png)](https://github.com/Griefed/docker-Curseforge-Bot)
Griefed's avatar
Griefed committed

[![Homepage](https://img.shields.io/badge/Griefed.de-Homepage-c0ffee?style=for-the-badge&labelColor=325358&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAACylBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v6OsnIvAAAA7XRSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiQlJicoKSorLC0uLzAxMjU2Nzg5Ojs8Pj9AQUJERUZHSElLTE9QUVJTVFVWV1hZXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gIGCg4SGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6Cio6WmqK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f3KqN49yCTyAkg7kVLNvgHh72YViAd9Z81JMLcakAp+bkFM+RbCsMxLn1Wnism1Hjh/YsSp2ZMtqjIjq7LW+9SWnqrzODjCQijFGPxiC71Ynp/RJrZnjehzZ+Q9fNggLmTcf8AAAAABJRU5ErkJggg==)](https://www.griefed.de)
[![Blog](https://img.shields.io/badge/Griefed.de-Blog-c0ffee?style=for-the-badge&labelColor=325358&logo=wordpress)](https://www.griefed.de/blog)
[![Fleet](https://img.shields.io/badge/Griefed.de-Fleet-c0ffee?style=for-the-badge&labelColor=325358&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAABiVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8XJWL///8gNCTuAAAAgXRSTlMAAgMEBQYHCAkLDA4PEBESFhgZGh0eISIlKC8zNDU3OT0+P0BBQkhKS01QU1RVVltcXWJjZGlrbG1wcnN0eHl6e4CBhYyOkJWWmZ6foaKkqaqsrrKztLe8vsHExcbHy8zNz9DT1NXX2Nna293e3+Tm5+nq7O3u7/Hy9fb4+fr7/f4zgtRAAAABWklEQVR42mKgHhCFMbg0dHW1xNGlBcw5wTS7tkcJoNV5UJItBoMA3GPjcm3btm3btq1+8s1JxijuV0p+X5NzVcfNRoT4O26ClEZykdydI5ddCHDt+EfqthiwYoXfRH++yb9r8IZ+o/CpeB1hE/zMtXf0KYKkP9p8ZSaCfq1S2ddDU84zrsuXYXZjYy0VcBxQKYVmgQ9slS8HhUbxSP+kNAPB+kIyO1ggr5mn9GoX70wKydA4/RNQQSVPvGspZEHQ5ZKHK5lu8UymUi/enRQuxYjcN5LPH+RTQfcVlQ4AbfJ1n4JKRusG0ErpzCn3vjFMe8g9/eUU2himHEAilc+Vq6XJ4Zyx6eXTk3f6/IOww7i2oOliXNXQ/H5kHBcWSO2MowyKJc4VU/BLOGcMm04EJF3FyHsQImkvMj/tQBhrz0to+rwSUf70XvjT23VWxKLLaBkYGuqr+Y8f9Q3q0fzzGED8cgAAAABJRU5ErkJggg==)](https://fleet.griefed.de)
[![GitHub](https://img.shields.io/badge/Griefed.de-Github-c0ffee?style=for-the-badge&labelColor=325358&logo=github)](https://github.com/Griefed)
[![DockerHub](https://img.shields.io/badge/Griefed.de-DockerHub-c0ffee?style=for-the-badge&labelColor=325358&logo=docker&logoColor=white)](https://hub.docker.com/u/griefed)
[![Discord](https://img.shields.io/badge/Griefed.de-Discord-c0ffee?style=for-the-badge&labelColor=325358&logo=discord&logoColor=white)](https://discord.griefed.de)
Griefed's avatar
Griefed committed

---

# docker-Curseforge-Bot

[![Docker Pulls](https://img.shields.io/docker/pulls/griefed/curseforge-bot?style=for-the-badge&logo=Docker&labelColor=325358&color=c0ffee&logoColor=white)](https://hub.docker.com/repository/docker/griefed/curseforge-bot)
[![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/griefed/curseforge-bot?label=Image%20size&sort=date&style=for-the-badge&logo=Docker&labelColor=325358&color=c0ffee&logoColor=white)](https://hub.docker.com/repository/docker/griefed/curseforge-bot)
[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/griefed/curseforge-bot?label=Docker%20build&style=for-the-badge&logo=Docker&labelColor=325358&color=c0ffee&logoColor=white)](https://hub.docker.com/repository/docker/griefed/curseforge-bot)
[![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/griefed/curseforge-bot?label=Docker%20build&style=for-the-badge&logo=Docker&labelColor=325358&color=c0ffee&logoColor=white)](https://hub.docker.com/repository/docker/griefed/curseforge-bot)
[![GitHub Repo stars](https://img.shields.io/github/stars/Griefed/docker-Curseforge-Bot?label=GitHub%20Stars&style=for-the-badge&logo=Github&labelColor=325358&color=c0ffee)](https://github.com/Griefed/docker-Curseforge-Bot)
[![GitHub forks](https://img.shields.io/github/forks/Griefed/docker-Curseforge-Bot?label=GitHub%20Forks&style=for-the-badge&logo=Github&labelColor=325358&color=c0ffee)](https://github.com/Griefed/docker-Curseforge-Bot)

Griefed's avatar
Griefed committed
A discord bot, which informs users about new files of specific mods or Curseforge projects in general.
Griefed's avatar
Griefed committed

[![Curseforge-Bot](https://i.griefed.de/images/2021/01/21/docker-Curseforge-Bot_screenshot.png)](https://github.com/ErdbeerbaerLP/Curseforge-Bot)
[![Curseforge-Bot](https://i.griefed.de/images/2021/01/22/docker-Curseforge-Bot_screenshot2.png)](https://github.com/ErdbeerbaerLP/Curseforge-Bot)
Griefed's avatar
Griefed committed

---

Creates a Container which runs [ErdbeerbaerLP's](https://github.com/ErdbeerbaerLP) [Curseforge-Bot](https://github.com/ErdbeerbaerLP/Curseforge-Bot), with [lsiobase/alpine](https://hub.docker.com/r/lsiobase/alpine) as the base image, as seen on https://github.com/ErdbeerbaerLP/Curseforge-Bot.

The [lsiobase/alpine](https://hub.docker.com/r/lsiobase/alpine) image is a custom base image built with [Alpine linux](https://alpinelinux.org/) and [S6 overlay](https://github.com/just-containers/s6-overlay).
Using this image allows us to use the same user/group ids in the container as on the host, making file transfers much easier

# Deployment

Tags | Description
-----|------------
`latest` | Using the `latest` tag will pull the latest image for linux/amd64,linux/arm/v7,linux/arm64.
`develop` | The latest image of, if existent, the in-dev version of this container. Use at your own risk!

Using GitHub Workflows, images for this container are multi-arch. Simply pulling `:latest` should retrieve the correct image for your architecture.
Images are available for linux/amd64,linux/arm/v7,linux/arm64.
Griefed's avatar
Griefed committed

## Pre-built images `latest`
Griefed's avatar
Griefed committed

Griefed's avatar
Griefed committed
```docker-compose.yml
Griefed's avatar
Griefed committed
services:
  curseforge-bot:
Griefed's avatar
Griefed committed
    container_name: curseforge-bot
    restart: unless-stopped
    environment:
      - TZ=Europe/Berlin # Timezone
      - ROLE_ID=000000000 # (Optional) The ID of the discord role mentioned when the bot makes a post
      - PUID=1000 # User ID
      - PROJECT_ID=430517 # The ID of your Curseforge project
      - PGID=1000 # Group ID
Griefed's avatar
Griefed committed
      - GITHUB_TOKEN= # (Optional) Required if you want the cache of the bot to be synched to a github repository. Create an github access token with full 
      - GITHUB_REPO=CurseforgeBotCache # (Optional) If using GITHUB_TOKEN this will be the name of the repo where the bot will store the cache
      - FILE_LINK=curse # direct-link to file or curseforge-link on project page or nolink.
      - DISCORD_CHANNEL_ID=000000000 # The ID of the channel you want the bot to post in
      - DISCORD_BOT_TOKEN=InsertHere # Your discord bot-token
      - DESCRIPTION=New File(s) Detected For CurseForge Project(s) # This sets the text that appears as the message description in the update notification
      - CHANGELOG_FORMAT=md # yml or md or css. Only choose one syntax. Can be very usefull if project owner/author uses discord MarkDown formatting in their changelog.
    volumes:
      - /host/path/to/config:/config # Where the bot-conf will be stored
```

Using CLI:

```bash
docker create \
  --name=curseforge-bot \
  -e TZ=Europe/Berlin `# Timezone` \
  -e ROLE_ID=000000000 `# (Optional) The ID of the discord role mentioned when the bot makes a post` \
  -e PUID=1000 `# User ID` \
  -e PROJECT_ID=430517 `# The ID of your Curseforge project` \
  -e PGID=1000 `# Group ID` \
Griefed's avatar
Griefed committed
  -e GITHUB_TOKEN=Your_GitHub_Token `# (Optional) Required if you want the cache of the bot to be synced to a github repository. Create an github access token with full ` \
  -e GITHUB_REPO=CurseforgeBotCache `# (Optional) If using GITHUB_TOKEN this will be the name of the repo where the bot will store the cache` \
  -e FILE_LINK=curse `# direct-link to file or curseforge-link on project page or nolink.` \
  -e DISCORD_CHANNEL_ID=000000000 `# The ID of the channel you want the bot to post in` \
  -e DISCORD_BOT_TOKEN=InsertHere `# Your discord bot-token` \
  -e DESCRIPTION=New File(s) Detected For CurseForge Project(s) `# This sets the text that appears as the message description in the update notification` \
Griefed's avatar
Griefed committed
  -e CHANGELOG_FORMAT=md `# yml or md or css. Only choose one syntax. Can be very useful if project owner/author uses discord MarkDown formatting in their changelog.` \
  -v /host/path/to/config:/config `# Where the bot-conf will be stored` \
  --restart unless-stopped \
  griefed/curseforge-bot:latest
```

Griefed's avatar
Griefed committed
# Configuration

Configuration | Explanation
------------ | -------------
[Restart policy](https://docs.docker.com/compose/compose-file/#restart) | "no", always, on-failure, unless-stopped
config volume | Contains config files and logs.
TZ | Timezone
PUID | for UserID
PGID | for GroupID
Griefed's avatar
Griefed committed
DISCORD_BOT_TOKEN | Your discord bot-token
DISCORD_CHANNEL_ID | The ID of the channel you want the bot to post in. When using `ijo42-latest` this Channel ID must the be one from your webhook URL.
Griefed's avatar
Griefed committed
PROJECT_ID | The ID of your Curseforge project
ROLE_ID | (Optional) The ID of the discord role mentioned when the bot makes a post
Griefed's avatar
Griefed committed
FILE_LINK | `direct`-link to file or `curse`forge-link on project page or `nolink`.
Griefed's avatar
Griefed committed
DESCRIPTION | This sets the text that appears as the message description in the update notification
CHANGELOG_FORMAT | `yml` or `md` or `css`. Only choose one syntax. Can be very usefull if project owner/author uses discord MarkDown formatting in their changelog.
GITHUB_TOKEN | (Optional) Required if you want the cache of the bot to be synched to a github repository. Create an github access token with full "Repo" access (https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)
GITHUB_REPO | (Optional) If using GITHUB_TOKEN this will be the name of the repo where the bot will store the cache
Griefed's avatar
Griefed committed

More information at [the Curseforge-Bot wiki](https://github.com/ErdbeerbaerLP/Curseforge-Bot/wiki).
Griefed's avatar
Griefed committed

## Adding more projects to track for `latest`and `arm`

If you have multiple projects in Curseforge which you want to track with this bot, you need to manually edit the bot.conf file which is created after container creation. Here's an example for multiple project IDs and how it's formatted:
```
ids = [
    "430517",
    "438915",
    "378473",
    "378719"
]
```
Every new project ID need to be in "" followed by a `,` if an additional ID follows. Last ID must not have a `,` at the end.

Griefed's avatar
Griefed committed
## User / Group Identifiers

When using volumes, permissions issues can arise between the host OS and the container. [Linuxserver.io](https://www.linuxserver.io/) avoids this issue by allowing you to specify the user `PUID` and group `PGID`.

Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.

In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below:

```
  $ id username
    uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)
```

# Building the image yourself

Use the [Dockerfile](https://github.com/Griefed/docker-Curseforge-Bot/Dockerfile) to build the image yourself, in case you want to make any changes to it

docker-compose.yml:

```docker-compose.yml
Griefed's avatar
Griefed committed
version: '2'
Griefed's avatar
Griefed committed
services:
Griefed's avatar
Griefed committed
  curseforge-bot:
Griefed's avatar
Griefed committed
    container_name: curseforge-bot
Griefed's avatar
Griefed committed
    build: ./docker-Curseforge-Bot
Griefed's avatar
Griefed committed
    restart: unless-stopped
    volumes:
Griefed's avatar
Griefed committed
      - ./path/to/config:/config
Griefed's avatar
Griefed committed
    environment:
      - TZ=Europe/Berlin
      - PUID=1000  # User ID
      - PGID=1000  # Group ID
Griefed's avatar
Griefed committed
      - DISCORD_BOT_TOKEN=
      - DISCORD_CHANNEL_ID=
      - PROJECT_ID=
      - ROLE_ID=
      - FILE_LINK=
      - DESCRIPTION=
      - CHANGELOG_FORMAT=
      - GITHUB_TOKEN=
      - GITHUB_REPO=
Griefed's avatar
Griefed committed
```

1. Clone the repository: `git clone https://github.com/Griefed/docker-Curseforge-Bot.git ./docker-Curseforge-Bot`
1. Prepare docker-compose.yml file as seen above
1. `docker-compose up -d --build curseforge-bot`
1. ???
Griefed's avatar
Griefed committed
1. Profit!