Skip to content
Merged
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
1 change: 1 addition & 0 deletions cmd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.syso
4 changes: 3 additions & 1 deletion cmd/agent_local/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ clean:
"$(MAKE)" -C ${TOP} ee/psso/clean || true

build:
echo "${TOP}/bin/${TARGET}"
mkdir -p "${TOP}/bin/${TARGET}"
ifeq ($(OS),Windows_NT)
$(call go_generate_resources,authentik Platform Agent)
endif
go build \
${GO_BUILD_FLAGS} \
-o "${TOP}/bin/${TARGET}/${BINARY_NAME}" \
Expand Down
3 changes: 3 additions & 0 deletions cmd/agent_system/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ clean:
.PHONY: build
build:
mkdir -p "${TOP}/bin/${TARGET}"
ifeq ($(OS),Windows_NT)
$(call go_generate_resources,authentik Platform System Service)
endif
go build \
${GO_BUILD_FLAGS} \
-o "${TOP}/bin/${TARGET}/${BINARY_NAME}" \
Expand Down
3 changes: 3 additions & 0 deletions cmd/browser_support/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ clean:
.PHONY: build
build:
mkdir -p "${TOP}/bin/${TARGET}"
ifeq ($(OS),Windows_NT)
$(call go_generate_resources,authentik Platform Browser Support)
endif
go build \
${GO_BUILD_FLAGS} \
-o "${TOP}/bin/${TARGET}/${BINARY_NAME}" \
Expand Down
3 changes: 3 additions & 0 deletions cmd/cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ clean:

build:
mkdir -p "${TOP}/bin/${TARGET}"
ifeq ($(OS),Windows_NT)
$(call go_generate_resources,authentik Platform CLI)
endif
go build \
${GO_BUILD_FLAGS} \
-o "${TOP}/bin/${TARGET}/${BINARY_NAME}" \
Expand Down
13 changes: 13 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,16 @@ define sentry_upload_symbols
--project platform \
$(1)
endef

define go_generate_resources
go tool goversioninfo \
-icon="${TOP}/cmd/agent_local/package/windows/resources/icon.ico" \
-company="Authentik Security Inc." \
-copyright="2025 Authentik Security Inc." \
-file-version=${VERSION} \
-product-version=${VERSION} \
-comment="$(1)" \
-description="$(1)" \
-product-name="$(1)" \
-skip-versioninfo
endef
4 changes: 0 additions & 4 deletions ee/wcp/ak_cred_provider/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,10 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
${CREDUI_LIB_PATH}
${SECUR32_LIB_PATH}
${SHLWAPI_LIB_PATH}
#${CEFSIMPLE_LIB_PATH}
# ${LIBCEF_LIB_PATH}
cefsimple
authentik_sys_bridge
spdlog
sentry
# libcef_lib
# libcef_dll_wrappe
)

# TODO: Add tests and install targets if needed.
134 changes: 0 additions & 134 deletions ee/wcp/cefsimple/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,140 +98,6 @@ endif()
SET_CEF_TARGET_OUT_DIR()


#
# Linux configuration.
#

if(OS_LINUX)
# Executable target.
add_executable(${CEF_TARGET} ${CEFSIMPLE_SRCS})
SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_TARGET})
add_dependencies(${CEF_TARGET} ak_cred_provider)
target_link_libraries(${CEF_TARGET} libcef_lib ak_cred_provider ${CEF_STANDARD_LIBS})

