Genshin Impact Auto Check-in (Docker on Linux Server)

📢 This article was translated by Gemini-3-flash

Introduction

Since Tencent Cloud Functions started charging in June, I’ve moved my setup to my own server.

Why write this now? Well, my miHoYo BBS cookies expired and needed replacing, so I’m documenting the process for future reference.

Tools & Original Tutorial

Genshin Impact Helper - Yindan’s Blog

The original post covers many methods, which can be a bit cluttered. This post focuses on the specific method I use.

Tencent Cloud Function Cleanup

Make sure to freeze your Tencent Cloud Functions to avoid any unexpected charges.

If you don’t need the service anymore, you can cancel your account, but be aware that account deletion requires a photo of you holding your ID.

Prerequisites

Your server must be able to reach miHoYo’s servers: https://mihoyo.com

Run ping mihoyo.com in your SSH terminal to verify connectivity.

One of my servers couldn’t connect, so I had to switch to another one.

Docker Installation

Use the official one-click script. It’s verified to work on Debian 10 and CentOS 7 (use the root account).

Installation command:

1
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

For users in Mainland China, you can use the DaoCloud mirror:

1
curl -sSL https://get.daocloud.io/docker | sh

Script Installation

Pull the image with the following command:

1
docker pull yindan/genshinhelper

CentOS Error

I encountered a Can't Connect to Docker Daemon error on CentOS.

Ensure you are root, then run:

1
systemctl start docker

Basic Usage

To get your miHoYo Cookie, refer to: Genshin Resin Tracker/Push – yexca’Blog

Note: The Cookie must include the account_id and cookie_token fields.

For multiple accounts, separate Cookies with a #, for example: Cookie1#Cookie2#Cookie3.

Simple Configuration

1
2
3
4
docker run -d --name=genshinhelper \
-e COOKIE_MIHOYOBBS="<COOKIE_MIHOYOBBS>" \
--restart always \
yindan/genshinhelper:latest

Just replace <COOKIE_MIHOYOBBS> with your actual Cookie.

Reconfiguring/Updating Cookies

To reconfigure, you usually need to remove and redeploy the container.

Alternatively, if using a configuration file, you just need to swap the Cookie (though Cookies tend to last a long time).

Common Commands

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# View all Docker containers
docker ps -a

# View logs
docker logs -f genshinhelper --tail 100

# Restart
docker restart genshinhelper

# Update
docker pull yindan/genshinhelper
docker rm -f genshinhelper
# Then redeploy using the basic or advanced method

# Uninstall
docker rm -f genshinhelper
docker image rm yindan/genshinhelper

Advanced Usage

You can download the example file and modify it.

Installation

Assuming your config file is at /etc/genshin/config.json, use this command to map the volume:

1
2
3
4
docker run -d --name=genshinhelper \
-v /etc/genshin:/app/genshincheckinhelper/config \
--restart always \
yindan/genshinhelper:latest

Configuration

You can strip the config file down to only the parameters you need. If you only need the Cookie, it can look like this:

1
2
3
{
  "COOKIE_MIHOYOBBS": "<COOKIE_MIHOYOBBS>"
}

Config Parameters

  • RANDOM_SLEEP_SECS_RANGE: Random sleep range in seconds before check-in. Set to “0-0” to disable.
  • CHECK_IN_TIME: Daily check-in time. This depends on the environment time, not the timezone. For Docker, set the timezone using TZ=Asia/Shanghai.
  • CHECK_RESIN_SECS: Interval for checking Genshin Original Resin (in seconds).
  • COOKIE_RESIN_TIMER: Cookies for accounts that need resin tracking.
  • SHOPTOKEN: WeChat points mall token (obtained via packet capture).
  • ONEPUSH: Notification configuration. notifier is the service name, params are the required arguments.

OnePush Parameters Overview

  • bark / notifier: bark params: {'required': ['key'], 'optional': ['title', 'content', 'sound', 'isarchive', 'icon', 'group', 'url', 'copy', 'autocopy']}

  • custom / notifier: custom params: {'required': ['url'], 'optional': ['method', 'datatype', 'data']}

  • dingtalk / notifier: dingtalk params: {'required': ['token'], 'optional': ['title', 'content', 'secret', 'markdown']}

  • discord / notifier: discord params: {'required': ['webhook'], 'optional': ['title', 'content', 'username', 'avatar_url', 'color']}

  • pushplus / notifier: pushplus params: {'required': ['token', 'content'], 'optional': ['title', 'topic', 'markdown']}

  • qmsg / notifier: qmsg params: {'required': ['key'], 'optional': ['title', 'content', 'mode', 'qq']}

  • serverchan / notifier: serverchan params: {'required': ['sckey', 'title'], 'optional': ['content']}

  • serverchanturbo / notifier: serverchanturbo params: {'required': ['sctkey', 'title'], 'optional': ['content', 'channel', 'openid']}

  • telegram / notifier: telegram params: {'required': ['token', 'userid'], 'optional': ['title', 'content', 'api_url']}

  • wechatworkapp / notifier: wechatworkapp params: {'required': ['corpid', 'corpsecret', 'agentid'], 'optional': ['title', 'content', 'touser', 'markdown']}

  • wechatworkbot / notifier: wechatworkbot params: {'required': ['key'], 'optional': ['title', 'content', 'markdown']}

Push Examples

1
2
3
4
5
# Telegram
ONEPUSH={"notifier":"telegram","params":{"markdown":false,"token":"xxxx","userid":"xxx"}}

# Discord
ONEPUSH={"notifier":"discord","params":{"markdown":true,"webhook":"https://discord.com/api/webhooks/xxxxxx"}}

Docker config mapping directory: /etc/genshin:/app/genshincheckinhelper/config

This post is licensed under CC BY-NC-SA 4.0 by the author.