shadowchat

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

README

Shadowchat

  • Self-hosted, non-custodial and minimalist Monero (XMR) superchat system written in Go.
  • No JavaScript required (Minimally used to enhance QoL).
  • Provides notification methods usable in OBS with an HTML page.
Installation

Building shadowchat requires:

For the purposes of the examples, it is assumed that shadowchat will be installed in /opt/shadowchat.

Running shadowchat requires:

Compiling

Once the executable is built, it is self-contained (portable) and can be copied around. The rest of the source directory is only required if customzing the appearance.

Installing a Release (Simple)
$ sudo mkdir -p /opt/shadowchat
$ sudo chown shadowchat:shadowchat /opt/shadowchat
$ go install gitgud.io/greyarea/shadowchat@latest
$ sudo mv $(go env GOPATH)/bin/shadowchat /opt/shadowchat/
Installing from Git
$ git clone https://gitgud.io/greyarea/shadowchat.git
$ cd shadowchat
$ go build

You may wish to checkout a release tag instead of building master as master is not guaranteed to be stable.

Setup
Monero Wallet
  1. Decide if your installation will have the shadowchat spawn monero-wallet-rpc (recomended) or not.
  2. Generate a view only wallet using your preferred wallet software such as monero-wallet-gui/monero-wallet-cli. If shadowchat will spawn monero-wallet-rpc do NOT set a password.
  3. Copy the walletname_viewonly and walletname_viewonly.keys files to the host that will run the wallet backend. Both files MUST be in the same directory (eg: /opt/shadowchat/walletname_viewonly and /opt/shadowchat/walletname_viewonly.keys).

If you are NOT going to have shadowchat spawn monero-wallet-rpc, start the RPC service:

$ monero-wallet-rpc \
    --rpc-bind-port 28088 \
    --daemon-address http://node.monerodevs.org:18089 \
    --wallet-file /opt/shadowchat/walletname_viewonly \
    --disable-rpc-login --password ""
Shadowchat

The shadowchat executable can create a commented example configuration file to use as the basis for the configuration. This MUST be edited and shadowchat will refuse to run with the default configuration.

$ /opt/shadowchat/shadowchat default-config -o /opt/shadowchat/config.yml
$ vi /opt/shadowchat/config.yml

The following config options should be set:

  • display.auth_key: The "authentication key" for the view and alert pages.
  • wallet.daemon.enable: true to have shadowchat spawn monero-wallet-rpc.
  • wallet.daemon.wallet_path: The path of the view-only wallet (eg: /opt/shadowchat/walletname_viewonly).

Start the shadowchat service:

$ /opt/shadowchat/shadowchat -f /opt/shadowchat/config.yml

A simple systemd unit file is provided as an example.

Usage
  • Visit 127.0.0.1:8900 to make superchats.
  • Visit 127.0.0.1:8900/view?auth=auth_key_here to view the superchat history.
  • Visit 127.0.0.1:8900/alert?auth=auth_key_here to view the alert "widget".

This is designed to be run on a cloud server behind a reverse-proxy that provides TLS, such as nginx.

There are a handful of sub-commands that can be used to administer a running instance, see shadowchat --help for more details.

If something goes horribly wrong and you wish to start over and delete all pending and paid-for superchats, stop the service and delete the store.db file.

If you decide to stop using shadowchat, but want to preserve the shadowchat history, see shadowchat dump --help.

OBS Alerts
  • Add a Browser source in OBS and point it at https://shadowchat.example.com/alert?auth=auth_key_here
Customization

Unless you want to customize the assets, the shadowchat executable is portable and nothing else in the repository is required. Otherwise a copy of the assets directory from the source distribution is needed.

Changes made to the included assets will not be applied unless the binary is rebuilt OR the assets are explicitly loaded via setting BOTH the assets.disable_internal and assets.asset_dir config options.

JavaScript is 100% optional, content is generated server-side via the Go template library. All of the .tmpl files are HTML files containing templates.

The non-locale specific static assets such as images (eg: xmr.svg) and stylesheets (eg: style.css) can be overridden on a per-locale basis if a file of the same name is present in a locale sub-directory (eg: assets/en_US/style.css will take precidence over assets/style.css).

WARNING: When compiling shadowchat, all files in the assets sub-directory will be embedded in the executable, regardless of if they are used or not.

Future plans
  • Improve the admin interface.
  • Add an API endpoint to allow third-party client development.
  • Widget for displaying top donors.
License

GPLv3-Only

The Shadowchan mascot (assets/logo.png) is distributed under CC BY-SA 4.0, and is free to copy, share, remix, and reuse under the terms of that license.

Origin

The shadowchat project was started at https://git.sr.ht/~anon_/shadowchat. The original author vanished off the face of the earth and the repository also has been removed, likely due to sr.ht's policies.

This fork loosly based on:

The current implementation has little in common with the original or other forks.

Donate

The current maintainer is not accepting donations.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
admin
Package admin provides the admin RPC client and server.
Package admin provides the admin RPC client and server.
api
Package api provides the external API.
Package api provides the external API.
assets
Package assets provides the web assets.
Package assets provides the web assets.
cmd
Package cmd implements the actual CLI command(s).
Package cmd implements the actual CLI command(s).
config
Package config provides the shadowchat daemon configuration.
Package config provides the shadowchat daemon configuration.
db
Package db provides the persistent and in-memory store.
Package db provides the persistent and in-memory store.
endpoints
Package config provides the web server endpoints.
Package config provides the web server endpoints.
xmr
Package xmr provides datastructures for dealing with XMR from a client (wallet) perspective.
Package xmr provides datastructures for dealing with XMR from a client (wallet) perspective.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL