diff --git a/.github/workflows/build-&-publish-docker-image.yml b/.github/workflows/build-&-publish-docker-image.yml index 4c4382675..6c5b0fe87 100644 --- a/.github/workflows/build-&-publish-docker-image.yml +++ b/.github/workflows/build-&-publish-docker-image.yml @@ -55,24 +55,30 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} + # - name: Login to Docker Hub + # uses: docker/login-action@v1 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_PASSWORD }} # - name: Get changed files using defaults # id: changed-files # uses: tj-actions/changed-files@v18.4 - name: Pull Build Base + env: + DOCKER_CONFIG: /tmp/docker-config-${{ github.run_id }} run: | + docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} docker pull $BLOBBER_BUILD_BASE_REGISTRY:staging docker tag $BLOBBER_BUILD_BASE_REGISTRY:staging $BLOBBER_BUILDBASE - name: Build Base image # if: contains(steps.changed-files.outputs.modified_files, 'docker.local/base.Dockerfile') + env: + DOCKER_CONFIG: /tmp/docker-config-${{ github.run_id }} run: | + docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8) ./docker.local/bin/build.base.sh && @@ -82,7 +88,10 @@ jobs: docker push $BLOBBER_BUILD_BASE_REGISTRY:$TAG-$SHORT_SHA - name: Build blobber + env: + DOCKER_CONFIG: /tmp/docker-config-${{ github.run_id }} run: | + docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8) export DOCKER_IMAGE_BASE="$BLOBBER_BUILD_BASE_REGISTRY:$TAG" export DOCKER_IMAGE_SWAGGER="${BLOBBER_REGISTRY}:swagger_test" @@ -123,11 +132,11 @@ jobs: # with: # go-version: ^1.21 # The Go version to download (if necessary) and use. - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} + # - name: Login to Docker Hub + # uses: docker/login-action@v1 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Clone blobber uses: actions/checkout@v3 @@ -144,13 +153,19 @@ jobs: # fetch-depth: 0 - name: Pull Build Base + env: + DOCKER_CONFIG: /tmp/docker-config-${{ github.run_id }} run: | + docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} docker pull $BLOBBER_BUILD_BASE_REGISTRY:staging docker tag $BLOBBER_BUILD_BASE_REGISTRY:staging $BLOBBER_BUILDBASE - name: Build Base image # if: contains(steps.changed-files.outputs.modified_files, 'docker.local/base.Dockerfile') + env: + DOCKER_CONFIG: /tmp/docker-config-${{ github.run_id }} run: | + docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8) ./docker.local/bin/build.base.sh @@ -160,7 +175,10 @@ jobs: docker push $BLOBBER_BUILD_BASE_REGISTRY:$TAG-$SHORT_SHA - name: Build validator + env: + DOCKER_CONFIG: /tmp/docker-config-${{ github.run_id }} run: | + docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8) export DOCKER_IMAGE_BASE="$BLOBBER_BUILD_BASE_REGISTRY:$TAG" # export DOCKER_BUILD="buildx build --platform linux/amd64,linux/arm64 --push" diff --git a/code/go/0chain.net/blobbercore/readmarker/authticket.go b/code/go/0chain.net/blobbercore/readmarker/authticket.go index af05624a6..e2c0a9033 100644 --- a/code/go/0chain.net/blobbercore/readmarker/authticket.go +++ b/code/go/0chain.net/blobbercore/readmarker/authticket.go @@ -67,7 +67,7 @@ func (authToken *AuthTicket) Verify(allocationObj *allocation.Allocation, client if authToken.OwnerID != allocationObj.OwnerID { return common.NewError("invalid_parameters", "Invalid auth ticket. Owner ID mismatch") } - if authToken.Timestamp > (common.Now() + 2) { + if authToken.Timestamp > (common.Now() + 120) { return common.NewError("invalid_parameters", "Invalid auth ticket. Timestamp in future") } diff --git a/code/go/0chain.net/blobbercore/reference/ref.go b/code/go/0chain.net/blobbercore/reference/ref.go index 8c3cc0709..af26a9153 100644 --- a/code/go/0chain.net/blobbercore/reference/ref.go +++ b/code/go/0chain.net/blobbercore/reference/ref.go @@ -375,7 +375,7 @@ func GetReferenceByLookupHashForDownload(ctx context.Context, allocationID, path func GetReferencesByName(ctx context.Context, allocationID, name string) (refs []*Ref, err error) { db := datastore.GetStore().GetTransaction(ctx) err = db.Model(&Ref{}). - Where("allocation_id = ? AND name LIKE ?", allocationID, "%"+name+"%"). + Where("allocation_id = ? AND name ILIKE ?", allocationID, "%"+name+"%"). Limit(20). Find(&refs).Error if err != nil {