原神自动签到(Linux服务器Docker)
本文最后更新于 833 天前,其中的信息可能已经有所发展或是发生改变。

引言

由于腾讯云函数从六月开始收费,于是便弃用改在自己的服务器上搭建

既然六月收费为什么现在才写文章呢?因为可能还有三个月的免费试用我米游社的Cookie过期更换,故记录

工具&原教程

原神签到小助手 每日福利不用愁 – 银弹博客

由于原文介绍了多种使用方法,自己的阅读体验不是太好,故写此文

腾讯云函数处理

请将腾讯云函数冻结已确保不会收取费用

当然,如果没什么其他需求可直接注销账号,但注销账号需要手持身份证照片,请注意

前提

服务器可以连接上米忽悠的服务器https://mihoyo.com

可在SSH命令行窗口输入ping mihoyo.com测试是否可以连接

我的一个服务器就连接不上,只好换一个,唉

Docker安装

可以直接使用一键脚本进行安装,实测Debian10和CentOS7正常安装(请使用root账户)

安装命令如下:

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

也可以使用国内 daocloud 一键安装命令:

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

脚本安装

使用以下命令即可

 docker pull yindan/genshinhelper

CentOS错误

我使用CentOS安装时出现错误Can't Connect to Docker Daemon

请确保使用root账户,然后输入以下命令

 systemctl start docker

简易使用

Cookie获取

获取米游社Cookie请参考:原神树脂查看/推送 – yexca|Hiyoung’Blog

注意:Cookie 应包含account_idcookie_token两个字段

多账号在不同Cookie中间加#即可,例如Cookie1#Cookie2#Cookie3

简易配置

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

将自己的Cookie替换上述命令的<COOKIE_MIHOYOBBS>即可

重新配置/更新Cookie

重新配置好像需要卸载再重装,然后再进行配置

或者使用配置文件只需替换Cookie就可以了吧(没用过,Cookie有效期很长的)

常用命令

 # 查看Docker所有的容器
 docker ps -a
 ​
 # 查看日志
 docker logs -f genshinhelper --tail 100
 ​
 # 重启
 docker restart genshinhelper
 ​
 # 更新
 docker pull yindan/genshinhelper
 docker rm -f genshinhelper
 # 之后依据基本使用或高级使用重新部署
 ​
 # 卸载
 docker rm -f genshinhelper
 docker image rm genshinhelper

配置文件

示例配置文件

可下载示例文件修改

安装

假设配置文件位于服务器的 /etc/genshin/config.json,使用以下命令已映射配置

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

配置

配置文件可以只留下需要的参数,把非必须的参数删除,例如只需要Cookie

则配置文件除了保持完整也可以写成:

 {
   "COOKIE_MIHOYOBBS": "<COOKIE_MIHOYOBBS>",
 }

配置文件新增

RANDOM_SLEEP_SECS_RANGE:随机延迟休眠秒数范围,单位:秒。设置成”0-0″为取消延迟。 CHECK_IN_TIME:每日签到时间。该时间和运行环境的时间有关,和时区无关。如果是docker,可以用TZ=Asia/Shanghai设置时区。 CHECK_RESIN_SECS:原神原粹树脂检测间隔时间,单位:秒。 COOKIE_RESIN_TIMER:需要开启原粹树脂检测账号的cookie。 SHOPTOKEN:微信积分商城的token,通过抓包获取。 ONEPUSH:推送配置。notifier为推送名字,params为所需参数。详见后文。

OnePush推送参数一览

推送名称 / notifier: bark 参数大全 / params: {‘required’: [‘key’], ‘optional’: [‘title’, ‘content’, ‘sound’, ‘isarchive’, ‘icon’, ‘group’, ‘url’, ‘copy’, ‘autocopy’]}

推送名称 / notifier: custom 参数大全 / params: {‘required’: [‘url’], ‘optional’: [‘method’, ‘datatype’, ‘data’]}

推送名称 / notifier: dingtalk 参数大全 / params: {‘required’: [‘token’], ‘optional’: [‘title’, ‘content’, ‘secret’, ‘markdown’]}

推送名称 / notifier: discord 参数大全 / params: {‘required’: [‘webhook’], ‘optional’: [‘title’, ‘content’, ‘username’, ‘avatar_url’, ‘color’]}

推送名称 / notifier: pushplus 参数大全 / params: {‘required’: [‘token’, ‘content’], ‘optional’: [‘title’, ‘topic’, ‘markdown’]}

推送名称 / notifier: qmsg 参数大全 / params: {‘required’: [‘key’], ‘optional’: [‘title’, ‘content’, ‘mode’, ‘qq’]}

推送名称 / notifier: serverchan 参数大全 / params: {‘required’: [‘sckey’, ‘title’], ‘optional’: [‘content’]}

