This platform can receive alerts posted by other software, then send the alert to specific person by matching the patterns.
Currently, this platform is connected with the DingTalk. You may modify the code to satisfy your needs.
- User privacy;
- Database security;
- Emphasizing client-side processing;
- Balancing the GPU and CPU;
- Maximizing server performance.
Though the code is mostly written in PHP, some pieces are written in C++, Python, HTML, JavaScript, and CSS.
2-Core CPU
2-GiB Memory
50-GiB SSD
Python 3.6+, PHP 7+ (incl. PHP-CLI)
php-fpm, php-curl, php-gd, php-intl, php-mbstring, php-soap, php-xml, php-xmlrpc, php-zip
pip::idna
zip, unzip
Nginx
The Server folder includes server-side scripts and dependencies.
The Client folder includes client-side scripts, which is about how to POST data to the server.
The Supplements folder includes files such as PHP and Nginx sample configurations.
- Move all files from "Server" to the parent directory of Web Root;
- Make following files executable:
chmod +x tools/email/sendEmail.py
,chmod +x tools/multi_threading/main
,chmod +x tools/randNum
;
- Add your database information by
nano tools/SQL/SQL.php
(Lines 11 - 15); - Modify the SMTP settings by
nano tools/email/sendEmail.py
(Lines 25 - 28); - Create following tables:
CREATE TABLE Alerts (ID INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY, Date TIMESTAMP, IP VARCHAR(129) NOT NULL, Service VARCHAR(2000) NOT NULL, Details VARCHAR(4000) NOT NULL, Others VARCHAR(8000));
CREATE TABLE Regex (Type CHAR(1) NOT NULL, Regex VARCHAR(1000) NOT NULL, Send VARCHAR(2000) NOT NULL, Date TIMESTAMP, Assignee VARCHAR(200));
CREATE TABLE Login (Usr VARCHAR(200) NOT NULL,Pwd CHAR(41) NOT NULL, PIN INT(5) NOT NULL, Last_Login TIMESTAMP, Permission INT(1) NOT NULL, Assignee VARCHAR(200));
CREATE TABLE Tel (Name VARCHAR(500) NOT NULL, Phone CHAR(11) NOT NULL, DDGroup CHAR(64) NOT NULL, Date TIMESTAMP, Assignee VARCHAR(200));
- Reboot.
The code has been tested on Nginx/Debian 9 and Chrome 75.
- If the parent directory is not
/var/www
, please check the file path in each source code file during installation. - When you are trying to modify the code, please make sure the table data type and max variable-length support it. You should also pay attention to the code comment.
Main Contributor: @PI, @Ranger, and @guanxiaobo.
Alert Platform is created for EQXIU and licensed under the MIT license. You are free to reuse and modify the source code.
Please note that this software uses third party components that are licensed under CC BY 3.0 and Apache.