Commit 19cc470
committed
fix(macos): resolve service installation issues and add Go binary signing
**Problem 1: Inconsistent developer names in Background Activity**
- Electron app signed as "Yaroslav Podieiapolskii"
- Go binaries (px, px-service) were unsigned
- Caused macOS to show different developer names in system dialogs
**Solution 1: Add Go binary code signing**
- Added "Sign Go Binaries" step in macOS workflow after Go builds
- Uses same CODESIGN_IDENTITY from GitHub secrets
- Signs both px and px-service with runtime hardening + timestamp
- Applies same entitlements as Electron app
- Now all binaries show consistent developer identity
**Problem 2: Conflicting success/error messages during installation**
- Electron invoked osascript with admin privileges
- Go code internally invoked osascript again (double elevation)
- Caused timeout/conflict but service still installed
- UI showed contradictory notifications
**Solution 2: Smart privilege detection in installer_darwin.go**
- Check if already running as root (os.Geteuid() == 0)
- If root: execute commands directly (cp, chmod, launchctl)
- If not root: use osascript for privilege elevation
- Applies to install/uninstall/start/stop functions
- Eliminates double osascript calls when launched via Electron
**Technical changes:**
- .github/workflows/release.yml: Added codesign step after Go builds
- src-service/installer_darwin.go: Added isRoot checks in all service functions
This resolves both the developer identity inconsistency and the
installation notification issues on macOS.
https://claude.ai/code/session_01U9NtT9hmX68VAbYp5x2Pi11 parent 451efdb commit 19cc470
File tree
2 files changed
+92
-20
lines changed- .github/workflows
- src-service
2 files changed
+92
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
349 | 375 | | |
350 | 376 | | |
351 | 377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 103 | + | |
| 104 | + | |
106 | 105 | | |
107 | | - | |
108 | | - | |
109 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
110 | 126 | | |
111 | 127 | | |
112 | 128 | | |
| |||
116 | 132 | | |
117 | 133 | | |
118 | 134 | | |
119 | | - | |
| 135 | + | |
120 | 136 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
124 | 141 | | |
125 | | - | |
126 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
127 | 155 | | |
128 | 156 | | |
129 | 157 | | |
| |||
133 | 161 | | |
134 | 162 | | |
135 | 163 | | |
136 | | - | |
| 164 | + | |
137 | 165 | | |
138 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
139 | 175 | | |
140 | | - | |
141 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
142 | 179 | | |
143 | 180 | | |
144 | 181 | | |
145 | 182 | | |
146 | 183 | | |
147 | 184 | | |
148 | 185 | | |
149 | | - | |
| 186 | + | |
150 | 187 | | |
151 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
152 | 197 | | |
153 | | - | |
154 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
155 | 201 | | |
156 | 202 | | |
157 | 203 | | |
| |||
0 commit comments