GithubHelp home page GithubHelp logo

derricw / siggo Goto Github PK

View Code? Open in Web Editor NEW
319.0 7.0 9.0 285 KB

a TUI for signal messenger, written in Go

License: GNU General Public License v3.0

Makefile 1.65% Go 98.35%
dbus signal-messenger tui signal-cli

siggo's Introduction

siggo

GoDoc Go Report Build

A terminal ui for signal-cli, written in Go.

Alt text

Unable to keep pace with signal-cli

I have not been keeping up with signal-cli development. They change the location and format of their local data constantly. If you want your install to work, use signal cli version 0.9.2 until I find time to update.

Features

  • vim-style ux
  • useful for quick messages or use $EDITOR to compose fancy ones
  • emoji support, just use colons, like :cat: or the kitty emoji picker
  • configurable contact colors
  • can use fzf to fuzzy-find files to attach
  • support for groups! (but not creating new groups)
  • quickly filter messages by providing a regex pattern

Dependencies

siggo uses the dbus daemon feature of signal-cli, so libunixsocket-java (Debian), libmatthew-java (Fedora) or libmatthew-unix-java (AUR) is required. There seems to be a brew forumla for dbus on MacOS.

Install signal-cli and put it somewhere safe in your path. You will need to follow its instructions to either link or register your device. Alternatively, the siggo link <phonenumber> <devicename> subcommand has been added to make linking more user-friendly. Be sure to prefix with + and country code (for example +12345678901).

When setup is finished, you should be able to run without error:

signal-cli -u +<yourphonenumber> -o json receive

You are now ready to use siggo.

Optional Dependencies

Some nice features are available if you have fzf in your PATH.

Security

siggo shells out to signal-cli, so if that worries you, don't use it, for now. I have lofty goals of eventually replacing this with libsignal.

Build

siggo should build on Linux or MacOS, but has primarily been tested on Linux.

make build

Run

bin/siggo

Updating

If you are updating from a previous version, I recommend deleting your conversation files first. See below.

Keybinds

  • j - Scroll Down
  • k - Scroll Up
  • J - Next Contact
  • K - Previous Contact
  • n - Move to next conversation with unread messages
  • t - Use fzf to goto contact with fuzzy matching
  • a - Attach file (sent with next message)
  • A - Use fzf to attach a file
  • / - Filter conversation by providing a pattern
  • i - Insert Mode
    • CTRL+L - Clear input field (also clears staged attachments)
  • I - Compose (opens $EDITOR and lets you make a fancy message)
  • y - Yank Mode
    • yy - Yank Last Message (from current conversation)
    • yl - Yank Last URL
  • o - Open Mode
    • Enter - Open selected attachment
    • oo - Open Last Attachment
  • l - Link Mode
    • Enter - Open selected link in browser
    • ll - Open Last URL
    • y - Yank selected link to clipboard
  • p or CTRL+V - Paste text/attach file in clipboard
  • ESC - Normal Mode
  • CTRL+Q - Quit (CTRL+C should also work)

Configuration

See the configuration README here.

Message History

Message saving is an opt-in feature.

If you enable it, conversations are stored in plain text in ~/.local/share/siggo/conversations.

Delete them like this:

