Skip to content

Commit

Permalink
!2 第二个正式版本发布
Browse files Browse the repository at this point in the history
Merge pull request !2 from dowflyon/develop
  • Loading branch information
xengine-qyt authored and gitee-org committed Jun 18, 2021
2 parents 2e32b50 + 1611d42 commit 5ceb2b5
Show file tree
Hide file tree
Showing 64 changed files with 5,486 additions and 238 deletions.
12 changes: 12 additions & 0 deletions APIList.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
只支持POST,业务处理端口

查询文件列表:/api/query/file

{
"lpszTimeStart":"开始时间,可NULL",
"lpszTimeEnd":"结束时间,可NULL",
"lpszFileName":"文件名,可NULL",
"lpszFileHash":"文件HASH,可NULL"
}

NGINX上传代理接口:/api/event/upfile
141 changes: 104 additions & 37 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,104 @@
# XEngine_Storage

#### Description
c c++ 存储服务
c c++ storage service

#### Software Architecture
Software architecture description

#### Installation

1. xxxx
2. xxxx
3. xxxx

#### Instructions

1. xxxx
2. xxxx
3. xxxx

#### Contribution

1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request


#### Gitee Feature

1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
# XEngine_Storage

## Introduction
c c++ 存储服务 c c++ 文件存储服务
c c++ file storage service
This is an api gateway for uploading and downloading.
The service is for users who have business needs for upload and download services (such as developers who need to upload and download servers).

## Software feature
The purpose of development and implementation based on libXEngine is a cross-platform network storage service
This repository has a development and master branch. If you want to use it, please use the master branch

feature list:
1. support file http upload and download(use put and get method)
2. support http api notify of event and management api interface(planning)
3. support encrypt data transimission(planning)
4. support mysql record infomation.
5. support load banace(planning)
6. supprot http and private auth(planning)
7. support log and config
8. supprot speeds contral
9. supprot task start and end proxy forwarding(planning)
10.support p2p,bt and many more(planning)
11.support second pass
12.support nginx download proxy_pass
13.support nginx upload module proxy_pass

## install

#### Requirements
support system above windows 7sp1 and linux(ubuntu20.04,centos8)
XEngine need V7.13 or above
vcpkg need 2021.05.11 or above

#### Windows
use vs2019 x86 open and complie
You need to configure the environment in the following way, otherwise you may need to set the library directory in the project yourself

##### install Dependent library
vcpkg:https://github.com/microsoft/vcpkg
vcpkg.exe install jsoncpp
vcpkg integrate install
you can not use vcpkg and config jsoncpp development for youself

##### XEngine
XEngine can be download with mine repository,whe you downloaded xengine,you have to add value to you user environment
- XEngine_Include header file path
- XEngine_Library library file path

#### Linux
Linux use Makefile to complie
supproted ubuntu or centos

##### install Dependent library
install jsoncpp to your system
ubuntu20.04
sudo apt install libjsoncpp-devel
Centos8.x
sudo dnf install jsoncpp-devel

##### XEngine Install
you can install xengine env to your system by shell
like this:sudo XEngine_RunEnv.sh -c 3
##### complie
execute command in XEngine_Source path
make complie
make FLAGS=InstallAll install
make FLAGS=CleanAll clear

#### use

1. Switch to the MASTER branch
2. download code
3. complie
4. install
5. run
6. use curl or postman test upload and download

## api list
POST Method used as api server
it is used as manage service.api format use to url,such as:POST /api/query/file
The three-segment format is fixed,first api is a fixed,second api of query is a type,third api of file is a name
support api list reference:apilist.txt

## second pass
The Second pass is not realized by the server, it is by the client
upload file second pass is first check the HASH file is on the server, if has file on the server, it will directly prompt the upload is successful.
The realization of downloading second transmission is to first query the local file save path through HASH, and download it directly if it exists.

## directory struct
- XEngine_Docment docment directory
- XEngine_Release install directory
- XEngine_Source code directory

## Participate in contribution

1. Fork this code
2. Create new Feat_xxx branch
3. Submit the code
4. New Pull Request

## post issues

if you have eny quest.post issues...
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# XEngine_Storage

