SkillAgentSearch skills...

Modmail Viewer

An advanced web frontend for the modmail discord bot with built in Discord OAuth2 authentication, and support for browsing and searching current and historical logs. Directly replaces logviewer.

Install / Use

npx skills add khakers/modmail-viewer

Installs into whichever agent you are using.

About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Modmail Viewer

GitHub latest release (latest SemVer) GitHub Help Wanted issues Wiki

Deploy on Railway (not recommended)

A drop in alternative frontend for your modmail-dev/modmail bot instance with built-in Discord authentication, advanced features and better mobile support. Replaces logivewer with more features

Built from scratch using Javalin, JTE, Bootstrap 5, and Unpoly.

<details> <summary>Screenshots</summary>

modmail-logviewer-log log browsing

</details>

Modmail-Viewer is currently a beta. You should always read update notes before applying updates as there may be breaking changes between major versions, and ensure you are running an up to date version to have the latest fixes and support.

Report any bugs you encounter via github issues at this repository (not modmail or logviewer, as this is a community project).
Use GitHub discussions for feature requests or to ask questions. Please prefer not to directly DM me, as it's not discoverable for other people that may help, and it's possible that I won't not notice it for a while.

Interested in a custom version or features for your server? Contact me privately on discord to sponsor features or to commision changes.

Features

  • All features in logviewer + more
  • Discord OAuth2 authentication based on your modmail roles. See the wiki page on permissions.
  • Browsable paginated logs sorted by most recent message and filterable by status.
  • Mobile friendly design.
  • Full Discord Markdown formatting (Including spoilers, custom emojis, and timestamps).
  • Customizable Branding
  • Dark/Light Themes
  • Log text search
  • HTTPS support
  • NSFW warnings
  • Image spoiler support
  • Ticket dashboard 🔜
  • Audit Logging 🔜
  • Inline attachment support 🔜
  • Retrievable message links 🔜

Modmail-viewer & logviewer comparison

Self-hosting

You should place your modmail-viewer instance behind Cloudflare or some other reverse proxy (such as Caddy) to provide automatic https OR provide the required keys/certs to the application yourself if you plan on using authentication.

Docker

Running the application with Docker is the fastest and best supported way to run modmail-viewer. Additionally, you can easily run it using any service that supports running docker containers.

Docker Run

To quickly test modmail-viewer, you can use this docker run command. Make sure to substitute the environment variables for what is applicable to you.

docker run --name modmail-viewer -p 80:80 \
  --env "MODMAIL_VIEWER_MONGODB_URI=mongodb://mongo:27017" \
  --env "MODMAIL_VIEWER_URL=http://127.0.0.1" \
  --env "MODMAIL_VIEWER_DISCORD_OAUTH_CLIENT_ID=1234" \
  --env "MODMAIL_VIEWER_DISCORD_OAUTH_CLIENT_SECRET=abcd" \
  -d ghcr.io/khakers/modmail-viewer:latest

Docker Compose

For long term ease of use, it's highly recommended that you use docker compose. An example docker compose for running only modmail-logviewer.

Note See docker-compose.yml for a compose file that can run modmail, modmail-viewer, and mongodb.

version: "3.7"
services:
  viewer:
    image: ghcr.io/khakers/modmail-viewer:latest
    env_file:
      - .env
    ports:
      - "80:80"
      # uncomment if using SSL
      #- "443:443"
    environment:
      - "MODMAIL_VIEWER_MONGODB_URI=mongodb://mongo:27017"
      - "MODMAIL_VIEWER_URL=http://127.0.0.1"
.env example

Should be located next to your docker-compose.yml, contains secrets.

Note See the wiki page on authentication setup for more information.

MODMAIL_VIEWER_DISCORD_OAUTH_CLIENT_ID=123456789
MODMAIL_VIEWER_DISCORD_OAUTH_CLIENT_SECRET=67234rtg3b2otgfhbn3298t7h
MODMAIL_VIEWER_SECRETKEY=secret

Other

Before getting started, you'll need:

  • A JDK/JRE 17 installation

Download the latest release from GitHub and unzip/tar the modmail-viewer archive

Run the webserver via the included scripts bin/modmail-viewer on linux, and bin/modmail-viewer.bat on windows.

It's recommended to either set up a reverse proxy (such as Cloudflare or Caddy) in front of your modmail-logviewer instance, or enable SSL and provide your own certificate and private key. You can generate one for your domain automatically with Certbot.

To run the webserver in the background, it's recommended you use a service manager such as Systemd.

Configuration

Permissions

See the wiki page on permissions.

Environment Variables

| Environment Variable | Description | |--------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | MODMAIL_VIEWER_URL | The URL your modmail viewer instance is reachable at (i.e http://127.0.0.1) | | MODMAIL_VIEWER_MONGODB_URI | URI for the MongoDB instance | | MODMAIL_VIEWER_DISCORD_OAUTH_CLIENT_ID | Your Discord Application ID. Can be skipped if authentication is disabled. | | MODMAIL_VIEWER_DISCORD_OAUTH_CLIENT_SECRET | Your Discord OAuth2 client secret | | MODMAIL_VIEWER_DISCORD_GUILD_ID | The ID of your discord Guild. This should be whatever guild has relevant discord Roles, as it checks the users roles in the provided guild | | MODMAIL_VIEWER_SECRETKEY | A randomly generated secret key used for signing auth tokens. <br/>ANYONE WITH THIS KEY CAN FORGE AUTHENTICATION TOKENS and impersonate any user. Should be at least 32 characters. If you don't provide one, sessions will not persist across restarts. | | MODMAIL_VIEWER_DEV | Enables development features. Do not enable in production. Requires a JDK. | | MODMAIL_VIEWER_AUTH_ENABLED | Set to false to completely disable authentication. May break some features. | | MODMAIL_VIEWER_SSL | Enables SSL and HTTP/2 when connected via https. | | MODMAIL_VIEWER_HTTPS_ONLY | Disables the http port and redirects all connections to https. Enabled by default if SSL is enabled. Does not function on localhost. | | MODMAIL_VIEWER_SSL_CERT | Path to the SSL certificate pem file. Does not hot reload. | | MODMAIL_VIEWER_SSL_KEY | Path to the SSL certificate private key pem file. Does not hot reload. | | MODMAIL_VIEWER_HTTP_PORT | Port HTTP traffic will be served at. Defaults to 80

Related Skills

View on GitHub
GitHub Stars9
CategoryCustomer
Updated3mo ago
Forks5

Languages

Java

Security Score

87/100

Audited on Apr 14, 2026

No findings