Skip to content

Commit

Permalink
Merge 48ff672 into 026997e
Browse files Browse the repository at this point in the history
  • Loading branch information
aligeti committed Aug 23, 2018
2 parents 026997e + 48ff672 commit c5b0e7b
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ storage-node-image:
docker build --build-arg GO_VERSION=${GO_VERSION} -t storjlabs/storage-node:${TAG} -f cmd/farmer/Dockerfile .
.PHONY: uplink-image
uplink-image:
docker build --build-arg GO_VERSION=${GO_VERSION} -t storjlabs/uplink:${TAG} -f cmd/gw/Dockerfile .
docker build --build-arg GO_VERSION=${GO_VERSION} -t storjlabs/uplink:${TAG} -f cmd/ul/Dockerfile .

.PHONY: all-in-one
all-in-one:
Expand Down
10 changes: 5 additions & 5 deletions cmd/captplanet/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var (
runCfg struct {
HeavyClient HeavyClient
Farmers [farmerCount]Farmer
Gateway miniogw.Config
Uplink miniogw.Config
}
)

Expand Down Expand Up @@ -95,11 +95,11 @@ func cmdRun(cmd *cobra.Command, args []string) (err error) {
o)
}()

// start s3 gateway
// start s3 uplink
go func() {
_, _ = fmt.Printf("starting minio gateway on %s\n",
runCfg.Gateway.IdentityConfig.Address)
errch <- runCfg.Gateway.Run(ctx)
_, _ = fmt.Printf("starting minio uplink on %s\n",
runCfg.Uplink.IdentityConfig.Address)
errch <- runCfg.Uplink.Run(ctx)
}()

return <-errch
Expand Down
36 changes: 18 additions & 18 deletions cmd/captplanet/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
type Config struct {
HCCA provider.CASetupConfig
HCIdentity provider.IdentitySetupConfig
GWCA provider.CASetupConfig
GWIdentity provider.IdentitySetupConfig
ULCA provider.CASetupConfig
ULIdentity provider.IdentitySetupConfig
FarmerCA provider.CASetupConfig
FarmerIdentity provider.IdentitySetupConfig
BasePath string `help:"base path for captain planet storage" default:"$CONFDIR"`
Expand Down Expand Up @@ -94,17 +94,17 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {
}
}

gwPath := filepath.Join(setupCfg.BasePath, "gw")
err = os.MkdirAll(gwPath, 0700)
uplinkPath := filepath.Join(setupCfg.BasePath, "uplink")
err = os.MkdirAll(uplinkPath, 0700)
if err != nil {
return err
}
setupCfg.GWCA.CertPath = filepath.Join(gwPath, "ca.cert")
setupCfg.GWCA.KeyPath = filepath.Join(gwPath, "ca.key")
setupCfg.GWIdentity.CertPath = filepath.Join(gwPath, "identity.cert")
setupCfg.GWIdentity.KeyPath = filepath.Join(gwPath, "identity.key")
fmt.Printf("creating identity for gateway\n")
err = provider.SetupIdentity(process.Ctx(cmd), setupCfg.GWCA, setupCfg.GWIdentity)
setupCfg.ULCA.CertPath = filepath.Join(uplinkPath, "ca.cert")
setupCfg.ULCA.KeyPath = filepath.Join(uplinkPath, "ca.key")
setupCfg.ULIdentity.CertPath = filepath.Join(uplinkPath, "identity.cert")
setupCfg.ULIdentity.KeyPath = filepath.Join(uplinkPath, "identity.key")
fmt.Printf("creating identity for uplink\n")
err = provider.SetupIdentity(process.Ctx(cmd), setupCfg.ULCA, setupCfg.ULIdentity)
if err != nil {
return err
}
Expand All @@ -129,17 +129,17 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {
setupCfg.BasePath, "hc", "pointerdb.db"),
"heavy-client.overlay.database-url": "bolt://" + filepath.Join(
setupCfg.BasePath, "hc", "overlay.db"),
"gateway.cert-path": setupCfg.GWIdentity.CertPath,
"gateway.key-path": setupCfg.GWIdentity.KeyPath,
"gateway.address": joinHostPort(
"uplink.cert-path": setupCfg.ULIdentity.CertPath,
"uplink.key-path": setupCfg.ULIdentity.KeyPath,
"uplink.address": joinHostPort(
setupCfg.ListenHost, startingPort),
"gateway.overlay-addr": joinHostPort(
"uplink.overlay-addr": joinHostPort(
setupCfg.ListenHost, startingPort+1),
"gateway.pointer-db-addr": joinHostPort(
"uplink.pointer-db-addr": joinHostPort(
setupCfg.ListenHost, startingPort+1),
"gateway.minio-dir": filepath.Join(
setupCfg.BasePath, "gw", "minio"),
"gateway.api-key": apiKey,
"uplink.minio-dir": filepath.Join(
setupCfg.BasePath, "uplink", "minio"),
"uplink.api-key": apiKey,
"pointer-db.auth.api-key": apiKey,
}

Expand Down
17 changes: 0 additions & 17 deletions cmd/gw/README.md

This file was deleted.

4 changes: 2 additions & 2 deletions cmd/storj/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func getStorjObjects(ctx context.Context, cfg Config) (minio.ObjectLayer, error)
return nil, err
}

gateway, err := cfg.NewGateway(ctx, identity)
uplink, err := cfg.NewGateway(ctx, identity)
if err != nil {
return nil, err
}
Expand All @@ -34,7 +34,7 @@ func getStorjObjects(ctx context.Context, cfg Config) (minio.ObjectLayer, error)
return nil, err
}

