Skip to content
/ SifCap Public

Sif国服个人数据收集服务。项目使用Java语言,依赖jnetpcap库,实现对网卡流量的监控,并存入数据库。数据库交互部分使用MyBatis框架编写。

License

Notifications You must be signed in to change notification settings

ghh3809/SifCap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SifCap

Sif国服个人数据收集服务

项目使用Java语言,依赖jnetpcap库,实现对网卡流量的监控,并存入数据库。数据库交互部分使用MyBatis框架编写。

环境配置 (for Linux)

  1. 安装libpcap、libpcap-devel、sqlite3库
yum install -y libpcap libpcap-devel sqlite-devel
  1. 下载jnetpcap

可以根据环境下载对应的版本

wget -O jnetpcap-1.4.r1425 https://downloads.sourceforge.net/project/jnetpcap/jnetpcap/Latest/jnetpcap-1.4.r1425-1.linux64.x86_64.tgz
  1. 添加so文件到系统库
tar -xvf jnetpcap-1.4.r1425
cp jnetpcap-1.4.r1425/libjnetpcap.so /lib/

快速开始

环境需求

项目需运行在Java 1.8,MySQL 5.6及以上环境

数据库配置

首次运行需配置数据库。

初始化:执行script/initial.sql,生成需要的数据表

mysql -h$host -u$user -p$pass -D$db < script/initial.sql

仿照下例添加文件:src/main/resources/mybatis-config.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>
    <!-- 环境配置 -->
    <environments default="development">
        <environment id="development">
            <transactionManager type="JDBC"/>
            <!-- 数据库连接相关配置 ,这里动态获取config.properties文件中的内容-->
            <dataSource type="POOLED">
                <property name="driver" value="com.mysql.cj.jdbc.Driver" />
                <property name="url" value="jdbc:mysql://{host}:{port}/{db}" />
                <property name="username" value="{user}" />
                <property name="password" value="{passwd}" />
            </dataSource>
        </environment>
    </environments>
    <!-- mapping文件路径配置 -->
    <mappers>
        <mapper resource="mapper/userMapper.xml"/>
        <mapper resource="mapper/liveMapper.xml"/>
    </mappers>

</configuration>

编译

sh build.sh

运行

cd output
sh server-start.sh

如何贡献

欢迎提Issue和Pull request

About

Sif国服个人数据收集服务。项目使用Java语言,依赖jnetpcap库,实现对网卡流量的监控,并存入数据库。数据库交互部分使用MyBatis框架编写。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages