# sensitivesword **Repository Path**: swnet/sensitivesword ## Basic Information - **Project Name**: sensitivesword - **Description**: 多租户下,使用go提供每个站点的敏感词检测 - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-03-01 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # sensitivesword #### 介绍 提供多站点下的铭感词检测 #### 软件架构 基于DFA算法, 将每个站点的敏感词load到内存中 #### 安装教程 1. 下载本项目到 `GOPATH` 下的 src 目录, 修改配置文件 `config.yaml` ```yaml -- 数据库的配置 databases: cloud_data: root:123456@tcp(192.168.56.10:3306)/cloud_data?charset=utf8 site: root:123456@tcp(192.168.56.10:3306)/site_%v?charset=utf8 -- 服务监听地址,host建议使用内网地址 http: host: 0.0.0.0 port: 8080 -- 定义更新词库的时间间隔 interval: minute: 10 ``` 2. 执行 `GOOS=linux GOARCH=amd64 go build -o bin/sensitive main.go` 生成二进制文件 3. 上传 `bin/sensitive` 文件到 /usr/local/server/go/sensitive/ 目录,并新建 `/usr/local/server/go/sensitive/config.yaml` 配置文件 #### 配置supervisor进程管理 ``` [program:sensitive] command=/usr/local/server/go/sensitive/sensitive -c config.yaml process_name=sensitive autostart=true autorestart=true startretries=3 stdout_logfile=/var/log/supervisor/sensitive.log stdout_logfile_maxbytes=64MB stderr_logfile=/var/log/supervisor/sensitive_err.log stderr_logfile_maxbytes=1MB ``` F