## 介绍
c c++ 存储服务 c c++ 文件存储服务
c c++ file storage service
c c++ 存储服务 c c++ 文件存储服务
c c++ file storage service
这是一个上传下载服务API网关,不是文件同步服务,也不是云存储.
这个服务的主要目的是为了给有上传下载服务业务需求的用户使用(比如需要开发上传下载服务的开发人员).

## 软件特性
基于libXEngine开发并实现的一套简洁高性能跨平台网络存储服务
本仓库有开发和主分支,如果要使用,请使用master分支下的代码
软件特性:
1. 支持HTTP协议上传和下载(采用PUT和GET)
2. 支持二进制私有协议传送数据(规划中)
2. 支持HTTP API接口事件通知与管理(规划中)
3. 支持加密传输(规划中)
4. 采用MYSQL记录信息
5. 支持分布式(规划中)
6. 支持HTTP和私有验证(规划中)
7. 支持详尽的日志和配置信息
8. 支持传输速率控制
9. 支持任务开始结束代理转发(规划中)
10.支持P2P,BT,数据分发(规划中)
9. 支持任务开始结束代理转发(规划中)
10.支持P2P,BT,数据分发(规划中)
11.支持秒传
12.支持NGINX 下载透传代理(规划中)
13.支持NGINX UPLOAD MODULE上传代理

## 安装教程

Expand All @@ -27,7 +32,7 @@ XEngine版本需要V7.13或者以上版本
vcpkg 需要2021.05.11以上版本

#### Windows
使用VS2019 打开并且编译
使用VS2019 x86打开并且编译
你需要按照下面的方式配置环境,不然你可能需要自己在项目中设置库目录
##### 三方库环境
需要使用VCPKG安装环境.代码地址:https://github.com/microsoft/vcpkg
Expand Down Expand Up @@ -73,6 +78,17 @@ make FLAGS=CleanAll 清理编译
- XEngine_Release 安装目录结构
- XEngine_Source 源代目录结构

## API列表
POST方法在本服务中用作于API.
API用于管理服务器.API列表格式使用URL来识别,比如,POST /api/query/file
三段格式是固定的,第一个api固定值,第二个query表示API类型,第三个file表示api名
支持的API列表参考:apilist.txt

## 秒传实现
秒传的实现不是靠服务器实现的,而是靠客户端实现的.
上传秒传的实现是先通过HASH查询文件是否在服务器,如果存在就不上传直接提示客户端上传成功.
下载秒传的实现是先通过HASH查询本地文件保存路径,如果存在就直接下载完成.

## 参与贡献

