All Projects → jackjoe → mailgun_logger

jackjoe / mailgun_logger

Licence: MIT license
Simple Mailgun log persistence in Phoenix/Elixir

Programming Languages

elixir
2628 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects
shell
77523 projects
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to mailgun logger

Anything
Digital asset organizing tool for creators.
Stars: ✭ 19 (-73.97%)
Mutual labels:  self-hosted
OpenBudgeteer
OpenBudgeteer is a budgeting app based on the Bucket Budgeting Principle
Stars: ✭ 501 (+586.3%)
Mutual labels:  self-hosted
martianpins
Self hosted IPFS pinning service.
Stars: ✭ 23 (-68.49%)
Mutual labels:  self-hosted
comments
A real-time, markdown-enabled comment engine powered by leveldb with oauth support
Stars: ✭ 60 (-17.81%)
Mutual labels:  self-hosted
Hemmelig.app
Keep your sensitive information out of chat logs, emails, and more with encrypted secrets.
Stars: ✭ 183 (+150.68%)
Mutual labels:  self-hosted
ass
The superior self-hosted ShareX server
Stars: ✭ 331 (+353.42%)
Mutual labels:  self-hosted
simon-frontend
💹 SIMON is powerful, flexible, open-source and easy to use machine learning knowledge discovery platform 💻
Stars: ✭ 114 (+56.16%)
Mutual labels:  self-hosted
autobrr
Automation for downloads.
Stars: ✭ 288 (+294.52%)
Mutual labels:  self-hosted
jmal-cloud-server
基于springboot的网盘服务端。JmalCloud 是一款私有云存储网盘项目,能够简单安全管理您的云端文件
Stars: ✭ 80 (+9.59%)
Mutual labels:  self-hosted
visited
Securely collect browsing history over browsers.
Stars: ✭ 60 (-17.81%)
Mutual labels:  self-hosted
wake-pc
Wake PC is a tiny self-hosted Wake-On-Lan (WOL) app written in PHP for linux machines that you can use to wake up machines on your local network.
Stars: ✭ 44 (-39.73%)
Mutual labels:  self-hosted
DSAC
DockSTARTer App Config helps you configure some of your Docker apps!
Stars: ✭ 20 (-72.6%)
Mutual labels:  self-hosted
krane
Open-source, self-hosted, container management solution
Stars: ✭ 76 (+4.11%)
Mutual labels:  self-hosted
nitter scraper
Scrape Twitter API without authentication using Nitter.
Stars: ✭ 31 (-57.53%)
Mutual labels:  self-hosted
Snippet2
A simple Code Snippet with user account and share feature
Stars: ✭ 20 (-72.6%)
Mutual labels:  self-hosted
urlzap
⚡️ Your own static URL shortener
Stars: ✭ 57 (-21.92%)
Mutual labels:  self-hosted
paperhero
webapp written in python to manage pdf collections and notes
Stars: ✭ 28 (-61.64%)
Mutual labels:  self-hosted
neko
A self hosted virtual browser that runs in docker and uses WebRTC.
Stars: ✭ 2,266 (+3004.11%)
Mutual labels:  self-hosted
auddly
Self hosted music streaming app
Stars: ✭ 60 (-17.81%)
Mutual labels:  self-hosted
gatus
⛑ Automated service health dashboard
Stars: ✭ 3,018 (+4034.25%)
Mutual labels:  self-hosted

Mailgun Logger

Build Status

Simple Mailgun log persistence in Phoenix/Elixir.

MailgunLogger is a simple admin tool that uses the Mailgun API to retrieves events on a regular basis from Mailgun - who only provide a limited time of event storage - and stores them inside a MySQL database. For efficiency and less complexity, it retrieves events for the last two days (free accounts offer up to three days of persistence) and then inserts everything. Only new events will pass the unique constraint on the db.

This is done because, as stated in the Mailgun docs, it is not guaranteed that for a given time period, all actual events will be ready, since some take time to get into the system although they already happened.

See the docs for implementation details.

IMPORTANT

This application is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Mailgun, or any of its subsidiaries or its affiliates. The official Mailgun website can be found at Mailgun.

