-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
157 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
**/build | ||
*/bin/** | ||
windows/WFP/bin | ||
windows/WFP/block/x64 | ||
windows/WFP/block/.vs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"files.associations": { | ||
"ostream": "cpp", | ||
"any": "cpp", | ||
"array": "cpp", | ||
"atomic": "cpp", | ||
"strstream": "cpp", | ||
"bit": "cpp", | ||
"*.tcc": "cpp", | ||
"bitset": "cpp", | ||
"cctype": "cpp", | ||
"cfenv": "cpp", | ||
"charconv": "cpp", | ||
"chrono": "cpp", | ||
"clocale": "cpp", | ||
"cmath": "cpp", | ||
"codecvt": "cpp", | ||
"complex": "cpp", | ||
"condition_variable": "cpp", | ||
"csignal": "cpp", | ||
"cstdarg": "cpp", | ||
"cstddef": "cpp", | ||
"cstdint": "cpp", | ||
"cstdio": "cpp", | ||
"cstdlib": "cpp", | ||
"cstring": "cpp", | ||
"ctime": "cpp", | ||
"cwchar": "cpp", | ||
"cwctype": "cpp", | ||
"deque": "cpp", | ||
"forward_list": "cpp", | ||
"list": "cpp", | ||
"map": "cpp", | ||
"set": "cpp", | ||
"unordered_map": "cpp", | ||
"unordered_set": "cpp", | ||
"vector": "cpp", | ||
"exception": "cpp", | ||
"algorithm": "cpp", | ||
"functional": "cpp", | ||
"iterator": "cpp", | ||
"memory": "cpp", | ||
"memory_resource": "cpp", | ||
"numeric": "cpp", | ||
"optional": "cpp", | ||
"random": "cpp", | ||
"ratio": "cpp", | ||
"regex": "cpp", | ||
"source_location": "cpp", | ||
"string": "cpp", | ||
"string_view": "cpp", | ||
"system_error": "cpp", | ||
"tuple": "cpp", | ||
"type_traits": "cpp", | ||
"utility": "cpp", | ||
"fstream": "cpp", | ||
"future": "cpp", | ||
"initializer_list": "cpp", | ||
"iomanip": "cpp", | ||
"iosfwd": "cpp", | ||
"iostream": "cpp", | ||
"istream": "cpp", | ||
"limits": "cpp", | ||
"mutex": "cpp", | ||
"new": "cpp", | ||
"shared_mutex": "cpp", | ||
"sstream": "cpp", | ||
"stdexcept": "cpp", | ||
"streambuf": "cpp", | ||
"thread": "cpp", | ||
"cinttypes": "cpp", | ||
"typeindex": "cpp", | ||
"typeinfo": "cpp", | ||
"valarray": "cpp", | ||
"variant": "cpp", | ||
"*.ipp": "cpp" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
UI/domain_block_client/domain_block.ini → ...main_block_client/domain_block_client.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# 服务器配置 | ||
[server] | ||
ip = 192.168.2.149 | ||
ip = 127.0.0.1 | ||
port = 6666 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
[Unit] | ||
Description=A domain block service | ||
[Service] | ||
ExecStart=/home/dacao/work/self/domain_block/bin/domain_block_service | ||
ExecStart=/opt/domain_block/domain_block_service | ||
ExecStop=/bin/kill -TERM $MAINPID | ||
Type=simple | ||
TimeoutStopSec=1 | ||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
cmake_minimum_required(VERSION 3.11) | ||
|
||
set(CPACK_PACKAGE_DESCRIPTION "domain block service") | ||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "域名阻断的服务程序") | ||
set(CPACK_PACKAGE_VENDOR "da234cao") | ||
set(CPACK_PACKAGE_CONTACT "da1234cao.github.io") | ||
set(CPACK_PACKAGE_NAME "domain_block_service") | ||
set(CPACK_PACKAGE_VERSION_MAJOR 0) | ||
set(CPACK_PACKAGE_VERSION_MINOR 1) | ||
set(CPACK_PACKAGE_VERSION_PATCH 0) | ||
|
||
set(INSTALL_DIR /opt/domain_block) | ||
set(SYSTEMD_DIR /etc/systemd/system/) | ||
set(POST_INSTALL_SCRIPT ${CMAKE_SOURCE_DIR}/linux/package/post_install.sh) | ||
|
||
# 服务程序 | ||
install(TARGETS domain_block_service RUNTIME DESTINATION ${INSTALL_DIR}) | ||
# 服务端配置文件-把配置文件和可执行程序防在一起,不符合fhs | ||
install(FILES ${CMAKE_SOURCE_DIR}/linux/domain_block_service.toml DESTINATION ${INSTALL_DIR}) | ||
|
||
# 客户端程序 | ||
# 客户端配置文件-执行的时候会复制一份到家目录的.config文件 | ||
install(TARGETS domain_block_client RUNTIME DESTINATION ${INSTALL_DIR}) | ||
install(FILES ${CMAKE_SOURCE_DIR}/UI/domain_block_client/domain_block_client.ini DESTINATION ${INSTALL_DIR}) | ||
|
||
|
||
# systemctl配置文件 | ||
install(FILES ${CMAKE_SOURCE_DIR}/linux/domain_block.service DESTINATION ${SYSTEMD_DIR}) | ||
|
||
set(CPACK_DEBIAN_PACKAGE_POST_INSTALL_SCRIPT_FILE ${POST_INSTALL_SCRIPT}) | ||
|
||
set(CPACK_GENERATOR "DEB") | ||
|
||
include(CPack) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
systemctl daemon-reload | ||
systemctl start domain_block | ||
|
||
echo "postinst end.\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters