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
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Before you add an account, the window shows a welcome screen with a card for eac
- **Shareable links:** copy a presigned URL that expires in an hour, a day or seven days, or copy the `s3://` URI.
- **Transfers popover** with progress, cancel and Show in Finder. Large files upload in parallel multipart chunks.
- **Credentials live in the Keychain.** Account settings (names, regions, endpoints) go in user defaults; access keys never do.
- **Private by design.** No analytics, no tracking, and no servers of ours: the app only talks to the storage endpoints you add. See the [privacy policy](docs/privacy.md).
- **iCloud sync.** In a build signed with a Developer ID, accounts and keys sync through iCloud Keychain, so they come back after a reinstall and show up on your other Macs.

## Requirements
Expand Down Expand Up @@ -65,7 +66,7 @@ Apple only lets apps signed by a developer team use iCloud Keychain. Ad-hoc sign
If Xcode manages your Developer ID certificate in the cloud, its private key isn't in your keychain and `SIGN_IDENTITY` won't work. Sign through Xcode instead. Run `scripts/build-app.sh`, then:

```sh
DEV_PROFILE=path/to/development.provisionprofile scripts/export-developer-id.sh
DEV_PROFILE=path/to/development.provisionprofile scripts/export-app.sh
```

`DEV_PROFILE` is a Mac development profile for your team that covers `com.bucketbrowser.app`, such as the "Mac Team Provisioning Profile: *" that Xcode keeps in `~/Library/Developer/Xcode/UserData/Provisioning Profiles`. The script wraps the app in an archive and has `xcodebuild -exportArchive` sign it with Developer ID through the account you're signed in to in Xcode. The signed app is written to `build/export/Bucket Browser.app`.
Expand All @@ -74,6 +75,23 @@ CI signs the app the same way when these repository secrets are set: `MACOS_CERT

The first time a signed build runs, it moves any accounts saved by an unsigned build into iCloud Keychain. Make sure iCloud Keychain is on in System Settings › Apple Account › iCloud › Passwords & Keychain.

## Mac App Store

The app runs in the App Sandbox with three entitlements, listed in `Resources/BucketBrowser.entitlements`: outgoing network connections, and read-write access to files and folders the user picks in an open panel or drops on the window. Every app bundle the scripts build is sandboxed, so what you test locally behaves like the App Store copy. (`swift run` isn't sandboxed.) The bundle also carries a privacy manifest (`Resources/PrivacyInfo.xcprivacy`) that declares no tracking and no collected data.

To build an App Store package, with Xcode signed in to an account on the team:

```sh
UNIVERSAL=1 scripts/build-app.sh
DEV_PROFILE=path/to/development.provisionprofile scripts/export-app.sh app-store
```

This writes `build/export/Bucket Browser.pkg`, signed for the App Store through Xcode's cloud-managed distribution certificates. Upload it with Transporter, or run the export with `UPLOAD=1` to have Xcode upload it to App Store Connect directly. The app record must exist in App Store Connect first.

`VERSION` sets the marketing version (1.0.0 by default). The build number defaults to the number of commits on the branch, so each upload from a newer commit gets a higher number, as App Store Connect requires. Set `BUILD_NUMBER` to override it.

The App Store copy uses the same keychain access group as the Developer ID copy, so accounts saved by either one sync through iCloud Keychain to the other.

## Adding an account

Choose **Add Account** at the bottom of the sidebar, or open **Settings › Accounts**.
Expand Down Expand Up @@ -104,7 +122,7 @@ BUCKET_BROWSER_DEMO=1 swift run BucketBrowser

## App icon

The icon's source is `Resources/AppIcon.svg`. To regenerate `Resources/AppIcon.png`, run `python3 scripts/render-icon.py` (it needs `cairosvg` and `Pillow`). `scripts/build-app.sh` turns the PNG into `AppIcon.icns`.
The icon's source is `Resources/AppIcon.svg`. To regenerate `Resources/AppIcon.png` and the ten sizes in `Resources/Assets.xcassets/AppIcon.appiconset`, run `python3 scripts/render-icon.py` (it needs `cairosvg` and `Pillow`). `scripts/build-app.sh` compiles the asset catalog with `actool` into `Assets.car` and `AppIcon.icns`.

## Tests

Expand Down
68 changes: 68 additions & 0 deletions Resources/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"images": [
{
"filename": "icon_16x16.png",
"idiom": "mac",
"scale": "1x",
"size": "16x16"
},
{
"filename": "icon_16x16@2x.png",
"idiom": "mac",
"scale": "2x",
"size": "16x16"
},
{
"filename": "icon_32x32.png",
"idiom": "mac",
"scale": "1x",
"size": "32x32"
},
{
"filename": "icon_32x32@2x.png",
"idiom": "mac",
"scale": "2x",
"size": "32x32"
},
{
"filename": "icon_128x128.png",
"idiom": "mac",
"scale": "1x",
"size": "128x128"
},
{
"filename": "icon_128x128@2x.png",
"idiom": "mac",
"scale": "2x",
"size": "128x128"
},
{
"filename": "icon_256x256.png",
"idiom": "mac",
"scale": "1x",
"size": "256x256"
},
{
"filename": "icon_256x256@2x.png",
"idiom": "mac",
"scale": "2x",
"size": "256x256"
},
{
"filename": "icon_512x512.png",
"idiom": "mac",
"scale": "1x",
"size": "512x512"
},
{
"filename": "icon_512x512@2x.png",
"idiom": "mac",
"scale": "2x",
"size": "512x512"
}
],
"info": {
"author": "xcode",
"version": 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Resources/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info": {
"author": "xcode",
"version": 1
}
}
15 changes: 15 additions & 0 deletions Resources/BucketBrowser.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- The Mac App Store requires the App Sandbox. -->
<key>com.apple.security.app-sandbox</key>
<true/>
<!-- Talks to S3, R2 and other S3-compatible endpoints. -->
<key>com.apple.security.network.client</key>
<true/>
<!-- Uploads read files and folders the user picks or drops; downloads write to the folder they pick. -->
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
</plist>
26 changes: 26 additions & 0 deletions Resources/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- No tracking, and nothing is collected: credentials and settings stay in the user's
keychain and preferences, and the app only talks to the storage endpoints they configure. -->
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<!-- UserDefaults holds the app's own settings: account names, endpoints and the view mode. -->
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
</array>
</dict>
</plist>
3 changes: 1 addition & 2 deletions Sources/S3Kit/S3Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ public final class S3Client: @unchecked Sendable {

/// Uploads a local file, switching to a multipart upload for large files.
public func uploadFile(_ fileURL: URL, bucket: String, key: String, contentType: String? = nil, progress: TransferProgress? = nil) async throws {
let attributes = try FileManager.default.attributesOfItem(atPath: fileURL.path)
let size = (attributes[.size] as? NSNumber)?.int64Value ?? 0
let size = Int64(try fileURL.resourceValues(forKeys: [.fileSizeKey]).fileSize ?? 0)
if size > multipartThreshold {
try await multipartUpload(fileURL, size: size, bucket: bucket, key: key, contentType: contentType, progress: progress)
return
Expand Down
23 changes: 23 additions & 0 deletions docs/privacy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Bucket Browser privacy policy

_Last updated: October 20, 2026_

Bucket Browser is a Mac app for browsing Amazon S3, Cloudflare R2 and other S3-compatible storage. It doesn't collect, store or share any information about you.

## What the app stores

- **Access keys** for the accounts you add are stored in your Mac's keychain. If iCloud Keychain is on, they sync to your other devices through it, end-to-end encrypted by Apple. The developer can't see them.
- **Account settings** (names, regions, endpoints and bucket names) are stored in the app's preferences on your Mac and, with iCloud Keychain on, in iCloud Keychain.
- **Previews** of files you open with Quick Look are cached on your Mac and can be deleted at any time.

## Network connections

The app connects only to the storage endpoints of the accounts you add, such as Amazon S3 or Cloudflare R2, to list, upload, download, rename and delete your files. Those services handle your data under their own privacy policies. The app has no servers of its own and sends nothing to the developer.

## Analytics and tracking

None. The app contains no analytics, advertising or tracking code, and it doesn't link your data to your identity.

## Contact

Questions about this policy: open an issue at https://github.com/chiranjeebhub/S3_R2_bucket_browser/issues.
13 changes: 13 additions & 0 deletions scripts/add-team-entitlements.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Adds the entitlements that tie the app to a developer team to an entitlements file:
# the application identifier and the keychain access group that iCloud Keychain sync uses.
# Usage: scripts/add-team-entitlements.sh <entitlements file> <team id> <bundle id>
set -euo pipefail

FILE="$1"
APP_ID="$2.$3"
BUDDY=/usr/libexec/PlistBuddy
"$BUDDY" -c "Add :com.apple.application-identifier string $APP_ID" "$FILE"
"$BUDDY" -c "Add :com.apple.developer.team-identifier string $2" "$FILE"
"$BUDDY" -c "Add :keychain-access-groups array" "$FILE"
"$BUDDY" -c "Add :keychain-access-groups:0 string $APP_ID" "$FILE"
84 changes: 53 additions & 31 deletions scripts/build-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
# Builds "Bucket Browser.app" from the Swift package and signs it.
# Usage: scripts/build-app.sh [debug|release] (default: release)
#
# The app runs in the App Sandbox (Resources/BucketBrowser.entitlements), as the Mac App Store
# requires. For an App Store build, see scripts/export-app.sh.
#
# VERSION is the marketing version (default 1.0.0). BUILD_NUMBER defaults to the commit count,
# so every build of a later commit has a higher number, which App Store Connect requires.
#
# By default the app is ad-hoc signed, which can't use iCloud Keychain. To build a copy
# that syncs accounts through iCloud, sign it with your team's Developer ID:
# SIGN_IDENTITY="Developer ID Application: Your Name (4TK5PNR392)" \
Expand All @@ -15,35 +21,45 @@ ROOT="$(cd "$(dirname "$0")/.." && pwd)"
APP_NAME="Bucket Browser"
BUNDLE_ID="com.bucketbrowser.app"
TEAM_ID="${TEAM_ID:-4TK5PNR392}"
VERSION="${VERSION:-0.1.0}"
BUILD_NUMBER="${BUILD_NUMBER:-1}"
VERSION="${VERSION:-1.0.0}"
BUILD_NUMBER="${BUILD_NUMBER:-$(git -C "$ROOT" rev-list --count HEAD 2>/dev/null || echo 1)}"
COPYRIGHT="${COPYRIGHT:-Copyright © $(date +%Y) Chiranjeeb Jena. All rights reserved.}"
OUT="$ROOT/build"
APP="$OUT/$APP_NAME.app"

cd "$ROOT"
ARCH_FLAGS=()
BUILD_FLAGS=()
if [[ "${UNIVERSAL:-0}" == "1" ]]; then
ARCH_FLAGS=(--arch arm64 --arch x86_64)
BUILD_FLAGS=(--arch arm64 --arch x86_64)
fi
# SwiftPM records the deployment target as the SDK version in the binary, and App Store Connect
# rejects apps that look built with an old SDK, so pass the real SDK version to the linker.
SDK_VERSION="$(xcrun --sdk macosx --show-sdk-version)"
BUILD_FLAGS+=(-Xlinker -platform_version -Xlinker macos -Xlinker 14.0 -Xlinker "$SDK_VERSION")
# The ${a[@]+...} form keeps bash 3.2 (the macOS default) happy with an empty array under `set -u`.
swift build -c "$CONFIG" ${ARCH_FLAGS[@]+"${ARCH_FLAGS[@]}"}
BIN_DIR="$(swift build -c "$CONFIG" ${ARCH_FLAGS[@]+"${ARCH_FLAGS[@]}"} --show-bin-path)"
swift build -c "$CONFIG" ${BUILD_FLAGS[@]+"${BUILD_FLAGS[@]}"}
BIN_DIR="$(swift build -c "$CONFIG" ${BUILD_FLAGS[@]+"${BUILD_FLAGS[@]}"} --show-bin-path)"

rm -rf "$APP"
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
cp "$BIN_DIR/BucketBrowser" "$APP/Contents/MacOS/BucketBrowser"

# App icon: Resources/AppIcon.png (1024x1024, from scripts/render-icon.py) -> AppIcon.icns
ICONSET="$OUT/AppIcon.iconset"
rm -rf "$ICONSET"
mkdir -p "$ICONSET"
for size in 16 32 128 256 512; do
sips -z "$size" "$size" "$ROOT/Resources/AppIcon.png" --out "$ICONSET/icon_${size}x${size}.png" >/dev/null
double=$((size * 2))
sips -z "$double" "$double" "$ROOT/Resources/AppIcon.png" --out "$ICONSET/icon_${size}x${size}@2x.png" >/dev/null
done
iconutil -c icns "$ICONSET" -o "$APP/Contents/Resources/AppIcon.icns"
rm -rf "$ICONSET"
# App icon: the asset catalog (from scripts/render-icon.py) compiles to Assets.car and AppIcon.icns.
xcrun actool "$ROOT/Resources/Assets.xcassets" --compile "$APP/Contents/Resources" \
--platform macosx --target-device mac --minimum-deployment-target 14.0 \
--app-icon AppIcon --output-partial-info-plist "$OUT/assets-info.plist" \
--errors --warnings --output-format human-readable-text >/dev/null

# Required-reason API declarations for App Store review.
cp "$ROOT/Resources/PrivacyInfo.xcprivacy" "$APP/Contents/Resources/PrivacyInfo.xcprivacy"

# The toolchain keys Xcode writes into every app. App Store Connect reads them to check that
# the app was built with a supported Xcode and SDK.
XCODE_VERSION="$(xcodebuild -version | awk 'NR == 1 { print $2 }')"
IFS=. read -r XCODE_MAJOR XCODE_MINOR XCODE_PATCH <<< "$XCODE_VERSION"
DT_XCODE="$(printf '%d%d%d' "$XCODE_MAJOR" "${XCODE_MINOR:-0}" "${XCODE_PATCH:-0}")"
DT_XCODE_BUILD="$(xcodebuild -version | awk 'NR == 2 { print $3 }')"
SDK_BUILD="$(xcrun --sdk macosx --show-sdk-build-version)"

cat > "$APP/Contents/Info.plist" <<PLIST
<?xml version="1.0" encoding="UTF-8"?>
Expand All @@ -58,17 +74,35 @@ cat > "$APP/Contents/Info.plist" <<PLIST
<key>CFBundleShortVersionString</key><string>$VERSION</string>
<key>CFBundleVersion</key><string>$BUILD_NUMBER</string>
<key>CFBundleIconFile</key><string>AppIcon</string>
<key>CFBundleIconName</key><string>AppIcon</string>
<key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
<key>CFBundleDevelopmentRegion</key><string>en</string>
<key>CFBundleSupportedPlatforms</key><array><string>MacOSX</string></array>
<key>NSHumanReadableCopyright</key><string>$COPYRIGHT</string>
<key>LSMinimumSystemVersion</key><string>14.0</string>
<key>LSApplicationCategoryType</key><string>public.app-category.developer-tools</string>
<key>ITSAppUsesNonExemptEncryption</key><false/>
<key>NSHighResolutionCapable</key><true/>
<key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSSupportsAutomaticTermination</key><false/>
<key>BuildMachineOSBuild</key><string>$(sw_vers -buildVersion)</string>
<key>DTCompiler</key><string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformName</key><string>macosx</string>
<key>DTPlatformVersion</key><string>$SDK_VERSION</string>
<key>DTPlatformBuild</key><string>$SDK_BUILD</string>
<key>DTSDKName</key><string>macosx$SDK_VERSION</string>
<key>DTSDKBuild</key><string>$SDK_BUILD</string>
<key>DTXcode</key><string>$DT_XCODE</string>
<key>DTXcodeBuild</key><string>$DT_XCODE_BUILD</string>
</dict>
</plist>
PLIST

ENTITLEMENTS="$OUT/BucketBrowser.entitlements"
cp "$ROOT/Resources/BucketBrowser.entitlements" "$ENTITLEMENTS"

if [[ -z "${SIGN_IDENTITY:-}" ]]; then
codesign --force --deep --sign - "$APP"
codesign --force --deep --entitlements "$ENTITLEMENTS" --sign - "$APP"
echo "Built $APP (ad-hoc signed; iCloud sync is off)"
exit 0
fi
Expand All @@ -81,19 +115,7 @@ if [[ -z "${PROVISIONING_PROFILE:-}" ]]; then
fi
cp "$PROVISIONING_PROFILE" "$APP/Contents/embedded.provisionprofile"

ENTITLEMENTS="$OUT/BucketBrowser.entitlements"
cat > "$ENTITLEMENTS" <<PLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.application-identifier</key><string>$TEAM_ID.$BUNDLE_ID</string>
<key>com.apple.developer.team-identifier</key><string>$TEAM_ID</string>
<key>keychain-access-groups</key>
<array><string>$TEAM_ID.$BUNDLE_ID</string></array>
</dict>
</plist>
PLIST
"$ROOT/scripts/add-team-entitlements.sh" "$ENTITLEMENTS" "$TEAM_ID" "$BUNDLE_ID"

codesign --force --options runtime --timestamp \
--entitlements "$ENTITLEMENTS" --sign "$SIGN_IDENTITY" "$APP"
Expand Down
Loading
Loading