@@ -19,7 +19,7 @@ import (
19
19
"github.com/spf13/cobra"
20
20
)
21
21
22
- const inletsProDefaultVersion = "0.9.25 "
22
+ const inletsProDefaultVersion = "0.9.28 "
23
23
const inletsProControlPort = 8123
24
24
25
25
func init () {
@@ -71,19 +71,25 @@ var createCmd = &cobra.Command{
71
71
with inlets preloaded as a systemd service. The estimated cost of each
72
72
VM along with what OS version and spec will be used is explained in the
73
73
project docs.` ,
74
- Example : ` # Create a TCP tunnel server
75
- inletsctl create \
76
- --provider [digitalocean|equinix-metal|ec2|scaleway|civo|gce|azure|linode|hetzner] \
77
- --access-token-file $HOME/access-token \
78
- --region lon1
79
-
74
+ Example : `
80
75
# Create a HTTPS tunnel server, terminating TLS with a certificate
81
- # from Let's Encrypt
76
+ # from Let's Encrypt called "tunnel-richardcase" so your team mates
77
+ # don't delete your VM unintentionally.
82
78
inletsctl create \
79
+ tunnel-richardcase \
83
80
--letsencrypt-domain inlets.example.com \
84
81
--letsencrypt-email [email protected]
85
82
86
- # Create a HTTPS tunnel server with multiple domains
83
+ # Create a TCP tunnel server with a VM name of ssh-tunnel
84
+ inletsctl create \
85
+ ssh-tunnel \
86
+ --tcp \
87
+ --provider [digitalocean|equinix-metal|ec2|scaleway|civo|gce|azure|linode|hetzner] \
88
+ --access-token-file $HOME/access-token \
89
+ --region lon1
90
+
91
+ # Create a HTTPS tunnel server with multiple domains and an auto-generated
92
+ # VM name
87
93
inletsctl create \
88
94
--letsencrypt-domain tunnel1.example.com \
89
95
--letsencrypt-domain tunnel2.example.com \
@@ -99,6 +105,12 @@ const EquinixMetalProvider = "equinix-metal"
99
105
100
106
func runCreate (cmd * cobra.Command , _ []string ) error {
101
107
108
+ // Get name from the Args, if not provided, generate a random name
109
+ name := strings .Replace (names .GetRandomName (10 ), "_" , "-" , - 1 )
110
+ if len (cmd .Flags ().Args ()) > 0 {
111
+ name = cmd .Flags ().Args ()[0 ]
112
+ }
113
+
102
114
inletsProVersion , err := cmd .Flags ().GetString ("inlets-version" )
103
115
if err != nil {
104
116
return err
@@ -301,8 +313,6 @@ func runCreate(cmd *cobra.Command, _ []string) error {
301
313
tcp = false
302
314
}
303
315
304
- name := strings .Replace (names .GetRandomName (10 ), "_" , "-" , - 1 )
305
-
306
316
var userData string
307
317
if len (letsencryptDomains ) > 0 {
308
318
userData = MakeHTTPSUserdata (inletsToken ,
@@ -341,9 +351,9 @@ func runCreate(cmd *cobra.Command, _ []string) error {
341
351
}
342
352
343
353
if provider == "gce" {
344
- fmt .Printf ("Requesting host : %s in %s, from %s \n " , name , zone , provider )
354
+ fmt .Printf ("Provisioning exit-server : %s in %s [%s] \n " , name , zone , provider )
345
355
} else {
346
- fmt .Printf ("Requesting host : %s in %s, from %s \n " , name , region , provider )
356
+ fmt .Printf ("Provisioning exit-server : %s in %s [%s] \n " , name , region , provider )
347
357
}
348
358
349
359
hostRes , err := provisioner .Provision (* hostReq )
0 commit comments