GithubHelp home page GithubHelp logo

rikudoupatrickstar / jd-base Goto Github PK

View Code? Open in Web Editor NEW
162.0 5.0 100.0 3.91 MB

自用工具,仅针对 Linux 和 Docker,尽可能简单干净

Home Page: https://hub.docker.com/r/thisispatrick/jd-base

License: GNU General Public License v3.0

Shell 17.31% HTML 15.83% CSS 5.90% JavaScript 60.33% Dockerfile 0.62%
jd-scripts docker jd-base linux

jd-base's Introduction

一、申明

  • 本脚本的原作者为 EvineDeng。

  • 本脚本只是给 lxk0301/jd_scripts 套层壳,用来运行其中的 js 脚本。

  • 请勿将本项目用于任何商业用途!

二、如有帮助你薅到羊毛,请不吝赏杯茶水

thanks

三、快速开始

1. Linux

脚本一键部署:

运行此脚本前必须手动安装好依赖:git wget curl perl moreutils node.js npm

wget -q https://cdn.jsdelivr.net/gh/RikudouPatrickstar/jd-base/onekey-install.sh -O onekey-jd-base.sh && chmod +x onekey-jd-base.sh && ./onekey-jd-base.sh

2. Docker

脚本一键部署单个容器:

wget -q https://cdn.jsdelivr.net/gh/RikudouPatrickstar/jd-base/docker/onekey-docker.sh -O onekey-jd-docker.sh && chmod +x onekey-jd-docker.sh && ./onekey-jd-docker.sh

安装 containrrr/watchtower 可自动更新 Docker 容器,更详细的部署说明,请自行查阅其文档。Docker 相关文件 已全部提供,其他玩法自行研究。

四、脚本相关说明

Web-控制面板 已集成手动执行脚本的功能,下列内容为命令行操作的示例。

  1. 手动执行 git_pull.sh,作用如下:

    • 自动更新 jd-base 套壳工具脚本和 jd_scripts 的京东薅羊毛脚本

    • 自动删除失效的定时任务、添加新的定时任务,并发送通知

    • 检测配置文件模板 config.sh.sample 是否升版,如有升版,发出通知

    # Linux
    cd {项目安装目录}
    bash git_pull.sh
    
    # Docker
    docker exec -it <容器名> bash git_pull.sh
  2. 手动执行 rm_log.sh 删除指定时间以前的旧日志

    # Linux
    cd {项目安装目录}
    bash rm_log.sh
    
    # Docker
    docker exec -it <容器名> bash rm_log.sh
  3. 手动执行 export_sharecodes.sh 从日志中按模板导出所有互助码

    # Linux
    cd {项目安装目录}
    bash export_sharecodes.sh
    
    # Docker
    docker exec -it <容器名> bash export_sharecodes.sh
  4. 手动执行薅羊毛脚本,用法如下(其中 xxx 为 jd_scripts 中的脚本名称,请勿直接以 node xxx.js 命令运行,jd.sh 的作用是为 js 脚本导入必须的环境变量并运行):

    # Linux
    cd {项目安装目录}
    bash jd.sh xxx      # 如果设置了随机延迟并且当时时间不在0-2、30-31、59分内,将随机延迟一定秒数
    bash jd.sh xxx now  # 无论是否设置了随机延迟,均立即运行
    
    # Docker
    docker exec -it <容器名> bash jd.sh xxx      # 如果设置了随机延迟并且当时时间不在0-2、30-31、59分内,将随机延迟一定秒数
    docker exec -it <容器名> bash jd.sh xxx now  # 无论是否设置了随机延迟,均立即运行
  5. 手动启动挂机程序

    # Linux
    cd {项目安装目录}
    bash jd.sh hangup
    
    # Docker
    docker exec -it <容器名> bash jd.sh hangup

    然后挂机脚本就会一直运行,目前仅一个 jd_crazy_joy_coin.js 为挂机脚本。

  6. jd-base 脚本已完全开源,更多细节请自行查阅源码。

五、Web 面板使用说明

下面内容是针对非 Docker 用户的,Docker 中这些流程都做好了,直接使用即可。