rm ~/.local/share/siggo/conversations/*

Troubleshooting

I've started a wiki here.

Development

Honestly the code is a hot mess right now, and I don't recommend trying to contribute yet. But I will absolutely take a PR if you want to throw one at me.

If you save the output of signal-cli like so:

signal-cli -u +<yourphonenumber> receive --json > example_messages.json

You can then run siggo using it as mock input. This is useful for development and testing.

bin/siggo -m example_messages.json

This way you can test without sending yourself messages.

Similar Projects / Inspiration

Roadmap

Here is a list of things that are currently broken.

  • Send read receipts for incoming messages (signal-cli limitation, but might be fixed soon)

Here is a list of features I'd like to add soonish.

  • Better Attachments Support
    • signal-cli seems to delete old attachments after a while. maybe I should move them somewhere where they wont get deleted?
  • default color list for contacts instead of white
  • better mode indication
  • gui configuration
    • colors and border styles
  • let user re-sort contact list (for example alphabetically)
  • use dbus to send instead of signal-cli, to avoid having to spin up the JVM
  • there is still some data that I'm dropping on the floor (I believe it to be the "typing indicator" messages)
  • weechat/BitlBee plugin that uses the siggo model without the UI
  • wouldn't tests be neat?

siggo's People

Contributors

derricw avatar jcrowgey avatar limero avatar xsteadfastx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

siggo's Issues

Provide better feedback when background daemon fails to start.

We should provide better feedback when we fail to start the daemon.

For example, on MacOS when running signal-cli 0.8.0, it will fail to start when the user doesn't have the new native libraries that are required. But to know what it wrong you have to read the logs, it isn't obvious in the GUI.

signal-cli 0.8.2 breaks contacts list

signal-cli removed its contact list to a new location in XDG_DATA_HOME/signal-cli (or at least is no longer available in the old location).

Until we deal with this, siggo will be unable to load contacts at startup for signal-cli >= 0.8.2

Message History not working

$ siggo version
Build Date:
Git Commit:
Version: 0.8.1
Go Version: go1.15.6
OS/Arch: linux amd64
signal-cli Version: 0.7.2

I set save_messages to true in config.yml, but received messages do not persist when restarting siggo. However, the message files do show up in ~/.local/share/siggo/conversations.

Empty UI

When I start siggo, I just get an empty UI without any further messages. I used siggo link to link the device and can retrieve the JSON data successfully.
I'm running Arch Linux:

$ java --version
openjdk 18.0.1.1 2022-04-22
OpenJDK Runtime Environment (build 18.0.1.1+2)
OpenJDK 64-Bit Server VM (build 18.0.1.1+2, mixed mode)
$ uname -a
Linux applecore 5.18.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 29 Jun 2022 23:03:08 +0000 x86_64 GNU/Linux

recipients-store: no such file or directory

Hello,

it seems siggo is searching on the wrong place for the recipient store.

In the log file i get the following error:

time="2023-02-21T15:15:02+01:00" level=warning msg="failed to read contacts from disk: open /home/sheimann/.local/share/signal-cli/data/+496349816574.d/recipients-store: no such file or directory"

But, the link was successful and the data is here:

Bildschirmfoto-20230221152521-804x201

Ist there any parameter that i can use, so that siggo would become funtional?

Siggo TUI empty on startup

Problem: when I start siggo, I get an empty TUI.

Here is the log file:

time="2020-11-22T20:11:22+01:00" level=warning msg="failed to read contacts from disk: json: cannot unmarshal string into Go struct field SignalGroup.groupStore.groups.members of type signal.SignalGroupMember"
time="2020-11-22T20:11:22+01:00" level=debug msg="contacts found: []"
time="2020-11-22T20:11:22+01:00" level=info msg="starting dbus daemon..."
time="2020-11-22T20:11:22+01:00" level=info msg="scanning stdout"
time="2020-11-22T20:11:25+01:00" level=info msg="starting dbus daemon..."
time="2020-11-22T20:11:25+01:00" level=info msg="scanning stdout"
time="2020-11-22T20:11:27+01:00" level=info msg="starting dbus daemon..."
time="2020-11-22T20:11:27+01:00" level=info msg="scanning stdout"
time="2020-11-22T20:11:28+01:00" level=debug msg="Key Event <NORMAL>: 256 mods: 0 rune: 113"
time="2020-11-22T20:11:28+01:00" level=debug msg="Key Event <NORMAL>: 24 mods: 2 rune: 24"
time="2020-11-22T20:11:28+01:00" level=debug msg="Key Event <NORMAL>: 3 mods: 2 rune: 3"
time="2020-11-22T20:11:28+01:00" level=debug msg="killing signal-cli daemon..."

I can confirm signal-cli works, as I can receive messages using the cli. Moreover, I can send messages through signal-cli.

Am I doing something wrong, or did I find a bug?

Building on FreeBSD

Hi, I am trying to build on FreeBSD (using gmake):

gmake build gives

github.com/godbus/dbus/v5
# github.com/godbus/dbus/v5
In file included from ../../go/pkg/mod/github.com/godbus/dbus/[email protected]/transport_unixcred_freebsd.go:13:
In file included from /usr/include/sys/ucred.h:39:
/usr/include/sys/_lock.h:38:2: error: unknown type name 'u_int'
        u_int   lo_flags;
        ^
/usr/include/sys/_lock.h:39:2: error: unknown type name 'u_int'
        u_int   lo_data;                /* General class specific data. */
        ^
