Skip to content

Commit 89eb2f2

Browse files
authored
fix: sign the windows setup .exe COMPASS-8945 COMPASS-8950 (#6709)
1 parent ab9f8bd commit 89eb2f2

File tree

6 files changed

+44
-25
lines changed

6 files changed

+44
-25
lines changed

.evergreen/verify-artifacts.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ verify_using_gpg() {
3434
verify_using_powershell() {
3535
echo "Verifying $1 using powershell"
3636
powershell Get-AuthenticodeSignature -FilePath $ARTIFACTS_DIR/$1 > "$TMP_FILE" 2>&1
37+
38+
# Get-AuthenticodeSignature just outputs text, it doesn't exit with a non-zero
39+
# code if the file is not signed
40+
if grep -q NotSigned "$TMP_FILE"; then
41+
echo "File $1 is not signed"
42+
exit 1
43+
fi
3744
}
3845

3946
verify_using_codesign() {

package-lock.json

Lines changed: 23 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/compass/.depcheckrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ ignores: [
1313
'mongodb-client-encryption',
1414
'interruptor',
1515
# webpack always externalizes 'clipboard' for legacy reasons
16-
'clipboard'
16+
'clipboard',
17+
# include signing-utils so that signtool.go can get to it
18+
'@mongodb-js/signing-utils'
1719
]

packages/compass/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@
231231
"@mongodb-js/my-queries-storage": "^0.22.0",
232232
"@mongodb-js/prettier-config-compass": "^1.2.0",
233233
"@mongodb-js/sbom-tools": "^0.7.0",
234+
"@mongodb-js/signing-utils": "^0.3.7",
234235
"@mongodb-js/testing-library-compass": "^1.2.0",
235236
"@mongodb-js/tsconfig-compass": "^1.2.0",
236237
"@mongodb-js/webpack-config-compass": "^1.6.0",
259 KB
Binary file not shown.

packages/hadron-build/signtool/signtool.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ func main() {
2727
}
2828

2929
allowedExtensions := []string{
30+
"GARASIGN_USERNAME",
31+
"GARASIGN_PASSWORD",
32+
"ARTIFACTORY_USERNAME",
33+
"ARTIFACTORY_PASSWORD",
3034
"SIGNING_SERVER_HOSTNAME",
3135
"SIGNING_SERVER_PRIVATE_KEY",
3236
"SIGNING_SERVER_USERNAME",
@@ -55,12 +59,15 @@ func main() {
5559
cmd := exec.Command("node", "-e", script)
5660
fmt.Println("Running command:", cmd.String())
5761

58-
cmd.Stdout = os.Stdout
59-
cmd.Stderr = os.Stderr
62+
stdoutStderr, err := cmd.CombinedOutput()
6063

61-
err := cmd.Run()
6264
if err != nil {
6365
fmt.Println("Error signing the file")
66+
fmt.Printf("%s\n", stdoutStderr)
67+
log.Println(err)
68+
// if we error out then we won't see much because of how
69+
// electron-windows-installer fails. We'll have to rely on package
70+
// verification elsewhere to fail CI
6471
return
6572
}
6673

0 commit comments

Comments
 (0)