Skip to content

Commit

Permalink
Rename Go module to github.com/getsops/sops/v3
Browse files Browse the repository at this point in the history
This commit renames the Go module from `go.mozilla.org/sops/v3` to
`github.com/getsops/sops/v3` without a major version bump, to align
with new stewardship.

For more information around this change, refer to
#1246.

For a one-liner to change the `go.mod` and any import paths in your
Go project making use of this module, run:

```
find /path/to/repo -type f \( -name "*.go" -o -name "go.mod" \) -exec sed -i 's|go.mozilla.org/sops/v3|github.com/getsops/sops/v3|g' {} \;
find /path/to/repo -type f \( -name "*.go" -o -name "go.mod" \) -exec sed -i '' 's|go.mozilla.org/sops/v3|github.com/getsops/sops/v3|g' {} \;
```

Signed-off-by: Hidde Beydals <[email protected]>
  • Loading branch information
hiddeco committed Jul 11, 2023
1 parent 7051ccd commit f029c6c
Show file tree
Hide file tree
Showing 47 changed files with 189 additions and 189 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ jobs:
- name: Set RELEASE_NUMBER
run: echo "RELEASE_NUMBER=$(echo $RELEASE_VERSION | cut -c2-)" >> $GITHUB_ENV
- name: Build linux amd64 binary
run: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -mod vendor -o dist/sops-${{ env.RELEASE_VERSION }}.linux.amd64 go.mozilla.org/sops/v3/cmd/sops && cp dist/sops-${{ env.RELEASE_VERSION }}.linux.amd64 dist/sops-${{ env.RELEASE_VERSION }}.linux
run: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -mod vendor -o dist/sops-${{ env.RELEASE_VERSION }}.linux.amd64 github.com/getsops/sops/v3/cmd/sops && cp dist/sops-${{ env.RELEASE_VERSION }}.linux.amd64 dist/sops-${{ env.RELEASE_VERSION }}.linux
- name: Build linux arm64 binary
run: GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -mod vendor -o dist/sops-${{ env.RELEASE_VERSION }}.linux.arm64 go.mozilla.org/sops/v3/cmd/sops
run: GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -mod vendor -o dist/sops-${{ env.RELEASE_VERSION }}.linux.arm64 github.com/getsops/sops/v3/cmd/sops
- name: Build darwin amd64 binary
run: GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -mod vendor -o dist/sops-${{ env.RELEASE_VERSION }}.darwin.amd64 go.mozilla.org/sops/v3/cmd/sops
run: GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -mod vendor -o dist/sops-${{ env.RELEASE_VERSION }}.darwin.amd64 github.com/getsops/sops/v3/cmd/sops
- name: Copy darwin amd64 to have a no-architecture labeled version
run: cp dist/sops-${{ env.RELEASE_VERSION }}.darwin.amd64 dist/sops-${{ env.RELEASE_VERSION }}.darwin
- name: Build darwin arm64 binary
run: GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -mod vendor -o dist/sops-${{ env.RELEASE_VERSION }}.darwin.arm64 go.mozilla.org/sops/v3/cmd/sops
run: GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -mod vendor -o dist/sops-${{ env.RELEASE_VERSION }}.darwin.arm64 github.com/getsops/sops/v3/cmd/sops
- name: Build windows binary
run: GOOS=windows CGO_ENABLED=0 go build -mod vendor -o dist/sops-${{ env.RELEASE_VERSION }}.exe go.mozilla.org/sops/v3/cmd/sops
run: GOOS=windows CGO_ENABLED=0 go build -mod vendor -o dist/sops-${{ env.RELEASE_VERSION }}.exe github.com/getsops/sops/v3/cmd/sops
- name: Create release
uses: "mozilla/action-automatic-releases@latest"
with:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Mozilla welcomes contributions from everyone. Here are a few guidelines and inst
# Getting started