In file included from ../../go/pkg/mod/github.com/godbus/dbus/[email protected]/transport_unixcred_freebsd.go:13:
In file included from /usr/include/sys/ucred.h:40:
/usr/include/sys/_mutex.h:49:11: error: unknown type name 'uintptr_t'
        volatile uintptr_t      mtx_lock;       /* Owner and flags. */
                 ^
/usr/include/sys/_mutex.h:63:11: error: unknown type name 'uintptr_t'
        volatile uintptr_t      mtx_lock;       /* Owner and flags. */
                 ^
4 errors generated.
gmake: *** [Makefile:28: build] Error 2

MacOS Support

siggo does not build on MacOS (and OpenBSD) because of this:

https://github.com/derricw/siggo/blob/master/signal/signal.go#L192

The Pdeathsig attribute is only available on Linux.

See: https://golang.org/pkg/syscall/#SysProcAttr

The purpose of this section is to ensure that we don't leave behind an orphaned signal-cli daemon if siggo is killed or panics or otherwise fails to handle a shutdown gracefully.

If we want siggo to build for MacOS we will need to find more platform-independent way to do this.

Groups Support

This is probably the next major thing I'll be adding.

Exit status 1 when trying to send messages in signal

Hello! Currently whenever I try to send a message in siggo it gives me exit status 1 and I can't currently find very much information on what is going on. Are there any log files being written? I have linked my account using signal-cli and am able to send messages using signal-cli but the siggo sending doesn't work. I'm also able to see my contacts on siggo as well, just seems the message sending is broken for me. I'm on Artix linux and don't have systemd, not sure if that makes a difference. Thanks for the help!

Crash

I updated signal-cli to 0.8.0 and siggo to 0.9.0 and have constant crashes:

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x7ed634]

goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1(0xc0001ea1c0)
	/home/georg/go/pkg/mod/github.com/rivo/[email protected]/application.go:244 +0x87
panic(0x8557a0, 0xcae5c0)
	/usr/lib/go/src/runtime/panic.go:969 +0x1b9
github.com/derricw/siggo/widgets.(*ContactListPanel).Render(0xc000251280)
	/home/georg/workspace/siggo/widgets/contactlist.go:73 +0x494
github.com/derricw/siggo/widgets.(*ChatWindow).update(0xc0002f6870)
	/home/georg/workspace/siggo/widgets/chatwindow.go:432 +0x68
github.com/derricw/siggo/widgets.NewChatWindow.func3.1()
	/home/georg/workspace/siggo/widgets/chatwindow.go:601 +0x2a
github.com/rivo/tview.(*Application).QueueUpdateDraw.func1()
	/home/georg/go/pkg/mod/github.com/rivo/[email protected]/application.go:716 +0x2f
github.com/rivo/tview.(*Application).Run(0xc0001ea1c0, 0x0, 0x0)
	/home/georg/go/pkg/mod/github.com/rivo/[email protected]/application.go:371 +0x9a7
github.com/derricw/siggo/cmd.glob..func10(0xcb6b40, 0xced1b0, 0x0, 0x0)
	/home/georg/workspace/siggo/cmd/root.go:121 +0x45a
