mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
build: auto-generate pf rules based on the build type
This commit is contained in:
@@ -81,6 +81,7 @@ client/.DS_Store
|
|||||||
._.DS_Store
|
._.DS_Store
|
||||||
._*
|
._*
|
||||||
*.dmg
|
*.dmg
|
||||||
|
deploy/data/macos/pf/amn.400.allowPIA.conf
|
||||||
|
|
||||||
# tmp files
|
# tmp files
|
||||||
*.*~
|
*.*~
|
||||||
|
|||||||
@@ -42,6 +42,27 @@ if(APPLE)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(APPLE AND NOT IOS)
|
||||||
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
set(AMN_PF_RULE_IDENTITY "user { root }")
|
||||||
|
else()
|
||||||
|
set(AMN_PF_RULE_IDENTITY "group { amnvpn }")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
"${CMAKE_SOURCE_DIR}/deploy/data/pf-templates/amn.400.allowPIA.conf.in"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/amn.400.allowPIA.conf"
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
|
file(COPY_FILE
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/amn.400.allowPIA.conf"
|
||||||
|
"${CMAKE_SOURCE_DIR}/deploy/data/macos/pf/amn.400.allowPIA.conf"
|
||||||
|
ONLY_IF_DIFFERENT
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
add_subdirectory(client)
|
add_subdirectory(client)
|
||||||
|
|
||||||
if(NOT IOS AND NOT ANDROID AND NOT MACOS_NE)
|
if(NOT IOS AND NOT ANDROID AND NOT MACOS_NE)
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
# Allow traffic by privileged group (used by daemon)
|
|
||||||
pass out proto { tcp, udp } group { amnvpn } flags any no state
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# Allow traffic by configured identity (set by CMake)
|
||||||
|
pass out proto { tcp, udp } @AMN_PF_RULE_IDENTITY@ flags any no state
|
||||||
Reference in New Issue
Block a user