diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 49c5582..0000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: build-and-test - -#on: [push] -on: - pull_request: - branches: - - main - push: - branches: - - main - -jobs: - build: - strategy: - matrix: - version: ['1.24'] - os: [ubuntu-latest, macos-latest, windows-latest] - name: Build - runs-on: ${{ matrix.os }} - steps: - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: ${{ matrix.version }} - id: go - - - name: checkout - uses: actions/checkout@v5 - - - name: build - run: go build - - - name: test - run: make test - - - name: Update coverage report - uses: ncruces/go-coverage-report@main - with: - report: true - chart: true - amend: true - if: | - matrix.os == 'ubuntu-latest' && - github.event_name == 'push' - continue-on-error: true - - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v6 - with: - go-version: 1.24 - - uses: actions/checkout@v5 - - name: golangci-lint - uses: golangci/golangci-lint-action@v8 diff --git a/.github/workflows/pushimage.yaml b/.github/workflows/pushimage.yaml deleted file mode 100644 index 6ea4956..0000000 --- a/.github/workflows/pushimage.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: build-push-image - -on: - push: - tags: - - 'v*' - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - permissions: - packages: write - steps: - - name: Checkout repository - uses: actions/checkout@v5 - - - name: Log in to the Container registry - uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef - with: - registry: https://ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push Docker image - uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 - with: - push: true - tags: ghcr.io/tlinden/anydb:${{ github.ref_name}} - - - name: Build and push latest Docker image - uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 - with: - push: true - tags: ghcr.io/tlinden/anydb:latest diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index a5337a8..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,87 +0,0 @@ -name: build-release -on: - push: - tags: - - "v*.*.*" - -jobs: - release: - name: Build Release Assets - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v5 - - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: 1.24.1 - - - name: Build the executables - run: ./mkrel.sh anydb ${{ github.ref_name}} - - - name: List the executables - run: ls -l ./releases - - - name: Upload the binaries - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ github.ref_name }} - file: ./releases/* - file_glob: true - - - name: Build Changelog - id: github_release - uses: mikepenz/release-changelog-builder-action@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - mode: "PR" - configurationJson: | - { - "template": "#{{CHANGELOG}}\n\n**Full Changelog**: #{{RELEASE_DIFF}}", - "pr_template": "- #{{TITLE}} (##{{NUMBER}}) by #{{AUTHOR}}\n#{{BODY}}", - "empty_template": "- no changes", - "categories": [ - { - "title": "## New Features", - "labels": ["add", "feature"] - }, - { - "title": "## Bug Fixes", - "labels": ["fix", "bug", "revert"] - }, - { - "title": "## Documentation Enhancements", - "labels": ["doc"] - }, - { - "title": "## Refactoring Efforts", - "labels": ["refactor"] - }, - { - "title": "## Miscellaneus Changes", - "labels": [] - } - ], - "ignore_labels": [ - "duplicate", "good first issue", "help wanted", "invalid", "question", "wontfix" - ], - "label_extractor": [ - { - "pattern": "(.) (.+)", - "target": "$1" - }, - { - "pattern": "(.) (.+)", - "target": "$1", - "on_property": "title" - } - ] - } - - - name: Create Release - uses: softprops/action-gh-release@v2 - with: - body: ${{steps.github_release.outputs.changelog}} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..0e35092 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,69 @@ +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 + +before: + hooks: + - go mod tidy + +gitea_urls: + api: https://codeberg.org/api/v1 + download: https://codeberg.org + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + - freebsd + +archives: + - formats: [tar.gz] + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }}_{{ .Tag }} + # use zip for windows archives + format_overrides: + - goos: windows + formats: [zip] + - goos: linux + formats: [tar.gz,binary] + files: + - src: "*.md" + strip_parent: true + - src: "docs/*" + strip_parent: true + - src: Makefile.dist + dst: Makefile + wrap_in_directory: true + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + groups: + - title: Improved + regexp: '^.*?(feat|add|new)(\([[:word:]]+\))??!?:.+$' + order: 0 + - title: Fixed + regexp: '^.*?(bug|fix)(\([[:word:]]+\))??!?:.+$' + order: 1 + - title: Changed + order: 999 + +release: + header: "# Release Notes" + footer: >- + + --- + + Full Changelog: [{{ .PreviousTag }}...{{ .Tag }}](https://codeberg.org/scip/epuppy/compare/{{ .PreviousTag }}...{{ .Tag }}) diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml new file mode 100644 index 0000000..d370fc9 --- /dev/null +++ b/.woodpecker/build.yaml @@ -0,0 +1,27 @@ +matrix: + platform: + - linux/amd64 + goversion: + - 1.24 + +labels: + platform: ${platform} + +steps: + build: + when: + event: [push] + image: golang:${goversion} + commands: + - go get + - go build + - go test + + linter: + when: + event: [push] + image: golang:${goversion} + commands: + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.5.0 + - golangci-lint --version + - golangci-lint run ./... diff --git a/.woodpecker/image.yaml b/.woodpecker/image.yaml new file mode 100644 index 0000000..193c00b --- /dev/null +++ b/.woodpecker/image.yaml @@ -0,0 +1,32 @@ +# https://woodpecker-ci.org/plugins/docker-buildx +# enable Package unit and go to /scip/-/packages after building to link to proj + +variables: + - &repo codeberg.org/${CI_REPO_OWNER}/anydb + +steps: + dryrun: + image: docker.io/woodpeckerci/plugin-docker-buildx:latest + settings: + dockerfile: Dockerfile + platforms: linux/amd64 + dry_run: true + repo: *repo + tags: latest + when: + event: [pull_request] + + publish: + image: docker.io/woodpeckerci/plugin-docker-buildx:latest + settings: + dockerfile: Dockerfile + platforms: linux/amd64 + repo: *repo + registry: codeberg.org + tags: latest,${CI_COMMIT_SHA:0:8},${CI_COMMIT_TAG} + username: ${CI_REPO_OWNER} + password: + from_secret: REGISTRY_TOKEN + when: + event: [tag] + branch: main diff --git a/.woodpecker/release.yaml b/.woodpecker/release.yaml new file mode 100644 index 0000000..916c008 --- /dev/null +++ b/.woodpecker/release.yaml @@ -0,0 +1,15 @@ +# build release + +labels: + platform: linux/amd64 + +steps: + goreleaser: + image: goreleaser/goreleaser + when: + event: [tag] + environment: + GITEA_TOKEN: + from_secret: DEPLOY_TOKEN + commands: + - goreleaser release --clean --verbose diff --git a/Makefile b/Makefile index f198825..3c7b7bf 100644 --- a/Makefile +++ b/Makefile @@ -51,11 +51,11 @@ endif app/dbentry.pb.go: app/dbentry.proto protoc -I=. --go_out=app app/dbentry.proto - mv app/github.com/tlinden/anydb/app/dbentry.pb.go app/dbentry.pb.go + mv app/codeberg.org/scip/anydb/app/dbentry.pb.go app/dbentry.pb.go rm -rf app/github.com buildlocal: - go build -ldflags "-X 'github.com/tlinden/anydb/cfg.VERSION=$(VERSION)'" + go build -ldflags "-X 'codeberg.org/scip/anydb/cfg.VERSION=$(VERSION)'" # binaries are being built by ci workflow on tag creation release: @@ -75,7 +75,7 @@ test: clean singletest: @echo "Call like this: ''make singletest TEST=TestPrepareColumns MOD=lib" - ANYDB_PASSWORD=test go test -run $(TEST) github.com/tlinden/anydb/$(MOD) + ANYDB_PASSWORD=test go test -run $(TEST) codeberg.org/scip/anydb/$(MOD) cover-report: go test ./... -cover -coverprofile=coverage.out diff --git a/README.md b/README.md index 2c7466d..39e0a8f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ ## A personal key value store -[![Actions](https://github.com/tlinden/anydb/actions/workflows/ci.yaml/badge.svg)](https://github.com/tlinden/anydb/actions) -[![License](https://img.shields.io/badge/license-GPL-blue.svg)](https://github.com/tlinden/anydb/blob/master/LICENSE) -[![Go Coverage](https://github.com/tlinden/anydb/wiki/coverage.svg)](https://raw.githack.com/wiki/tlinden/anydb/coverage.html) -[![Go Report Card](https://goreportcard.com/badge/github.com/tlinden/anydb)](https://goreportcard.com/report/github.com/tlinden/anydb) -[![GitHub release](https://img.shields.io/github/v/release/tlinden/anydb?color=%2300a719)](https://github.com/TLINDEN/anydb/releases/latest) -[![Documentation](https://img.shields.io/badge/manpage-documentation-blue)](https://github.com/TLINDEN/anydb/blob/master/anydb.pod) +[![status-badge](https://ci.codeberg.org/api/badges/15517/status.svg)](https://ci.codeberg.org/repos/15517) +[![License](https://img.shields.io/badge/license-GPL-blue.svg)](https://codeberg.org/scip/anydb/blob/master/LICENSE) +[![Go Report Card](https://goreportcard.com/badge/codeberg.org/scip/anydb)](https://goreportcard.com/report/codeberg.org/scip/anydb) +[![GitHub release](https://img.shields.io/github/v/release/tlinden/anydb?color=%2300a719)](https://codeberg.org/scip/anydb/releases) +[![Documentation](https://img.shields.io/badge/manpage-documentation-blue)](https://codeberg.org/scip/anydb/raw/branch/main/anydb.pod) > [!CAUTION] > Between version 0.1.0 and version 0.2.1 deletion of keys did not work. There @@ -14,7 +13,7 @@ > upgrade to 0.2.1 and above. > [!CAUTION] -> Version 0.1.3 introduced a [regression](https://github.com/TLINDEN/anydb/issues/19), +> Version 0.1.3 introduced a [regression](https://codeberg.org/scip/anydb/issues/19), > which caused the encryption feature not to work correctly anymore. > If you are using anydb 0.1.3, you are urgently advised to > upgrade to 0.2.0 @@ -47,17 +46,17 @@ And I wrote a very similar [tool](https://www.daemon.de/projects/dbtool/) 24 yea **anydb** can do all the things you can do with skate: -![simple demo](https://github.com/TLINDEN/anydb/blob/main/demo/intro.gif) +![simple demo](https://codeberg.org/scip/anydb/raw/branch/demo/intro.gif) However, there are more features than just that! -![advanced demo](https://github.com/TLINDEN/anydb/blob/main/demo/advanced.gif) +![advanced demo](https://codeberg.org/scip/anydb/raw/branch/demo/advanced.gif) ## Installation There are multiple ways to install **anydb**: -- Go to the [latest release page](https://github.com/tlinden/anydb/releases/latest), +- Go to the [latest release page](https://codeberg.org/scip/anydb/releases), locate the binary for your operating system and platform. Download it and put it into some directory within your `$PATH` variable. @@ -70,7 +69,7 @@ There are multiple ways to install **anydb**: - You can also install from source. Issue the following commands in your shell: ```shell - git clone https://github.com/TLINDEN/anydb.git + git clone https://codeberg.org/scip/anydb.git cd anydb make sudo make install @@ -78,7 +77,7 @@ There are multiple ways to install **anydb**: - Or, if you have the GO toolkit installed, just install it like this: ```shell - go install github.com/tlinden/anydb@latest + go install codeberg.org/scip/anydb@latest ``` If you do not find a binary release for your platform, please don't @@ -105,14 +104,14 @@ Here, we operate in a local directory `mydb`, which we'll use as HOME inside the docker container. anydb will store its database in `mydb/.config/anydb/default.db`. -A list of available images is [here](https://github.com/tlinden/anydb/pkgs/container/anydb/versions?filters%5Bversion_type%5D=tagged) +A list of available images is [here](https://codeberg.org/scip/anydb/pkgs/container/anydb/versions?filters%5Bversion_type%5D=tagged) ## Documentation The documentation is provided as a unix man-page. It will be automatically installed if you install from source. However, you can -[read the man-page online](https://github.com/TLINDEN/anydb/blob/master/anydb.pod) +[read the man-page online](https://codeberg.org/scip/anydb/blob/master/anydb.pod) Or if you cloned the repository you can read it this way (perl needs to be installed though): `perldoc anydb.pod`. @@ -129,7 +128,7 @@ best way for me to forget to do something. In order to report a bug, unexpected behavior, feature requests or to submit a patch, please open an issue on github: -https://github.com/TLINDEN/anydb/issues. +https://codeberg.org/scip/anydb/issues. ## Copyright and license @@ -141,7 +140,7 @@ T.v.Dein ## Project homepage -https://github.com/TLINDEN/anydb +https://codeberg.org/scip/anydb ## Copyright and License diff --git a/anydb.1 b/anydb.1 index 280e9d4..1fd4492 100644 --- a/anydb.1 +++ b/anydb.1 @@ -746,7 +746,7 @@ List all keys: .IX Header "BUGS" In order to report a bug, unexpected behavior, feature requests or to submit a patch, please open an issue on github: -. +. .PP Please repeat the failing command with debugging enabled \f(CW\*(C`\-d\*(C'\fR and include the output in the issue. diff --git a/anydb.pod b/anydb.pod index 6da0378..d7ab50f 100644 --- a/anydb.pod +++ b/anydb.pod @@ -583,7 +583,7 @@ List all keys: In order to report a bug, unexpected behavior, feature requests or to submit a patch, please open an issue on github: -L. +L. Please repeat the failing command with debugging enabled C<-d> and include the output in the issue. diff --git a/app/db.go b/app/db.go index 06720d6..82ce768 100644 --- a/app/db.go +++ b/app/db.go @@ -28,7 +28,7 @@ import ( "strings" "time" - common "github.com/tlinden/anydb/common" + common "codeberg.org/scip/anydb/common" bolt "go.etcd.io/bbolt" "google.golang.org/protobuf/proto" diff --git a/app/dbentry.proto b/app/dbentry.proto index 820dcfa..1d7891a 100644 --- a/app/dbentry.proto +++ b/app/dbentry.proto @@ -5,7 +5,7 @@ package app; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/tlinden/anydb/app"; +option go_package = "codeberg.org/scip/anydb/app"; message DbEntry { string Id = 1; diff --git a/cfg/config.go b/cfg/config.go index c04267c..c7b4402 100644 --- a/cfg/config.go +++ b/cfg/config.go @@ -22,8 +22,8 @@ import ( "os" "github.com/pelletier/go-toml" - "github.com/tlinden/anydb/app" - "github.com/tlinden/anydb/common" + "codeberg.org/scip/anydb/app" + "codeberg.org/scip/anydb/common" ) var Version string = "v0.2.6" diff --git a/cmd/anydb.go b/cmd/anydb.go index 3f038fa..4911b1e 100644 --- a/cmd/anydb.go +++ b/cmd/anydb.go @@ -517,7 +517,7 @@ REST API BUGS In order to report a bug, unexpected behavior, feature requests or to submit a patch, please open an issue on github: - . + . Please repeat the failing command with debugging enabled "-d" and include the output in the issue. diff --git a/cmd/crud.go b/cmd/crud.go index 4e125c8..5b90920 100644 --- a/cmd/crud.go +++ b/cmd/crud.go @@ -22,9 +22,9 @@ import ( "strings" "github.com/spf13/cobra" - "github.com/tlinden/anydb/app" - "github.com/tlinden/anydb/cfg" - "github.com/tlinden/anydb/output" + "codeberg.org/scip/anydb/app" + "codeberg.org/scip/anydb/cfg" + "codeberg.org/scip/anydb/output" ) func Set(conf *cfg.Config) *cobra.Command { diff --git a/cmd/extra.go b/cmd/extra.go index a86112d..741ede0 100644 --- a/cmd/extra.go +++ b/cmd/extra.go @@ -26,10 +26,10 @@ import ( "os/exec" "github.com/spf13/cobra" - "github.com/tlinden/anydb/app" - "github.com/tlinden/anydb/cfg" - "github.com/tlinden/anydb/output" - "github.com/tlinden/anydb/rest" + "codeberg.org/scip/anydb/app" + "codeberg.org/scip/anydb/cfg" + "codeberg.org/scip/anydb/output" + "codeberg.org/scip/anydb/rest" ) func Export(conf *cfg.Config) *cobra.Command { diff --git a/cmd/root.go b/cmd/root.go index 4879c1d..61925eb 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -25,8 +25,8 @@ import ( "runtime/debug" "github.com/spf13/cobra" - "github.com/tlinden/anydb/app" - "github.com/tlinden/anydb/cfg" + "codeberg.org/scip/anydb/app" + "codeberg.org/scip/anydb/cfg" "github.com/tlinden/yadu" ) diff --git a/demo/advanced.tape b/demo/advanced.tape index 9cb631e..e2eb5c4 100644 --- a/demo/advanced.tape +++ b/demo/advanced.tape @@ -177,6 +177,6 @@ Enter Sleep 3s Enter -Type "# Try it out yourself: github.com/tlinden/anydb!" +Type "# Try it out yourself: codeberg.org/scip/anydb!" Enter Sleep 4s diff --git a/go.mod b/go.mod index 17ea5b8..dd0ddfe 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/tlinden/anydb +module codeberg.org/scip/anydb go 1.24.0 diff --git a/main.go b/main.go index 6e82089..dc4c7da 100644 --- a/main.go +++ b/main.go @@ -24,7 +24,7 @@ import ( "runtime" "github.com/inconshreveable/mousetrap" - "github.com/tlinden/anydb/cmd" + "codeberg.org/scip/anydb/cmd" ) func main() { diff --git a/output/export.go b/output/export.go index 27ea719..ffc485f 100644 --- a/output/export.go +++ b/output/export.go @@ -21,8 +21,8 @@ import ( "fmt" "os" - "github.com/tlinden/anydb/app" - "github.com/tlinden/anydb/cfg" + "codeberg.org/scip/anydb/app" + "codeberg.org/scip/anydb/cfg" ) func WriteJSON(attr *app.DbAttr, conf *cfg.Config, entries app.DbEntries) error { diff --git a/output/list.go b/output/list.go index 0048930..cd08f4c 100644 --- a/output/list.go +++ b/output/list.go @@ -30,8 +30,8 @@ import ( "github.com/olekukonko/tablewriter" "github.com/olekukonko/tablewriter/renderer" "github.com/olekukonko/tablewriter/tw" - "github.com/tlinden/anydb/app" - "github.com/tlinden/anydb/cfg" + "codeberg.org/scip/anydb/app" + "codeberg.org/scip/anydb/cfg" ) func List(writer io.Writer, conf *cfg.Config, entries app.DbEntries) error { diff --git a/output/single.go b/output/single.go index 352ad9f..2a5f777 100644 --- a/output/single.go +++ b/output/single.go @@ -25,8 +25,8 @@ import ( "reflect" "github.com/dustin/go-humanize" - "github.com/tlinden/anydb/app" - "github.com/tlinden/anydb/cfg" + "codeberg.org/scip/anydb/app" + "codeberg.org/scip/anydb/cfg" "golang.org/x/term" //"github.com/alecthomas/repr" ) diff --git a/rest/handlers.go b/rest/handlers.go index d49e4de..ecc9d02 100644 --- a/rest/handlers.go +++ b/rest/handlers.go @@ -20,8 +20,8 @@ import ( //"github.com/alecthomas/repr" "github.com/gofiber/fiber/v2" - "github.com/tlinden/anydb/app" - "github.com/tlinden/anydb/cfg" + "codeberg.org/scip/anydb/app" + "codeberg.org/scip/anydb/cfg" ) type SetContext struct { diff --git a/rest/serve.go b/rest/serve.go index 837b08b..fed2881 100644 --- a/rest/serve.go +++ b/rest/serve.go @@ -21,7 +21,7 @@ import ( "github.com/gofiber/fiber/v2/middleware/compress" "github.com/gofiber/fiber/v2/middleware/cors" "github.com/gofiber/fiber/v2/middleware/logger" - "github.com/tlinden/anydb/cfg" + "codeberg.org/scip/anydb/cfg" ) // used to return to the api client