This is NOT meant as a replacement for the excellent online tooling provided by Mailgun. Just simple storage, that's it.

Jack + Joe is not responsible for your use of this tool, neither for any persistence guarantees. Free comes at a price :)

Versioning

We use a simplified version numbering in the format of:

YYMM.MAJOR.MINOR

Where minor version bumps are consider to be hotfixes or small patches, major are bigger changes. For example:

2202.3.1 -> 2022, Februari, third major release, hotfix number 1.

Every month the major and minor versions are reset to zero, but start with one:

2202.4.0
2202.4.1
2202.5.0
2203.1.0
2203.2.0
2203.3.0
2203.3.1
2203.3.2
2203.4.0
2204.1.0
...

Installation

MailgunLogger is available as a Docker image at Docker.

Variables

Following variables are available:

[Required]

  • ML_DB_USER: database user
  • ML_DB_PASSWORD: database password
  • ML_DB_NAME: database name
  • ML_DB_HOST: database host

[Optional]

  • ML_PAGESIZE: events per page
  • ML_LOG_LEVEL: log level (info, debug, warn, ...)
  • MAILGUN_API_KEY: to send the password reset email
  • MAILGUN_DOMAIN: to send the password reset email
  • MAILGUN_FROM: to send the password reset email
  • MAILGUN_REPLY_TO: to send the password reset email

Docker

$ docker run -d -p 5050:5050 \
  -e "ML_DB_USER=username" \
  -e "ML_DB_PASSWORD=password" \
  -e "ML_DB_NAME=mailgun_logger" \
  -e "ML_DB_HOST=my_db_host" \
  --name mailgun_logger jackjoe/mailgun_logger

Docker Compose

With the following docker-compose.yml:

version: "3"

services:
  db:
    image: mysql
    networks:
      - webnet
    environment:
      - MYSQL_PASSWORD=logger
      - MYSQL_USER=logger
      - MYSQL_DATABASE=mailgun_logger
      - MYSQL_RANDOM_ROOT_PASSWORD=yes
    volumes:
      - db_data:/var/lib/mysql

  web:
    image: jackjoe/mailgun_logger
    depends_on:
      - db
    entrypoint: ["./wait-for", "db:3306", "--", "./start.sh"]
    ports:
      - "5050:5050"
    networks:
      - webnet
    environment:
      - ML_DB_USER=logger
      - ML_DB_PASSWORD=logger
      - ML_DB_NAME=mailgun_logger
      - ML_DB_HOST=db

networks:
  webnet:
    external: false

volumes:
  db_data: {}

Run:

$ docker-compose up

Then head over to http://0.0.0.0:5050.

Contributing

To run on your local machine, you need to setup shop first. Mailgun Logger requires a MySQL database using the following environment variables along with their defaults:

# config/config.ex
config :mailgun_logger, MailgunLogger.Repo,
  username: System.get_env("ML_DB_USER", "mailgun_logger_ci"),
  password: System.get_env("ML_DB_PASSWORD", "johndoe"),
  database: System.get_env("ML_DB_NAME", "mailgun_logger_ci_test"),
  hostname: System.get_env("ML_DB_HOST", "localhost"),

Either export your own enviroment variables or adhere to the defaults. Then, for convenience, run:

# runs mix local.hex, deps.get, compile; install dev certificates, make run (see below)
$ make install

which will install all dependencies and setup local dev https certificates using phx.cert.

Then you can run the project:

# runs `iex -S mix phx.server`
$ make run

All of the make targets are convenience wrappers around mix, feel free to run your own. If you are using your own environment variables, consider gathering them in an .env file and source that prior to running the make command:

# non POSIX uses `source` instead of `.`
$ . .env && make run

Then head over to https://0.0.0.0:7000.

TODO

  • test coverage
  • provide generic logging agent? (no papertrail)

License

This software is licensed under the MIT license.

About Jack + Joe

MailgunLogger is our very first open source project, and we are excited to get it out! We love open source and contributed to various tools over the years, and now we have our own! We use it ourselves as well.

Our announcement article.

Get to know our projects, get in touch. jackjoe.be

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].