Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
go-cqhttp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
go-cqhttp
Commits
d6ebc143
Commit
d6ebc143
authored
Aug 26, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update env config
parent
229098d2
Pipeline
#630
passed with stages
in 4 minutes and 36 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
2 deletions
+32
-2
Dockerfile
Dockerfile
+10
-0
README.md
README.md
+2
-0
main.go
main.go
+20
-2
No files found.
Dockerfile
View file @
d6ebc143
...
@@ -21,4 +21,14 @@ RUN chmod +x /usr/bin/cqhttp
...
@@ -21,4 +21,14 @@ RUN chmod +x /usr/bin/cqhttp
WORKDIR
/data
WORKDIR
/data
ENV
UIN 11111111
ENV
PASS password
ENV
HTTP_POST http://app
ENV
HTTP_SECRET aaaaaaaaaa
ENV
ACCESS_TOKEN bbbbbbbbbb
ENV
ENABLE_DB 'true'
ENV
DEBUG 'false'
ENV
IGNORE_INVALID_CQCODE 'false'
ENV
FORCE_FRAGMENTED 'true'
ENTRYPOINT
[ "/usr/bin/cqhttp" ]
ENTRYPOINT
[ "/usr/bin/cqhttp" ]
README.md
View file @
d6ebc143
...
@@ -132,3 +132,5 @@
...
@@ -132,3 +132,5 @@
*
`ACCESS_TOKEN`
访问令牌,需要和业务后端保持一致。
*
`ACCESS_TOKEN`
访问令牌,需要和业务后端保持一致。
*
`ENABLE_DB`
默认为
`true`
,若为
`false`
则不使用数据库,功能会受到限制。
*
`ENABLE_DB`
默认为
`true`
,若为
`false`
则不使用数据库,功能会受到限制。
*
`DEBUG`
若为
`true`
则输出更多的调试信息。
*
`DEBUG`
若为
`true`
则输出更多的调试信息。
*
`IGNORE_INVALID_CQCODE`
若为
`true`
则会忽略错误的 CQ 码。
*
`FORCE_FRAGMENTED`
若为
`true`
则会强制分片发送群长消息。
main.go
View file @
d6ebc143
...
@@ -113,6 +113,8 @@ func main() {
...
@@ -113,6 +113,8 @@ func main() {
Port
:
6700
,
Port
:
6700
,
},
},
PostMessageFormat
:
"string"
,
PostMessageFormat
:
"string"
,
IgnoreInvalidCQCode
:
false
,
ForceFragmented
:
true
,
Debug
:
os
.
Getenv
(
"DEBUG"
)
==
"true"
,
Debug
:
os
.
Getenv
(
"DEBUG"
)
==
"true"
,
}
}
if
post
!=
""
{
if
post
!=
""
{
...
@@ -164,6 +166,22 @@ func main() {
...
@@ -164,6 +166,22 @@ func main() {
log
.
Infof
(
"已覆盖 ENABLE_DB 为 false"
)
log
.
Infof
(
"已覆盖 ENABLE_DB 为 false"
)
}
}
if
os
.
Getenv
(
"IGNORE_INVALID_CQCODE"
)
!=
"false"
&&
os
.
Getenv
(
"IGNORE_INVALID_CQCODE"
)
!=
""
{
conf
.
IgnoreInvalidCQCode
=
true
log
.
Infof
(
"已覆盖 IGNORE_INVALID_CQCODE 为 true"
)
}
else
if
os
.
Getenv
(
"IGNORE_INVALID_CQCODE"
)
==
"false"
{
conf
.
IgnoreInvalidCQCode
=
false
log
.
Infof
(
"已覆盖 IGNORE_INVALID_CQCODE 为 false"
)
}
if
os
.
Getenv
(
"FORCE_FRAGMENTED"
)
!=
"false"
&&
os
.
Getenv
(
"FORCE_FRAGMENTED"
)
!=
""
{
conf
.
ForceFragmented
=
true
log
.
Infof
(
"已覆盖 FORCE_FRAGMENTED 为 true"
)
}
else
if
os
.
Getenv
(
"FORCE_FRAGMENTED"
)
==
"false"
{
conf
.
ForceFragmented
=
false
log
.
Infof
(
"已覆盖 FORCE_FRAGMENTED 为 false"
)
}
if
conf
.
EncryptPassword
&&
conf
.
PasswordEncrypted
==
""
{
if
conf
.
EncryptPassword
&&
conf
.
PasswordEncrypted
==
""
{
log
.
Infof
(
"密码加密已启用, 请输入Key对密码进行加密: (Enter 提交)"
)
log
.
Infof
(
"密码加密已启用, 请输入Key对密码进行加密: (Enter 提交)"
)
strKey
,
_
:=
console
.
ReadString
(
'\n'
)
strKey
,
_
:=
console
.
ReadString
(
'\n'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment