Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Latest commit

 

History

History
92 lines (76 loc) · 3.08 KB

SETUP.md

File metadata and controls

92 lines (76 loc) · 3.08 KB

Setup

Compiling

Installing Crystal https://crystal-lang.org/docs/installation/

Installing git https://gist.github.com/derhuerst/1b15ff4652a867391f03#file-linux-md

Compiling RotateSRV You may need to install either openssl-dev or libssl-dev.

$ git clone https://github.com/Yive/RotateSRV
$ cd RotateSRV
$ shards install
$ crystal build ./src/RotateSRV.cr
  • Note: If git clone https://github.com/Yive/RotateSRV errors out, try git clone git://github.com/Yive/RotateSRV

Pre-compiled builds

https://github.com/Yive/RotateSRV/releases

Usage

$ ./RotateSRV
  1. First off, execute the file once to generate it's config files.
  2. Two folders will be generated in the base directory. One being domains and the other being example-domains.
  3. example-domains will contain another folder within it which will have the required files for a domain.
  4. Create a copy of the mc.example.com folder inside of the domains folder.
  5. Edit the files in the newly made folder. Then execute the file again.

Note: example-domains gets deleted & regenerated each launch so don't keep anything in it.

It's recommended to run the command inside of tmux or screen so it doesn't close the program when you close your ssh session Tmux Tutorial Screen Tutorial

Files

.env

# API key for Cloudflare.
CLOUDFLARE-KEY=
# Zone ID for your domain at Cloudflare.
CLOUDFLARE-ZONE=
# The email for the account that has your domain on it.
CLOUDFLARE-EMAIL=

# The sub-domain/domain that your players join through. (MUST BE AN SRV RECORD)
DOMAIN-NAME=mc.example.com
# The port that your SRV record is pointing to.
PORT=25565
  • CLOUDFLARE-KEY - Your global API key from Cloudflare.
  • CLOUDFLARE-ZONE - The zone id for the base domain of that folder. IE, the zone id for example.com if your server is on mc.example.com or just example.com
  • CLOUDFLARE-EMAIL - The email address that you use to log into Cloudflare with.
  • DOMAIN-NAME - The exact domain/subdomain which is an SRV record for your players to join your server.
  • PORT - Port used within that SRV record.

domains.txt

example1.ddns.net
example2.ddns.net
  • List of domains which are not blacklisted. Domains are separated by new lines. You cannot have multiple domains on the same line.

current.txt

example.ddns.net
  • The current target of the SRV record. THIS MUST BE MANUALLY SET DURING SETUP.

File structure example

This is what your file structure should look like when ready.

Won't 100% look the same, but the concept should match no matter how many domains you have.

RotateSRV/
├── domains/
│   ├── mc.example.com/
│   │   ├── .env
│   │   ├── current.txt
│   │   ├── domains.txt
│   ├── play.example.com/
│   │   ├── .env
│   │   ├── current.txt
│   │   ├── domains.txt
└── RotateSRV