Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
build/bin/
wailsjs/
hack/node_modules/
omni-socat.zip
build/windows/wails.exe.manifest
cmd/agent-bench/agent-bench
cmd/agent-bench/agent-bench.exe
test*/
pkg/muxconn
pkg/stdioconn
18 changes: 16 additions & 2 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,14 @@ func (a *App) onSign(pubkey *agent.Key) error {
return errors.New("private key not found")
}

a.ti.ShowBalloonNotification(wintray.ID,
fmt.Sprintf("SSH Key '%s' was used", privkey.PublicKey.Comment))
name := privkey.PublicKey.Comment
if len(name) == 0 {
name = truncateString(privkey.PublicKey.SHA256)
}
msg := fmt.Sprintf("SSH Key '%s' was used", name)
if a.settings.ShowBalloon {
a.ti.ShowBalloonNotification(wintray.ID, msg)
}
return nil
}

Expand Down Expand Up @@ -256,7 +262,15 @@ func (a *App) Save(s store.SaveData) error {
a.settings.SaveData.UnixSocketAgent = s.UnixSocketAgent
a.settings.SaveData.UnixSocketPath = s.UnixSocketPath
a.settings.SaveData.CygWinAgent = s.CygWinAgent
a.settings.SaveData.ShowBalloon = s.ShowBalloon
a.settings.SaveData.CygWinSocketPath = s.CygWinSocketPath
a.settings.SaveData.ProxyModeOfNamedPipe = s.ProxyModeOfNamedPipe
return a.settings.Save()
}

func truncateString(s string) string {
if len(s) <= 16 {
return s
}
return s[:16] + "..."
}
4 changes: 2 additions & 2 deletions build/windows/info.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"fixed": {
"file_version": "0.3.5"
"file_version": "0.5.0"
},
"info": {
"0000": {
"ProductVersion": "0.3.5",
"ProductVersion": "0.5.0",
"CompanyName": "OmniSSHAgent",
"FileDescription": "OmniSSHAgent",
"LegalCopyright": "Copyright.........",
Expand Down
14 changes: 14 additions & 0 deletions frontend/src/Settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
NamedPipeAgent: false,
UnixSocketAgent: false,
CygWinAgent: false,
ShowBalloon: false,
UnixSocketPath: "",
CygWinSocketPath: "",
ProxyModeOfNamedPipe: false,
Expand Down Expand Up @@ -103,6 +104,19 @@
>
</FormField>
</div>
<div>
<FormField>
<Switch
bind:checked={data.ShowBalloon}
value="Show a balloon notification when an SSH key is used"
/>
<span
>{data.ShowBalloon
? "Show a balloon notification when an SSH key is used"
: "Do not show a balloon notification when an SSH key is used"}</span
>
</FormField>
</div>
<div>
<FormField>
<Switch bind:checked={data.PageantAgent} value="Enable pageant" />
Expand Down
2 changes: 2 additions & 0 deletions pkg/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type SaveData struct {
NamedPipeAgent bool
UnixSocketAgent bool
CygWinAgent bool
ShowBalloon bool
UnixSocketPath string
CygWinSocketPath string

Expand All @@ -46,6 +47,7 @@ func initSetting() SaveData {
NamedPipeAgent: true,
UnixSocketAgent: true,
CygWinAgent: true,
ShowBalloon: true,
UnixSocketPath: filepath.Join(home, "OmniSSHAgent.sock"),
CygWinSocketPath: filepath.Join(home, "OmniSSHCygwin.sock"),

Expand Down