No description
  • Go 73.2%
  • TypeScript 14%
  • Makefile 10.1%
  • JavaScript 2.7%
Find a file
Felipe M. 9e888709d1
All checks were successful
ci / lint (push) Successful in 3m27s
ci / build (push) Successful in 3m27s
ci / test (push) Successful in 3m20s
release / release (push) Successful in 3m3s
Sign plugin bundles in the release workflow
Generate a detached GPG signature alongside each .tar.gz so users can
verify the bundle came from this repository. The signing key and
passphrase are pulled from repo secrets.
2026-05-06 22:21:02 +02:00
.github/workflows Sign plugin bundles in the release workflow 2026-05-06 22:21:02 +02:00
assets Replace starter template icon with Shelfmark logo 2026-03-18 10:47:29 +01:00
build Add webapp boilerplate from starter template and switch build to bun 2026-03-18 09:28:10 +01:00
public Add RHS panel with channel header toggle button 2026-03-18 11:35:30 +01:00
server Validate channel existence and Shelfmark reachability on config change 2026-03-18 17:55:08 +01:00
webapp Fix RHS panel scrolling so long content is reachable 2026-05-06 18:59:22 +02:00
.editorconfig Initial plugin scaffold from the mattermost-plugin-starter-template 2026-03-16 10:41:22 +01:00
.gitattributes Initial plugin scaffold from the mattermost-plugin-starter-template 2026-03-16 10:41:22 +01:00
.gitignore Initial plugin scaffold from the mattermost-plugin-starter-template 2026-03-16 10:41:22 +01:00
.gitpod.yml Initial plugin scaffold from the mattermost-plugin-starter-template 2026-03-16 10:41:22 +01:00
.golangci.yml Add webapp boilerplate from starter template and switch build to bun 2026-03-18 09:28:10 +01:00
.nvmrc Initial plugin scaffold from the mattermost-plugin-starter-template 2026-03-16 10:41:22 +01:00
CLAUDE.md Add CLAUDE.md and fix misspell false positive for Spanish word Comando 2026-03-18 08:42:42 +01:00
go.mod Fix concurrency bugs, error handling, and add comprehensive unit tests 2026-03-17 17:17:38 +01:00
go.sum Implement Shelfmark book request integration 2026-03-17 14:11:24 +01:00
LICENSE Initial plugin scaffold from the mattermost-plugin-starter-template 2026-03-16 10:41:22 +01:00
Makefile Add webapp boilerplate from starter template and switch build to bun 2026-03-18 09:28:10 +01:00
plugin.json Shorten plugin display name to Shelfmark 2026-03-18 17:31:37 +01:00
README.md Document the RHS panel as the primary entry point in the README 2026-05-06 19:00:47 +02:00

Mattermost Plugin Shelfmark

Build Status

A Mattermost plugin that integrates with Shelfmark to let users search and request books directly from Mattermost. Browse results in a dedicated side panel or use the /requestbook slash command -- requested books are automatically downloaded and posted to a designated channel.

Features

  • RHS panel -- Search, browse covers and authors, and pick a specific release to download from a side panel toggled from the channel header
  • Slash command -- Quick one-shot requests via /requestbook <query> for users who prefer the keyboard
  • Language filtering -- Specify a preferred language (e.g., es, fr) in the panel or with --language <code> on the slash command, with a configurable default
  • Automatic downloads -- Background processing handles the full lifecycle: search, queue, download, and post
  • Channel posting -- Books are posted with cover art to a configured channel, with the file attached as a reply
  • User notifications -- Requestors receive DM updates on download progress and completion
  • Localization -- User-facing messages available in English and Spanish, with locale-aware delivery
  • Customizable posts -- Post format is configurable via Go text/template syntax

Usage

RHS panel

Click the Shelfmark icon in the channel header to open the side panel. Enter a query, pick a language, browse the matching books, then choose a specific release to request. Requested releases are queued for download and posted to the configured channel when ready.

Slash command

/requestbook [--language <code>] <search query>

Examples:

/requestbook The Hitchhiker's Guide to the Galaxy
/requestbook --language es El Quijote
/requestbook 978-0-13-468599-1

The slash command picks the best match automatically and queues it for download.

Configuration

Configure the plugin in System Console > Plugins > Mattermost Plugin Shelfmark.

Setting Description
Shelfmark Server URL Base URL of your Shelfmark instance (e.g., http://shelfmark:8084)
Shelfmark Username Username for Shelfmark authentication (leave empty if auth is disabled)
Shelfmark Password Password for Shelfmark authentication (leave empty if auth is disabled)
Channel ID Mattermost channel ID where book posts will be created
Default Language ISO language code used when --language is not specified (e.g., en, es, fr)
Post Template Go template for book post messages. Variables: {{.Title}}, {{.Authors}}, {{.AuthorsList}}

Development

Prerequisites

  • Go 1.25+
  • A running Mattermost server with plugin uploads enabled

Building

make                # lint, test, and build
make dist           # create distributable plugin bundle
make test           # run tests only
make coverage       # generate test coverage report

The build produces a plugin bundle at dist/com.fmartingr.shelfmark.tar.gz with support for Linux (amd64/arm64), macOS (amd64/arm64), and Windows (amd64).

Deploying

Enable plugin uploads in your Mattermost config:

{
    "PluginSettings": {
        "EnableUploads": true
    }
}

Then deploy with local mode:

make deploy

Or with credentials:

export MM_SERVICESETTINGS_SITEURL=http://localhost:8065
export MM_ADMIN_TOKEN=<your-token>
make deploy

Releasing

make patch       # patch release (e.g., 1.0.1)
make minor       # minor release (e.g., 1.1.0)
make major       # major release (e.g., 2.0.0)

Release candidate variants are also available: make patch-rc, make minor-rc, make major-rc.

The version is determined automatically from git tags. See the Makefile for details.