Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nomoresat committed Jan 3, 2022
0 parents commit 6243894
Show file tree
Hide file tree
Showing 338 changed files with 106,711 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CD

on:
release:
types: [created]
push:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: amd64
- arch: x86
- arch: armhf
- arch: arm64
name: Build on ${{ matrix.arch }}
steps:
- name: Git Checkout
uses: actions/checkout@v2

- name: Setup Docker
run: |
docker run --rm --privileged multiarch/qemu-user-static:register --reset
- name: Build
run: |
docker run --workdir /github/workspace --rm --entrypoint "./build_static_alpine.sh" -v "$(pwd)":"/github/workspace" multiarch/alpine:${{ matrix.arch }}-v3.14
- name: Upload Binary
if: github.event_name != 'release'
uses: actions/upload-artifact@v2
with:
name: dpitunnel-cli-${{ matrix.arch }}
path: build/DPITunnel-cli-exec

- name: Upload Binary to Release
if: github.event_name == 'release'
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/DPITunnel-cli-exec
asset_name: dpitunnel-cli-${{ matrix.arch }}
tag: ${{ github.ref }}
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
pull_request:
types: [opened, edited]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: amd64
name: Build on ${{ matrix.arch }}
steps:
- name: Git Checkout
uses: actions/checkout@v2

- name: Setup Docker
run: |
docker run --rm --privileged multiarch/qemu-user-static:register --reset
- name: Build
run: |
docker run --workdir /github/workspace --rm --entrypoint "./build_static_alpine.sh" -v "$(pwd)":"/github/workspace" multiarch/alpine:${{ matrix.arch }}-v3.14
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
72 changes: 72 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Set the minimum version of CMake that can be used
cmake_minimum_required(VERSION 3.5)

set(CMAKE_CXX_STANDARD 14)
cmake_policy(SET CMP0065 NEW)

if (STATIC_BINARY)
message("Building static portable binary with small size")
endif ()


# Set the project name
project(DPITunnel-cli)

# Add dependencies
add_subdirectory(RawSocket)
add_subdirectory(cpp-httplib)
add_subdirectory(dnslib)
add_subdirectory(libnl)

# Add an executable
add_executable(DPITunnel-cli-exec
autoconf.cpp
desync.cpp
dns.cpp
dpitunnel-cli.cpp
netiface.cpp
packet.cpp
profiles.cpp
socket.cpp
ssl.cpp
utils.cpp
)

if (STATIC_BINARY)
target_link_libraries(DPITunnel-cli-exec -static)
target_link_options(DPITunnel-cli-exec PRIVATE "LINKER:--gc-sections")
target_link_options(DPITunnel-cli-exec PRIVATE "LINKER:-s")
target_compile_options(DPITunnel-cli-exec PRIVATE -ffunction-sections)
endif ()

# Set the directories that should be included in the build command for this target
target_include_directories(DPITunnel-cli-exec
PRIVATE
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/RawSocket/include
${PROJECT_SOURCE_DIR}/cpp-httplib/include
${PROJECT_SOURCE_DIR}/dnslib/include
${PROJECT_SOURCE_DIR}/libnl/include
)

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

if (STATIC_BINARY)
set(OPENSSL_USE_STATIC_LIBS TRUE)
endif ()
find_package(OpenSSL REQUIRED)

target_link_libraries(DPITunnel-cli-exec
RawSocket
cpp-httplib
dnslib
libnl
Threads::Threads
OpenSSL::SSL
OpenSSL::Crypto
)

if (STATIC_BINARY)
target_link_libraries(DPITunnel-cli-exec ${CMAKE_DL_LIBS})
endif ()
Loading

0 comments on commit 6243894

Please sign in to comment.