* Make sure you have Go 1.12 or greater installed. You can find information on how to install Go [here](https://golang.org/dl/)
* After following the [Go installation guide](https://golang.org/doc/install), run `go get go.mozilla.org/sops`. This will automatically clone this repository.
* Switch into sops's directory, which will be in `$GOPATH/src/go.mozilla.org/sops`.
* After following the [Go installation guide](https://golang.org/doc/install), run `go get github.com/getsops/sops/v3`. This will automatically clone this repository.
* Switch into sops's directory, which will be in `$GOPATH/src/github.com/getsops/sops/v3`.
* Run the tests with `make test`. They should all pass.
* Fork the project on GitHub.
* Add your fork to git's remotes:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM golang:1.20

COPY . /go/src/go.mozilla.org/sops
WORKDIR /go/src/go.mozilla.org/sops
COPY . /go/src/github.com/getsops/sops/v3
WORKDIR /go/src/github.com/getsops/sops/v3

RUN CGO_ENABLED=1 make install
RUN apt-get update
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM golang:1.20-alpine3.18 AS builder

RUN apk --no-cache add make

COPY . /go/src/go.mozilla.org/sops
WORKDIR /go/src/go.mozilla.org/sops
COPY . /go/src/github.com/getsops/sops/v3
WORKDIR /go/src/github.com/getsops/sops/v3

RUN CGO_ENABLED=1 make install

Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

PROJECT := go.mozilla.org/sops/v3
PROJECT := github.com/getsops/sops/v3
GO := GOPROXY=https://proxy.golang.org go
GOLINT := golint

all: test vet generate install functional-tests
origin-build: test vet generate install functional-tests-all

install:
$(GO) install go.mozilla.org/sops/v3/cmd/sops
$(GO) install github.com/getsops/sops/v3/cmd/sops

tag: all
git tag -s $(TAGVER) -a -m "$(TAGMSG)"
Expand Down Expand Up @@ -39,13 +39,13 @@ generate: keyservice/keyservice.pb.go
protoc --go_out=plugins=grpc:. $<

functional-tests:
$(GO) build -o functional-tests/sops go.mozilla.org/sops/v3/cmd/sops
$(GO) build -o functional-tests/sops github.com/getsops/sops/v3/cmd/sops
cd functional-tests && cargo test

# Ignored tests are ones that require external services (e.g. AWS KMS)
# TODO: Once `--include-ignored` lands in rust stable, switch to that.
functional-tests-all:
$(GO) build -o functional-tests/sops go.mozilla.org/sops/v3/cmd/sops
$(GO) build -o functional-tests/sops github.com/getsops/sops/v3/cmd/sops
cd functional-tests && cargo test && cargo test -- --ignored

# Creates variables during target re-definition. Basically this block allows the particular variables to be used in the final target
Expand All @@ -56,11 +56,11 @@ build-deb-%: FPM_ARCH = $(word 3,$(subst -, ,$*))
build-deb-%:
rm -rf tmppkg
mkdir -p tmppkg/usr/local/bin
GOOS=$(OS) GOARCH="$(ARCH)" CGO_ENABLED=0 go build -mod vendor -o tmppkg/usr/local/bin/sops go.mozilla.org/sops/v3/cmd/sops
GOOS=$(OS) GOARCH="$(ARCH)" CGO_ENABLED=0 go build -mod vendor -o tmppkg/usr/local/bin/sops github.com/getsops/sops/v3/cmd/sops
fpm -C tmppkg -n sops --license MPL2.0 --vendor mozilla \
--description "Sops is an editor of encrypted files that supports YAML, JSON and BINARY formats and encrypts with AWS KMS and PGP." \
-m "AJ Bahnken <[email protected]>" \
--url https://go.mozilla.org/sops \
--url https://github.com/getsops/sops/v3 \
--architecture $(FPM_ARCH) \
-v "$$(grep '^const Version' version/version.go |cut -d \" -f 2)" \
-s dir -t deb .
Expand All @@ -76,11 +76,11 @@ build-rpm-%: FPM_ARCH = $(word 3,$(subst -, ,$*))
build-rpm-%:
rm -rf tmppkg
mkdir -p tmppkg/usr/local/bin
GOOS=$(OS) GOARCH="$(ARCH)" CGO_ENABLED=0 go build -mod vendor -o tmppkg/usr/local/bin/sops go.mozilla.org/sops/v3/cmd/sops
GOOS=$(OS) GOARCH="$(ARCH)" CGO_ENABLED=0 go build -mod vendor -o tmppkg/usr/local/bin/sops github.com/getsops/sops/v3/cmd/sops
fpm -C tmppkg -n sops --license MPL2.0 --vendor mozilla \
--description "Sops is an editor of encrypted files that supports YAML, JSON and BINARY formats and encrypts with AWS KMS and PGP." \
-m "AJ Bahnken <[email protected]>" \
--url https://go.mozilla.org/sops \
--url https://github.com/getsops/sops/v3 \
--architecture $(FPM_ARCH) \
--rpm-os $(OS) \
-v "$$(grep '^const Version' version/version.go |cut -d \" -f 2)" \
Expand All @@ -99,7 +99,7 @@ else
fpm -C tmppkg -n sops --license MPL2.0 --vendor mozilla \
--description "Sops is an editor of encrypted files that supports YAML, JSON and BINARY formats and encrypts with AWS KMS and PGP." \
-m "Mozilla Security <[email protected]>" \
--url https://go.mozilla.org/sops \
--url https://github.com/getsops/sops/v3 \
--architecture x86_64 \
-v "$$(grep '^const Version' version/version.go |cut -d \" -f 2)" \
-s dir -t osxpkg \
Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ formats and encrypts with AWS KMS, GCP KMS, Azure Key Vault, age, and PGP.

------------

.. image:: https://pkg.go.dev/badge/go.mozilla.org/sops/v3.svg
:target: https://pkg.go.dev/go.mozilla.org/sops/v3
.. image:: https://pkg.go.dev/badge/github.com/getsops/sops/v3.svg
:target: https://pkg.go.dev/github.com/getsops/sops/v3

Download
--------
Expand All @@ -25,9 +25,9 @@ For the adventurous, unstable features are available in the `develop` branch, wh

.. code:: bash
$ mkdir -p $GOPATH/src/go.mozilla.org/sops/
$ git clone https://github.com/mozilla/sops.git $GOPATH/src/go.mozilla.org/sops/
$ cd $GOPATH/src/go.mozilla.org/sops/
$ mkdir -p $GOPATH/src/github.com/getsops/sops/v3/
$ git clone https://github.com/mozilla/sops.git $GOPATH/src/github.com/getsops/sops/v3/
$ cd $GOPATH/src/github.com/getsops/sops/v3/
$ git checkout develop
$ make install
Expand All @@ -44,7 +44,7 @@ If you don't have Go installed, set it up with:
Or whatever variation of the above fits your system and shell.

To use **sops** as a library, take a look at the `decrypt package <https://pkg.go.dev/go.mozilla.org/sops/v3/decrypt>`_.
To use **sops** as a library, take a look at the `decrypt package <https://pkg.go.dev/github.com/getsops/sops/v3/decrypt>`_.

.. sectnum::
.. contents:: Table of Contents
Expand Down
6 changes: 3 additions & 3 deletions aes/cipher.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Package aes defines a Cipher that uses 256-bit AES-GCM authenticated encryption to encrypt values the SOPS tree.
*/
package aes //import "go.mozilla.org/sops/v3/aes"
package aes //import "github.com/getsops/sops/v3/aes"

import (
cryptoaes "crypto/aes"
Expand All @@ -14,8 +14,8 @@ import (
"strings"

"github.com/sirupsen/logrus"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/logging"
"github.com/getsops/sops/v3"
"github.com/getsops/sops/v3/logging"
)

var log *logrus.Logger
Expand Down
2 changes: 1 addition & 1 deletion aes/cipher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing/quick"

"github.com/stretchr/testify/assert"
"go.mozilla.org/sops/v3"
"github.com/getsops/sops/v3"
)

func TestDecrypt(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion age/keysource.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"filippo.io/age"
"filippo.io/age/armor"
"github.com/sirupsen/logrus"
"go.mozilla.org/sops/v3/logging"
"github.com/getsops/sops/v3/logging"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion audit/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"gopkg.in/yaml.v3"
"github.com/sirupsen/logrus"
"go.mozilla.org/sops/v3/logging"
"github.com/getsops/sops/v3/logging"
)

var log *logrus.Logger
Expand Down
6 changes: 3 additions & 3 deletions azkv/keysource.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Package azkv contains an implementation of the go.mozilla.org/sops/v3/keys.MasterKey
Package azkv contains an implementation of the github.com/getsops/sops/v3/keys.MasterKey
interface that encrypts and decrypts the data key using Azure Key Vault with the
Azure Key Vault Keys client module for Go.
*/
package azkv // import "go.mozilla.org/sops/v3/azkv"
package azkv // import "github.com/getsops/sops/v3/azkv"

import (
"context"
Expand All @@ -19,7 +19,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys"
"github.com/sirupsen/logrus"

"go.mozilla.org/sops/v3/logging"
"github.com/getsops/sops/v3/logging"
)

var (
Expand Down
22 changes: 11 additions & 11 deletions cmd/sops/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import (
"github.com/fatih/color"
wordwrap "github.com/mitchellh/go-wordwrap"
"github.com/urfave/cli"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/cmd/sops/codes"
. "go.mozilla.org/sops/v3/cmd/sops/formats"
"go.mozilla.org/sops/v3/keys"
"go.mozilla.org/sops/v3/keyservice"
"go.mozilla.org/sops/v3/kms"
"go.mozilla.org/sops/v3/stores/dotenv"
"go.mozilla.org/sops/v3/stores/ini"
"go.mozilla.org/sops/v3/stores/json"
"go.mozilla.org/sops/v3/stores/yaml"
"go.mozilla.org/sops/v3/version"
"github.com/getsops/sops/v3"
"github.com/getsops/sops/v3/cmd/sops/codes"
. "github.com/getsops/sops/v3/cmd/sops/formats"
"github.com/getsops/sops/v3/keys"
"github.com/getsops/sops/v3/keyservice"
"github.com/getsops/sops/v3/kms"
"github.com/getsops/sops/v3/stores/dotenv"
"github.com/getsops/sops/v3/stores/ini"
"github.com/getsops/sops/v3/stores/json"
"github.com/getsops/sops/v3/stores/yaml"
"github.com/getsops/sops/v3/version"
"golang.org/x/crypto/ssh/terminal"
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/sops/decrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package main
import (
"fmt"

"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/keyservice"
"github.com/getsops/sops/v3"
"github.com/getsops/sops/v3/cmd/sops/codes"
"github.com/getsops/sops/v3/cmd/sops/common"
"github.com/getsops/sops/v3/keyservice"
)

type decryptOpts struct {
Expand Down
10 changes: 5 additions & 5 deletions cmd/sops/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
"path/filepath"

"github.com/google/shlex"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/keyservice"
"go.mozilla.org/sops/v3/version"
"github.com/getsops/sops/v3"
"github.com/getsops/sops/v3/cmd/sops/codes"
"github.com/getsops/sops/v3/cmd/sops/common"
"github.com/getsops/sops/v3/keyservice"
"github.com/getsops/sops/v3/version"
)

type editOpts struct {
Expand Down
10 changes: 5 additions & 5 deletions cmd/sops/encrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"fmt"

wordwrap "github.com/mitchellh/go-wordwrap"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/keyservice"
"go.mozilla.org/sops/v3/version"
"github.com/getsops/sops/v3"
"github.com/getsops/sops/v3/cmd/sops/codes"
"github.com/getsops/sops/v3/cmd/sops/common"
"github.com/getsops/sops/v3/keyservice"
"github.com/getsops/sops/v3/version"
)

type encryptOpts struct {
Expand Down
48 changes: 24 additions & 24 deletions cmd/sops/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main //import "go.mozilla.org/sops/v3/cmd/sops"
package main //import "github.com/getsops/sops/v3/cmd/sops"

import (
encodingjson "encoding/json"
Expand All @@ -15,29 +15,29 @@ import (

"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/aes"
"go.mozilla.org/sops/v3/age"
_ "go.mozilla.org/sops/v3/audit"
"go.mozilla.org/sops/v3/azkv"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/cmd/sops/subcommand/exec"
"go.mozilla.org/sops/v3/cmd/sops/subcommand/groups"
keyservicecmd "go.mozilla.org/sops/v3/cmd/sops/subcommand/keyservice"
publishcmd "go.mozilla.org/sops/v3/cmd/sops/subcommand/publish"
"go.mozilla.org/sops/v3/cmd/sops/subcommand/updatekeys"
"go.mozilla.org/sops/v3/config"
"go.mozilla.org/sops/v3/gcpkms"
"go.mozilla.org/sops/v3/hcvault"
"go.mozilla.org/sops/v3/keys"
"go.mozilla.org/sops/v3/keyservice"
"go.mozilla.org/sops/v3/kms"
"go.mozilla.org/sops/v3/logging"
"go.mozilla.org/sops/v3/pgp"
"go.mozilla.org/sops/v3/stores/dotenv"
"go.mozilla.org/sops/v3/stores/json"
"go.mozilla.org/sops/v3/version"
"github.com/getsops/sops/v3"
"github.com/getsops/sops/v3/aes"
"github.com/getsops/sops/v3/age"
_ "github.com/getsops/sops/v3/audit"
"github.com/getsops/sops/v3/azkv"
"github.com/getsops/sops/v3/cmd/sops/codes"
"github.com/getsops/sops/v3/cmd/sops/common"
"github.com/getsops/sops/v3/cmd/sops/subcommand/exec"
"github.com/getsops/sops/v3/cmd/sops/subcommand/groups"
keyservicecmd "github.com/getsops/sops/v3/cmd/sops/subcommand/keyservice"
publishcmd "github.com/getsops/sops/v3/cmd/sops/subcommand/publish"
"github.com/getsops/sops/v3/cmd/sops/subcommand/updatekeys"
"github.com/getsops/sops/v3/config"
"github.com/getsops/sops/v3/gcpkms"
"github.com/getsops/sops/v3/hcvault"
"github.com/getsops/sops/v3/keys"
"github.com/getsops/sops/v3/keyservice"
"github.com/getsops/sops/v3/kms"
"github.com/getsops/sops/v3/logging"
"github.com/getsops/sops/v3/pgp"
"github.com/getsops/sops/v3/stores/dotenv"
"github.com/getsops/sops/v3/stores/json"
"github.com/getsops/sops/v3/version"
"google.golang.org/grpc"
)

Expand Down
12 changes: 6 additions & 6 deletions cmd/sops/rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package main
import (
"fmt"

"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/audit"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/keys"
"go.mozilla.org/sops/v3/keyservice"
"github.com/getsops/sops/v3"
"github.com/getsops/sops/v3/audit"
"github.com/getsops/sops/v3/cmd/sops/codes"
"github.com/getsops/sops/v3/cmd/sops/common"
"github.com/getsops/sops/v3/keys"
"github.com/getsops/sops/v3/keyservice"
)

type rotateOpts struct {
Expand Down
8 changes: 4 additions & 4 deletions cmd/sops/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package main
import (
"fmt"

"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/keyservice"
"github.com/getsops/sops/v3"
"github.com/getsops/sops/v3/cmd/sops/codes"
"github.com/getsops/sops/v3/cmd/sops/common"
"github.com/getsops/sops/v3/keyservice"
)

type setOpts struct {
Expand Down

0 comments on commit f029c6c

Please sign in to comment.