Skip to content

Commit 69f5321

Browse files
authored
Feat: OSX Local Codesigning (#1319)
* stage makefile * OSX local code signing and entitlements file to fix incoming connections prompt
1 parent 9dddd11 commit 69f5321

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Entitlements.plist

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.network.client</key>
6+
<true/>
7+
<key>com.apple.security.network.server</key>
8+
<true/>
9+
</dict>
10+
</plist>

Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ ifeq ($(BUILD_TYPE),clblas)
106106
CGO_LDFLAGS+=-lOpenCL -lclblast
107107
endif
108108

109+
ifeq ($(OS),Darwin)
110+
ifeq ($(OSX_SIGNING_IDENTITY),)
111+
OSX_SIGNING_IDENTITY := $(shell security find-identity -v -p codesigning | grep '"' | head -n 1 | sed -E 's/.*"(.*)"/\1/')
112+
endif
113+
endif
114+
109115
# glibc-static or glibc-devel-static required
110116
ifeq ($(STATIC),true)
111117
LD_FLAGS=-linkmode external -extldflags -static
@@ -273,6 +279,9 @@ dist: build
273279
mkdir -p release
274280
cp $(BINARY_NAME) release/$(BINARY_NAME)-$(BUILD_ID)-$(OS)-$(ARCH)
275281

282+
osx-signed: build
283+
codesign --deep --force --sign "$(OSX_SIGNING_IDENTITY)" --entitlements "./Entitlements.plist" "./$(BINARY_NAME)"
284+
276285
## Run
277286
run: prepare ## run local-ai
278287
CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOCMD) run ./

0 commit comments

Comments
 (0)