Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libacl based fallback resolver enablement #1001

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,30 @@ ENV TZ=UTC

RUN dnf install -y \
"@Development Tools" \
autoconf \
automake \
cmake-rpm-macros \
dnf-plugins-core \
gcc-toolset-10 \
gcc-toolset-10-libatomic-devel \
gettext-devel \
iproute \
libacl-devel \
libcap-devel \
libtool \
perl \
perl-IPC-Cmd \
python3 \
systemd-devel \
zlib-devel \
systemd-rpm-macros \
cmake-rpm-macros \
perl \
zlib-devel \
&& dnf config-manager --set-enabled powertools \
&& dnf install -y \
doxygen \
graphviz \
git \
graphviz \
ninja-build \
&& dnf clean all
&& dnf clean all

RUN curl -sSfL https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-linux-$(uname -m).sh -o cmake.sh \
&& (bash cmake.sh --skip-license --prefix=/usr/local) \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "acl",
"version": "0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "libcap",
"version": "0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,32 @@ ENV TZ=UTC

RUN dnf install -y \
"@Development Tools" \
autoconf \
automake \
cmake-rpm-macros \
dnf-plugins-core \
gettext-devel \
iproute \
libacl-devel \
libatomic \
libcap-devel \
libtool \
openssl-devel \
perl-File-Compare \
perl-File-Copy \
perl-FindBin \
perl-IPC-Cmd \
python3 \
systemd-devel \
zlib-devel \
systemd-rpm-macros \
cmake-rpm-macros \
perl-FindBin perl-IPC-Cmd perl-File-Compare perl-File-Copy \
libatomic \
zlib-devel \
&& dnf config-manager --set-enabled crb \
&& dnf install -y \
doxygen \
graphviz \
git \
graphviz \
ninja-build \
&& dnf clean all
&& dnf clean all

RUN curl -sSfL https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-linux-$(uname -m).sh -o cmake.sh \
&& (bash cmake.sh --skip-license --prefix=/usr/local) \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "acl",
"version": "0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "libcap",
"version": "0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,41 @@ WORKDIR /root/

RUN apt-get update \
&& apt-get -y install \
autoconf automake autopoint \
gcc-arm-linux-gnueabihf \
g++-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu \
autoconf \
automake \
autopoint \
build-essential \
crossbuild-essential-arm64 \
crossbuild-essential-armhf \
build-essential \
curl zip unzip tar \
curl \
doxygen \
g++-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabihf \
git \
graphviz \
libacl1-dev \
libcap-dev \
libsystemd-dev \
libtool \
ninja-build \
pkg-config \
python3 \
tar \
unzip \
zip \
zlib1g-dev \
ninja-build \
&& rm -rf /var/lib/apt/lists/*

COPY ./crossbuild.list /etc/apt/sources.list.d/crossbuild.list
RUN sed -Ei 's/^deb/deb [arch=amd64]/g' /etc/apt/sources.list
RUN dpkg --add-architecture arm64 && dpkg --add-architecture armhf
RUN apt-get update \
&& apt-get -y install \
libacl1-dev:armhf \
libacl1-dev:arm64 \
libcap-dev:armhf \
libcap-dev:arm64 \
zlib1g-dev:arm64 \
zlib1g-dev:armhf \
&& rm -rf /var/lib/apt/lists/*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "acl",
"version": "0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "libcap",
"version": "0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,24 @@ WORKDIR /root/

RUN apt-get update \
&& apt-get -y install \
autoconf automake autopoint \
gcc-arm-linux-gnueabihf \
g++-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu \
autoconf \
automake \
autopoint \
build-essential \
crossbuild-essential-arm64 \
crossbuild-essential-armhf \
build-essential \
curl zip unzip tar \
doxygen \
g++-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabihf \
git \
graphviz \
libacl1-dev \
libcap-dev \
libsystemd-dev \
libtool \
ninja-build \
pkg-config \
python3 \
zlib1g-dev \
Expand All @@ -40,6 +45,10 @@ RUN sed -Ei 's/^deb/deb [arch=amd64]/g' /etc/apt/sources.list
RUN dpkg --add-architecture arm64 && dpkg --add-architecture armhf
RUN apt-get update \
&& apt-get -y install \
libacl1-dev:armhf \
libacl1-dev:arm64 \
libcap-dev:armhf \
libcap-dev:arm64 \
zlib1g-dev:arm64 \
zlib1g-dev:armhf \
&& rm -rf /var/lib/apt/lists/*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "acl",
"version": "0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "libcap",
"version": "0"
}
19 changes: 19 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@ site](https://openziti.io/).
* make sure cmake is on your path or replace the following `cmake` commands with the fully qualified path to the binary
* [vcpkg](https://github.com/microsoft/vcpkg) is now used for dependencies.

On Linux, you may also need the following:

* autoconf
* automake
* libtool
* autopoint

On Red Hat distributions:

```bash
sudo yum install automake autoconf libtool gettext-devel
```

On Debian based distributions:

```bash
sudo apt install automake autoconf libtool autopoint
```

### Setting up vcpkg

To setup vcpkg you'll need to clone the actual vcpkg repository. The first step will have you set this environment variable.
Expand Down
18 changes: 17 additions & 1 deletion programs/ziti-edge-tunnel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,29 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Linux")

find_package(PkgConfig REQUIRED)

pkg_check_modules(LIBACL IMPORTED_TARGET "libacl")
pkg_check_modules(LIBCAP IMPORTED_TARGET "libcap")

if (LIBACL_FOUND)
target_compile_definitions(ziti-edge-tunnel PRIVATE HAVE_LIBACL_PKG)
target_link_libraries(ziti-edge-tunnel PRIVATE PkgConfig::LIBACL)
endif()

if (LIBCAP_FOUND)
target_compile_definitions(ziti-edge-tunnel PRIVATE HAVE_LIBCAP_PKG)
target_link_libraries(ziti-edge-tunnel PRIVATE PkgConfig::LIBCAP)
endif()


option(DISABLE_LIBSYSTEMD_FEATURE "libsystemd library integration toggle" OFF)
message("DISABLE_LIBSYSTEMD_FEATURE: ${DISABLE_LIBSYSTEMD_FEATURE}")

if (DISABLE_LIBSYSTEMD_FEATURE)
target_compile_definitions(ziti-edge-tunnel PRIVATE EXCLUDE_LIBSYSTEMD_RESOLVER)
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBSYSTEMD IMPORTED_TARGET "libsystemd")

if(LIBSYSTEMD_FOUND)
Expand Down
Loading
Loading