Skip to content

Commit

Permalink
Merge pull request #195 from quexten/restructure
Browse files Browse the repository at this point in the history
Restructure & add version command
  • Loading branch information
quexten authored May 4, 2024
2 parents 63ee486 + 53a6454 commit 88ec34c
Show file tree
Hide file tree
Showing 117 changed files with 383 additions and 201 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@ modules:
- type: git
url: https://gitlab.gnome.org/jwestman/blueprint-compiler
tag: v0.12.0
- ./gui/python3-requirements.json
- ../gui/python3-requirements.json
- name: goldwarden-python-ui
buildsystem: simple
build-commands:
- mkdir -p /app/bin
- cp -R ./gui/* /app/bin
- cp -R ./* /app/bin
- chmod +x /app/bin/goldwarden_ui_main.py
- install -D ./gui/com.quexten.Goldwarden.desktop /app/share/applications/com.quexten.Goldwarden.desktop
- install -D ./gui/goldwarden.svg /app/share/icons/hicolor/scalable/apps/com.quexten.Goldwarden.svg
- install -Dm644 ./gui/com.quexten.Goldwarden.metainfo.xml -t /app/share/metainfo/
- install -D ./com.quexten.Goldwarden.desktop /app/share/applications/com.quexten.Goldwarden.desktop
- install -D ./goldwarden.svg /app/share/icons/hicolor/scalable/apps/com.quexten.Goldwarden.svg
- install -Dm644 ./com.quexten.Goldwarden.metainfo.xml -t /app/share/metainfo/
- blueprint-compiler batch-compile /app/bin/src/gui/.templates/ /app/bin/src/gui/ /app/bin/src/gui/*.blp
sources:
- type: dir
path: ./
path: ../gui/
- name: goldwarden-core-daemon
buildsystem: simple
build-commands:
- install -D goldwarden /app/bin/goldwarden
sources:
- type: file
path: ./goldwarden
path: ../goldwarden
4 changes: 3 additions & 1 deletion PKGBUILD → .github/workflows/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pkgname=goldwarden
pkgver=0.2.16
pkgver=REPLACED_IN_CI_PIPELINE
pkgrel=1
pkgdesc='A feature-packed Bitwarden compatible desktop integration'
arch=('x86_64' 'aarch64')
Expand All @@ -24,6 +24,8 @@ build() {
export GOFLAGS="-buildmode=pie -trimpath -modcacherw"
export CGO_ENABLED=1

echo "$pkgver" > cmd/version.txt

go mod tidy
go build -o build/$pkgname .
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ jobs:
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: goldwarden.flatpak
manifest-path: com.quexten.Goldwarden.yml
manifest-path: .github/com.quexten.Goldwarden.yml
cache-key: flatpak-builder-${{ github.sha }}
arch: ${{ matrix.arch }}
16 changes: 16 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Write version
run: echo "$(git rev-parse --short HEAD)" > ./cli/cmd/version.txt
- name: Install libfido2-dev
run: sudo apt-get install -y libfido2-dev
- name: Build Debug
Expand All @@ -35,6 +37,8 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Write version
run: echo "$(git rev-parse --short HEAD)" > ./cli/cmd/version.txt
- name: Install libfido2-dev
run: sudo apt-get install -y libfido2-dev
- name: Build
Expand All @@ -52,6 +56,8 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Write version
run: echo "$(git rev-parse --short HEAD)" > ./cli/cmd/version.txt
- name: Install libfido2-dev
run: sudo apt-get install -y libfido2-dev
- name: Build
Expand All @@ -69,6 +75,8 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Write version
run: echo "$(git rev-parse --short HEAD)" > ./cli/cmd/version.txt
- name: Build
run: GOARCH=386 go build -tags nofido2 -o goldwarden_linux_x86 -v .
- uses: actions/upload-artifact@v3
Expand All @@ -85,6 +93,8 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Write version
run: echo "$(git rev-parse --short HEAD)" > ./cli/cmd/version.txt
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
Expand All @@ -106,6 +116,8 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Write version
run: echo "$(git rev-parse --short HEAD)" > ./cli/cmd/version.txt
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
Expand All @@ -127,6 +139,8 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Write version
run: echo "$(git rev-parse --short HEAD)" > ./cli/cmd/version.txt
- uses: MinoruSekine/setup-scoop@v2
- name: Fido2
run: |
Expand All @@ -148,6 +162,8 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Write version
run: echo "$(git rev-parse --short HEAD)" > ./cli/cmd/version.txt
- name: Build
run: set GOARCH=arm64 && go build -tags nofido2 -o "goldwarden_windows_aarch64.exe" -v .
- uses: actions/upload-artifact@v3
Expand Down
48 changes: 35 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Write version
run: echo "${GITHUB_REF#refs/tags/}" > ./cli/cmd/version.txt
- name: Install libfido2-dev
run: sudo apt-get install -y libfido2-dev
- name: Build
Expand All @@ -39,17 +40,6 @@ jobs:
with:
files: './goldwarden_linux_x86_64'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish AUR package
uses: KSXGitHub/[email protected]
with:
pkgname: goldwarden
updpkgsums: true
pkgbuild: ./PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update AUR package from GitHub Actions automation
ssh_keyscan_types: ed25519
- name: Move binaries to directories
run: |
mkdir -p .debpkg/usr/bin
Expand Down Expand Up @@ -93,7 +83,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Write version
run: echo "${GITHUB_REF#refs/tags/}" > ./cli/cmd/version.txt
- name: Set up Go
uses: actions/setup-go@v4
with:
Expand All @@ -109,6 +100,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Write version
run: echo "${GITHUB_REF#refs/tags/}" > ./cli/cmd/version.txt
- name: Set up Go
uses: actions/setup-go@v4
with:
Expand All @@ -125,6 +118,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Write version
run: echo "${GITHUB_REF#refs/tags/}" > ./cli/cmd/version.txt
- name: Set up Go
uses: actions/setup-go@v4
with:
Expand All @@ -146,6 +141,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Write version
run: echo "${GITHUB_REF#refs/tags/}" > ./cli/cmd/version.txt
- name: Set up Go
uses: actions/setup-go@v4
with:
Expand All @@ -167,6 +164,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Write version
run: echo "${GITHUB_REF#refs/tags/}" > ./cli/cmd/version.txt
- name: Set up Go
uses: actions/setup-go@v4
with:
Expand All @@ -188,6 +187,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Write version
run: echo "${GITHUB_REF#refs/tags/}" > ./cli/cmd/version.txt
- name: Set up Go
uses: actions/setup-go@v4
with:
Expand All @@ -198,3 +199,24 @@ jobs:
with:
files: './goldwarden_windows_aarch64.exe'
repo-token: ${{ secrets.GITHUB_TOKEN }}

publish_to_aur:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Write version
run: echo "${GITHUB_REF#refs/tags/}" > ./cli/cmd/version.txt
- name: Replace version in PKGBUILD
run: sed -i "s/pkgver=.*/pkgver=${GITHUB_REF#refs\/tags\//}/" ./.github/workflows/PKGBUILD
- name: Publish AUR package
uses: KSXGitHub/[email protected]
with:
pkgname: goldwarden
updpkgsums: true
pkgbuild: ./.github/workflows/PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update AUR package from GitHub Actions automation
ssh_keyscan_types: ed25519
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ flatpak-pip-generator
repo
__debug*
.templates
vendor
8 changes: 4 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ There is a flatpak that includes a small UI, autotype functionality and autostar

[<img width='240' alt='Download on Flathub' src='https://flathub.org/assets/badges/flathub-badge-en.png' />](https://flathub.org/apps/details/com.quexten.Goldwarden)

<img src='https://github.com/quexten/goldwarden/assets/11866552/fd302636-3494-4f92-a51d-50ac863885f2' width='400'>
<img src='https://github.com/quexten/goldwarden/assets/11866552/683f0ed4-e4cb-4088-9fb0-d08fcec3fa22' width='400'>
<img src='https://github.com/quexten/goldwarden/cli/assets/11866552/fd302636-3494-4f92-a51d-50ac863885f2' width='400'>
<img src='https://github.com/quexten/goldwarden/cli/assets/11866552/683f0ed4-e4cb-4088-9fb0-d08fcec3fa22' width='400'>

#### CLI
##### Arch (AUR)
Expand Down Expand Up @@ -61,12 +61,12 @@ go install github.com/quexten/goldwarden@latest
```

### Setup and Usage
To get started, follow the instructions provided in the wiki https://github.com/quexten/goldwarden/wiki/Getting-Started.
To get started, follow the instructions provided in the wiki https://github.com/quexten/goldwarden/cli/wiki/Getting-Started.
For instructions on specific features, also consult the wiki page for the feature.

### Contributing
Interested in contributing a feature or bug-fix? Great! Here is some information on how to set up your development environment:

https://github.com/quexten/goldwarden/wiki/Setting-up-the-Development-Environment
https://github.com/quexten/goldwarden/cli/wiki/Setting-up-the-Development-Environment

After that, create a PR. If you encounter any issues, feel free to open a discussion thread.
16 changes: 8 additions & 8 deletions agent/actions/actions.go → cli/agent/actions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package actions
import (
"context"

"github.com/quexten/goldwarden/agent/bitwarden"
"github.com/quexten/goldwarden/agent/bitwarden/crypto"
"github.com/quexten/goldwarden/agent/config"
"github.com/quexten/goldwarden/agent/sockets"
"github.com/quexten/goldwarden/agent/systemauth"
"github.com/quexten/goldwarden/agent/vault"
"github.com/quexten/goldwarden/ipc/messages"
"github.com/quexten/goldwarden/logging"
"github.com/quexten/goldwarden/cli/agent/bitwarden"
"github.com/quexten/goldwarden/cli/agent/bitwarden/crypto"
"github.com/quexten/goldwarden/cli/agent/config"
"github.com/quexten/goldwarden/cli/agent/sockets"
"github.com/quexten/goldwarden/cli/agent/systemauth"
"github.com/quexten/goldwarden/cli/agent/vault"
"github.com/quexten/goldwarden/cli/ipc/messages"
"github.com/quexten/goldwarden/cli/logging"
)

var actionsLog = logging.GetLogger("Goldwarden", "Actions")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"fmt"
"time"

"github.com/quexten/goldwarden/agent/config"
"github.com/quexten/goldwarden/agent/notify"
"github.com/quexten/goldwarden/agent/sockets"
"github.com/quexten/goldwarden/agent/systemauth/biometrics"
"github.com/quexten/goldwarden/agent/systemauth/pinentry"
"github.com/quexten/goldwarden/agent/vault"
"github.com/quexten/goldwarden/cli/agent/config"
"github.com/quexten/goldwarden/cli/agent/notify"
"github.com/quexten/goldwarden/cli/agent/sockets"
"github.com/quexten/goldwarden/cli/agent/systemauth/biometrics"
"github.com/quexten/goldwarden/cli/agent/systemauth/pinentry"
"github.com/quexten/goldwarden/cli/agent/vault"

"github.com/quexten/goldwarden/ipc/messages"
"github.com/quexten/goldwarden/cli/ipc/messages"
)

func handleGetBiometricsKey(request messages.IPCMessage, cfg *config.Config, vault *vault.Vault, ctx *sockets.CallingContext) (response messages.IPCMessage, err error) {
Expand Down
8 changes: 4 additions & 4 deletions agent/actions/config.go → cli/agent/actions/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"io"
"net/http"

"github.com/quexten/goldwarden/agent/config"
"github.com/quexten/goldwarden/agent/sockets"
"github.com/quexten/goldwarden/agent/vault"
"github.com/quexten/goldwarden/ipc/messages"
"github.com/quexten/goldwarden/cli/agent/config"
"github.com/quexten/goldwarden/cli/agent/sockets"
"github.com/quexten/goldwarden/cli/agent/vault"
"github.com/quexten/goldwarden/cli/ipc/messages"
)

func handleSetApiURL(request messages.IPCMessage, cfg *config.Config, vault *vault.Vault, ctx *sockets.CallingContext) (response messages.IPCMessage, err error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package actions
import (
"fmt"

"github.com/quexten/goldwarden/agent/config"
"github.com/quexten/goldwarden/agent/sockets"
"github.com/quexten/goldwarden/agent/systemauth"
"github.com/quexten/goldwarden/agent/systemauth/pinentry"
"github.com/quexten/goldwarden/agent/vault"
"github.com/quexten/goldwarden/ipc/messages"
"github.com/quexten/goldwarden/cli/agent/config"
"github.com/quexten/goldwarden/cli/agent/sockets"
"github.com/quexten/goldwarden/cli/agent/systemauth"
"github.com/quexten/goldwarden/cli/agent/systemauth/pinentry"
"github.com/quexten/goldwarden/cli/agent/vault"
"github.com/quexten/goldwarden/cli/ipc/messages"
)

func handleGetCliCredentials(request messages.IPCMessage, cfg *config.Config, vault *vault.Vault, ctx *sockets.CallingContext) (response messages.IPCMessage, err error) {
Expand Down
14 changes: 7 additions & 7 deletions agent/actions/login.go → cli/agent/actions/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"fmt"
"time"

"github.com/quexten/goldwarden/agent/bitwarden"
"github.com/quexten/goldwarden/agent/bitwarden/crypto"
"github.com/quexten/goldwarden/agent/config"
"github.com/quexten/goldwarden/agent/notify"
"github.com/quexten/goldwarden/agent/sockets"
"github.com/quexten/goldwarden/agent/vault"
"github.com/quexten/goldwarden/ipc/messages"
"github.com/quexten/goldwarden/cli/agent/bitwarden"
"github.com/quexten/goldwarden/cli/agent/bitwarden/crypto"
"github.com/quexten/goldwarden/cli/agent/config"
"github.com/quexten/goldwarden/cli/agent/notify"
"github.com/quexten/goldwarden/cli/agent/sockets"
"github.com/quexten/goldwarden/cli/agent/vault"
"github.com/quexten/goldwarden/cli/ipc/messages"
)

func handleLogin(msg messages.IPCMessage, cfg *config.Config, vault *vault.Vault, callingContext *sockets.CallingContext) (response messages.IPCMessage, err error) {
Expand Down
14 changes: 7 additions & 7 deletions agent/actions/logins.go → cli/agent/actions/logins.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"fmt"
"runtime/debug"

"github.com/quexten/goldwarden/agent/bitwarden/crypto"
"github.com/quexten/goldwarden/agent/config"
"github.com/quexten/goldwarden/agent/sockets"
"github.com/quexten/goldwarden/agent/systemauth"
"github.com/quexten/goldwarden/agent/systemauth/pinentry"
"github.com/quexten/goldwarden/agent/vault"
"github.com/quexten/goldwarden/ipc/messages"
"github.com/quexten/goldwarden/cli/agent/bitwarden/crypto"
"github.com/quexten/goldwarden/cli/agent/config"
"github.com/quexten/goldwarden/cli/agent/sockets"
"github.com/quexten/goldwarden/cli/agent/systemauth"
"github.com/quexten/goldwarden/cli/agent/systemauth/pinentry"
"github.com/quexten/goldwarden/cli/agent/vault"
"github.com/quexten/goldwarden/cli/ipc/messages"
)

func handleGetLoginCipher(request messages.IPCMessage, cfg *config.Config, vault *vault.Vault, ctx *sockets.CallingContext) (response messages.IPCMessage, err error) {
Expand Down
Loading

0 comments on commit 88ec34c

Please sign in to comment.