storjObjects, err := gateway.NewGatewayLayer(credentials)
storjObjects, err := uplink.NewGatewayLayer(credentials)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/gw/Dockerfile → cmd/ul/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
WORKDIR /go/src/storj.io/storj
COPY . .
RUN dep ensure -vendor-only
RUN go build -o uplink cmd/gw/*.go
RUN go build -o uplink cmd/ul/*.go

# final stage
FROM alpine
Expand All @@ -17,5 +17,5 @@ EXPOSE 7777

WORKDIR /app
COPY --from=build-env /go/src/storj.io/storj/uplink /app/
COPY cmd/gw/entrypoint /entrypoint
COPY cmd/ul/entrypoint /entrypoint
ENTRYPOINT ["/entrypoint"]
File renamed without changes.
17 changes: 17 additions & 0 deletions cmd/uplink/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Gateway

Documentation for developing and building the uplink service

Usage:

First make an identity:
```
go install storj.io/storj/cmd/ul
ul setup
```

You can edit `~/.storj/ul/config.yaml` to your liking. Then run it!

```
ul run
```
10 changes: 5 additions & 5 deletions cmd/gw/main.go → cmd/uplink/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import (

var (
rootCmd = &cobra.Command{
Use: "gw",
Short: "Gateway",
Use: "ul",
Short: "Uplink",
}
runCmd = &cobra.Command{
Use: "run",
Short: "Run the gateway",
Short: "Run the uplink",
RunE: cmdRun,
}
setupCmd = &cobra.Command{
Expand All @@ -43,7 +43,7 @@ var (
APIKey string `default:"" help:"the api key to use for the satellite"`
}

defaultConfDir = "$HOME/.storj/gw"
defaultConfDir = "$HOME/.storj/ul"
)

func init() {
Expand All @@ -65,7 +65,7 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {

_, err = os.Stat(setupCfg.BasePath)
if !setupCfg.Overwrite && err == nil {
fmt.Println("A gw configuration already exists. Rerun with --overwrite")
fmt.Println("A ul configuration already exists. Rerun with --overwrite")
return nil
}

Expand Down
6 changes: 3 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/structs v1.0.0 h1:BrX964Rv5uQ3wwS+KRUAJCBBw5PQmgJfJ6v4yly5QwU=
github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPULxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/garyburd/redigo v1.0.1-0.20170216214944-0d253a66e6e1 h1:YmyuMm99D7kezPc0ZVWYnaUIWfMKR81lVVXttKTnDbw=
github.com/garyburd/redigo v1.0.1-0.20170216214944-0d253a66e6e1/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
Expand Down Expand Up @@ -131,7 +131,7 @@ github.com/klauspost/crc32 v0.0.0-20170628072449-bab58d77464a h1:NLr4Iy1X81t+cfi
github.com/klauspost/crc32 v0.0.0-20170628072449-bab58d77464a/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg=
github.com/klauspost/pgzip v1.0.1 h1:J1UvIV7CrOZlEMyfAfnqIzTmoPHEX0ODZsLATb71mkk=
github.com/klauspost/pgzip v1.0.1/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/klauspost/reedsolomon v0.0.0-20180704173009-925cb01d6510 h1:9eOgsI7EIGhJWPMBvSY+x0SEpeGGWUSijOrwK0XhpIk=
github.com/klauspost/reedsolomon v0.0.0-20180704173009-925cb01d6510 h1:9eOgsI7EIGhJWPMBvSY+x0SEpeGULUSijOrwK0XhpIk=
github.com/klauspost/reedsolomon v0.0.0-20180704173009-925cb01d6510/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4=
github.com/kurin/blazer v0.5.1 h1:mBc4i1uhHJEqU0KvzOgpMHhkwf+EcXvxjWEUS7HG+eY=
github.com/kurin/blazer v0.5.1/go.mod h1:4FCXMUWo9DllR2Do4TtBd377ezyAJ51vB5uTBjt0pGU=
Expand Down Expand Up @@ -218,7 +218,7 @@ github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165 h1:nkcn14uNmFE
github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rjeczalik/notify v0.9.0 h1:xJX3IQ09+O0qLAv4YdYe03EwYRyM7NPuC5O7Mc6/Jv4=
github.com/rjeczalik/notify v0.9.0/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho=
github.com/rs/cors v1.5.0 h1:dgSHE6+ia18arGOTIYQKKGWLvEbGvmbNE6NfxhoNHUY=
github.com/rs/cors v1.5.0 h1:dgSHE6+ia18arGOTIYQKKULLvEbGvmbNE6NfxhoNHUY=
github.com/rs/cors v1.5.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/ryanuber/go-glob v0.0.0-20170128012129-256dc444b735 h1:7YvPJVmEeFHR1Tj9sZEYsmarJEQfMVYpd/Vyy/A8dqE=
github.com/ryanuber/go-glob v0.0.0-20170128012129-256dc444b735/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
Expand Down

0 comments on commit c5b0e7b

Please sign in to comment.