KibaFox / asmith

asmith (aka Agent Smith) exports the text from unencrypted Matrix Synapse chat rooms by querying the PostgreSQL database.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

asmith (Agent Smith)

asmith (aka Agent Smith) exports the text from unencrypted Matrix Synapse chat rooms by querying the PostgreSQL database.

Disclaimer

This project is intended to be a one-time use to preserve some chats with my friends before I decommission my Matrix server.

There are no plans to maintain or expand this project, but feel free to fork this project.

This is not intended for server administrators to snoop on users. Please use good moral judgement when using this tool.

Usage

$ asmith -room '!abc123:domain.tld' -dsn 'user=USER password=PASS dbname=DB'

Options:

  • -room is the ID of the room. You can find this in the advanced room settings in the Riot.im client.
  • -dsn specifies the PostgreSQL connection string for querying the database. This needs to be set to connect to the same database that Synapse uses. You can see the lib/pq documentation on connection strings for details.

This will output in the following format:

### @ada:domain.tld - 2006-01-02T15:04:05Z07:00

What are you up to?

### @pascal:domain.tld - 2006-01-02T15:05:15Z07:00

Not much.  How about you?

You can redirect the output to a file:

$ asmith -dsn 'user=USER password=PASS dbname=DB' \
    -room '!abc123:domain.tld' > chat.txt

Then you can view the exported chat in chat.txt.

Building

This is a Go project.

This project provides a Magefile which is a build tool similar in use to make.

To build the project, run:

$ mage build

This will build a binary for linux on amd64 architecture to dist/asmith. If you need to change this, modify the goEnv variable in the magefile.go.

The goEnv sets the GOOS and GOARCH environment variables for cross-compiling the result. You need to set these values to the environment where you need to run asmith.

Possible values for GOOS and GOARCH can be found in the Go documentation for optional environment variables.

About

asmith (aka Agent Smith) exports the text from unencrypted Matrix Synapse chat rooms by querying the PostgreSQL database.

License:The Unlicense


Languages

Language:Go 100.0%