Skip to content

Commit

Permalink
chore: use pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
daidr committed Sep 11, 2022
1 parent 701d7d5 commit b3247e2
Show file tree
Hide file tree
Showing 8 changed files with 4,797 additions and 6,656 deletions.
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
/node_modules

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

/.vscode
/test
/config/config.yml
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
pnpm lint-staged
786 changes: 0 additions & 786 deletions .yarn/releases/yarn-3.2.1.cjs

This file was deleted.

1 change: 0 additions & 1 deletion .yarnrc.yml

This file was deleted.

118 changes: 67 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,101 @@
GHAuth
========
# GHAuth

![GitHub package.json version](https://img.shields.io/github/package-json/v/daidr/ghauth?style=flat-square)
[![GitHub commit](https://img.shields.io/github/last-commit/daidr/ghauth?style=flat-square)](https://github.com/daidr/ghauth/commit/master)
[![MIT License](https://img.shields.io/badge/license-MIT-yellowgreen.svg?style=flat-square)](https://github.com/daidr/ghauth/blob/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/daidr/ghauth?style=flat-square)](https://github.com/daidr/ghauth/issues)

轻量的MC服务器yggdrasil验证/皮肤加载解决方案
轻量的 MC 服务器 yggdrasil 验证/皮肤加载解决方案

[GHAuth](https://auth.daidr.me)

[更改日志](/CHANGELOG.md)

## 功能
* 完整的yggdrasil协议支持
* 完整的皮肤管理
* 简易的用户管理
* 邮箱验证

- 完整的 yggdrasil 协议支持
- 完整的皮肤管理
- 简易的用户管理
- 邮箱验证

## 暂未实现
* 站点的可视化设置
* 玩家名称修改
* 修改邮箱功能
* FIDO支持

- 站点的可视化设置
- 玩家名称修改
- 修改邮箱功能
- FIDO 支持

## 环境
* MongoDB
* Redis
* NodeJS v16+
* yarn v2+ (请不要使用另外的包管理器 npm/cnpm/pnpm)

- MongoDB
- Redis
- NodeJS v16+
- pnpm (请不要使用另外的包管理器 npm/cnpm/yarn)

## 部署(辅助配置)
* 克隆本仓库 `git clone https://github.com/GHAuth-Team/ghauth.git`
* 安装依赖 `yarn install`
* 启动配置程序 `yarn helper`
* 根据提示完成基础配置
* 进入 `config` 目录
* 修改 `config.yml` (配置项注释可参考`config.sample.yml`)以完成高级配置(页脚配置、邮件服务器配置、资源可信域配置)
* [可选] 进入 `adminList.yml` 以添加更多管理员
* 启动 `yarn start`

- 克隆本仓库 `git clone https://github.com/GHAuth-Team/ghauth.git`
- 安装依赖 `pnpm install`
- 启动配置程序 `pnpm helper`
- 根据提示完成基础配置
- 进入 `config` 目录
- 修改 `config.yml` (配置项注释可参考`config.sample.yml`)以完成高级配置(页脚配置、邮件服务器配置、资源可信域配置)
- [可选] 进入 `adminList.yml` 以添加更多管理员
- 启动 `pnpm start`

## 部署(手动配置)
* 克隆本仓库 `git clone https://github.com/GHAuth-Team/ghauth.git`
* 安装依赖 `yarn install`
* 进入 `config` 目录
* 复制一份 `config.sample.yml` 并将其重命名为 `config.yml`
* 修改 `config.yml` 以完成站点配置
* 复制一份 `adminList.sample.yml` 并将其重命名为 `adminList.yml`
* 修改 `adminList.yml` 以定义管理员邮箱列表
* 启动 `yarn start`

- 克隆本仓库 `git clone https://github.com/GHAuth-Team/ghauth.git`
- 安装依赖 `pnpm install`
- 进入 `config` 目录
- 复制一份 `config.sample.yml` 并将其重命名为 `config.yml`
- 修改 `config.yml` 以完成站点配置
- 复制一份 `adminList.sample.yml` 并将其重命名为 `adminList.yml`
- 修改 `adminList.yml` 以定义管理员邮箱列表
- 启动 `pnpm start`

## 常用命令
* 启动: `yarn start`
* 停止: `yarn stop`
* 重启: `yarn restart`
* 查看日志: `yarn logs`
* 实时监控: `yarn monit`

- 启动: `pnpm start`
- 停止: `pnpm stop`
- 重启: `pnpm restart`
- 查看日志: `pnpm logs`
- 实时监控: `pnpm monit`

## 关于管理权限
* 具有管理权限的账号由 `config/adminList.yml` 控制
* 用户管理Widget会对拥有管理权限的用户显示

- 具有管理权限的账号由 `config/adminList.yml` 控制
- 用户管理 Widget 会对拥有管理权限的用户显示

## 站点公告
* 站点公告默认**关闭**
* 进入 `config` 目录
* 复制一份 `announcement.sample.md` 并将其重命名为 `announcement.md`
* 修改 `announcement.md`
* 修改 `config.yml``common` 配置节点的 `showAnnouncement` 配置项为 `true` 来启用公告
* 支持Markdown语法

- 站点公告默认**关闭**
- 进入 `config` 目录
- 复制一份 `announcement.sample.md` 并将其重命名为 `announcement.md`
- 修改 `announcement.md`
- 修改 `config.yml``common` 配置节点的 `showAnnouncement` 配置项为 `true` 来启用公告
- 支持 Markdown 语法

## NodeJS 版本兼容
* 建议 NodeJS 版本 >= v16.0.0
* 倘若系统 OpenSSL 版本 >= v3.0.0, 则要求 NodeJS 版本 >= v18.0.0

- 建议 NodeJS 版本 >= v16.0.0
- 倘若系统 OpenSSL 版本 >= v3.0.0, 则要求 NodeJS 版本 >= v18.0.0

## 版本差异
GHAuth v0.7.2 版本之后(不包含 v0.7.2),将使用 Yarn 2 进行依赖管理。

GHAuth v0.7.2 版本之后(不包含 v0.7.2),将使用 pnpm 进行依赖管理。

## 建议
* 建议使用nginx等类似服务器代理程序代理public目录,减轻后端压力

- 建议使用 nginx 等类似服务器代理程序代理 public 目录,减轻后端压力

## 安全警告
* yggdrasil验证时明文传递密码(协议限制),你需要启用https以提升安全性

- yggdrasil 验证时明文传递密码(协议限制),你需要启用 https 以提升安全性

## 生成签名验证密钥
*`0.6.1` 版本开始辅助配置程序能够自动生成密钥。倘若需要手动配置rsa公私钥,可以参考下面的内容。

-`0.6.1` 版本开始辅助配置程序能够自动生成密钥。倘若需要手动配置 rsa 公私钥,可以参考下面的内容。

> 以下内容引用自[https://github.com/yushijinhun/authlib-injector/wiki/签名密钥对#密钥对的生成和处理](https://github.com/yushijinhun/authlib-injector/wiki/%E7%AD%BE%E5%90%8D%E5%AF%86%E9%92%A5%E5%AF%B9#%E5%AF%86%E9%92%A5%E5%AF%B9%E7%9A%84%E7%94%9F%E6%88%90%E5%92%8C%E5%A4%84%E7%90%86)
Expand All @@ -95,6 +107,7 @@ GHAuth v0.7.2 版本之后(不包含 v0.7.2),将使用 Yarn 2 进行依赖管
如果要使用文件,可使用参数 `-in <file>``-out <file>`

#### 生成私钥

密钥算法为 RSA,推荐长度为 4096 位。

```
Expand All @@ -104,6 +117,7 @@ openssl genrsa 4096
生成的私钥将输出到标准输出。

#### 从私钥生成公钥

```
openssl rsa -pubout
```
Expand All @@ -113,7 +127,9 @@ openssl rsa -pubout
> 结束引用
## 交流
Q群:850093647(同时也是“基佬之家”基友服交流群)

Q 群:850093647(同时也是“基佬之家”基友服交流群)

## 协议

MIT Licence
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,5 @@
},
"script": "app.js",
"ext": "js json"
},
"packageManager": "[email protected]"
}
}
Loading

0 comments on commit b3247e2

Please sign in to comment.