1. Fork 本仓库
Expand Down
Binary file added XEngine_Docment/Docment_en.docx
Binary file not shown.
Binary file added XEngine_Docment/Docment_zh.docx
Binary file not shown.
19 changes: 12 additions & 7 deletions XEngine_Release/XEngine_Config/XEngine_Config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"tszIPAddr": "127.0.0.1",
"bDeamon": 0,
"nCenterPort": 5001,
"nStorageDLPort": 5002,
"nStorageUPPort": 5003,
"nCenterPort": 5000,
"nStorageDLPort": 5001,
"nStorageUPPort": 5002,
"XMax": {
"MaxClient": 10000,
"MaxQueue": 10000,
Expand All @@ -13,7 +13,8 @@
"nStorageDLThread": 2
},
"XTime": {
"bHBTime": 1,
"bHBTime": 0,
"nDBMonth": 3,
"nTimeCheck": 3,
"nCenterTimeOut": 5,
"nStorageTimeOut": 5
Expand All @@ -24,13 +25,15 @@
"LogLeave": 32
},
"XSql": {
"SQLAddr": "127.0.0.1",
"SQLAddr": "192.168.1.9",
"SQLPort": 3306,
"SQLUser": "root",
"SQLPass": "123123aa"
"SQLPass": "123123Ruiyue"
},
"XStorage": {
"nUseMode": 1,
"nHashMode": 2,
"bRename": 0,
"tszHttpAddr": "http://192.168.1.4",
"tszNginAddr": "http://192.168.1.4:5010",
"tszFileDir": "./XEngine_File"
Expand All @@ -41,7 +44,9 @@
},
"XVer": {
"StorageVersion": [
"1.2.0.1001 Build20210618",
"1.1.0.1001 Build20210611",
"1.0.0.1001 Build20210501"
]
}
}
}
52 changes: 52 additions & 0 deletions XEngine_SQLFile/XEngine.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
Navicat Premium Data Transfer
Source Server : 192.168.1.9
Source Server Type : MySQL
Source Server Version : 80025
Source Host : 192.168.1.9:3306
Source Schema : XEngine
Target Server Type : MySQL
Target Server Version : 80025
File Encoding : 65001
Date: 17/06/2021 17:19:26
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for XStorage_Count
-- ----------------------------
DROP TABLE IF EXISTS `XStorage_Count`;
CREATE TABLE `XStorage_Count` (
`ID` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
`FileCount` bigint NULL DEFAULT NULL COMMENT '文件总个数',
`FileSize` bigint NULL DEFAULT NULL COMMENT '文件总大小',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for XStorage_User
-- ----------------------------
DROP TABLE IF EXISTS `XStorage_User`;
CREATE TABLE `XStorage_User` (
`ID` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
`UserName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
`UserPass` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码',
`FileCount` bigint NOT NULL COMMENT '文件个数',
`FileSize` bigint NOT NULL COMMENT '占用大小',
`PhoneNumber` bigint NOT NULL COMMENT '电话号码',
`IDNumber` bigint NOT NULL COMMENT '身份证号码',
`PermissionLeave` tinyint NOT NULL COMMENT '权限级别',
`Status` tinyint NULL DEFAULT NULL COMMENT '状态',
`xhToken` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户临时句柄',
`EMailAddr` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '电子邮件地址',
`IPAddr` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '最后登录IP地址',
`CreateTime` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;

SET FOREIGN_KEY_CHECKS = 1;
35 changes: 35 additions & 0 deletions XEngine_SQLFile/XEngine_Storage.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
Navicat Premium Data Transfer
Source Server : 192.168.1.9
Source Server Type : MySQL
Source Server Version : 80025
Source Host : 192.168.1.9:3306
Source Schema : XEngine_Storage
Target Server Type : MySQL
Target Server Version : 80025
File Encoding : 65001
Date: 17/06/2021 17:19:07
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for XStorage_File
-- ----------------------------
DROP TABLE IF EXISTS `XStorage_File`;
CREATE TABLE `XStorage_File` (
`ID` int NOT NULL AUTO_INCREMENT COMMENT 'ID序号',
`FilePath` varchar(260) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件路径',
`FileName` varchar(260) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件名称',
`FileHash` varchar(260) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件HASH',
`FileUser` varchar(260) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件所属用户',
`FileSize` bigint NOT NULL COMMENT '文件大小',
`FileTime` datetime NOT NULL COMMENT '插入时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;

SET FOREIGN_KEY_CHECKS = 1;
7 changes: 7 additions & 0 deletions XEngine_SQLFile/XStorage_Create.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
qyt create sql file
*/


CREATE DATABASE `XEngine` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_general_ci;
CREATE DATABASE `XEngine_Storage` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_general_ci;
13 changes: 11 additions & 2 deletions XEngine_Source/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@ UNICODE = 0

FLAGS = RELEASE=$(RELEASE)

COMPONENTS_SQL_PATH = ./XEngine_StorageComponents/XStorage_SQLPacket
COMPONENTS_PROTOCOL_PATH = ./XEngine_StorageComponents/XStorage_Protocol

BASE_CONFIG_PATH = ./StorageModule_Config
BASE_SESSION_PATH = ./StorageModule_Session

APPSERVICE_STORAGE_PATH = ./XEngine_StorageApp

NETENGINE_LIB = libStorageModule_Config.so libStorageModule_Session.so \
XEngine_StorageApp.exe
NETENGINE_LIB = libXStorage_SQLPacket.so libXStorage_Protocol.so \
libStorageModule_Config.so libStorageModule_Session.so \
XEngine_StorageApp.exe

.PHONY:MakeAll
MakeAll:$(NETENGINE_LIB)

libXStorage_SQLPacket.so:
make -C $(COMPONENTS_SQL_PATH) $(FLAGS)
libXStorage_Protocol.so:
make -C $(COMPONENTS_PROTOCOL_PATH) $(FLAGS)

libStorageModule_Config.so:
make -C $(BASE_CONFIG_PATH) $(FLAGS)
libStorageModule_Session.so:
Expand Down
Loading

0 comments on commit 5ceb2b5

Please sign in to comment.