使用流程

  1. 面板目录为 {项目安装目录}/panel

  2. 手动启动,根据需要二选一。

    # 1. 如需要编辑保存好就结束掉在线页面(保存好后按 Ctrl + C 结束)
    node server.js
    
    # 2. 如需一直后台运行,以方便随时在线编辑
    npm install -g pm2    # npm和yarn二选一
    yarn global add pm2   # npm和yarn二选一
    pm2 start server.js
    
    # 2.1 如果需要开机自启
    pm2 save && pm2 startup
  3. 访问 http://<ip>:5678 登陆、编辑并保存即可(初始用户名:admin,初始密码:password)。如无法访问,请从防火墙、端口转发、网络方面着手解决。

  4. 如需要重置面板密码,cd 到本仓库的目录下输入 bash jd.sh resetpwd

jd-base's People

Contributors

accors avatar binge8 avatar dellear avatar domking avatar fanchangwang avatar gotoboy avatar jerrykuku avatar leeyiding avatar meselson avatar rikudoupatrickstar avatar rockbund avatar xiexuan20 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jd-base's Issues

docker 镜像不存在啦么

docker 镜像不存在啦么 pull不下来

Unable to find image 'patrick/jd-base:v3' locally
docker: Error response from daemon: repository patrick/jd-base not found: does not exist or no pull access

更新脚本文件日志有点小问题 wget: missing URL

首先感谢作者的辛勤劳动!
手动更新脚本后,日志显示一个小错误。是因为没有需要替换的脚本,所以显示miss么?
日志如下:

##############################################################

系统时间:2021-03-20 16:59:46


更新 jd-base 脚本

Fetching origin
HEAD is now at bca36e8 增加临时活动“城城领现金”

更新 jd-base 脚本成功


更新 jd_scripts 脚本

Fetching origin
From https://github.com/RikudouPatrickstar/jd_scripts
4142edb..ad110a6 master -> origin/master
HEAD is now at ad110a6 add SCF tutorial image

更新 jd_scripts 脚本成功


替换 js 脚本

wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
.js 替换失败,请检查原因


设置额外的 js 脚本环境

docker镜像源问题

请问大佬有没有国内ecs服务器能用的docker加速源,用docker一键脚本在国内ecs服务器上拉取不动源码,网上找的好像都失效了,一点加速作用也没有。

Panel服务挂了,起不来

/root/.pm2/logs/server-error.log last 15 lines:
0|server   | Require stack:
0|server   | - /jd/panel/server.js
0|server   |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
0|server   |     at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:61:29)
0|server   |     at require (internal/modules/cjs/helpers.js:88:18)
0|server   |     at Object.<anonymous> (/jd/panel/server.js:11:19)
0|server   |     at Module._compile (internal/modules/cjs/loader.js:1063:30)
0|server   |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
0|server   |     at Module.load (internal/modules/cjs/loader.js:928:32)
0|server   |     at Function.Module._load (internal/modules/cjs/loader.js:769:14)
0|server   |     at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
0|server   |     at Module._compile (internal/modules/cjs/loader.js:1063:30) {
0|server   |   code: 'MODULE_NOT_FOUND',
0|server   |   requireStack: [ '/jd/panel/server.js' ]
0|server   | }

找不到config.sh.sample

Bark推送有模板更新,但是在/root/jd-docker/config没有找到config.sh.sample文件,其他功能一切正常

TG通知不能用

TG_BOT_TOKEN和TG_USER_ID没有问题 别的镜像可以用 大佬的这个就不行
telegram发送通知消息失败!!

