bug修复
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Qumolama.d 2022-05-13 15:28:13 +08:00
parent c94563f5c8
commit c8891848f1
Signed by: Lama3L9R
GPG Key ID: 1762AFC05157CE18
4 changed files with 28 additions and 19 deletions

View File

@ -7,6 +7,8 @@ kind: pipeline
name: test
steps:
- name: setup-database
image: mongo:5
- name: test
image: node:16
commands:
@ -25,20 +27,23 @@ steps:
format: markdown
message: >
{{#success build.status}}
✅ `{{repo.name}}` #{{build.number}} 号构建测试已通过\n
📝 {{commit.author}} 在 `{{commit.branch}}` 的提交:\n
```
{{commit.message}}
```
\n🌐 {{ build.link }}
{{else}}
❌ `{{repo.name}}` #{{build.number}} 号构建测试已失败\n
📝 {{commit.author}} 在 `{{commit.branch}}` 的提交:\n
```
{{commit.message}}
```
\n🌐 {{ build.link }}
{{/success}}
✅ `{{repo.name}}` #{{build.number}} 号构建测试已通过
📝 {{commit.author}} 在 `{{commit.branch}}` 的提交:
```
{{commit.message}}
```
🌐 {{ build.link }}
{{else}}
❌ `{{repo.name}}` #{{build.number}} 号构建测试已失败
📝 {{commit.author}} 在 `{{commit.branch}}` 的提交:
```
{{commit.message}}
```
🌐 {{ build.link }}
{{/success}}

View File

@ -61,6 +61,9 @@
4. 使用 `$ node build.js` 创建运行时构建
5. 使用 `$ node path/to/lsp-yggdrasil.full.cjs` 起飞
> 注:对于开发者的首次运行,您可能需要创建一个测试账户,添加环境参数:`DEVEL_FIRST_RUN=1` 即可创建一个测试玩家
> 测试玩家的账户为: `i@lama.icu` 密码为 `123456` 您可以到 `index.js` 中自由修改
## 常见问题
- Q支持 `https` 嘛?

View File

@ -49,7 +49,7 @@ export const setup = async () => {
config.custom.postRouting(server)
/*
if(process.env["UNIT_TEST"] || process.env["DEVEL_FIRST_RUN"]) {
// Create a test player
await new models.Player({
username: 'test',
@ -63,7 +63,7 @@ export const setup = async () => {
registerDate: Date.now(),
permissions: [{ node: 'login', allowed: true, duration: 0, eternal: true, startDate: Date.now(), highPriority: false }]
}).save()
*/
}
}
const launch = async () => {

View File

@ -2,6 +2,7 @@ import { PNG } from 'pngjs'
import fs from 'fs'
import { createHash, createPrivateKey, createSign } from 'crypto'
import { config } from './config.js'
import { server } from './index.js'
export const ImageSecurity = {
createImageHash: async (path, isCape) => {
@ -70,7 +71,7 @@ export const ImageSecurity = {
throw new Error('Invalid image size')
},
sign: async (data) => {
return createSign('RSA-SHA1').update(data).sign(createPrivateKey(config.privateKey), 'hex')
return createSign('RSA-SHA1').update(data).sign({ key: createPrivateKey(server.keys.privateKey) }, 'hex')
}
}