github.com/spf13/cobra.(*Command).execute(0xcb6b40, 0xc0001101b0, 0x0, 0x0, 0xcb6b40, 0xc0001101b0)
	/home/georg/go/pkg/mod/github.com/spf13/[email protected]/command.go:842 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xcb6b40, 0x408025, 0xc000100058, 0x0)
	/home/georg/go/pkg/mod/github.com/spf13/[email protected]/command.go:943 +0x336
github.com/spf13/cobra.(*Command).Execute(...)
	/home/georg/go/pkg/mod/github.com/spf13/[email protected]/command.go:883
github.com/derricw/siggo/cmd.Execute()
	/home/georg/workspace/siggo/cmd/root.go:131 +0x31
main.main()
	/home/georg/workspace/siggo/main.go:8 +0x25

I suppose this is related to group messages, but I can't say this for sure. I can provide more debug information if needed.

Panic when starting siggo

I've just linked siggo, and am running into an immediate panic when trying to run it:

$ siggo

panic: no conversation for current contact

goroutine 1 [running]:
github.com/derricw/siggo/widgets.(*ChatWindow).update(0xc0002b8630)
	github.com/derricw/siggo/widgets/chatwindow.go:457 +0xbe
github.com/derricw/siggo/widgets.NewChatWindow(0xc00006c8c0, 0xc0001a8380, 0xc000062ba0)
	github.com/derricw/siggo/widgets/chatwindow.go:696 +0x93e
github.com/derricw/siggo/cmd.glob..func10(0x55d14ad71180, 0x55d14adc71f0, 0x0, 0x0)
	github.com/derricw/siggo/cmd/root.go:95 +0x24d
github.com/spf13/cobra.(*Command).execute(0x55d14ad71180, 0xc0000121d0, 0x0, 0x0, 0x55d14ad71180, 0xc0000121d0)
	github.com/spf13/[email protected]/command.go:842 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x55d14ad71180, 0x55d14a571625, 0xc00006e058, 0x0)
	github.com/spf13/[email protected]/command.go:943 +0x336
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:883
github.com/derricw/siggo/cmd.Execute()
	github.com/derricw/siggo/cmd/root.go:119 +0x2f
main.main()
	github.com/derricw/siggo/main.go:8 +0x25

My config is the default:

$ cat ~/.config/siggo/config.yml

user_number: "+elided"
user_name: self
save_messages: false
desktop_notifications: false
desktop_notifications_show_message: false
desktop_notifications_show_avatar: false
terminal_bell_notifications: false
max_coversation_length: 0
hide_panel_titles: false
hide_phone_numbers: false
contact_colors: {}
contact_aliases: {}
log_file: ""

but with my phone number instead of elided.

I don't really understand the signal protocol, but I've been running signal-desktop on a separate machine using signal-cli to register everything in the first place. This machine is now linked to that instance of signal-cli.

siggo 0.9.0. on FreeBSD slightly broken interface

Hello,
Basically, my siggo now looks like this, any idea where should I start troubleshooting? The area where my contacts are present makes the adjacent text field shifted by one character to the left, which makes the text field corrupted. Some random characters appear there, which nobody typed, the borders are shifted, etc, see picture.
Running on FreeBSD 12.2-p4, I rebuilt siggo from source again just to be sure, the issue is there.

scrot-21-0408-20:32:03

`Go get` fails

Hello,

I just wanted to install siggo but the go get command fails:

go get github.com/derricw/siggo
# github.com/derricw/siggo/cmd
.go/src/github.com/derricw/siggo/cmd/cfg.go:83:13: constant -1 overflows tcell.Color

Crashed when first opened

A couple messages displayed after loading for the first time, then it crashed.

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x5591d4df4254]

goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1(0xc0002d8000)
	github.com/rivo/[email protected]/application.go:244 +0x87
panic(0x5591d4feb900, 0x5591d524dc10)
	runtime/panic.go:969 +0x1b9
