Skip to content

Commit

Permalink
Move socket path on osx (#28034)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnojima authored Oct 1, 2024
1 parent 8d3f934 commit 9f350ba
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
3 changes: 2 additions & 1 deletion go/libkb/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,11 @@ func (d Darwin) SandboxCacheDir() string {
if d.isIOS() {
return ""
}
return d.CacheDir()
// The container name "keybase" is the group name specified in the entitlement for sandboxed extensions
// Note: this was added for kbfs finder integration, which was never activated.
// keybased.sock and kbfsd.sock live in this directory.
return d.appDir(d.Home(false), "Library", "Group Containers", "keybase", "Library", "Caches")
// return d.appDir(d.Home(false), "Library", "keybase", "Library", "Caches")
}
func (d Darwin) ConfigDir() string {
return d.appDir(d.sharedHome(), "Library", "Application Support")
Expand Down
22 changes: 12 additions & 10 deletions packaging/prerelease/build_keybase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e -u -o pipefail # Fail on error

dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
cd "$dir"
client_dir="$dir/../../go"

Expand All @@ -18,23 +18,25 @@ tags=${TAGS:-"prerelease production"}
ldflags="-X github.com/keybase/client/go/libkb.PrereleaseBuild=$keybase_build -s -w"
arch=${ARCH:-"amd64"}

echo "------------------ Building go ------------------"
echo "Building $build_dir/keybase ($keybase_build) with $(go version) on arch: $arch"
(cd "$client_dir" && GOARCH="$arch" go build -a -tags "$tags" -ldflags "$ldflags" -o "$build_dir/keybase" "github.com/keybase/client/go/keybase")
echo "------------------ Building go ------------------"

if [ "$PLATFORM" = "darwin" ] || [ "$PLATFORM" = "darwin-arm64" ]; then
echo "Signing binary..."
code_sign_identity="90524F7BEAEACD94C7B473787F4949582F904104" # "Developer ID Application: Keybase, Inc. (99229SGT5K)"
codesign --verbose --force --deep --timestamp --options runtime --sign "$code_sign_identity" "$build_dir/keybase"
echo "Signing binary..."
code_sign_identity="90524F7BEAEACD94C7B473787F4949582F904104" # "Developer ID Application: Keybase, Inc. (99229SGT5K)"
codesign --verbose --force --deep --timestamp --options runtime --sign "$code_sign_identity" "$build_dir/keybase"
elif [ "$PLATFORM" = "linux" ]; then
echo "No codesigning for Linux"
echo "No codesigning for Linux"
elif [ "$PLATFORM" = "windows" ]; then
echo "No codesigning for Windows"
echo "No codesigning for Windows"
else
echo "Invalid PLATFORM"
exit 1
echo "Invalid PLATFORM"
exit 1
fi

if [ ! "$PLATFORM" = "darwin-arm64" ]; then # we can't run the arm64 binary on the amd64 build machine!
version=$("$build_dir"/keybase version -S)
echo "Keybase version: $version"
version=$("$build_dir"/keybase version -S)
echo "Keybase version: $version"
fi
22 changes: 12 additions & 10 deletions packaging/prerelease/build_updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e -u -o pipefail # Fail on error

dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
cd "$dir"

build_dir=${BUILD_DIR:-/tmp/keybase}
Expand All @@ -16,23 +16,25 @@ cd "$src_dir"

mkdir -p "$build_dir"

echo "------------------ Building updater go ------------------"
echo "Building $build_dir/updater with $(go version) on arch: $arch"
GOARCH="$arch" go build -a -o "$dest" "$package"
echo "------------------ Building updater go ------------------"

if [ "$PLATFORM" = "darwin" ] || [ "$PLATFORM" = "darwin-arm64" ]; then
echo "Signing binary..."
code_sign_identity="90524F7BEAEACD94C7B473787F4949582F904104" # "Developer ID Application: Keybase, Inc. (99229SGT5K)"
codesign --verbose --force --deep --timestamp --options runtime --sign "$code_sign_identity" "$dest"
echo "Signing binary..."
code_sign_identity="90524F7BEAEACD94C7B473787F4949582F904104" # "Developer ID Application: Keybase, Inc. (99229SGT5K)"
codesign --verbose --force --deep --timestamp --options runtime --sign "$code_sign_identity" "$dest"
elif [ "$PLATFORM" = "linux" ]; then
echo "No codesigning for Linux"
echo "No codesigning for Linux"
elif [ "$PLATFORM" = "windows" ]; then
echo "No codesigning for Windows"
echo "No codesigning for Windows"
else
echo "Invalid PLATFORM"
exit 1
echo "Invalid PLATFORM"
exit 1
fi

if [ ! "$PLATFORM" = "darwin-arm64" ]; then # we can't run the arm64 binary on the amd64 build machine!
updater_version=$("$build_dir"/updater -version)
echo "Updater version: $updater_version"
updater_version=$("$build_dir"/updater -version)
echo "Updater version: $updater_version"
fi
2 changes: 1 addition & 1 deletion shared/constants/platform.desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const getDarwinPaths = () => {
jsonDebugFileName: `${logDir}${appName}.app.debug`,
logDir,
serverConfigFileName: `${logDir}${appName}.app.serverConfig`,
socketPath: join(`${libraryDir}Group Containers/keybase/Library/Caches`, appName, socketName),
socketPath: join(`${libraryDir}Caches`, appName, socketName),
}
}

Expand Down

0 comments on commit 9f350ba

Please sign in to comment.