RequestError: connect ECONNREFUSED 149.154.167.220:443
at ClientRequest. (/jd/scripts/node_modules/got/dist/source/core/index.js:953:111)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:327:22)
at ClientRequest.origin.emit (/jd/scripts/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
at TLSSocket.socketErrorListener (_http_client.js:469:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
code: 'ECONNREFUSED',
timings: {
start: 1615378786972,
socket: 1615378786974,
lookup: 1615378787066,
connect: undefined,
secureConnect: undefined,
upload: undefined,
response: undefined,
end: undefined,
error: 1615378787084,
abort: undefined,
phases: {
wait: 2,
dns: 92,
tcp: undefined,
tls: undefined,
request: undefined,
firstByte: undefined,
download: undefined,
total: 112
}
}
}

无法访问web控制面板

使用Docker部署
随机提示以下三种错误之一

0.Connection refused
1.Connection reset by peer
2.Empty reply from server

计划任务不启动,手动运行脚本没有问题

arm64的docker
镜像是thisispatrick/jd-base:v3
crontab -l里面是正常的

root@jd:/jd $ crontab -l
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

55 8-23/3 * * * bash /jd/git_pull.sh >> /jd/log/git_pull.log 2>&1
57 3 * * * bash /jd/rm_log.sh >/dev/null 2>&1
48 4 * * * bash /jd/export_sharecodes.sh
33 13 * * * bash /jd/jd.sh hangup

5 0 * * * bash /jd/jd.sh jd_bean_change
33 4 * * * bash /jd/jd.sh jd_bean_home
3 0,18 * * * bash /jd/jd.sh jd_bean_sign
0,30 0 * * * bash /jd/jd.sh jd_blueCoin
7 8,12,18 * * * bash /jd/jd.sh jd_bookshop
0 0 * * * bash /jd/jd.sh jd_car
0 0 * * * bash /jd/jd.sh jd_car_exchange
27 */4 * * * bash /jd/jd.sh jd_cash
5 0,8,13,19 * * * bash /jd/jd.sh jd_cfd
0 0 * * * bash /jd/jd.sh jd_club_lottery
10 7,23 * * * bash /jd/jd.sh jd_crazy_joy
10 12 * * * bash /jd/jd.sh jd_crazy_joy_bonus
18 * * * * bash /jd/jd.sh jd_daily_egg
20 9 * * 6 bash /jd/jd.sh jd_delCoupon
20 * * * * bash /jd/jd.sh jd_dreamFactory
*/20 * * * * bash /jd/jd.sh jd_family
5 6-18/6 * * * bash /jd/jd.sh jd_fruit
47 7 * * * bash /jd/jd.sh jd_get_share_code
36 * * * * bash /jd/jd.sh jd_jdfactory
10 11 * * * bash /jd/jd.sh jd_jdzz
45 */2,23 * * * bash /jd/jd.sh jd_joy
15 */1 * * * bash /jd/jd.sh jd_joy_feedPets
0 0-16/8 * * * bash /jd/jd.sh jd_joy_reward
10 9-20/2 * * * bash /jd/jd.sh jd_joy_run
0 0-10/2 * * * bash /jd/jd.sh jd_joy_steal
20 5,23 * * * bash /jd/jd.sh jd_jxd
0 9,12,18 * * * bash /jd/jd.sh jd_jxnc
23 1 * * * bash /jd/jd.sh jd_kd
10-20/5 12,23 * * * bash /jd/jd.sh jd_live
11 1 * * * bash /jd/jd.sh jd_lotteryMachine
0 */2 * * * bash /jd/jd.sh jd_moneyTree
10 7 * * * bash /jd/jd.sh jd_ms
20 0,20 * * * bash /jd/jd.sh jd_necklace
5 6-18/6 * * * bash /jd/jd.sh jd_pet
12 * * * * bash /jd/jd.sh jd_pigPet
0 7-22/1 * * * bash /jd/jd.sh jd_plantBean
1 0,23 * * * bash /jd/jd.sh jd_price
11 9 * * * bash /jd/jd.sh jd_rankingList
1 1 * * * bash /jd/jd.sh jd_redPacket
27 8 * * * bash /jd/jd.sh jd_sgmh
10 0 * * * bash /jd/jd.sh jd_shop
16 6,23 * * * bash /jd/jd.sh jd_small_home
8 */3 * * * bash /jd/jd.sh jd_speed
1 1,6 * * * bash /jd/jd.sh jd_speed_sign
11 1-23/5 * * * bash /jd/jd.sh jd_superMarket
36 8,18 * * * bash /jd/jd.sh jd_syj
55 23 * * * bash /jd/jd.sh jd_unsubscribe
39 7 * * * bash /jd/jd.sh jx_sign
以下为自动添加的任务
5 1,23 * * * bash /jd/jd.sh jd_nzmh
15 0,23 * * * bash /jd/jd.sh jd_speed_redpocke
30,31 20-23/1 * * * bash /jd/jd.sh jd_live_redrain
1 7,12,19 * * * bash /jd/jd.sh jd_beauty
35 6,22 * * * bash /jd/jd.sh jd_global
5 7,12,23 * * * bash /jd/jd.sh jd_global_mh
0 0,12 * * * bash /jd/jd.sh jd_xtg
root@jd:/jd $ ps -ef|grep crond
5772 root 0:00 crond start
5774 root 0:00 crond status
8433 root 0:00 grep crond

##root@jd:/jd $ ps -ef
PID USER TIME COMMAND
1 root 0:00 node
17 root 0:00 bash
22 root 0:00 bash
62 root 7:19 {node} PM2 v4.5.5: God Daemon (/root/.pm2)
73 root 24:00 node /jd/panel/server.js
5772 root 0:00 crond start
5774 root 0:00 crond status
7947 root 0:00 bash /jd/jd.sh jd_jxnc
7948 root 0:00 bash /jd/jd.sh jd_plantBean
8144 root 0:04 node jd_plantBean.js
8145 root 0:00 tee /jd/log/jd_plantBean/2021-03-18-09-00-00.log
8147 root 0:04 node jd_jxnc.js
8148 root 0:00 tee /jd/log/jd_jxnc/2021-03-18-09-00-00.log
8164 root 0:00 bash /jd/jd.sh jd_jxnc
8165 root 0:00 bash /jd/jd.sh jd_plantBean
8364 root 0:04 node jd_plantBean.js
8365 root 0:00 tee /jd/log/jd_plantBean/2021-03-18-09-00-01.log
8373 root 0:04 node jd_jxnc.js
8374 root 0:00 tee /jd/log/jd_jxnc/2021-03-18-09-00-01.log
8392 root 0:08 node /jd/scripts/jd_crazy_joy_coin.js
8426 root 0:00 bash
8434 root 0:00 ps -ef

导出互助码格式

每次手动倒腾互助太添麻烦了,能否能导出适用于配置文件的互助码格式
类似于如下这样的格式

MyFruit1="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
MyFruit2="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
MyFruit3="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
MyFruit4="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
MyFruit5="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

ForOtherFruit1="${MyFruit1}@${MyFruit2}@${MyFruit3}@${MyFruit4}@${MyFruit5}"
ForOtherFruit2="${MyFruit1}@${MyFruit2}@${MyFruit3}@${MyFruit4}@${MyFruit5}"
ForOtherFruit3="${MyFruit1}@${MyFruit2}@${MyFruit3}@${MyFruit4}@${MyFruit5}"
ForOtherFruit4="${MyFruit1}@${MyFruit2}@${MyFruit3}@${MyFruit4}@${MyFruit5}"
ForOtherFruit5="${MyFruit1}@${MyFruit2}@${MyFruit3}@${MyFruit4}@${MyFruit5}"

仓库更新问题

请问21号lxk0301大佬仓库私有化之后再使用一键脚本还可以正常安装使用并进行后续脚本更新吗?谢谢

疯狂的joy挂机

请问使用了docker一键脚本部署后应该如何启动挂机程序?cd 到脚本目录后输入 bash jd.sh hangup无效

限制账号数量

## jd.sh

## 用户数量UserSum
function Count_UserSum() {
  for ((i = 1; i <= 30; i++)); do
    Tmp=Cookie$i
    CookieTmp=${!Tmp}
    [[ ${CookieTmp} ]] && UserSum=$i || break
  done

  for ((d = 31; d <= 1000; d++)); do
    Del=Cookie$d
    sed -i "/${!Del}/d" ${FileConf} || break
  done
}

docker-compose.yml的问题

我看了大神仓库目录下的这个docker-compose.yml文件
有点不明白的地方
文件是定义了3个容器,也有不同的配置目录(除了log)之外
是不是要去3个容器里面修改保存了config文件后才可以执行?
这样能3个容器并发执行任务不?

环球挑战赛任务运行失败

日志如下:

当前活动:第3/24天
去做每日签到任务
{"code":"1"}
您的好友助力码为 bmVYdkFBQlVQZzlVVGRSeFd2dXpadz09
去做去进口超市下单解锁奖励任务
{"code":"1"}
去做逛进口超市宠粉会场20秒任务
{"code":"1"}
去做浏览进口精选商品20秒任务
{"code":"1"}
{"code":"1"}
{"code":"1"}
{"code":"1"}
{"code":"1"}
去做逛惠氏营养品会场20秒任务
{"code":"1"}
{"code":"1"}
{"code":"1"}
{"code":"1"}
{"code":"1"}
{"code":"1"}
{"code":"1"}

==============📣系统通知📣==============
环球挑战赛
京东账号1wdnzvGVtbxHyya
本次运行获得0里程,0京豆,共计120里程
{"code":"1"}

🔔环球挑战赛, 结束! 🕛 20.248 秒

"Timeout awaiting 'request' for 10000ms"
环球挑战赛 API请求失败,请检查网路重试

手机app上查看任务并没有完成

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.