github.com/derricw/siggo/widgets.(*ContactListPanel).Render(0xc0001cce00)
	github.com/derricw/siggo/widgets/contactlist.go:73 +0x494
github.com/derricw/siggo/widgets.(*ChatWindow).update(0xc0002b8750)
	github.com/derricw/siggo/widgets/chatwindow.go:424 +0x69
github.com/derricw/siggo/widgets.NewChatWindow.func3.1()
	github.com/derricw/siggo/widgets/chatwindow.go:640 +0x2c
github.com/rivo/tview.(*Application).QueueUpdateDraw.func1()
	github.com/rivo/[email protected]/application.go:716 +0x31
github.com/rivo/tview.(*Application).Run(0xc0002d8000, 0x0, 0x0)
	github.com/rivo/[email protected]/application.go:371 +0x9a7
github.com/derricw/siggo/cmd.glob..func10(0x5591d5255180, 0x5591d52aac58, 0x0, 0x0)
	github.com/derricw/siggo/cmd/root.go:121 +0x45a
github.com/spf13/cobra.(*Command).execute(0x5591d5255180, 0xc0000121d0, 0x0, 0x0, 0x5591d5255180, 0xc0000121d0)
	github.com/spf13/[email protected]/command.go:842 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x5591d5255180, 0x5591d4a4c625, 0xc000072058, 0x0)
	github.com/spf13/[email protected]/command.go:943 +0x336
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:883
github.com/derricw/siggo/cmd.Execute()
	github.com/derricw/siggo/cmd/root.go:131 +0x2f
main.main()
	github.com/derricw/siggo/main.go:8 +0x25

May I suggest using cview instead of tview? I used it personally and it's great, and it has numerous improvements over the original.

exit status 2

I just set up signal-cli and siggo on my ubuntu server to try it out. This is pretty awesome thank you.

Signal on my iPhone is the primary account. I added my signal-cli user with

signal link -n myname | tee >(xargs -L 1 qrencode -t utf8)

So I see this status message sometimes when I try to send a message, it seems like the flow is:

  1. Open siggo after it being stopped
  2. Send a message
  3. See exit status 2, the message also doesn't send and is removed from the chat
  4. Open Signal on my iPhone, send a message
  5. Wait for message to show up in siggo
  6. Once it shows up in siggo then I can send messages and it all seems to work fine. Eventually the chat will sync up but that can take a bit
  • Any idea if this is a normal behavior for starting up siggo?
  • Should I be doing something to run this as a daemon or in screen so that I don't need to start/stop siggo ?

I enabled debug mode but this didn't seem too helpful

time="2022-01-08T15:48:44-08:00" level=info msg="starting dbus daemon..."
time="2022-01-08T15:48:44-08:00" level=info msg="scanning stdout"
time="2022-01-08T15:48:46-08:00" level=error msg="exit status 2"
time="2022-01-08T15:48:46-08:00" level=debug msg="updating contact panel..."

Support for Signals "New Groups"

There is a new group system in Signal with has features like admins and mentions. Signal currently asks all groups to update to the new system, which leads into me being removed from these groups for using siggo, since its not compatible. Would be nice to add these new group features

conversations missing in siggo

my siggo tends to always open without memory of conversations making software quite unusable even i have set to save these recipients-stores in config file.

save_messages: true
-> % siggo conv lol
WARN[0000] failed to read contacts from disk: open /home/satoshi/.local/share/signal-cli/data/+573292314943.d/recipients-store: no such file or directory
FATA[0000] failed to find conversation 

correct folder location would be 630010.d

satoshi@xiaomi13 [04:44:01] [~/.local/share/signal-cli/data]
-> % ls
630010  630010.d  accounts.json

Read Receipts / Typing Indicators - Feature Request

is it possible to enable Read receipts? when i receive a message the recipent can't see i've read their messages. if so how? also is it possible to enable typing indicators so that the recipient will see if im typing a mesg? thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.