Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bits/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ type Conf struct {
//holds the aws s3 bucket name
AWSS3BucketName string `json:"aws_s3_bucket_name"`

//holds the aws s3 bucket domain
AWSDomain string `json:"aws_s3_bucket_domain"`

//The aws key that has access to the above bucket
AWSAccessKeyID string `json:"aws_access_key_id"`

Expand Down Expand Up @@ -62,6 +65,8 @@ func (conf *Conf) OverwriteFromGit(repo *Repository) (err error) {
conf.AWSAccessKeyID = fields[1]
case "bits.aws-secret-access-key":
conf.AWSSecretAccessKey = fields[1]
case "bits.aws-s3-bucket-domain":
conf.AWSDomain = fields[1]
}
}

Expand Down
6 changes: 6 additions & 0 deletions bits/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ func NewRepository(dir string, output io.Writer) (repo *Repository, err error) {
repo.conf.AWSS3BucketName,
repo.conf.AWSAccessKeyID,
repo.conf.AWSSecretAccessKey,
repo.conf.AWSDomain,
)

if err != nil {
Expand Down Expand Up @@ -239,6 +240,10 @@ func (repo *Repository) Install(w io.Writer, conf *Conf) (err error) {
gconf["bits.aws-s3-bucket-name"] = conf.AWSS3BucketName
}

if conf.AWSDomain != "" {
gconf["bits.aws-s3-bucket-domain"] = conf.AWSDomain
}

if conf.AWSAccessKeyID != "" {
gconf["bits.aws-access-key-id"] = conf.AWSAccessKeyID
}
Expand All @@ -261,6 +266,7 @@ func (repo *Repository) Install(w io.Writer, conf *Conf) (err error) {
repo.conf.AWSS3BucketName,
repo.conf.AWSAccessKeyID,
repo.conf.AWSSecretAccessKey,
repo.conf.AWSDomain,
)

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion bits/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"testing"
"time"

"github.com/nerdalize/git-bits/bits"
"github.com/jungleai/git-bits/bits"
)

func GitInitRemote(t *testing.T) (dir string) {
Expand Down
4 changes: 2 additions & 2 deletions bits/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ type S3Remote struct {
repo *Repository
}

func NewS3Remote(repo *Repository, remote, bucket, accessKey, secretKey string) (s3 *S3Remote, err error) {
func NewS3Remote(repo *Repository, remote, bucket, accessKey, secretKey string, domain string) (s3 *S3Remote, err error) {
s3 = &S3Remote{
repo: repo,
gitRemote: remote,
}

s3.bucket = s3gof3r.New("", s3gof3r.Keys{
s3.bucket = s3gof3r.New(domain, s3gof3r.Keys{
AccessKey: accessKey,
SecretKey: secretKey,
}).Bucket(bucket)
Expand Down
2 changes: 1 addition & 1 deletion command/combine.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/mitchellh/cli"
"github.com/nerdalize/git-bits/bits"
"github.com/jungleai/git-bits/bits"
)

type Combine struct {
Expand Down
2 changes: 1 addition & 1 deletion command/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/mitchellh/cli"
"github.com/nerdalize/git-bits/bits"
"github.com/jungleai/git-bits/bits"
)

type Fetch struct {
Expand Down
8 changes: 7 additions & 1 deletion command/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/jessevdk/go-flags"
"github.com/mitchellh/cli"
"github.com/nerdalize/git-bits/bits"
"github.com/jungleai/git-bits/bits"
)

var InstallOpts struct {
Expand Down Expand Up @@ -97,6 +97,12 @@ func (cmd *Install) Run(args []string) int {
return 128
}

conf.AWSDomain, err = cmd.ui.Ask("What is the AWS where domain the bucket is located? (if left empty, defaults to s3.amazonaws.com)\n")
if err != nil {
cmd.ui.Error(fmt.Sprintf("failed to get input: %v", err))
return 128
}

conf.AWSSecretAccessKey, err = cmd.ui.AskSecret("What is your AWS Secret Key that autorizes the above access key? (input will be hidden)\n")
if err != nil {
cmd.ui.Error(fmt.Sprintf("failed to get input: %v", err))
Expand Down
2 changes: 1 addition & 1 deletion command/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/mitchellh/cli"
"github.com/nerdalize/git-bits/bits"
"github.com/jungleai/git-bits/bits"
)

type Pull struct {
Expand Down
2 changes: 1 addition & 1 deletion command/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/mitchellh/cli"
"github.com/nerdalize/git-bits/bits"
"github.com/jungleai/git-bits/bits"
)

type Push struct {
Expand Down
2 changes: 1 addition & 1 deletion command/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/mitchellh/cli"
"github.com/nerdalize/git-bits/bits"
"github.com/jungleai/git-bits/bits"
)

type Scan struct {
Expand Down
2 changes: 1 addition & 1 deletion command/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/mitchellh/cli"
"github.com/nerdalize/git-bits/bits"
"github.com/jungleai/git-bits/bits"
)

type Split struct {
Expand Down
16 changes: 10 additions & 6 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package: github.com/nerdalize/git-bits
package: github.com/jungleai/git-bits
import:
- package: github.com/mitchellh/cli #cross-platform command lines
version: fa17b36f6c61f1ddbbb08c9f6fde94b3c065a09d
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/mitchellh/cli"

"github.com/nerdalize/git-bits/command"
"github.com/jungleai/git-bits/command"
)

var (
Expand Down