Skip to content

Commit

Permalink
rename to connecti
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxxstorm committed Oct 21, 2022
1 parent 1911e57 commit 2e4a688
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 57 deletions.
10 changes: 5 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ builds:
goarch:
- amd64
- arm64
ldflags: -X github.com/jaxxstorm/connectme/pkg/version.Version={{.Version}}
binary: connectme
main: ./cmd/connectme/main.go
ldflags: -X github.com/jaxxstorm/connecti/pkg/version.Version={{.Version}}
binary: connecti
main: ./cmd/connecti/main.go
archives:
- name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
format_overrides:
Expand All @@ -24,7 +24,7 @@ changelog:
release:
prerelease: auto
brews:
- name: connectme
- name: connecti
tap:
owner: jaxxstorm
name: homebrew-tap
Expand All @@ -37,7 +37,7 @@ brews:
dependencies:
- pulumi
scoop:
url_template: "http://github.com/jaxxstorm/connectme/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
url_template: "http://github.com/jaxxstorm/connecti/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
bucket:
owner: jaxxstorm
name: scoop-bucket
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# connectme
# connecti

`connectme` is a command line tool to quickly connect you to cloud infrastructure via [Tailscale](https://tailscale.com)
`connecti` is a command line tool to quickly connect you to cloud infrastructure via [Tailscale](https://tailscale.com)

## About

If you're provisioning cloud infrastructure correctly, you'll provision sensitive services in private subnets. This means they're often not routable from your machine or your CI/CD infrastructure, which means automating processes and using infrastructure as code tools can be difficult.

[Tailscale](https://tailscale.com) is a VPN service that allows you to quickly connect to remote infrastructure without the need to punch holes inside your security posture. It supports quickly spinning up nodes that will advertise routes as well, making it ideal for "ephemeral" VPN infrastructure.

`connectme` uses [Pulumi](https://pulumi.com)'s [Automation API](https://www.pulumi.com/automation/) to take the pain out of provisioning the infrastructure needed to provision the VPN. It declaratively creates Tailscale API keys, stores them in the cloud provider's secret store, and then creates a small compute node for which to advertise routes for you.
`connecti` uses [Pulumi](https://pulumi.com)'s [Automation API](https://www.pulumi.com/automation/) to take the pain out of provisioning the infrastructure needed to provision the VPN. It declaratively creates Tailscale API keys, stores them in the cloud provider's secret store, and then creates a small compute node for which to advertise routes for you.

**This is not intended to be used as a production tool!*Its main purpose is for you to quickly debug things or provision infrastructure during automated processes.

Expand All @@ -18,10 +18,10 @@ If you're provisioning cloud infrastructure correctly, you'll provision sensitiv

#### Homebrew

`connectme` is installed into a homebrew tap. You can install it via:
`connecti` is installed into a homebrew tap. You can install it via:

```
brew install jaxxstorm/tap/connectme
brew install jaxxstorm/tap/connecti
```

#### Manually
Expand All @@ -41,7 +41,7 @@ scoop bucket add jaxxstorm https://github.com/jaxxstorm/scoop-bucket.git
then installing directly from the bucket

```
scoop install connectme
scoop install connecti
```

#### Manually
Expand All @@ -54,15 +54,15 @@ Coming Soon

#### Tailscale

`connectme` uses Tailscale to create tunneled connections. You need to have Tailscale installed and have created a TailNet.
`connecti` uses Tailscale to create tunneled connections. You need to have Tailscale installed and have created a TailNet.

You can follow the getting started docs [here](https://tailscale.com/kb/1017/install/)

You'll also need an API key. You can get a Tailscale API key from [here](https://tailscale.com/kb/1101/api/)

#### Pulumi

`connectme` uses Pulumi's automation API. You'll need to ensure you have the Pulumi CLI installed and be logged into a state backend.
`connecti` uses Pulumi's automation API. You'll need to ensure you have the Pulumi CLI installed and be logged into a state backend.

Installation docs for your operating system can be found [here](https://www.pulumi.com/docs/get-started/install/)

Expand All @@ -84,7 +84,7 @@ pulumi login --local

#### Cloud Provider

Before using `connectme` - you'll need to make sure you have valid cloud provider credentials for the account you wish to use. The mechanism you'll use to provision credentials will be different depending on your cloud provider and authentication mechanism. See the provider-specific documentation below.
Before using `connecti` - you'll need to make sure you have valid cloud provider credentials for the account you wish to use. The mechanism you'll use to provision credentials will be different depending on your cloud provider and authentication mechanism. See the provider-specific documentation below.

You'll need then to sign up to [Tailscale](https://tailscale.com/kb/1017/install/) and create a "Tailnet". Information on how to do this will depend on your operating system. Tailscale offers a generous free tier for individuals.

Expand All @@ -94,15 +94,15 @@ Finally, you'll also need a Tailscale API key, to allow you to create resources

### Provisioning

Provisioning your infrastructure will depend on the cloud provider you're using. At the time of writing, `connectme` supports the following cloud providers:
Provisioning your infrastructure will depend on the cloud provider you're using. At the time of writing, `connecti` supports the following cloud providers:

| Cloud Provider| Usage Documentation|
| ------------- |:-------------:|
| AWS | [Docs](../docs/aws/README.md) |

## Configuration

`connectme` has a configuration file that you can specify when you run the program using the `--config` flag or you can store it in the default location `${HOME}/.connectme.yaml`.
`connecti` has a configuration file that you can specify when you run the program using the `--config` flag or you can store it in the default location `${HOME}/.connecti.yaml`.

The configuration file allows you to store common configurations so you don't have to specify them as command line flags:

Expand Down
6 changes: 3 additions & 3 deletions cmd/connectme/connect/aws/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"fmt"

"github.com/jaxxstorm/connectme/pkg/aws"
randomname "github.com/jaxxstorm/connectme/pkg/name"
tui "github.com/jaxxstorm/connectme/pkg/terminal"
"github.com/jaxxstorm/connecti/pkg/aws"
randomname "github.com/jaxxstorm/connecti/pkg/name"
tui "github.com/jaxxstorm/connecti/pkg/terminal"
"github.com/pulumi/pulumi/sdk/v3/go/auto/optup"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down
6 changes: 3 additions & 3 deletions cmd/connectme/connect/cli.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package connect

import (
"github.com/jaxxstorm/connectme/cmd/connectme/connect/aws"
"github.com/jaxxstorm/connecti/cmd/connecti/connect/aws"
"github.com/spf13/cobra"
)

Expand All @@ -11,8 +11,8 @@ func Command() *cobra.Command {
Short: "Connect commands",
Long: "Commands that connect infrastructure",
}

command.AddCommand(aws.Command())

return command
}
}
4 changes: 2 additions & 2 deletions cmd/connectme/disconnect/aws/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"

"github.com/jaxxstorm/connectme/pkg/aws"
tui "github.com/jaxxstorm/connectme/pkg/terminal"
"github.com/jaxxstorm/connecti/pkg/aws"
tui "github.com/jaxxstorm/connecti/pkg/terminal"
"github.com/pulumi/pulumi/sdk/v3/go/auto/optdestroy"
"github.com/spf13/cobra"
)
Expand Down
6 changes: 3 additions & 3 deletions cmd/connectme/disconnect/cli.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package disconnect

import (
"github.com/jaxxstorm/connectme/cmd/connectme/disconnect/aws"
"github.com/jaxxstorm/connecti/cmd/connecti/disconnect/aws"
"github.com/spf13/cobra"
)

Expand All @@ -11,8 +11,8 @@ func Command() *cobra.Command {
Short: "Disconnect commands",
Long: "Commands that disconnect infrastructure",
}

command.AddCommand(aws.Command())

return command
}
}
18 changes: 9 additions & 9 deletions cmd/connectme/list/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ var ()
func Command() *cobra.Command {
command := &cobra.Command{
Use: "list",
Short: "List all active connectme infrastructure",
Long: `List all the connectme infrastructure from the backend store`,
Short: "List all active connecti infrastructure",
Long: `List all the connecti infrastructure from the backend store`,
RunE: func(cmd *cobra.Command, args []string) error {

projectName := "connectme"
projectName := "connecti"
ctx := context.Background()

ws, err := auto.NewLocalWorkspace(ctx, auto.Project(workspace.Project{
Name: tokens.PackageName(projectName),
Runtime: workspace.NewProjectRuntimeInfo("go", nil),
}))
if err != nil {
return fmt.Errorf("error listing connectme instances: %v", err)
return fmt.Errorf("error listing connecti instances: %v", err)
}

stacks, err := ws.ListStacks(ctx)
if err != nil {
return fmt.Errorf("error listing connectme instances: %v", err)
return fmt.Errorf("error listing connecti instances: %v", err)
}

writer := tabwriter.NewWriter(os.Stdout, tabwriterMinWidth, tabwriterWidth, tabwriterPadding, tabwriterPadChar, tabwriterFlags)
Expand All @@ -51,7 +51,7 @@ func Command() *cobra.Command {
for _, stack := range stacks {
var url string
var resourceCount int
var connectMeType string
var connectiType string

// FIXME: this is going to be very slow for lots of stacks.
// I don't love it..
Expand All @@ -65,20 +65,20 @@ func Command() *cobra.Command {
}
}

cfg, err := ws.GetConfig(ctx, stack.Name, "connectme:type")
cfg, err := ws.GetConfig(ctx, stack.Name, "connecti:type")

if err != nil {
return fmt.Errorf("error retrieving config value for stack %s: %v", stack.Name, err)
}

connectMeType = cfg.Value
connectiType = cfg.Value

if stack.URL == "" {
url = "Not available"
} else {
url = stack.URL
}
fmt.Fprintf(writer, "%s\t%s\t%d\t%s\t%s\n", stack.Name, stack.LastUpdate, resourceCount, connectMeType, url)
fmt.Fprintf(writer, "%s\t%s\t%d\t%s\t%s\n", stack.Name, stack.LastUpdate, resourceCount, connectiType, url)
}

writer.Flush()
Expand Down
16 changes: 8 additions & 8 deletions cmd/connectme/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package main

import (
"fmt"
"github.com/jaxxstorm/connectme/cmd/connectme/connect"
"github.com/jaxxstorm/connectme/cmd/connectme/disconnect"
"github.com/jaxxstorm/connectme/cmd/connectme/version"
"github.com/jaxxstorm/connectme/cmd/connectme/list"
"github.com/jaxxstorm/connectme/pkg/contract"
"github.com/jaxxstorm/connecti/cmd/connecti/connect"
"github.com/jaxxstorm/connecti/cmd/connecti/disconnect"
"github.com/jaxxstorm/connecti/cmd/connecti/list"
"github.com/jaxxstorm/connecti/cmd/connecti/version"
"github.com/jaxxstorm/connecti/pkg/contract"
"os"

"github.com/spf13/cobra"
Expand All @@ -26,7 +26,7 @@ func initConfig() {
if cfgFile != "" { // enable ability to specify config file via flag
viper.SetConfigFile(cfgFile)
} else {
viper.SetConfigName(".connectme") // name of config file (without extension)
viper.SetConfigName(".connecti") // name of config file (without extension)
viper.AddConfigPath("$HOME") // adding home directory as first search path
viper.AddConfigPath(".")
viper.AutomaticEnv() // read in environment variables that match
Expand All @@ -43,7 +43,7 @@ func initConfig() {

func configureCLI() *cobra.Command {
rootCommand := &cobra.Command{
Use: "connectme",
Use: "connecti",
Long: "Quickly connect to cloud infrastructure via Tailscale",
}

Expand All @@ -53,7 +53,7 @@ func configureCLI() *cobra.Command {
rootCommand.AddCommand(list.Command())

rootCommand.PersistentFlags().BoolVarP(&debug, "debug", "D", false, "enable debug logging")
rootCommand.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.connectme.yaml)")
rootCommand.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.connecti.yaml)")
viper.BindPFlag("debug", rootCommand.PersistentFlags().Lookup("debug"))

return rootCommand
Expand Down
4 changes: 2 additions & 2 deletions cmd/connectme/version/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package version
import (
"fmt"

"github.com/jaxxstorm/connectme/pkg/version"
"github.com/jaxxstorm/connecti/pkg/version"
"github.com/spf13/cobra"
)

func Command() *cobra.Command {
command := &cobra.Command{
Use: "version",
Short: "Get the current version",
Long: `Get the current version of connectme`,
Long: `Get the current version of connecti`,
RunE: func(cmd *cobra.Command, args []string) error {

var v string
Expand Down
14 changes: 7 additions & 7 deletions docs/aws/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AWS

`connectme` will launch an AWS autoscaling group with a single instance inside an [AWS VPC](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html)
`connecti` will launch an AWS autoscaling group with a single instance inside an [AWS VPC](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html)

It creates the following resources:

Expand All @@ -11,7 +11,7 @@ It creates the following resources:

# Prerequisites

Before running `connectme` you need to have valid AWS credentials for the AWS that contains the VPC you want to connect to.
Before running `connecti` you need to have valid AWS credentials for the AWS that contains the VPC you want to connect to.

You can verify this by running:

Expand All @@ -30,22 +30,22 @@ You can do this via environment variables or the configuration file.

# Connecting

Once you've set up your environment, you need to provision your bastion. You can do this by specifying the subnets you want to connect to. `connectme` takes a list of subnets, these subnets all need to be within the same VPC
Once you've set up your environment, you need to provision your bastion. You can do this by specifying the subnets you want to connect to. `connecti` takes a list of subnets, these subnets all need to be within the same VPC

```
connectme connect aws --subnet-ids subnet-0b5bef562bf7308b8 --route "172.20.0.0/22"
connecti connect aws --subnet-ids subnet-0b5bef562bf7308b8 --route "172.20.0.0/22"
```

# Disconnecting

Once you're done using your private connection, you can destroy the connection by name. Listing the connections is done like so:

```
connectme list
connecti list
```

Then, select the `connectme` instance you'd like to destroy, and disconnect:
Then, select the `connecti` instance you'd like to destroy, and disconnect:

```
connectme disconnect aws --name <my-name>
connecti disconnect aws --name <my-name>
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/jaxxstorm/connectme
module github.com/jaxxstorm/connecti

go 1.19

Expand Down
2 changes: 1 addition & 1 deletion pkg/aws/bastion.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func Bastion(args BastionArgs) pulumi.RunFunc {
return fmt.Errorf("error creating bastion: %v", err)
}

// ctx.Export("connectMeType", pulumi.String("aws"))
// ctx.Export("connectiType", pulumi.String("aws"))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/aws/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func Program(name string, ctx context.Context, args BastionArgs) (auto.Stack, error) {
projectName := "connectme"
projectName := "connecti"
stackName := name

s, err := auto.UpsertStackInlineSource(ctx, stackName, projectName, Bastion(args))
Expand All @@ -29,7 +29,7 @@ func Program(name string, ctx context.Context, args BastionArgs) (auto.Stack, er
return s, fmt.Errorf("error installing AWS tailscale plugin: %v", err)
}

s.SetConfig(ctx, "connectme:type", auto.ConfigValue{Value: "aws"})
s.SetConfig(ctx, "connecti:type", auto.ConfigValue{Value: "aws"})
s.SetConfig(ctx, "aws:region", auto.ConfigValue{Value: args.Region})
s.SetConfig(ctx, "tailscale:tailnet", auto.ConfigValue{Value: args.Tailnet})
s.SetConfig(ctx, "tailscale:apiKey", auto.ConfigValue{Value: args.ApiKey, Secret: true})
Expand Down

0 comments on commit 2e4a688

Please sign in to comment.