Skip to content

Commit

Permalink
Merge branch 'release/0.15.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
lucor committed Jan 26, 2022
2 parents f71e73b + ff0957d commit f2e0b6e
Show file tree
Hide file tree
Showing 42 changed files with 2,769 additions and 959 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dist
/fyne-cross
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog - Paw

## 0.15.0 - 26 January 2022

- cli: add CLI application #3

## 0.14.0 - 09 January 2022

> This release updates the internal storage, so previous versions won't be compatible.
Expand Down
8 changes: 8 additions & 0 deletions FyneApp.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Website = "https://lucor.dev/paw"

[Details]
Icon = "logo/paw.png"
Name = "paw"
ID = "dev.lucor.paw"
Version = "0.15.0"
Build = 1
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ It is written in Go and uses [Fyne](https://github.com/fyne-io/fyne) as UI toolk
## Main features

* Cross platform application (linux, macOS, Windows, BSD ...) with a single codebase
* Desktop and CLI application
* Minimal direct dependencies
* Open source: code can be audited
* Audit passwords against data breaches
Expand All @@ -33,7 +34,6 @@ It is written in Go and uses [Fyne](https://github.com/fyne-io/fyne) as UI toolk

* Automatically detect and use password rules for known web sites that require ones
* Automatic backup / syncronization
* CLI application
* Mobile / Web applications
* Stateless password derivation support
* Unicode password support
Expand All @@ -42,16 +42,29 @@ It is written in Go and uses [Fyne](https://github.com/fyne-io/fyne) as UI toolk

### Latest version

#### Desktop application

```
go install lucor.dev/paw/cmd/paw@latest
```

#### CLI application

```
go install lucor.dev/paw/cmd/paw-cli@latest
```

### Development version

To try the development version or help with testing:


```
# Desktop application
go install lucor.dev/paw/cmd/paw@develop
# CLI application
go install lucor.dev/paw/cmd/paw-cli@develop
```

## How it works - cryptography details
Expand Down
69 changes: 69 additions & 0 deletions cmd/paw-cli/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package main

import (
"log"
"os"

"lucor.dev/paw/internal/cli"
"lucor.dev/paw/internal/paw"
)

// Version allow to set the version at link time
var Version string

func main() {

log.SetFlags(0)

s, err := paw.NewOSStorage()
if err != nil {
log.Fatal(err)
}

// Define the command to use
commands := []cli.Cmd{
&cli.AddCmd{},
&cli.EditCmd{},
&cli.InitCmd{},
&cli.ListCmd{},
&cli.PwGenCmd{},
&cli.RemoveCmd{},
&cli.ShowCmd{},
&cli.VersionCmd{Version: Version},
}

// display the usage if no command is specified
if len(os.Args) == 1 {
cli.Usage(commands)
os.Exit(1)
}

// check for valid command
var cmd cli.Cmd
for _, v := range commands {
if os.Args[1] == v.Name() {
cmd = v
break
}
}

// If no valid command is specified display the usage
if cmd == nil {
cli.Usage(commands)
os.Exit(1)
}

// Parse the arguments for the command
// It will display the command usage if -help is specified
// and will exit in case of error
err = cmd.Parse(os.Args[2:])
if err != nil {
log.Fatalf("[✗] %s", err)
}

// Finally run the command
err = cmd.Run(s)
if err != nil {
log.Fatalf("[✗] %s", err)
}
}
20 changes: 18 additions & 2 deletions cmd/paw/paw.go → cmd/paw/main.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
package main

import (
"runtime/debug"

"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"

"lucor.dev/paw/internal/icon"
"lucor.dev/paw/internal/ui"
)

// Version allow to set the version at link time
var Version string

func main() {
a := app.NewWithID("dev.lucor.paw")
a.SetIcon(icon.PawIcon)

w := a.NewWindow("Paw")
w.SetMaster()

w.Resize(fyne.NewSize(800, 600))
w.SetContent(ui.Make(a, w))
w.SetContent(ui.Make(a, w, version()))
w.ShowAndRun()
}

func version() string {
if Version != "" {
return Version
}

info, ok := debug.ReadBuildInfo()
if ok {
return info.Main.Version
}
return "(unknown)"
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ require (
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
golang.org/x/image v0.0.0-20211028202545-6944b10bf410
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b
)
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210903071746-97244b99971b h1:3Dq0eVHn0uaQJmPO+/aYPI/fRMqdrVDbu7MQcku54gg=
golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down
Loading

0 comments on commit f2e0b6e

Please sign in to comment.