@@ -17,11 +17,11 @@ func GetCertificates(domainName, email string) bool {
17
17
18
18
prompt := pterm .DefaultInteractiveContinue .WithOptions (options )
19
19
20
- pterm .Println ()
20
+ pterm .Println ()
21
21
pterm .Println (pterm .Cyan ("Do you want to obtain SSL certificates using Certbot?" ))
22
22
pterm .Println (pterm .Cyan ("This step requires that you already have a configured domain name." ))
23
23
pterm .Println (pterm .Cyan ("You can always re-run this installer after you have configured your domain name." ))
24
- pterm .Println ()
24
+ pterm .Println ()
25
25
26
26
result , _ := prompt .Show ()
27
27
@@ -48,10 +48,18 @@ func GetCertificates(domainName, email string) bool {
48
48
}
49
49
50
50
spinner .UpdateText ("Obtaining SSL certificates..." )
51
- cmd := exec .Command ("certbot" , "certonly" , "--webroot" , "-w" , fmt .Sprintf ("/var/www/%s" , dirName ), "-d" , domainName , "--email" , email , "--agree-tos" , "--no-eff-email" , "-q" )
52
- err = cmd .Run ()
53
- if err != nil {
54
- log .Fatalf ("Certbot failed to obtain the certificate for %s: %v" , domainName , err )
51
+ if email == "" {
52
+ cmd := exec .Command ("certbot" , "certonly" , "--webroot" , "-w" , fmt .Sprintf ("/var/www/%s" , dirName ), "-d" , domainName , "--agree-tos" , "--no-eff-email" , "-q" , "--register-unsafely-without-email" )
53
+ err = cmd .Run ()
54
+ if err != nil {
55
+ log .Fatalf ("Certbot failed to obtain the certificate for %s: %v" , domainName , err )
56
+ }
57
+ } else {
58
+ cmd := exec .Command ("certbot" , "certonly" , "--webroot" , "-w" , fmt .Sprintf ("/var/www/%s" , dirName ), "-d" , domainName , "--email" , email , "--agree-tos" , "--no-eff-email" , "-q" )
59
+ err = cmd .Run ()
60
+ if err != nil {
61
+ log .Fatalf ("Certbot failed to obtain the certificate for %s: %v" , domainName , err )
62
+ }
55
63
}
56
64
57
65
spinner .Success ("SSL certificates obtained successfully." )
0 commit comments