Repository navigation
Expand file tree
/
Copy pathelectron-builder.yml
More file actions
338 lines (324 loc) · 17 KB
/
Copy pathelectron-builder.yml
File metadata and controls
338 lines (324 loc) · 17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
appId: dev.dosya.desktop
productName: dosya
artifactName: "${productName}-${version}-${arch}.${ext}"
copyright: Copyright 2025 dosya.dev
directories:
output: release
buildResources: build
# Ship exactly the bundles. The renderer is fully bundled and the main
# process bundles its last runtime deps (see externalizeDepsPlugin exclude
# list), so node_modules has no business in the asar - it was 56 MB of dead
# weight and about to double when maplibre entered dependencies.
files:
- "out/main/**/*"
- "out/preload/**/*"
- "out/renderer/**/*"
- "build/*.png"
- "!out/**/*.tsbuildinfo"
# Source maps exist only on a release build that uploads them to Sentry
# (electron.vite.config.ts deletes them after upload); this keeps a failed
# upload from shipping the app's full source inside the asar.
- "!out/**/*.map"
- "!out/src/**"
- "!out/apps/**"
- "!out/packages/**"
- "!out/electron.vite.config.*"
# Close the packaged binary's generic-Node-runtime and tamper surfaces.
# enableCookieEncryption invalidates existing session cookies once: users
# re-login on first launch after this ships.
electronFuses:
runAsNode: false
enableNodeOptionsEnvironmentVariable: false
enableNodeCliInspectArguments: false
enableEmbeddedAsarIntegrityValidation: true
onlyLoadAppFromAsar: true
enableCookieEncryption: true
# Disable auto-update publish - we upload to R2 via our own API
publish: []
# ── macOS ───────────────────────────────────────────────────────────
# Two targets: the .dmg is the human download (drag-to-Applications), the
# .zip is what electron-updater installs in place (it cannot update from a
# .dmg). Both are built from the same signed .app in one pass, so notarizing
# the .dmg registers the identical .app the .zip carries. See the update feed
# wiring in apps/api (renderLatestYaml points mac at the .zip).
# Builds the macOS File Provider extension (native/macos/DosyaFileProvider) and
# puts it in Contents/PlugIns, signed, BEFORE electron-builder signs the app
# around it: the app's signature seals whatever is nested inside it.
afterPack: scripts/afterPack.mjs
# Runs once at the end of the build. When a .pkg was produced it proves the
# signed store bundle is what App Store Connect will accept (sandbox
# entitlement on app and extension, store identifiers, matching bundle
# versions, embedded profiles) and fails the build naming each miss. A no-op
# for every other target.
#
# NOT afterSign, which cannot work here: app-builder-lib packs the mas targets
# with `{ sign: false }` and signs them through signMas() (macPackager.js
# packMasTargets), a path that never emits afterSign - so an afterSign hook
# fires only for the dmg/zip target, where there is no store bundle to check.
afterAllArtifactBuild: scripts/afterAllArtifactBuild.mjs
mac:
target:
- target: dmg
arch:
- universal
- target: zip
arch:
- universal
icon: build/icon.png
category: public.app-category.productivity
hardenedRuntime: true
gatekeeperAssess: false
entitlements: build/entitlements.mac.plist
# A SEPARATE file for the helper processes, and the difference is load-bearing:
# it has no keychain-access-groups. The helpers (GPU, Renderer, Utility,
# Network) are their own bundles with their own identifiers, and the app's
# embedded provisioning profile does not cover them, so a restricted
# entitlement there is unauthorized and every child is killed at launch
# (exit code 9) while the main process survives. The app itself keeps the
# entitlement, authorized by its own profile.
entitlementsInherit: build/entitlements.mac.inherit.plist
# Pinned, not auto-discovered. This Mac holds three Developer ID certificates
# and two of them are the personal team; auto-discovery would pick whichever
# came first and sign a release under the wrong identity without saying so.
# Without the "Developer ID Application:" prefix, which electron-builder
# adds itself. scripts/afterPack.mjs expands it back to the full unique
# name before calling codesign, because this team also owns Apple
# Distribution and 3rd Party Mac Developer certificates with the same
# common name, and a partial match would be ambiguous.
identity: "DOSYA PTY LTD (53HFF44WQ8)"
# entitlements.mac.plist deliberately carries NO XML comments: codesign hands
# entitlements to AMFI, whose parser rejects them with "syntax error near
# line N" and fails the whole signing step. Explanations belong here instead.
# The app claims keychain-access-groups 53HFF44WQ8.group.dev.dosya.desktop,
# shared with the Finder extension in Contents/PlugIns, which reads the
# session the app mints for it.
#
# Authorizes keychain-access-groups. Without it the app is killed at launch.
# Supplied per machine and by CI from a secret; never committed, because this
# app is published to a public mirror.
provisioningProfile: build/embedded.provisionprofile
# Written into Info.plist for every macOS build. Only the Mac App Store reads
# it: with the key absent App Store Connect holds each upload at "Missing
# Compliance" until the encryption question is answered by hand; `false`
# (the app uses only HTTPS, which is exempt) answers it up front. Must be in
# THIS block: electron-builder ignores extendInfo under `mas`.
extendInfo:
ITSAppUsesNonExemptEncryption: false
# dmg-background.tiff carries both @1x (540x380) and @2x (1080x760) reps,
# combined with `tiffutil -cathidpicheck`. dmg-builder sizes the Finder
# window from the background file itself (via `sips`, which reads the @1x
# rep of a HiDPI tiff) - dmg.window is only honored for the flat-color
# fallback, not here, so it's intentionally omitted. iconSize/x/y were
# verified against the art with a real dmgbuild run: x/y is each icon's
# center, and Finder draws the filename label itself below it - the
# background only reserves the space and never contains that text.
dmg:
background: build/dmg-background.tiff
iconSize: 128
contents:
- x: 130
y: 220
type: file
- x: 410
y: 220
type: link
path: /Applications
# ── Mac App Store ───────────────────────────────────────────────────
# Sandboxed sibling of the `mac` target, built from the same bundles. The
# options here are merged OVER the mac block for the mas and mas-dev targets
# (app-builder-lib macPackager.js), so `identity` and `icon` are inherited and
# only what differs is listed.
#
# appId: dev.dosya.desktop was uploaded to App Store Connect once in July 2026
# and that record was deleted, which spends the identifier for the store
# forever. The DMG keeps dev.dosya.desktop; the store build is dev.dosya.mac,
# App Store Connect app 6818700723. scripts/afterPack.mjs stamps the matching
# dev.dosya.mac.fileprovider into the extension for this target.
#
# hardenedRuntime is OFF on purpose: it is a Developer ID concept, and the App
# Sandbox in build/entitlements.mas.plist replaces it. That file carries no XML
# comments (AMFI rejects them), so what each entitlement is for lives here:
# app-sandbox required by the store
# network.client API calls
# network.server LAN Transfer. The two peers establish a
# direct WebRTC connection with NO relay
# (iceServers is empty), so each side must
# accept an inbound connection from the
# other and receive mDNS responses while
# resolving local candidates; client alone
# is not enough. App Review questioned this
# on 2026-10-04 because the app opens no
# listening socket of its own - the inbound
# socket belongs to Chromium's WebRTC stack
# - and was answered with a written
# justification in Resolution Center and in
# App Review Information.
# Removing it does not just drop an unused
# permission: it kills LAN Transfer, so the
# title-bar entry point would have to go too.
# files.user-selected.read-write sync folders and save dialogs
# files.bookmarks.app-scope security-scoped bookmarks that keep a
# sync folder reachable after a relaunch
# (src/main/sync/bookmarks.ts)
# cs.allow-jit V8
# keychain-access-groups the session the Finder extension reads,
# same group as the Developer ID build
# application-groups the File Provider document group, same
# as the extension's
# The inherit file for helpers has ONLY app-sandbox + inherit: a restricted
# entitlement on a helper is unauthorized by the app's profile and every
# child is killed at launch (see entitlementsInherit on the mac block).
#
# The provisioning profiles are written by CI from secrets, never committed.
mas:
appId: dev.dosya.mac
target:
- target: pkg
arch:
- universal
category: public.app-category.productivity
hardenedRuntime: false
entitlements: build/entitlements.mas.plist
entitlementsInherit: build/entitlements.mas.inherit.plist
provisioningProfile: build/mas.provisionprofile
# extendInfo does NOT belong here: electron-builder reads it from the mac
# block only (app-builder-lib macPackager.js, platformSpecificBuildOptions),
# so a key placed under mas never reaches Info.plist. The export-compliance
# key lives in the mac block above for that reason.
# `electron-builder --mac mas-dev`: the same bundle signed for local runs with
# a development profile for dev.dosya.mac (a store-signed .pkg cannot be
# launched outside the store). The target name on the CLI is `mas-dev` with a
# hyphen; `masDev` is only this config key.
#
# TWO development profiles are needed, both "Mac App Development" type and
# neither committed: build/mas-dev.provisionprofile for the app (below) and
# build/fileprovider.mas-dev.provisionprofile for the File Provider extension
# (scripts/afterPack.mjs EXTENSION_PROFILE_DEV). The extension is a separately
# signed bundle with its own App ID, so the app's profile does not cover it,
# and the store's distribution profile is refused at launch here.
masDev:
provisioningProfile: build/mas-dev.provisionprofile
# ── Windows ─────────────────────────────────────────────────────────
win:
target:
- target: nsis
arch:
- x64
- target: appx
arch:
- x64
icon: build/icon.png
# electron-builder 26 moved signtool options out of `win` (leaving the old
# key a schema error that fails all three platform builds, not just Windows).
signtoolOptions:
signingHashAlgorithms:
- sha256
# ── Microsoft Store (MSIX/AppX) ────────────────────────────────────
# Do NOT sign this target. Microsoft re-signs Store packages, and a package
# we signed ourselves is rejected on upload.
appx:
# These three are copied verbatim from Partner Center > Product management >
# Product identity. They are not ours to choose: any drift, including case,
# fails the Store upload with an identity mismatch. identityName is issued
# per product, so it changes if the product is ever recreated.
identityName: "DOSYA.dosyaCloudStorageandFileSync"
publisher: "CN=BEC0775D-6155-4622-BFBE-ABEBBF38FA5E"
publisherDisplayName: "DOSYA"
# Start menu, taskbar, Apps list and tile - NOT the Store listing, which uses
# the reserved product name "dosya: Cloud Storage and File Sync" instead. That
# title is 34 characters and truncates in every one of those Windows surfaces,
# so the short form is deliberate. Both names are reserved in Partner Center.
#
# Also note this string lands in AppxManifest.xml through a raw regex
# substitution with no XML escaping (app-builder-lib AppxTarget.js), so an
# unescaped "&" here would produce a malformed manifest and fail makeappx.
displayName: "dosya"
# Forms part of the AUMID. Changing it after the first Store release breaks
# taskbar pinning and notification identity for everyone already installed.
# Charset is letters, digits and dots only - no spaces, colons or hyphens.
applicationId: "dosya"
backgroundColor: "#f9f8f6"
# electron-builder defaults x64 to MinVersion 10.0.14316.0 - a pre-release
# 1607 build, older than 1607's own RTM. Electron 23+ dropped everything
# below Windows 10, so the default advertises a floor this app cannot
# actually run on, and the Store would happily install it there. 17763 is
# Windows 10 1809 / LTSC 2019, the oldest build still worth supporting.
minVersion: "10.0.17763.0"
languages:
- en-US
# ── Linux ───────────────────────────────────────────────────────────
linux:
target:
- target: AppImage
arch:
- x64
- target: deb
arch:
- x64
- target: snap
arch:
- x64
icon: build/icon.png
category: Utility
synopsis: Cloud storage and file sync for dosya.dev
# electron-builder 26 derives the default from the scoped npm package name
# ("@dosya-dev/desktop" -> "@dosya-devdesktop") and then rejects the "@".
# Pin the name v25 used (productName), which is also the binary existing
# AppImage/deb installs already have on disk. It is ALSO the snap's name
# (SnapCoreLegacy lowercases executableName), which must match the name
# registered on the Snap Store and SNAP_NAME in src/main/distribution.ts.
executableName: dosya
# ── Snap Store ─────────────────────────────────────────────────────
# Built from electron-builder's prebuilt Electron snap template with
# mksquashfs, so the Linux runner needs no snapcraft/LXD to BUILD it; the
# release workflow installs snapcraft only to upload. Two things silently
# switch the template off and make the build shell out to snapcraft instead:
# a non-default `stagePackages` list or any `buildPackages`. Plugs do not (the
# template check in coreLegacy.js only looks at those two), so the extras
# below are safe to add.
#
# The template also drops chrome-sandbox and appends --no-sandbox to the app
# command: in strict confinement Chromium's own sandbox cannot start (it
# needs user namespaces snapd's AppArmor profile denies), and snapd's
# confinement replaces it.
snap:
# Ubuntu 22.04 runtime; Electron's Linux builds want glibc 2.35+.
base: core22
confinement: strict
grade: stable
title: dosya
summary: Cloud storage and file sync for dosya.dev
plugs:
- default
# Sync folders on other drives and USB media. Not auto-connected: users
# run `sudo snap connect dosya:removable-media` (documented on /desktop).
- removable-media
# Electron's safeStorage (the encrypted session cookie, see the
# enableCookieEncryption fuse above) talks to the keyring over D-Bus; the
# `default` set does not include the interface, so without it snapd blocks
# the call and safeStorage falls back to an unencrypted backend.
- password-manager-service
# LAN transfer listens for peers.
- network-bind
# ── Installer options ──────────────────────────────────────────────
nsis:
oneClick: false
allowToChangeInstallationDirectory: true
# Uninstall removes %APPDATA%/dosya too: the session cookie, the sync index
# and the sync config. Without this a reinstall on a shared or resold
# machine came up already signed in to the previous owner's account (field
# report 2026-09-02, desktop #15). Sync folders on disk are never touched.
deleteAppDataOnUninstall: true
# Registers the dosya:// URL scheme in the Windows registry. `protocols:`
# below does NOT do this - electron-builder only feeds that block to the
# macOS, Linux and AppX packagers, so the NSIS build shipped with the scheme
# unregistered and the desktop OAuth callback had nowhere to land.
include: build/installer.nsh
# ── Protocol registration ──────────────────────────────────────────
# macOS (CFBundleURLTypes), Linux (.desktop MimeType) and AppX (uriSchemes)
# only. Windows/NSIS is handled by nsis.include above plus the runtime
# setAsDefaultProtocolClient call in src/main/index.ts.
protocols:
- name: dosya
schemes:
- dosya