Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
cdle committed Aug 17, 2021
1 parent 011d821 commit c30184e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ session.token
device.json
data/
logs/
conf
conf/app.conf
conf/config.yaml
conf/config_cdle.yaml
conf/reply.php
jdCookie.js
2 changes: 2 additions & 0 deletions conf/demo_app.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#扫码端口
httpport = 8080
37 changes: 37 additions & 0 deletions conf/demo_config_.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
mode: parallel
containers:
- address: http://192.168.31.233:5700
username: admin
password: admin
weigth:
mode: parallel
limit: 9999
theme:
static: ./static
master:
database:
qywx_key:
daily_push:
resident:
user_agent:
telegram_bot_token:
telegram_user_id:
qquid:
qqgid:
default_priority:
no_ghproxy: true
daily_asset_push_cron:
tasks:
- cron: 0 6 * * *
path: https://raw.githubusercontent.com/cdle/xdd/main/scripts/jd_goodMorning.js
enable: true
word: 早起福利
mode: obo
- cron: 0 0 * * *
path: https://raw.githubusercontent.com/cdle/xdd/main/scripts/jd_angryBean.js
enable: true
word: 抢京豆
mode: alo
envs:
- name: angryBeanPins
- value: jd_xxxxx&jd_ooooo
Empty file added conf/demo_reply.php
Empty file.
8 changes: 2 additions & 6 deletions models/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func initConfig() {
if _, err := os.Stat(confDir); err != nil {
os.MkdirAll(confDir, os.ModePerm)
}
for _, name := range []string{"app.conf", "config.yaml"} {
for _, name := range []string{"app.conf", "config.yaml", "reply.php"} {
f, err := os.OpenFile(ExecPath+"/conf/"+name, os.O_RDWR|os.O_CREATE, 0777)
if err != nil {
logs.Warn(err)
Expand All @@ -67,11 +67,7 @@ func initConfig() {
}
f.Close()
}
config := ExecPath + "/conf/config.yaml"
if Cdle {
config = ExecPath + "/conf/config_cdle.yaml"
}
content, err := ioutil.ReadFile(config)
content, err := ioutil.ReadFile(ExecPath + "/conf/config.yaml")
if err != nil {
logs.Warn("解析config.yaml读取错误: %v", err)
}
Expand Down

0 comments on commit c30184e

Please sign in to comment.