Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2b836c3
update:workflows/msbuild.yml
xengine-qyt Sep 23, 2024
9e1fd84
fixed:crashed when exist
xengine-qyt Sep 27, 2024
d22a5d2
update:workflows
xengine-qyt Nov 15, 2024
b12f0c9
added:issues translator and release support for workflows
xengine-qyt Nov 15, 2024
01cfb8f
update:depend library
xengine-qyt Nov 15, 2024
e3ba7bf
improved:start parameter parse
xengine-qyt Nov 15, 2024
bbc11af
update:not run ci test
xengine-qyt Nov 15, 2024
381d828
update:not run ci test
xengine-qyt Nov 15, 2024
3762de0
modify:test ci
xengine-qyt Nov 15, 2024
e43ef77
added:service app and management app core-dump supported
xengine-qyt Nov 15, 2024
d6aeba2
add default pipeline template yaml
xengine-qyt Nov 15, 2024
eb74c6a
improved:release workflows
xengine-qyt Nov 18, 2024
71a3352
Merge branch 'develop' of gitee.com:xengine/XEngine_Authorize into de…
xengine-qyt Nov 18, 2024
1f31400
delete:gitee workflows
xengine-qyt Nov 18, 2024
2e67863
fixed:add user incorrect for management app
xengine-qyt Nov 18, 2024
d52f4f0
fixed:multi login handle is incorrect and tips logged in
xengine-qyt Nov 18, 2024
b80be80
improved:tips when request not support protocol
xengine-qyt Nov 18, 2024
78a7fcc
improved:user insert and modify init value for management app
xengine-qyt Nov 18, 2024
bd8481a
update:configure
xengine-qyt Nov 18, 2024
691228f
added:auto renewal token
xengine-qyt Nov 19, 2024
b941a14
added:pass encrypt supported
xengine-qyt Nov 19, 2024
6c9ab54
modify:user delete away
xengine-qyt Nov 19, 2024
4616496
added:delete client for management app with token
xengine-qyt Nov 19, 2024
82ce149
modify:modify user encrypt password support
xengine-qyt Nov 19, 2024
7add6d2
modify:adjust st_XToken location
xengine-qyt Nov 19, 2024
41f28c7
fixed:configure file parse count
xengine-qyt Nov 19, 2024
816302a
update:read me and document
xengine-qyt Nov 20, 2024
c632874
modify:user pass now support get and set
xengine-qyt Nov 20, 2024
805cfb5
update:document and CHANGELOG
xengine-qyt Nov 20, 2024
0f0ee10
update:release dir struct
xengine-qyt Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/issue-translator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Issue Translator
on:
issue_comment:
types: [created]
issues:
types: [opened]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: usthe/[email protected]
with:
IS_MODIFY_TITLE: false
CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically.
14 changes: 10 additions & 4 deletions .github/workflows/linuxbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: ubuntu build workflows
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

paths:
- 'XEngine_Source/**'
- 'XEngine_Release/**'
permissions:
contents: read

Expand Down Expand Up @@ -61,4 +61,10 @@ jobs:
- name: test
run: |
cd XEngine_Release
./XEngine_AuthorizeService -t
./XEngine_AuthorizeService -t

- name: Upload folder as artifact with ubuntu
uses: actions/upload-artifact@v4
with:
name: XEngine_AuthorizeService-x86_64-Ubuntu
path: XEngine_Release/
12 changes: 10 additions & 2 deletions .github/workflows/macbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: macos build workflows
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
paths:
- 'XEngine_Source/**'
- 'XEngine_Release/**'

permissions:
contents: read
Expand All @@ -29,6 +30,7 @@ jobs:
with:
repository: libxengine/libxengine
path: libxengine
ref: 'master'

- name: sub module checkout (opensource)
run: |
Expand Down Expand Up @@ -62,3 +64,9 @@ jobs:
run: |
cd XEngine_Release
./XEngine_AuthorizeService -t

- name: Upload folder as artifact with mac
uses: actions/upload-artifact@v4
with:
name: XEngine_AuthorizeService-x86_64-Mac
path: XEngine_Release/
43 changes: 28 additions & 15 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ name: windows build workflows

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

