mailbox

module
v0.0.0-...-96d23e7 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT

README

mailbox

GitHub Actions Workflow Status GitHub License GitHub issues Go Reference

Mailbox is a simple Go program for controlling website contact form submissions. It implements an API server backend for accepting form submissions and an intuitive, authenticated terminal UI for webmasters. It currently works with MongoDB, but a modular database interface is provided for integrating with other backends. CloudFlare Turnstile captchas are also supported. Mailbox was designed as a minimal, non-properietary system for serving dynamic forms on static websites (e.g. GitHub pages).

Install

[!WARNING] Mailbox is work-in-progress. There are currently no stable releases.

This project uses the Go compiler. To get started, clone the GitHub repository:

git clone https://github.com/zeim839/mailbox.git
cd mailbox

Quick Start

Mailbox implements both a server and client executable. The server hosts a CRUD API for accepting and handling form submissions and the client is a TUI for interacting with the server.

To install the server:

cd server
go build .
./server

The server executable must be ran with a present working directory which contains a configuration file (see configure).

To install the client:

cd cmd
go build .
./cmd

Docker

To build a dedicated docker container for the server, run:

docker build --tag 'mailbox' .

Configure

The server is configured through a config.env file in the present working directory. The client application does not require any configuration. The following configuration options are defined for the server:

  • MONGO_URI: the MongoDB connection URI.
  • GIN_MODE: The Gin server mode (one of DEBUG, RELEASE, or TEST)
  • PORT: server port.
  • USERNAME: an optional username for implementing Basic http auth.
  • PASSWORD: the password for basic http auth.
  • CAPTCHA_SECRET: an optional secret API key for configuring Cloudflare Turnstile captcha.

A minimal configuration is illustrated below:

# config.env
MONGO_URI = "mongodb+srv:// ... "
USERNAME  = "admin"
PASSWORD  = "strong-password-123"

Currently, only MongoDB is supported. We are working on implementing additional database backends.

License

MIT

Copyright (C) 2024 Michail Zeipekki

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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