Desktop 0.3.20 keeps macOS folder permissions between launches and updates. #34
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@photoreport/desktop",
|
||||
"version": "0.3.19",
|
||||
"version": "0.3.20",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "photoreport-desktop"
|
||||
version = "0.3.19"
|
||||
version = "0.3.20"
|
||||
edition = "2024"
|
||||
publish = false
|
||||
description = "PhotoReport desktop: the web app in a native shell, with keychain sign-in and (later) local FTP and the native engine."
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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>
|
||||
<!-- Shown once in macOS's permission prompt (merged into the app's Info.plist by Tauri). -->
|
||||
<key>NSDesktopFolderUsageDescription</key>
|
||||
<string>O PhotoReport lê a pasta de entrada (FTP) e guarda os originais de cada evento na Secretária.</string>
|
||||
<key>NSDocumentsFolderUsageDescription</key>
|
||||
<string>O PhotoReport lê e guarda fotografias nas pastas que escolheres em Documentos.</string>
|
||||
<key>NSDownloadsFolderUsageDescription</key>
|
||||
<string>O PhotoReport lê fotografias que estejam nas Transferências, quando escolhes essa pasta.</string>
|
||||
<key>NSRemovableVolumesUsageDescription</key>
|
||||
<string>O PhotoReport copia as fotografias dos cartões de memória.</string>
|
||||
<key>NSNetworkVolumesUsageDescription</key>
|
||||
<string>O PhotoReport lê e guarda fotografias nas pastas de rede que escolheres.</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "PhotoReport",
|
||||
"version": "0.3.19",
|
||||
"version": "0.3.20",
|
||||
"identifier": "pt.photoreport.desktop",
|
||||
"build": {
|
||||
"devUrl": "http://localhost:5173",
|
||||
|
||||
@@ -52,6 +52,41 @@ if [[ -n "${TAURI_SIGNING_PRIVATE_KEY:-}" && -n "${TAURI_UPDATER_PUBKEY:-}" ]];
|
||||
# The bundler checks each signature against plugins.updater.pubkey, so the public key goes into the config too.
|
||||
extra=(--bundles dmg,app --config "$(node -e 'console.log(JSON.stringify({bundle:{createUpdaterArtifacts:true},plugins:{updater:{pubkey:process.env.PHOTOREPORT_UPDATER_PUBKEY}}}))')")
|
||||
fi
|
||||
step "Code signing"
|
||||
# macOS remembers the folders an app may open (Desktop, Documents, cards) by its signature. Unsigned, every build
|
||||
# (and every update) looks like a new app and asks again, once per access. Signed always with the same identity, the
|
||||
# answer is kept. With an Apple Developer ID set in APPLE_SIGNING_IDENTITY that one is used; otherwise a local
|
||||
# identity, made once in the login keychain, the same for every build on this Mac.
|
||||
if [[ -z "${APPLE_SIGNING_IDENTITY:-}" ]]; then
|
||||
local_id="PhotoReport Local Signing"
|
||||
if ! security find-identity -p codesigning | grep -q "\"$local_id\""; then
|
||||
tmp="$(mktemp -d)"
|
||||
cat >"$tmp/cert.cfg" <<CFG
|
||||
[req]
|
||||
distinguished_name = dn
|
||||
x509_extensions = ext
|
||||
prompt = no
|
||||
[dn]
|
||||
CN = $local_id
|
||||
[ext]
|
||||
keyUsage = critical, digitalSignature
|
||||
extendedKeyUsage = critical, codeSigning
|
||||
basicConstraints = critical, CA:false
|
||||
CFG
|
||||
# The system's LibreSSL: its .p12 is one the keychain imports (OpenSSL 3's default one is not).
|
||||
/usr/bin/openssl req -x509 -newkey rsa:2048 -nodes -days 3650 -keyout "$tmp/key.pem" -out "$tmp/cert.pem" -config "$tmp/cert.cfg" 2>/dev/null
|
||||
/usr/bin/openssl pkcs12 -export -inkey "$tmp/key.pem" -in "$tmp/cert.pem" -name "$local_id" -out "$tmp/id.p12" -passout pass:photoreport
|
||||
security import "$tmp/id.p12" -k "$HOME/Library/Keychains/login.keychain-db" -P photoreport -T /usr/bin/codesign
|
||||
echo "macOS asks for your password once, to trust this certificate for signing:"
|
||||
security add-trusted-cert -r trustRoot -p codeSign -k "$HOME/Library/Keychains/login.keychain-db" "$tmp/cert.pem"
|
||||
rm -rf "$tmp"
|
||||
fi
|
||||
export APPLE_SIGNING_IDENTITY="$local_id"
|
||||
# Not a Developer ID: no notarisation, so no hardened runtime (it would refuse the bundled ONNX library).
|
||||
extra+=(--config '{"bundle":{"macOS":{"hardenedRuntime":false}}}')
|
||||
fi
|
||||
echo "Signing as: $APPLE_SIGNING_IDENTITY"
|
||||
|
||||
VITE_API_URL="$API" PHOTOREPORT_API_URL="$API" pnpm --filter @photoreport/desktop exec tauri build --target universal-apple-darwin "${extra[@]}"
|
||||
BUNDLE="apps/desktop/src-tauri/target/universal-apple-darwin/release/bundle"
|
||||
OUT="$BUNDLE/dmg"
|
||||
|
||||
Reference in new issue
Block a user