diff --git a/Makefile b/Makefile index 8aecf0de..430d7c2a 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,10 @@ PACKAGE ?= github.com/gptscript-ai/gptscript-credential-helpers VERSION ?= $(shell ./hack/git-meta version) REVISION ?= $(shell ./hack/git-meta revision) +COMMIT_DATE ?= $(shell .hack/git-meta commit-date) GO_PKG = github.com/gptscript-ai/gptscript-credential-helpers -GO_LDFLAGS = -s -w -X ${GO_PKG}/credentials.Version=${VERSION} -X ${GO_PKG}/credentials.Revision=${REVISION} -X ${GO_PKG}/credentials.Package=${PACKAGE} +GO_LDFLAGS = -s -w -X ${GO_PKG}/credentials.Version=${VERSION} -X ${GO_PKG}/credentials.Revision=${REVISION} -X ${GO_PKG}/credentials.Package=${PACKAGE} -X main.version=${VERSION} -X main.commit=${REVISION} -X main.date=${COMMIT_DATE} BUILDX_CMD ?= docker buildx DESTDIR ?= ./bin/build diff --git a/README.md b/README.md index a0fe9cd4..ae222b52 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This is a fork of https://github.com/docker/docker-credential-helpers for use wi 1 - Download the source. ```shell -$ git clone https://github.com/gptscript/gptscript-credential-helpers.git +$ git clone https://github.com/gptscript-ai/gptscript-credential-helpers.git $ cd gptscript-credential-helpers ``` diff --git a/client/client.go b/client/client.go index 7ca5ab72..517c537c 100644 --- a/client/client.go +++ b/client/client.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/docker/docker-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" ) // isValidCredsMessage checks if 'msg' contains invalid credentials error message. diff --git a/client/client_test.go b/client/client_test.go index 0db20057..d4bbd72f 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/docker-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" ) const ( diff --git a/credentials/version.go b/credentials/version.go index 84377c26..2e035194 100644 --- a/credentials/version.go +++ b/credentials/version.go @@ -5,7 +5,7 @@ var ( Name = "" // Package is filled at linking time - Package = "github.com/docker/docker-credential-helpers" + Package = "github.com/gptscript-ai/gptscript-credential-helpers" // Version holds the complete version number. Filled in at linking time. Version = "v0.0.0+unknown" diff --git a/deb/Dockerfile b/deb/Dockerfile deleted file mode 100644 index ae27517d..00000000 --- a/deb/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -# syntax=docker/dockerfile:1 - -ARG GO_VERSION=1.21.6 -ARG DISTRO=ubuntu -ARG SUITE=focal - -FROM golang:${GO_VERSION}-bullseye AS golang - -FROM ${DISTRO}:${SUITE} - -ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -yy debhelper dh-make libsecret-1-dev -RUN mkdir -p /build - -WORKDIR /build -ENV GOPROXY=https://proxy.golang.org|direct -ENV GO111MODULE=off -ENV GOPATH=/build -ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin -COPY --from=golang /usr/local/go /usr/local/go - -COPY Makefile . -COPY credentials credentials -COPY secretservice secretservice -COPY pass pass -COPY deb/debian ./debian -COPY deb/build-deb . - -ARG VERSION -ENV VERSION=${VERSION} -ARG REVISION -ENV REVISION=${REVISION} -ARG DISTRO -ENV DISTRO=${DISTRO} -ARG SUITE -ENV SUITE=${SUITE} -RUN /build/build-deb diff --git a/deb/build-deb b/deb/build-deb deleted file mode 100755 index 04d3de1d..00000000 --- a/deb/build-deb +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -set -ex - -maintainer=$(awk -F ': ' '$1 == "Maintainer" { print $2; exit }' debian/control) - -cat > "debian/changelog" <<-EOF -docker-credential-helpers ($VERSION) $DISTRO-$SUITE; urgency=low - - * New upstream version - - -- $maintainer $(date --rfc-2822) -EOF - -mkdir -p src/github.com/docker/docker-credential-helpers -ln -s /build/credentials /build/src/github.com/docker/docker-credential-helpers/credentials -ln -s /build/secretservice /build/src/github.com/docker/docker-credential-helpers/secretservice -ln -s /build/pass /build/src/github.com/docker/docker-credential-helpers/pass - -dpkg-buildpackage -us -uc - -mkdir /release -mv /docker-credential-* /release diff --git a/deb/debian/compat b/deb/debian/compat deleted file mode 100644 index ec635144..00000000 --- a/deb/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/deb/debian/control b/deb/debian/control deleted file mode 100644 index 33f2041a..00000000 --- a/deb/debian/control +++ /dev/null @@ -1,25 +0,0 @@ -Source: docker-credential-helpers -Section: admin -Priority: optional -Maintainer: Docker -Homepage: https://dockerproject.org -Standards-Version: 3.9.6 -Vcs-Browser: https://github.com/docker/docker-credential-helpers -Vcs-Git: git://github.com/docker/docker-credential-helpers.git -Build-Depends: debhelper - , dh-make - , libsecret-1-dev - -Package: docker-credential-secretservice -Architecture: any -Depends: libsecret-1-0 - , ${misc:Depends} -Description: docker-credential-secretservice is a credential helper backend - which uses libsecret to keep Docker credentials safe. - -Package: docker-credential-pass -Architecture: any -Depends: pass - , ${misc:Depends} -Description: docker-credential-secretservice is a credential helper backend - which uses the pass utility to keep Docker credentials safe. diff --git a/deb/debian/docker-credential-pass.install b/deb/debian/docker-credential-pass.install deleted file mode 100644 index fb17479b..00000000 --- a/deb/debian/docker-credential-pass.install +++ /dev/null @@ -1 +0,0 @@ -debian/tmp/usr/bin/docker-credential-pass diff --git a/deb/debian/docker-credential-secretservice.install b/deb/debian/docker-credential-secretservice.install deleted file mode 100644 index 4a17630b..00000000 --- a/deb/debian/docker-credential-secretservice.install +++ /dev/null @@ -1 +0,0 @@ -debian/tmp/usr/bin/docker-credential-secretservice diff --git a/deb/debian/rules b/deb/debian/rules deleted file mode 100755 index 4750af38..00000000 --- a/deb/debian/rules +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/make -f - -DESTDIR := $(CURDIR)/debian/tmp - -override_dh_auto_build: - make build-secretservice DESTDIR=bin - make build-pass DESTDIR=bin - -override_dh_auto_install: - install -D bin/docker-credential-secretservice $(DESTDIR)/usr/bin/docker-credential-secretservice - install -D bin/docker-credential-pass $(DESTDIR)/usr/bin/docker-credential-pass - -%: - dh $@ - -override_dh_auto_test: - # no tests - diff --git a/docker-bake.hcl b/docker-bake.hcl index db192b91..5ba28e89 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -57,13 +57,7 @@ target "binaries" { "darwin/amd64", "darwin/arm64", "linux/amd64", - "linux/arm64", - "linux/arm/v7", - "linux/arm/v6", - "linux/ppc64le", - "linux/s390x", - "windows/amd64", - "windows/arm64" + "linux/arm64" ] } diff --git a/go.mod b/go.mod index a8ec1cd8..0c2dd6a1 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/docker/docker-credential-helpers +module github.com/gptscript-ai/gptscript-credential-helpers go 1.19 diff --git a/hack/git-meta b/hack/git-meta index ed4bfb84..65e4cbc6 100755 --- a/hack/git-meta +++ b/hack/git-meta @@ -9,6 +9,9 @@ case $1 in "revision") echo "$(git rev-parse HEAD)$(if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi)" ;; + "commit-date") + git show -s --format=%cI HEAD + ;; *) echo "usage: ./hack/git-meta " exit 1 diff --git a/hack/release b/hack/release index 960c89dd..03f9eff9 100755 --- a/hack/release +++ b/hack/release @@ -54,8 +54,8 @@ find ./${DESTDIR} -type d -empty -delete # universal binary ( cd ${DESTDIR} - wget https://github.com/g-linville/makefat/releases/download/v0.1.0/makefat_0.1.0_linux_amd64.tar.gz - tar -xzf makefat_0.1.0_linux_amd64.tar.gz + wget https://github.com/g-linville/makefat/releases/download/v0.1.2/makefat_0.1.2_linux_amd64.tar.gz + tar -xzf makefat_0.1.2_linux_amd64.tar.gz find . -name "gptscript-credential-osxkeychain-*" -print0 | xargs ./makefat gptscript-credential-osxkeychain rm -f makefat* gptscript-credential-osxkeychain-* ) diff --git a/osxkeychain/cmd/main.go b/osxkeychain/cmd/main.go index 08844b47..9656a479 100644 --- a/osxkeychain/cmd/main.go +++ b/osxkeychain/cmd/main.go @@ -3,8 +3,8 @@ package main import ( - "github.com/docker/docker-credential-helpers/credentials" - "github.com/docker/docker-credential-helpers/osxkeychain" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/osxkeychain" ) func main() { diff --git a/osxkeychain/osxkeychain.go b/osxkeychain/osxkeychain.go index e6347304..3ed3138c 100644 --- a/osxkeychain/osxkeychain.go +++ b/osxkeychain/osxkeychain.go @@ -16,8 +16,8 @@ import ( "strconv" "unsafe" - "github.com/docker/docker-credential-helpers/credentials" - "github.com/docker/docker-credential-helpers/registryurl" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/registryurl" ) // errCredentialsNotFound is the specific error message returned by OS X diff --git a/osxkeychain/osxkeychain_test.go b/osxkeychain/osxkeychain_test.go index c82c6490..3d0f1ec2 100644 --- a/osxkeychain/osxkeychain_test.go +++ b/osxkeychain/osxkeychain_test.go @@ -6,7 +6,7 @@ import ( "fmt" "testing" - "github.com/docker/docker-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" ) func TestOSXKeychainHelper(t *testing.T) { diff --git a/pass/cmd/main.go b/pass/cmd/main.go index 4fe7c1ed..1dd89616 100644 --- a/pass/cmd/main.go +++ b/pass/cmd/main.go @@ -1,8 +1,8 @@ package main import ( - "github.com/docker/docker-credential-helpers/credentials" - "github.com/docker/docker-credential-helpers/pass" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/pass" ) func main() { diff --git a/pass/pass.go b/pass/pass.go index 80af37dd..fbfc5c34 100644 --- a/pass/pass.go +++ b/pass/pass.go @@ -17,7 +17,7 @@ import ( "strings" "sync" - "github.com/docker/docker-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" ) // PASS_FOLDER contains the directory where credentials are stored diff --git a/pass/pass_test.go b/pass/pass_test.go index 47e5e902..bb8780a5 100644 --- a/pass/pass_test.go +++ b/pass/pass_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/docker-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" ) func TestPassHelper(t *testing.T) { diff --git a/secretservice/cmd/main.go b/secretservice/cmd/main.go index 22d2a6d4..f77c040f 100644 --- a/secretservice/cmd/main.go +++ b/secretservice/cmd/main.go @@ -3,8 +3,8 @@ package main import ( - "github.com/docker/docker-credential-helpers/credentials" - "github.com/docker/docker-credential-helpers/secretservice" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/secretservice" ) func main() { diff --git a/secretservice/secretservice.go b/secretservice/secretservice.go index caf0fe7c..982d642b 100644 --- a/secretservice/secretservice.go +++ b/secretservice/secretservice.go @@ -14,7 +14,7 @@ import ( "errors" "unsafe" - "github.com/docker/docker-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" ) // Secretservice handles secrets using Linux secret-service as a store. diff --git a/secretservice/secretservice_test.go b/secretservice/secretservice_test.go index 21da1042..e31f8259 100644 --- a/secretservice/secretservice_test.go +++ b/secretservice/secretservice_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/docker-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" ) func TestSecretServiceHelper(t *testing.T) { diff --git a/wincred/cmd/main.go b/wincred/cmd/main.go index d2bcefb7..80b54680 100644 --- a/wincred/cmd/main.go +++ b/wincred/cmd/main.go @@ -3,8 +3,8 @@ package main import ( - "github.com/docker/docker-credential-helpers/credentials" - "github.com/docker/docker-credential-helpers/wincred" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/wincred" ) func main() { diff --git a/wincred/wincred.go b/wincred/wincred.go index 41c792bc..8145e150 100644 --- a/wincred/wincred.go +++ b/wincred/wincred.go @@ -8,8 +8,8 @@ import ( "strings" winc "github.com/danieljoos/wincred" - "github.com/docker/docker-credential-helpers/credentials" - "github.com/docker/docker-credential-helpers/registryurl" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/registryurl" ) // Wincred handles secrets using the Windows credential service. diff --git a/wincred/wincred_test.go b/wincred/wincred_test.go index ed5f1f84..c51a222d 100644 --- a/wincred/wincred_test.go +++ b/wincred/wincred_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/docker-credential-helpers/credentials" + "github.com/gptscript-ai/gptscript-credential-helpers/credentials" ) func TestWinCredHelper(t *testing.T) {