permissions:
contents: read

branches:
- develop
paths:
- 'XEngine_Source/**'
- 'XEngine_Release/**'

jobs:
build:
strategy:
Expand Down Expand Up @@ -50,7 +49,7 @@ jobs:

# 配置 MSBuild 的路径,准备构建 VC++ 项目
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v2
#编译
- name: Build Solution
run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
Expand All @@ -65,13 +64,27 @@ jobs:
./VSCopy_x86.bat
./XEngine_AuthorizeService.exe -t
shell: pwsh
- name: Conditional Step for x86 Debug
if: matrix.configuration == 'Debug' && matrix.platform == 'x86'
- name: Conditional Step for x64 Release
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
run: |
cp -r XEngine_Source/Debug/*.dll XEngine_Release/
cp -r XEngine_Source/Debug/*.exe XEngine_Release/
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
cp -r XEngine_Source/x64/Release/*.dll XEngine_Release/
cp -r XEngine_Source/x64/Release/*.exe XEngine_Release/
cp -r XEngine_Source/VSCopy_x64.bat XEngine_Release/
cd XEngine_Release
./VSCopy_x86.bat
./XEngine_AuthorizeService.exe -t
./VSCopy_x64.bat
shell: pwsh

#将文件夹打包为 artifact
- name: Upload folder as artifact with x86
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
uses: actions/upload-artifact@v4
with:
name: XEngine_AuthorizeService-x86_32-Windows
path: XEngine_Release/

- name: Upload folder as artifact with x64
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
uses: actions/upload-artifact@v4
with:
name: XEngine_AuthorizeService-x86_64-Windows
path: XEngine_Release/
89 changes: 89 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: release packet

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
# 检出代码并包含标签
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download linuxbuild
uses: dawidd6/action-download-artifact@v6
with:
workflow: linuxbuild.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/
- name: Download macbuild
uses: dawidd6/action-download-artifact@v6
with:
workflow: macbuild.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/
- name: Download msbuild
uses: dawidd6/action-download-artifact@v6
with:
workflow: msbuild.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/

- name: Display structure of downloaded files
run: ls -al ./XRelease/

- name: Get current version and increment X
id: versioning
run: |
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Latest tag: $latest_tag"
# 提取 X 的值并递增
major=$(echo $latest_tag | cut -d '.' -f 1)
minor=$(echo $latest_tag | cut -d '.' -f 2)
patch=$(echo $latest_tag | cut -d '.' -f 3)
build=$(echo $latest_tag | cut -d '.' -f 4)

new_minor=$((minor + 1))
new_version="$major.$new_minor.$patch.$build"
echo "New version: $new_version"
echo "new_tag=$new_version" >> $GITHUB_OUTPUT
echo "prev_tag=$latest_tag" >> $GITHUB_OUTPUT

- name: Create and push new tag
run: |
git tag ${{ steps.versioning.outputs.new_tag }}
git push origin ${{ steps.versioning.outputs.new_tag }}

- name: Generate release notes
run: |
logs=$(git log ${{ steps.versioning.outputs.prev_tag }}..${{ steps.versioning.outputs.new_tag }} --pretty=format:"* %h - %s - %an - %cd" --no-merges)
release_notes=$(echo "$logs" | sed 's/ qyt$/ @xengine-qyt/')
echo "$release_notes"
echo "$release_notes" > release_notes.txt

- name: Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: false
prerelease: false
tag_name: ${{ steps.versioning.outputs.new_tag }}
name: XEngine_AuthorizeService ${{ steps.versioning.outputs.new_tag }}
body_path: release_notes.txt
files: ./XRelease/*.zip
32 changes: 32 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
XEngine_Authorize V3.15.0.1001

增加:密码加密
增加:TOKEN自动续期
增加:服务和管理程序coredump支持
增加:client 删除用户协议支持
更新:工作流CI添加了发布CI
更新:依赖库
优化:启动参数解析
优化:不支持的协议提示
优化:管理端用户插入修改初始化值
修改:用户删除方法
修改:密码协议现在支持找回和设置功能了
修正:某些时候退出崩溃
修正:管理端添加用户失败的问题
修正:多端登录处理不正确的问题

added:pass encrypt supported
added:auto renewal token
added:service app and management app core-dump supported
added:delete client for management app with token
update:workflow and add release ci
update:depend library
improved:start parameter parse
improved:tips when request not support protocol
improved:user insert and modify init value for management app
modify:user delete away
modify:user pass now support get and set
fixed:crashed when exist
fixed:add user incorrect for management app
fixed:multi login handle is incorrect and tips logged in
================================================================
XEngine_Authorize V3.14.0.1001

增加:支持无限制多端登录了
Expand Down
4 changes: 4 additions & 0 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ network verification support tcp and websocket and http protocol verification.it
first open source C/C++ network authentication server, supporting various languages ​​and platforms for network authentication and authorization
This is a cross-platform simple high-performance network authorization server that provides a complete demo code

## Notice
the compiled release version will only be released on github.

#### why choose us
Fast iteration: feature updates are timely
Technical support: complete technical documentation and technical support, quick response to your questions
Expand Down Expand Up @@ -119,6 +122,7 @@ port :tcp port 5300,websocket port 5301,http management port 5302,Transmission v
2. Create new Feat_xxx branch
3. Submit the code
4. New Pull Request
5. merge to develop branch

## development path
The V1 version is an XEngine component. Most of the code is concentrated in XEngine
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ c c++network Authorize service
全国首款开源C/C++ 网络验证服务器,支持各种语言各种平台进行网络验证和授时服务
这是一个跨平台简单高性能网络授权服务器,提供了完整的演示代码

## 注意
编译发布版本将只在github上面发布.

#### 为什么选择我们
快速迭代:功能更新及时
技术支持:完善的技术文档和技术支持,快速响应你的问题
Expand Down Expand Up @@ -130,6 +133,7 @@ Linux or macos:直接运行即可
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
5. 提交到develop分支

## 发展历程
V1版本为XEngine组件.大部分代码集中在XEngine中
Expand Down
9 changes: 9 additions & 0 deletions XEngine_Apps/Authorize_APPClient/Authorize_APPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ using namespace std;
//Linux::g++ -std=c++17 -Wall -g Authorize_APPClient.cpp -o Authorize_APPClient.exe -I ../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Release -lXEngine_OPenSsl -lXClient_Socket -lXEngine_BaseLib -lXClient_APIHelp -lpthread -ljsoncpp -Wl,-rpath=../../XEngine_Release

//#define _DYNAMIC_CODE
//#define _PASS_ENCRYPT
bool bRun = true;
bool bLogin = true;
bool bTimeOut = true;
Expand Down Expand Up @@ -244,6 +245,14 @@ int AuthClient_Login()
strcpy(st_AuthUser.tszUserName, lpszUser);
strcpy(st_AuthUser.tszUserPass, lpszPass);

#ifdef _PASS_ENCRYPT
int nPLen = _tcsxlen(st_AuthUser.tszUserPass);
XBYTE byMD5Buffer[MAX_PATH] = {};
OPenSsl_Api_Digest(st_AuthUser.tszUserPass, byMD5Buffer, &nPLen, false, XENGINE_OPENSSL_API_DIGEST_MD5);
memset(st_AuthUser.tszUserPass, '\0', sizeof(st_AuthUser.tszUserPass));
BaseLib_OperatorString_StrToHex((LPCXSTR)byMD5Buffer, nPLen, st_AuthUser.tszUserPass);
#endif

if (nDYCode > 0)
{
st_ProtocolHdr.xhToken = xhToken;
Expand Down
Binary file modified XEngine_Docment/Docment_en.docx
Binary file not shown.
Binary file modified XEngine_Docment/Docment_zh.docx
Binary file not shown.
10 changes: 9 additions & 1 deletion XEngine_Release/XEngine_Config/XEngine_Config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@
"st_XCDKey":{
"tszKeyFile":"./APPVer.key",
"tszKeyPass":"123123qa"
}
},
"st_PassCrypto":{
"bEnable":false,
"nCodec":2
},
"st_XToken":{
"bAutoRenewal":false,
"nRenewalTime":-1
}
},
"XLogin":{
"bHTTPAuth":false,
Expand Down
1 change: 1 addition & 0 deletions XEngine_Release/XEngine_Config/XEngine_VersionConfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"XVer":[
"V3.15.0.1001 Build20241121",
"V3.14.0.1001 Build20240920",
"V3.13.0.1001 Build20240715",
"V3.12.1.1001 Build20240621",
Expand Down
10 changes: 10 additions & 0 deletions XEngine_Source/AuthorizeModule_Configure/Config_Define.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ typedef struct
XCHAR tszKeyFile[MAX_PATH]; //本地CDKEY文件地址
XCHAR tszKeyPass[MAX_PATH]; //本地CDKEY密码
}st_XCDKey;
struct
{
bool bEnable; //是否启用
int nCodec; //加密方法:ENUM_XENGINE_OPENSSL_DIGEST
}st_PassCrypto;
struct
{
bool bAutoRenewal; //自动续期
int nRenewalTime; //续期次数
}st_XToken;
int nCheckTimeNumber; //检测次数
int nCheckTimeout; //超时时间
int nTokenTimeout; //TOKEN登录超时时间
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
pSt_ServerConfig->st_XMax.nWSThread = st_JsonXMax["nWSThread"].asInt();
pSt_ServerConfig->st_XMax.nHTTPThread = st_JsonXMax["nHTTPThread"].asInt();
//验证配置
if (st_JsonRoot["XVerification"].empty() || (7 != st_JsonRoot["XVerification"].size()))
if (st_JsonRoot["XVerification"].empty() || (9 != st_JsonRoot["XVerification"].size()))
{
Config_IsErrorOccur = true;
Config_dwErrorCode = ERROR_AUTHORIZE_MODULE_CONFIGURE_XVER;
Expand All @@ -117,6 +117,12 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE

_tcsxcpy(pSt_ServerConfig->st_XVerification.st_XCDKey.tszKeyFile, st_JsonXVerification["st_XCDKey"]["tszKeyFile"].asCString());
_tcsxcpy(pSt_ServerConfig->st_XVerification.st_XCDKey.tszKeyPass, st_JsonXVerification["st_XCDKey"]["tszKeyPass"].asCString());

pSt_ServerConfig->st_XVerification.st_PassCrypto.bEnable = st_JsonXVerification["st_PassCrypto"]["bEnable"].asBool();
pSt_ServerConfig->st_XVerification.st_PassCrypto.nCodec = st_JsonXVerification["st_PassCrypto"]["nCodec"].asInt();

pSt_ServerConfig->st_XVerification.st_XToken.bAutoRenewal = st_JsonXVerification["st_XToken"]["bAutoRenewal"].asBool();
pSt_ServerConfig->st_XVerification.st_XToken.nRenewalTime = st_JsonXVerification["st_XToken"]["nRenewalTime"].asInt();
//登录配置
if (st_JsonRoot["XLogin"].empty() || (5 != st_JsonRoot["XLogin"].size()))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ bool CDBModule_SQLite::DBModule_SQLite_UserDelete(XENGINE_PROTOCOL_USERINFO* pSt
SQLPacket_IsErrorOccur = false;
XCHAR tszSQLStatement[1024]; //SQL语句
memset(tszSQLStatement, '\0', 1024);
_xstprintf(tszSQLStatement, _X("DELETE FROM `Authorize_User` WHERE UserName = '%s' AND Password = '%s' AND EmailAddr = '%s' AND IDCard = '%lld'"), pSt_UserInfo->tszUserName, pSt_UserInfo->tszUserPass, pSt_UserInfo->tszEMailAddr, pSt_UserInfo->nIDNumber);
_xstprintf(tszSQLStatement, _X("DELETE FROM `Authorize_User` WHERE UserName = '%s'"), pSt_UserInfo->tszUserName);
//执行
if (!DataBase_SQLite_Exec(xhData, tszSQLStatement))
{
Expand Down
Loading