@@ -61,6 +61,7 @@ type WorkflowInclude struct {
61
61
type WorkflowSettings struct {
62
62
Defaults * WorkflowSettingsDefaults `yaml:"defaults"`
63
63
ExitOnChecksumMismatch bool `yaml:"exit-on-checksum-mismatch"`
64
+ ChecksumVerification * bool `yaml:"checksum-verification"`
64
65
DotEnvFiles []string `yaml:"dotenv"`
65
66
Cache * WorkflowSettingsCache `yaml:"cache"`
66
67
Domains struct {
@@ -355,9 +356,11 @@ func (workflow *StackupWorkflow) Initialize() {
355
356
356
357
// no default settings were provided, so create sensible defaults
357
358
if workflow .Settings == nil {
359
+ verifyChecksums := true
358
360
workflow .Settings = & WorkflowSettings {
359
- DotEnvFiles : []string {".env" },
360
- Cache : & WorkflowSettingsCache {TtlMinutes : 5 },
361
+ DotEnvFiles : []string {".env" },
362
+ Cache : & WorkflowSettingsCache {TtlMinutes : 5 },
363
+ ChecksumVerification : & verifyChecksums ,
361
364
Defaults : & WorkflowSettingsDefaults {
362
365
Tasks : & WorkflowSettingsDefaultsTasks {
363
366
Silent : false ,
@@ -368,6 +371,11 @@ func (workflow *StackupWorkflow) Initialize() {
368
371
}
369
372
}
370
373
374
+ if workflow .Settings .ChecksumVerification == nil {
375
+ verifyChecksums := true
376
+ workflow .Settings .ChecksumVerification = & verifyChecksums
377
+ }
378
+
371
379
if workflow .Settings .Cache .TtlMinutes <= 0 {
372
380
workflow .Settings .Cache .TtlMinutes = 5
373
381
}
@@ -486,7 +494,9 @@ func (workflow *StackupWorkflow) ProcessInclude(include *WorkflowInclude) bool {
486
494
workflow .Cache .Set (include .DisplayName (), item , App .Workflow .Settings .Cache .TtlMinutes )
487
495
}
488
496
489
- include .ChecksumValidated , include .FoundChecksum , _ = include .ValidateChecksum (include .Contents )
497
+ if workflow .Settings .ChecksumVerification != nil && * workflow .Settings .ChecksumVerification {
498
+ include .ChecksumValidated , include .FoundChecksum , _ = include .ValidateChecksum (include .Contents )
499
+ }
490
500
491
501
if err != nil {
492
502
fmt .Println (err )
@@ -495,25 +505,27 @@ func (workflow *StackupWorkflow) ProcessInclude(include *WorkflowInclude) bool {
495
505
496
506
include .ValidationState = "verification skipped"
497
507
498
- if include .IsRemoteUrl () {
499
- if * include .VerifyChecksum == true || include .VerifyChecksum == nil {
500
- if include .ChecksumValidated {
501
- include .ValidationState = "verified"
502
- }
503
-
504
- if ! include .ChecksumValidated && include .FoundChecksum != "" {
505
- include .ValidationState = "verification failed"
506
- }
507
-
508
- // if err != nil {
509
- // fmt.Println(err)
510
- // return false
511
- // }
512
-
513
- if ! include .ChecksumValidated && App .Workflow .Settings .ExitOnChecksumMismatch {
514
- support .FailureMessageWithXMark ("Exiting due to checksum mismatch." )
515
- App .exitApp ()
516
- return false
508
+ if workflow .Settings .ChecksumVerification != nil && * workflow .Settings .ChecksumVerification {
509
+ if include .IsRemoteUrl () {
510
+ if * include .VerifyChecksum == true || include .VerifyChecksum == nil {
511
+ if include .ChecksumValidated {
512
+ include .ValidationState = "verified"
513
+ }
514
+
515
+ if ! include .ChecksumValidated && include .FoundChecksum != "" {
516
+ include .ValidationState = "verification failed"
517
+ }
518
+
519
+ // if err != nil {
520
+ // fmt.Println(err)
521
+ // return false
522
+ // }
523
+
524
+ if ! include .ChecksumValidated && App .Workflow .Settings .ExitOnChecksumMismatch {
525
+ support .FailureMessageWithXMark ("Exiting due to checksum mismatch." )
526
+ App .exitApp ()
527
+ return false
528
+ }
517
529
}
518
530
}
519
531
}
0 commit comments