diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7080f63b..28e94bca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,6 +51,7 @@ jobs: args: release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + IPFS_ADDR: ${{ secrets.IPFS_ADDR }} IPFS_NODE_ADDR: ${{ secrets.IPFS_NODE_ADDR }} IPFS_NODE_PATH: ${{ secrets.IPFS_NODE_PATH }} SERVICES_API_URL: ${{ secrets[steps.secretnames.outputs.SERVICES_API_URL] }} diff --git a/.goreleaser.yml b/.goreleaser.yml index db5de96c..784281a7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -22,6 +22,7 @@ builds: - -X main.textileuserkey={{ .Env.TXL_USER_KEY }} - -X main.textileusersecret={{ .Env.TXL_USER_SECRET }} - -X main.spacestoragesiteurl={{ .Env.SPACE_STORAGE_SITE_URL }} + - -X main.ipfsaddr={{ .Env.IPFS_ADDR }} - -X main.ipfsnodeaddr={{ .Env.IPFS_NODE_ADDR }} - -X main.ipfsnodepath={{ .Env.IPFS_NODE_PATH }} main: ./cmd/space-daemon/main.go @@ -44,6 +45,7 @@ builds: - -X main.textileuserkey={{ .Env.TXL_USER_KEY }} - -X main.textileusersecret={{ .Env.TXL_USER_SECRET }} - -X main.spacestoragesiteurl={{ .Env.SPACE_STORAGE_SITE_URL }} + - -X main.ipfsaddr={{ .Env.IPFS_ADDR }} - -X main.ipfsnodeaddr={{ .Env.IPFS_NODE_ADDR }} - -X main.ipfsnodepath={{ .Env.IPFS_NODE_PATH }} main: ./cmd/space-daemon/main.go @@ -68,6 +70,7 @@ builds: - -X main.textileuserkey={{ .Env.TXL_USER_KEY }} - -X main.textileusersecret={{ .Env.TXL_USER_SECRET }} - -X main.spacestoragesiteurl={{ .Env.SPACE_STORAGE_SITE_URL }} + - -X main.ipfsaddr={{ .Env.IPFS_ADDR }} - -X main.ipfsnodeaddr={{ .Env.IPFS_NODE_ADDR }} - -X main.ipfsnodepath={{ .Env.IPFS_NODE_PATH }} main: ./cmd/space-daemon/main.go diff --git a/Makefile b/Makefile index 88ca079b..229b61fb 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ build: go build \ -o bin/space \ -ldflags \ - "-X 'main.ipfsnodeaddr=${IPFS_NODE_ADDR}' \ + "-X 'main.ipfsaddr=${IPFS_ADDR}' \ + -X 'main.ipfsnodeaddr=${IPFS_NODE_ADDR}' \ -X 'main.ipfsnodepath=${IPFS_NODE_PATH}' \ -X 'main.spaceapi=${SERVICES_API_URL}' \ -X 'main.spacestoragesiteurl=${SPACE_STORAGE_SITE_URL}' \ diff --git a/cmd/space-daemon/main.go b/cmd/space-daemon/main.go index 1affe930..e12da4f4 100644 --- a/cmd/space-daemon/main.go +++ b/cmd/space-daemon/main.go @@ -28,8 +28,8 @@ var ( debugMode = flag.Bool("debug", true, "run daemon with debug mode for profiling") enableTracing = flag.Bool("trace", false, "run tracing on daemon rpc") devMode = flag.Bool("dev", false, "run daemon in dev mode to use .env file") - ipfsaddr = flag.String("ipfsaddr", "/ip4/127.0.0.1/tcp/5001", "IPFS multiaddress to connect to (defaults to local node)") ipfsnode = flag.Bool("ipfsnode", true, "run IPFS embedded into the daemon (defaults to true)") + ipfsaddr string ipfsnodeaddr string ipfsnodepath string spaceapi string @@ -56,7 +56,7 @@ func main() { log.Debug("Running mode", fmt.Sprintf("DevMode:%v", *devMode)) cf := &config.Flags{ - Ipfsaddr: *ipfsaddr, + Ipfsaddr: ipfsaddr, Ipfsnode: *ipfsnode == true, Ipfsnodeaddr: ipfsnodeaddr, Ipfsnodepath: ipfsnodepath,