# Set rpath so that libraries can be placed next to the executable.
set_target_properties(${CEF_TARGET} PROPERTIES INSTALL_RPATH "$ORIGIN")
set_target_properties(${CEF_TARGET} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
set_target_properties(${CEF_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CEF_TARGET_OUT_DIR})

# Copy binary and resource files to the target output directory.
COPY_FILES("${CEF_TARGET}" "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${CEF_TARGET_OUT_DIR}")
COPY_FILES("${CEF_TARGET}" "${CEF_RESOURCE_FILES}" "${CEF_RESOURCE_DIR}" "${CEF_TARGET_OUT_DIR}")
if (EXISTS "${CEF_BINARY_DIR}/libminigbm.so")
COPY_FILES("${CEF_TARGET}" "libminigbm.so" "${CEF_BINARY_DIR}" "${CEF_TARGET_OUT_DIR}")
endif()

# Set SUID permissions on the chrome-sandbox target.
SET_LINUX_SUID_PERMISSIONS("${CEF_TARGET}" "${CEF_TARGET_OUT_DIR}/chrome-sandbox")
endif()


#
# Mac OS X configuration.
#

if(OS_MAC)
option(OPTION_USE_ARC "Build with ARC (automatic Reference Counting) on macOS." ON)
if(OPTION_USE_ARC)
list(APPEND CEF_COMPILER_FLAGS
-fobjc-arc
)
set_target_properties(${target} PROPERTIES
CLANG_ENABLE_OBJC_ARC "YES"
)
endif()

# Output path for the main app bundle.
set(CEF_APP "${CEF_TARGET_OUT_DIR}/${CEF_TARGET}.app")

# Variables referenced from the main Info.plist file.
set(EXECUTABLE_NAME "${CEF_TARGET}")
set(PRODUCT_NAME "${CEF_TARGET}")

if(USE_SANDBOX)
# Logical target used to link the cef_sandbox library.
ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}")
endif()

# Main app bundle target.
add_executable(${CEF_TARGET} MACOSX_BUNDLE ${CEFSIMPLE_RESOURCES_SRCS} ${CEFSIMPLE_SRCS})
SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_TARGET})
add_dependencies(${CEF_TARGET} ak_cred_provider)
target_link_libraries(${CEF_TARGET} ak_cred_provider ${CEF_STANDARD_LIBS})
set_target_properties(${CEF_TARGET} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/Info.plist.in
)

# Copy the CEF framework into the Frameworks directory.
add_custom_command(
TARGET ${CEF_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CEF_BINARY_DIR}/Chromium Embedded Framework.framework"
"${CEF_APP}/Contents/Frameworks/Chromium Embedded Framework.framework"
VERBATIM
)

# Create the multiple Helper app bundle targets.
foreach(_suffix_list ${CEF_HELPER_APP_SUFFIXES})
# Convert to a list and extract the suffix values.
string(REPLACE ":" ";" _suffix_list ${_suffix_list})
list(GET _suffix_list 0 _name_suffix)
list(GET _suffix_list 1 _target_suffix)
list(GET _suffix_list 2 _plist_suffix)

# Define Helper target and output names.
set(_helper_target "${CEF_HELPER_TARGET}${_target_suffix}")
set(_helper_output_name "${CEF_HELPER_OUTPUT_NAME}${_name_suffix}")

