Skip to content

Commit 9d40743

Browse files
committed
refactor: pin Gitea and GitLab SDK versions in go.mod to ensure compatibility with nuclei dependencies
1 parent f45a4b2 commit 9d40743

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,13 @@ COPY cmd/ ./cmd/
3434
COPY internal/ ./internal/
3535

3636
# Fetch katana and all its sub-packages into go.sum.
37-
# go get on the top-level module alone doesn't resolve transitive deps
38-
# of sub-packages — we must fetch each used sub-package explicitly.
39-
# After katana's gets, downgrade gitea/gitlab SDKs back to the versions
40-
# nuclei v3.7.1 was compiled against (katana doesn't use these SDKs).
37+
# replace directives in go.mod prevent katana from upgrading the
38+
# gitea/gitlab SDKs that nuclei v3.7.1 depends on.
4139
RUN go get github.com/projectdiscovery/katana@v1.6.1 && \
4240
go get github.com/projectdiscovery/katana/pkg/utils@v1.6.1 && \
4341
go get github.com/projectdiscovery/katana/pkg/output@v1.6.1 && \
4442
go get github.com/projectdiscovery/katana/pkg/types@v1.6.1 && \
45-
go get github.com/projectdiscovery/katana/pkg/engine/standard@v1.6.1 && \
46-
go get code.gitea.io/sdk/gitea@v0.17.0 && \
47-
go get gitlab.com/gitlab-org/api/client-go@v0.130.1
43+
go get github.com/projectdiscovery/katana/pkg/engine/standard@v1.6.1
4844

4945
# Build main autoar binary from cmd/autoar (CGO enabled for naabu/libpcap)
5046
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w" -o /app/autoar ./cmd/autoar

go.mod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,3 +471,11 @@ require (
471471
replace github.com/go-git/go-git/v5 => github.com/go-git/go-git/v5 v5.2.0
472472

473473
replace github.com/go-git/go-billy/v5 => github.com/go-git/go-billy/v5 v5.0.0
474+
475+
// Pin to versions compatible with nuclei v3.7.1.
476+
// katana v1.6.1 pulls in newer versions of these but katana doesn't
477+
// actually import them — the replace directive ensures nuclei's code
478+
// always compiles against the API it was written for.
479+
replace code.gitea.io/sdk/gitea => code.gitea.io/sdk/gitea v0.17.0
480+
481+
replace gitlab.com/gitlab-org/api/client-go => gitlab.com/gitlab-org/api/client-go v0.130.1

0 commit comments

Comments
 (0)