Skip to content
This repository was archived by the owner on Feb 26, 2019. It is now read-only.

Getting Started

CornierKhan1 edited this page Aug 15, 2018 · 3 revisions

Getting Started with Mail-GO

You will find that setting up Mail-GO will be quite easy, as long as you know how to use bash/shell and Docker.

Installing Mail-GO.

Before you can pull Mail-GO into your VPS, you will need to make sure you have the correct software installed.

Prerequisites

  • Docker CE and Docker Compose

Mail-GO is designed to run in a docker container so it can easily run while you do other things on your server.

  • Git

You'll specifically need Git to allow you to easily pull the latest copy of Mail-GO.

  • Nano (Or any File Editor)
  • SendGrid Account

And that's all you need to begin setting up Mail-GO, and it can be done in 3 steps.

Step One: Pull an edition of Mail-GO.

Mail-GO is now ready to be pulled into a directory of your choice, we recommend giving Mail-GO it's own directory.

Mail-GO has two editions. The unofficially maintained edition which is almost always stable (RiiConnect24) and the default edition that is officially maintained and has full support to our abilities (Disconnect24).

Warning: Although we provide support for the RiiConnect24 version of Mail-GO, support may not be promised as modifications may have been made by RiiConnect24 that we did not intend or document fully.

To clone Mail-GO, simply "cd" into an empty directory and one of the following commands below:

  • Disconnect24 (Recommended): git clone https://github.com/Disconnect24/Mail-Go.git
  • RiiConnect24 (Specifically for RC24 use, not recommended.): git clone https://github.com/RiiConnect24/Mail-Go.git

Now that you have your Mail-GO version pulled (assuming you've selected the Disconnect24 version.), you are now ready to configure it.

Step Two: Configuring Mail-GO.

Mail-GO's source should be flexible enough to safely edit and rebuild to your heart's content. The first configuration you should look at is docker-compose.yml and then look inside the config folder.

  • The example docker-compose YAML file.
version: "3"

services:
  database:
    image: disconnect24/docker-alpine-mariadb
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: "true"
      MYSQL_USER: rc24
      MYSQL_PASSWORD: changeme
    ports:
      # Container 80 -> Host 8080
      - "3306:3306"
    volumes:
      - mail_data:/var/lib/mysql
      - ./schema/:/docker-entrypoint-initdb.d/:ro
  mail:
    build: .
    volumes:
      - ./config:/go/src/github.com/Disconnect24/Mail-Go/config
    ports:
      # Container 80 -> Host 8080
      - "8080:80"
    # We must wait for the DB to import/etc before starting ourselves.
    depends_on:
      - "database"
    restart: on-failure
volumes:
  mail_data:

To setup the docker-compose file, simply change MYSQL_PASSWORD section to a password of your choice.

After that, you'll now look at creating your config.json, simply "cd" into the config/ and cp config.json.example config.json and then sudo nano config.json.

  • The example config.json.
{
  "Port": 3306,
  "Host": "database",
  "Username": "rc24",
  "Password": "changeme",
  "DBName": "WC24Mail",
  "Interval": 10,
  "BindTo": ":80",
  "SendGridKey": "changeme",
  "SendGridDomain": "changeme.xyz",
  "Debug": true,
  "PatchBaseDomain": "http://mail.changeme.xyz"
}

You should change PatchBaseDomain, SendGridKey, SendGridDomain and Host. Set the Password to the same one as the password you defined in docker-compose.yml. All other settings are either hardcoded or optional and changing them isn't necessary.

These are the only necessary configurations you need to change for Mail-GO.

Step Three: Starting Mail-GO for the first time.

To start Mail-GO, simply go to the main directory of your installation and run one of the following commands:

sudo docker-compose up --build

If you are starting Mail-GO for the first time, you should run this command so you can watch how Mail-GO starts up. This will allow you to easily debug and diagnose errors the program may run into.

  • Rebuild tag: --build (sudo docker-compose up --build)
  • Run Detached tag: -d (sudo docker-compose up -d or sudo docker-compose up -d --build)
  • Remove Mail-Go Docker image: (sudo docker-compose down)

Remove Image is good if you want to completely rebuild Mail-GO, otherwise, using the --build tag works best.


Mail-GO should now be running and the built-in Mail Patcher can be ran by going to mail.[yourdomain].xyz.

If you can see this image, Mail-GO is working.

If you can see this on your domain, that means Mail-GO is working so congratulations!

Latest Update:

Some changes to where the docker-compose.yml and config files were made. From now on, the config.json file should be located in ./docker/config/config.json and the docker-compose file in ./docker/docker-compose.yml.

This applies to all future versions of Mail-GO unless stated otherwise.

Clone this wiki locally