-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.go
More file actions
708 lines (596 loc) · 20.8 KB
/
Copy pathsetup.go
File metadata and controls
708 lines (596 loc) · 20.8 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
339
340
341
342
343
344
345
346
347
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
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
// -----------------BEGIN FILE-------------setup.go
package main
import (
"bufio"
"fmt"
"log"
"io"
"net"
"net/http"
"os"
"os/exec"
"path/filepath"
"regexp"
"strconv"
"strings"
"time"
)
// Windows API structures and functions for firewall management
var (
firewallRuleName = "CupAndString_P2P"
upnpManager *UPnPManager // Global UPnP manager for cleanup
)
// detectLanIP finds the best local network IP address
func detectLanIP() string {
// Get all network interfaces
interfaces, err := net.Interfaces()
if err != nil {
TimestampLog(fmt.Sprintf("Failed to get network interfaces: %v", err))
return "127.0.0.1"
}
var ip192, ip10, ipOther string
for _, iface := range interfaces {
// Skip loopback and down interfaces
if iface.Flags&net.FlagLoopback != 0 || iface.Flags&net.FlagUp == 0 {
continue
}
addrs, err := iface.Addrs()
if err != nil {
continue
}
for _, addr := range addrs {
var ip net.IP
switch v := addr.(type) {
case *net.IPNet:
ip = v.IP
case *net.IPAddr:
ip = v.IP
}
// Only consider IPv4 addresses
if ip == nil || ip.To4() == nil {
continue
}
ipStr := ip.String()
// Skip loopback
if strings.HasPrefix(ipStr, "127.") {
continue
}
// Prioritize 192.168.* addresses
if strings.HasPrefix(ipStr, "192.168.") && ip192 == "" {
ip192 = ipStr
} else if strings.HasPrefix(ipStr, "10.") && ip10 == "" {
ip10 = ipStr
} else if ipOther == "" {
ipOther = ipStr
}
}
}
// Return in priority order
if ip192 != "" {
return ip192
}
if ip10 != "" {
return ip10
}
if ipOther != "" {
return ipOther
}
TimestampLog("No suitable local IP found, using localhost")
return "127.0.0.1"
}
// detectWanIPNonInteractive attempts to detect the public IP address without user interaction
func detectWanIPNonInteractive() string {
// HTTP and HTTPS services for IP detection
services := []string{
"https://api.ipify.org",
"https://checkip.amazonaws.com",
"https://ipinfo.io/ip",
"https://api.ipsimple.org/ipv4",
"http://ipecho.net/plain",
"http://icanhazip.com",
"http://ifconfig.me",
"https://ipapi.co/ip",
}
client := &http.Client{
Timeout: 5 * time.Second,
}
for _, service := range services {
TimestampLog(fmt.Sprintf("Trying IP detection service: %s", service))
resp, err := client.Get(service)
if err != nil {
TimestampLog(fmt.Sprintf("Failed to connect to %s: %v", service, err))
continue
}
body, err := io.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
TimestampLog(fmt.Sprintf("Failed to read response from %s: %v", service, err))
continue
}
ipStr := strings.TrimSpace(string(body))
TimestampLog(fmt.Sprintf("Received from %s: '%s' (Status: %d)", service, ipStr, resp.StatusCode))
// Validate IP address
ip := net.ParseIP(ipStr)
if ip != nil && ip.To4() != nil && ipStr != "0.0.0.0" && ipStr != "127.0.0.1" {
TimestampLog(fmt.Sprintf("Detected WAN IP using %s: %s", service, ipStr))
return ipStr
} else {
TimestampLog(fmt.Sprintf("Invalid IP from %s: %s", service, ipStr))
}
}
TimestampLog("WARNING: All automatic WAN IP detection services failed.")
return "" // Return empty string instead of prompting user
}
// detectWanIP attempts to detect the public IP address using multiple services
func detectWanIP() string {
// HTTP and HTTPS services for IP detection
services := []string{
"http://ipecho.net/plain",
"http://icanhazip.com",
"http://ifconfig.me",
"https://api.ipsimple.org/ipv4",
"https://api.ipify.org",
"https://checkip.amazonaws.com",
"https://ipinfo.io/ip",
"https://ipapi.co/ip",
}
client := &http.Client{
Timeout: 5 * time.Second,
}
for _, service := range services {
TimestampLog(fmt.Sprintf("Trying IP detection service: %s", service))
resp, err := client.Get(service)
if err != nil {
TimestampLog(fmt.Sprintf("Failed to connect to %s: %v", service, err))
continue
}
body, err := io.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
TimestampLog(fmt.Sprintf("Failed to read response from %s: %v", service, err))
continue
}
ipStr := strings.TrimSpace(string(body))
TimestampLog(fmt.Sprintf("Received from %s: '%s' (Status: %d)", service, ipStr, resp.StatusCode))
// Validate IP address
ip := net.ParseIP(ipStr)
if ip != nil && ip.To4() != nil && ipStr != "0.0.0.0" && ipStr != "127.0.0.1" {
TimestampLog(fmt.Sprintf("Detected WAN IP using %s: %s", service, ipStr))
return ipStr
} else {
TimestampLog(fmt.Sprintf("Invalid IP from %s: %s", service, ipStr))
}
}
// All automatic detection failed, ask user for manual input
TimestampLog("WARNING: All automatic WAN IP detection services failed.")
log.Println("Visit https://whatismyipaddress.com or similar to find your public IP.")
scanner := bufio.NewScanner(os.Stdin)
for {
log.Print("Enter your public IP manually: ")
scanner.Scan()
manualIP := strings.TrimSpace(scanner.Text())
// Validate manually entered IP
ip := net.ParseIP(manualIP)
if ip != nil && ip.To4() != nil && manualIP != "0.0.0.0" && manualIP != "127.0.0.1" {
TimestampLog(fmt.Sprintf("Using manually entered WAN IP: %s", manualIP))
return manualIP
} else {
log.Println("ERROR: Invalid IP format. Please try again.")
}
}
}
// findFreeListenPort finds an available port starting from basePort
func findFreeListenPort(basePort int) int {
maxPort := basePort + 100 // Search up to basePort + 100
for port := basePort; port <= maxPort; port++ {
// Try to bind to the port
addr := fmt.Sprintf(":%d", port)
listener, err := net.Listen("tcp", addr)
if err != nil {
continue // Port is busy, try next
}
// Port is available, close the listener and return
listener.Close()
if port != basePort {
TimestampLog(fmt.Sprintf("Port %d busy, using %d", basePort, port))
} else {
TimestampLog(fmt.Sprintf("Port %d available", port))
}
return port
}
// No free port found in range
TimestampLog(fmt.Sprintf("ERROR: No free port in range %d-%d!", basePort, maxPort))
log.Printf("ERROR: No free port in range %d-%d!\n", basePort, maxPort)
log.Println("Press Enter to exit...")
bufio.NewScanner(os.Stdin).Scan()
os.Exit(1)
return 0
}
// createFirewallRule creates a Windows firewall rule for the specified port
func createFirewallRule(port int) error {
// Remove existing rule first to avoid duplicates
removeCmd := fmt.Sprintf(`netsh advfirewall firewall delete rule name="%s"`, firewallRuleName)
exec.Command("cmd", "/C", removeCmd).Run() // Ignore errors for remove
// Create new rule
addCmd := fmt.Sprintf(`netsh advfirewall firewall add rule name="%s" dir=in action=allow protocol=TCP localport=%d`,
firewallRuleName, port)
err := exec.Command("cmd", "/C", addCmd).Run()
if err == nil {
TimestampLog(fmt.Sprintf("OK: Firewall rule created/updated for port %d", port))
return nil
} else {
TimestampLog(fmt.Sprintf("WARNING: Failed to create firewall rule for port %d", port))
log.Printf("WARNING: Failed to create firewall rule for port %d\n", port)
log.Println("Application may not receive connections. Check if running as admin.")
return fmt.Errorf("firewall rule creation failed")
}
}
// removeFirewallRule removes the Windows firewall rule
func removeFirewallRule() {
removeCmd := fmt.Sprintf(`netsh advfirewall firewall delete rule name="%s"`, firewallRuleName)
err := exec.Command("cmd", "/C", removeCmd).Run()
if err == nil {
TimestampLog("OK: Firewall rule removed")
} else {
TimestampLog("WARNING: Failed to remove firewall rule")
}
}
// validateName checks if a name contains only valid characters (letters, numbers, underscores)
func validateName(name, fieldName string) bool {
if name == "" {
return true // Empty names are allowed for optional fields
}
// Only allow letters, numbers, and underscores
validName := regexp.MustCompile(`^[a-zA-Z0-9_]+$`)
if !validName.MatchString(name) {
log.Printf("ERROR: %s cannot contain spaces, hyphens, or special characters. Use underscores instead.\n", fieldName)
return false
}
return true
}
// testNetworkConnectivity tests basic network connectivity
func testNetworkConnectivity() {
TimestampLog("Testing network connectivity...")
// Try to connect to Google DNS
conn, err := net.DialTimeout("tcp", "8.8.8.8:53", 3*time.Second)
if err != nil {
TimestampLog("WARNING: No internet connectivity detected")
log.Println("WARNING: No internet connectivity detected")
log.Println("IRC connection may fail")
return
}
conn.Close()
TimestampLog("OK: Network connectivity confirmed")
log.Println("OK: Network connectivity confirmed")
}
// testDirectoryPermissions tests if we can write to a directory
func testDirectoryPermissions(dir string) error {
testFile := filepath.Join(dir, "writetest.tmp")
// Try to create and write to test file
file, err := os.Create(testFile)
if err != nil {
return fmt.Errorf("cannot create file in directory: %v", err)
}
_, err = file.WriteString("test")
file.Close()
if err != nil {
os.Remove(testFile)
return fmt.Errorf("cannot write to file: %v", err)
}
// Clean up test file
err = os.Remove(testFile)
if err != nil {
return fmt.Errorf("cannot remove test file: %v", err)
}
return nil
}
// runInteractiveSetup runs the interactive setup wizard
func runInteractiveSetup() *Config {
log.Println("===============================================================")
log.Println(" CUP AND STRING P2P FILE SYNC")
log.Println("===============================================================")
log.Println()
// Default values
config := &Config{
IRCServer: "irc.libera.chat",
IRCPort: 6697,
ChannelName: "cupandstring",
TLSEnabled: true,
LocalPort: 4200,
ExternalIP: "127.0.0.1",
PairingSecret: "Practice",
}
// Get current directory for default folders
currentDir, err := os.Getwd()
if err != nil {
currentDir = "."
}
config.ExportFolder = filepath.Join(currentDir, "export")
config.ImportFolder = filepath.Join(currentDir, "import")
scanner := bufio.NewScanner(os.Stdin)
log.Println("Enter configuration (press Enter for defaults):")
log.Println()
log.Println("WARNING: Names are CASE SENSITIVE. Use only letters, numbers, and underscores.")
log.Println("Do NOT use spaces, hyphens, or special characters like @#$%^&*")
log.Println()
// Network type selection
log.Println("Are you connecting to the recipient on the same local network or over the Internet?")
log.Println(" 1 = Same local network (LAN) - faster, more reliable")
log.Println(" 2 = Over the Internet (WAN) - works anywhere but slower")
log.Print("Enter choice [1]: ")
scanner.Scan()
networkInput := strings.TrimSpace(scanner.Text())
networkType := "LAN"
if networkInput == "2" {
networkType = "WAN"
config.ExternalIP = detectWanIP()
} else {
config.ExternalIP = detectLanIP()
}
log.Printf("Detected IP: %s\n", config.ExternalIP)
// IRC server
log.Printf("IRC server [%s]: ", config.IRCServer)
scanner.Scan()
if input := strings.TrimSpace(scanner.Text()); input != "" {
config.IRCServer = input
}
// IRC port
log.Printf("IRC port [%d]: ", config.IRCPort)
scanner.Scan()
if input := strings.TrimSpace(scanner.Text()); input != "" {
if port, err := strconv.Atoi(input); err == nil {
config.IRCPort = port
}
}
// TLS
log.Print("Use TLS (secure connection)? (Y/N) [Y]: ")
scanner.Scan()
tlsInput := strings.ToLower(strings.TrimSpace(scanner.Text()))
config.TLSEnabled = !(tlsInput == "n" || tlsInput == "no")
// Local port
log.Printf("Local listen port [%d]: ", config.LocalPort)
scanner.Scan()
if input := strings.TrimSpace(scanner.Text()); input != "" {
if port, err := strconv.Atoi(input); err == nil {
config.LocalPort = port
}
}
// Find free port
config.LocalPort = findFreeListenPort(config.LocalPort)
// Export folder
log.Printf("Export folder [%s]: ", config.ExportFolder)
scanner.Scan()
if input := strings.TrimSpace(scanner.Text()); input != "" {
config.ExportFolder = input
}
// Import folder
log.Printf("Import folder [%s]: ", config.ImportFolder)
scanner.Scan()
if input := strings.TrimSpace(scanner.Text()); input != "" {
config.ImportFolder = input
}
log.Println()
log.Println("IRC Channel Configuration:")
log.Println("(Use only letters, numbers, and underscores - NO spaces or special chars)")
log.Println()
// Channel name
for {
log.Printf("IRC channel name [%s]: ", config.ChannelName)
scanner.Scan()
input := strings.TrimSpace(scanner.Text())
if input == "" {
break // Use default
}
if validateName(input, "Channel name") {
config.ChannelName = input
break
}
}
// Your username
for {
log.Print("Your username []: ")
scanner.Scan()
input := strings.TrimSpace(scanner.Text())
if input == "" {
break // Empty is allowed
}
if validateName(input, "Username") {
config.YourUsername = input
break
}
}
// Recipient username
for {
log.Print("Recipient username []: ")
scanner.Scan()
input := strings.TrimSpace(scanner.Text())
if input == "" {
break // Empty is allowed
}
if validateName(input, "Username") {
config.RecipientUsername = input
break
}
}
// Pairing secret
for {
log.Printf("What are we talking about? [%s]: ", config.PairingSecret)
scanner.Scan()
input := strings.TrimSpace(scanner.Text())
if input == "" {
break // Use default
}
if validateName(input, "Pairing secret") {
config.PairingSecret = input
break
}
}
// Display configuration summary
TimestampLog("Configuration set:")
TimestampLog(fmt.Sprintf(" Network Type: %s", networkType))
TimestampLog(fmt.Sprintf(" Your IP: %s", config.ExternalIP))
TimestampLog(fmt.Sprintf(" IRC Server: %s", config.IRCServer))
TimestampLog(fmt.Sprintf(" IRC Port: %d", config.IRCPort))
TimestampLog(fmt.Sprintf(" TLS Enabled: %t", config.TLSEnabled))
TimestampLog(fmt.Sprintf(" Listen Port: %d", config.LocalPort))
TimestampLog(fmt.Sprintf(" Export Folder: %s", config.ExportFolder))
TimestampLog(fmt.Sprintf(" Import Folder: %s", config.ImportFolder))
TimestampLog(fmt.Sprintf(" Channel: %s", config.ChannelName))
TimestampLog(fmt.Sprintf(" Your Username: %s", config.YourUsername))
TimestampLog(fmt.Sprintf(" Recipient: %s", config.RecipientUsername))
TimestampLog(fmt.Sprintf(" Pairing Secret: %s", config.PairingSecret))
return config
}
// setupDirectories creates and tests the export and import directories
func setupDirectories(config *Config) error {
TimestampLog("[2/5] Setting up directories...")
// Create export folder
if _, err := os.Stat(config.ExportFolder); os.IsNotExist(err) {
TimestampLog(fmt.Sprintf("Creating directory: %s", config.ExportFolder))
if err := os.MkdirAll(config.ExportFolder, 0755); err != nil {
return fmt.Errorf("failed to create export folder: %v", err)
}
} else {
TimestampLog(fmt.Sprintf("OK: Directory exists: %s", config.ExportFolder))
}
// Create import folder
if _, err := os.Stat(config.ImportFolder); os.IsNotExist(err) {
TimestampLog(fmt.Sprintf("Creating directory: %s", config.ImportFolder))
if err := os.MkdirAll(config.ImportFolder, 0755); err != nil {
return fmt.Errorf("failed to create import folder: %v", err)
}
} else {
TimestampLog(fmt.Sprintf("OK: Directory exists: %s", config.ImportFolder))
}
// Test write permissions for export folder
if err := testDirectoryPermissions(config.ExportFolder); err != nil {
return fmt.Errorf("no write permission for export folder %s: %v", config.ExportFolder, err)
}
TimestampLog("OK: Write permissions confirmed for export folder")
// Test write permissions for import folder
if err := testDirectoryPermissions(config.ImportFolder); err != nil {
return fmt.Errorf("no write permission for import folder %s: %v", config.ImportFolder, err)
}
TimestampLog("OK: Write permissions confirmed for import folder")
return nil
}
// saveConfiguration saves the configuration to mysetup.json
func saveConfiguration(config *Config) error {
TimestampLog("[3/5] Saving configuration...")
TimestampLog("Saving configuration to mysetup.json...")
// Convert Windows paths to JSON format (forward slashes)
config.ExportFolder = filepath.ToSlash(config.ExportFolder)
config.ImportFolder = filepath.ToSlash(config.ImportFolder)
TimestampLog(fmt.Sprintf("EXPORT_JSON = %s", config.ExportFolder))
TimestampLog(fmt.Sprintf("IMPORT_JSON = %s", config.ImportFolder))
// Save configuration using the SaveConfig function from config.go
if err := SaveConfig("mysetup.json", config); err != nil {
return fmt.Errorf("failed to save configuration: %v", err)
}
TimestampLog("OK: Configuration saved to mysetup.json")
return nil
}
// performSystemChecks performs pre-flight system checks
func performSystemChecks(config *Config) error {
TimestampLog("[4/5] Pre-flight system check...")
// Test network connectivity
testNetworkConnectivity()
// Check UPnP support
TimestampLog("Checking UPnP support for automatic port opening...")
if checkUPnPSupport() {
TimestampLog("OK: UPnP support detected")
// Optionally show available devices for debugging
discoverUPnPDevices()
} else {
TimestampLog("WARNING: No UPnP support detected")
TimestampLog("You may need to manually configure port forwarding on your router")
}
// Create firewall rule
TimestampLog(fmt.Sprintf("Setting up firewall rule for port %d...", config.LocalPort))
createFirewallRule(config.LocalPort)
return nil
}
// RunSetup runs the complete setup process
func RunSetup() *Config {
TimestampLog("[1/5] Loading configuration...")
var config *Config
// Check if config file exists
if _, err := os.Stat("mysetup.json"); err == nil {
TimestampLog("Found existing configuration file")
TimestampLog("Auto-loading saved configuration...")
TimestampLog("TO RECONFIGURE SOFTWARE")
TimestampLog("DELETE OR RENAME mysetup.json")
// Load existing config
var err error
config, err = LoadConfig("mysetup.json")
if err != nil {
TimestampLog(fmt.Sprintf("Failed to load existing config: %v", err))
TimestampLog("Running interactive setup...")
config = runInteractiveSetup()
} else {
// Re-detect IP and port for existing config
if strings.Contains(config.ExternalIP, "192.168.") || strings.Contains(config.ExternalIP, "10.") {
// Assume LAN
config.ExternalIP = detectLanIP()
} else {
// Assume WAN
config.ExternalIP = detectWanIP()
}
TimestampLog(fmt.Sprintf("Detected IP: %s", config.ExternalIP))
// Find free listen port
config.LocalPort = findFreeListenPort(config.LocalPort)
TimestampLog("Configuration loaded successfully")
}
} else {
TimestampLog("No existing configuration found, will create new one")
config = runInteractiveSetup()
}
// Setup directories
if err := setupDirectories(config); err != nil {
TimestampLog(fmt.Sprintf("Directory setup failed: %v", err))
os.Exit(1)
}
// Save configuration
if err := saveConfiguration(config); err != nil {
TimestampLog(fmt.Sprintf("Configuration save failed: %v", err))
os.Exit(1)
}
// Perform system checks
if err := performSystemChecks(config); err != nil {
TimestampLog(fmt.Sprintf("System checks failed: %v", err))
// Don't exit on system check failures, just warn
}
TimestampLog("[5/5] Starting Cup and String P2P File Sync...")
TimestampLog("Setup completed, starting P2P file sync")
return config
}
// CleanupSetup performs cleanup operations (like removing firewall rules and UPnP mappings)
func CleanupSetup() {
// Add panic recovery to prevent crashes during cleanup
defer func() {
if r := recover(); r != nil {
TimestampLog(fmt.Sprintf("Cleanup panic recovered: %v", r))
}
}()
TimestampLog("Performing setup cleanup...")
// Remove UPnP port mapping using the global manager
if upnpManager != nil {
TimestampLog("Cleaning up UPnP manager...")
if err := upnpManager.Close(); err != nil {
TimestampLog(fmt.Sprintf("UPnP cleanup error: %v", err))
}
upnpManager = nil
}
// Remove UPnP port mapping using the global variable (fallback)
if activePortMapping != nil {
TimestampLog("Cleaning up global UPnP mapping...")
if err := removeUPnPPortMapping(activePortMapping); err != nil {
TimestampLog(fmt.Sprintf("UPnP cleanup error: %v", err))
}
activePortMapping = nil
}
// Remove firewall rule
removeFirewallRule()
TimestampLog("Cleanup completed")
}
// -----------------END OF FILE-------------setup.go