# Create Helper-specific variants of the helper-Info.plist file. Do this
# manually because the configure_file command (which is executed as part of
# MACOSX_BUNDLE_INFO_PLIST) uses global env variables and would insert the
# wrong values with multiple targets.
set(_helper_info_plist "${CMAKE_CURRENT_BINARY_DIR}/helper-Info${_target_suffix}.plist")
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/mac/helper-Info.plist.in" _plist_contents)
string(REPLACE "\${EXECUTABLE_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents})
string(REPLACE "\${PRODUCT_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents})
string(REPLACE "\${BUNDLE_ID_SUFFIX}" "${_plist_suffix}" _plist_contents ${_plist_contents})
file(WRITE ${_helper_info_plist} ${_plist_contents})

# Create Helper executable target.
add_executable(${_helper_target} MACOSX_BUNDLE ${CEFSIMPLE_HELPER_SRCS})
SET_EXECUTABLE_TARGET_PROPERTIES(${_helper_target})
add_dependencies(${_helper_target} ak_cred_provider)
target_link_libraries(${_helper_target} ak_cred_provider ${CEF_STANDARD_LIBS})
set_target_properties(${_helper_target} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${_helper_info_plist}
OUTPUT_NAME ${_helper_output_name}
)

if(USE_SANDBOX)
target_link_libraries(${_helper_target} cef_sandbox_lib)
endif()

# Add the Helper as a dependency of the main executable target.
add_dependencies(${CEF_TARGET} "${_helper_target}")

# Copy the Helper app bundle into the Frameworks directory.
add_custom_command(
TARGET ${CEF_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CEF_TARGET_OUT_DIR}/${_helper_output_name}.app"
"${CEF_APP}/Contents/Frameworks/${_helper_output_name}.app"
VERBATIM
)
endforeach()

# Manually process and copy over resource files.
# The Xcode generator can support this via the set_target_properties RESOURCE
# directive but that doesn't properly handle nested resource directories.
# Remove these prefixes from input file paths.
set(PREFIXES "mac/")
COPY_MAC_RESOURCES("${CEFSIMPLE_RESOURCES_SRCS}" "${PREFIXES}" "${CEF_TARGET}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_APP}")
endif()


#
# Windows configuration.
#
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ require (
github.com/Masterminds/semver/v3 v3.3.1 // indirect
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
github.com/ProtonMail/go-crypto v1.3.0 // indirect
github.com/akavel/rsrc v0.10.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.13 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.13 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.3 // indirect
Expand Down Expand Up @@ -95,6 +96,7 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/invopop/jsonschema v0.13.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/josephspurrier/goversioninfo v1.5.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/jstemmer/go-junit-report/v2 v2.1.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
Expand Down Expand Up @@ -153,6 +155,7 @@ require (

tool (
github.com/goreleaser/nfpm/v2/cmd/nfpm
github.com/josephspurrier/goversioninfo/cmd/goversioninfo
github.com/jstemmer/go-junit-report/v2
google.golang.org/grpc/cmd/protoc-gen-go-grpc
google.golang.org/protobuf/cmd/protoc-gen-go
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ github.com/ProtonMail/gopenpgp/v2 v2.7.1 h1:Awsg7MPc2gD3I7IFac2qE3Gdls0lZW8SzrFZ
github.com/ProtonMail/gopenpgp/v2 v2.7.1/go.mod h1:/BU5gfAVwqyd8EfC3Eu7zmuhwYQpKs+cGD8M//iiaxs=
github.com/adrg/xdg v0.5.3 h1:xRnxJXne7+oWDatRhR1JLnvuccuIeCoBu2rtuLqQB78=
github.com/adrg/xdg v0.5.3/go.mod h1:nlTsY+NNiCBGCK2tpm09vRqfVzrc2fLmXGpBLF0zlTQ=
github.com/akavel/rsrc v0.10.2 h1:Zxm8V5eI1hW4gGaYsJQUhxpjkENuG91ki8B4zCrvEsw=
github.com/akavel/rsrc v0.10.2/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
github.com/aletheia7/ul v1.5.0 h1:9zBVP4Z2mpky36i92/bwjq+iRsn5rIli1w/uam4OjaA=
github.com/aletheia7/ul v1.5.0/go.mod h1:phZ/+NW72pFssEYvoGuilY35jpzIbW8utY0oGF5yjxI=
github.com/alexw23/go-keychain v0.0.0-20240507145345-41efe171240e h1:tr4NMs+H918AUrqOpYkjfeZDg7554ufuQXS/Ego/JRU=
Expand Down Expand Up @@ -198,6 +200,8 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/johnbellone/grpc-middleware-sentry v0.4.0 h1:4Ojhjv+/1skH2wLMkNGWtYHo+iwiOnLZV3dn7KUhCvc=
github.com/johnbellone/grpc-middleware-sentry v0.4.0/go.mod h1:o017YrGIUqWfhPMbcg/Jg2CTeLTdbGRkuEQywqcDVqY=
github.com/josephspurrier/goversioninfo v1.5.0 h1:9TJtORoyf4YMoWSOo/cXFN9A/lB3PniJ91OxIH6e7Zg=
github.com/josephspurrier/goversioninfo v1.5.0/go.mod h1:6MoTvFZ6GKJkzcdLnU5T/RGYUbHQbKpYeNP0AgQLd2o=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
Expand Down
Loading