推送名称 / notifier: serverchanturbo 参数大全 / params: {‘required’: [‘sctkey’, ‘title’], ‘optional’: [‘content’, ‘channel’, ‘openid’]}

推送名称 / notifier: telegram 参数大全 / params: {‘required’: [‘token’, ‘userid’], ‘optional’: [‘title’, ‘content’, ‘api_url’]}

推送名称 / notifier: wechatworkapp 参数大全 / params: {‘required’: [‘corpid’, ‘corpsecret’, ‘agentid’], ‘optional’: [‘title’, ‘content’, ‘touser’, ‘markdown’]}

推送名称 / notifier: wechatworkbot 参数大全 / params: {‘required’: [‘key’], ‘optional’: [‘title’, ‘content’, ‘markdown’]}

例子 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 配置文件映射目录为:/etc/genshin:/app/genshincheckinhelper/config

所有变量

Variable NameRequiredDefaultDescription
LANGUAGEen项目语言。目前支持中文(zh)和英文(en)。
MAX_SLEEP_SECS300最大休眠秒数。自v1.5.0添加了运行前随机延迟,设置此参数可自定义延迟,秒数应该>10
RUN_ENVprod运行环境。设置为任意非默认值即可跳过随机延迟。
COOKIE_MIHOYOBBSCookie from miHoYo bbs. https://bbs.mihoyo.com/ys/
COOKIE_BH3和 COOKIE_MIHOYOBBS 一样
COOKIE_MIYOUBICookie from miHoYo bbs. https://bbs.mihoyo.com/ys/
COOKIE_HOYOLABCookie from HoYoLAB community. https://webstatic-sea.mihoyo.com/ys/event/signin-sea/index.html?act_id=e202102251931481&lang=en-us
COOKIE_WEIBOParameters from Sina Weibo intl. app. aid=xxx; gsid=xxx; s=xxx; from=xxx
COOKIE_KACookie from https://m.weibo.cn
BARK_KEYiOS Bark app’s IP or device code. For example: https://api.day.app/xxxxxx
BARK_SOUNDhealthnotificationiOS Bark app’s notification sound. Default: healthnotification
COOL_PUSH_SKEYSKEY for Cool Push. https://cp.xuthus.cc/
COOL_PUSH_MODEsendPush method for Cool Push. Choose from send(私聊),group(群组),wx(微信). Default: send
CRON_SIGNIN0 6 *Docker custom runtime
CUSTOM_NOTIFIERCustom notifier configuration
DD_BOT_TOKEN钉钉机器人WebHook地址中access_token后的字段.
DD_BOT_SECRET钉钉加签密钥.在机器人安全设置页面,加签一栏下面显示的以SEC开头的字符串.
DISCORD_WEBHOOKWebhook of Discord.
IGOT_KEYKEY for iGot. For example: https://push.hellyw.com/xxxxxx
PUSH_PLUS_TOKEN一对一推送pushplus 一对一推送或一对多推送的token.不配置push_plus_user则默认为一对一推送. https://www.pushplus.plus/doc/
PUSH_PLUS_USERpushplus 一对多推送的群组编码.在’一对多推送’->’您的群组'(如无则新建)->’群组编码’里查看,如果是创建群组人,也需点击’查看二维码’扫描绑定,否则不能接收群组消息.
SCKEYSCKEY for ServerChan. https://sc.ftqq.com/3.version/
SCTKEYSENDKEY for ServerChanTurbo. https://sct.ftqq.com/
TG_BOT_APIapi.telegram.orgTelegram robot api address. Default: api.telegram.org
TG_BOT_TOKENTelegram robot token. Generated when requesting a bot from @botfather
TG_USER_IDUser ID of the Telegram push target.
WW_ID企业微信的企业ID(corpid).在’管理后台’->’我的企业’->’企业信息’里查看. https://work.weixin.qq.com/api/doc/90000/90135/90236
WW_APP_SECRET企业微信应用的secret.在’管理后台’->’应用与小程序’->’应用’->’自建’,点进某应用里查看.
WW_APP_USERID@all企业微信应用推送对象的用户ID.在’管理后台’->’ 通讯录’,点进某用户的详情页里查看.默认: @all
WW_APP_AGENTID企业微信应用的agentid.在’管理后台’->’应用与小程序’->’应用’,点进某应用里查看.
WW_BOT_KEY企业微信机器人WebHook地址中key后的字段. https://work.weixin.qq.com/api/doc/90000/90136/91770

​参考文章

原神签到小助手 每日福利不用愁 – 银弹博客

linux – Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running? – Stack Overflow

Docker 容器使用 | 菜鸟教程

本文链接:原神自动签到(Linux服务器Docker)
本文章由 yexca 采用 知识共享署名 - 非商业性使用 - 相同方式共享 4.0 国际许可协议 进行许可,转载请注明出处。
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