Code Monkey home page Code Monkey logo

ssn's Introduction

Over-engineered open-source Minecraft anarchy server โ€” made in Brasil ๐Ÿ‡ง๐Ÿ‡ทโœจ

๐Ÿ—‚ What's inside?

This monorepo uses npm as a package manager. It includes the following applications:

  • apps: web applications related to the server
  • packages: libraries shared between apps
  • plugins: first-party Minecraft plugins source code
  • servers: the Minecraft servers configuration files and plugin binaries

๐Ÿ“ฆ Dependencies

Make sure you have Node.js v20 installed with npm v8 or up. You can easily change your Node version using nvm:

$ nvm install 20
$ nvm use 20

For plugin development, you will need JDK 17 and Maven. To install them on macOS using Homebrew, run:

$ brew install openjdk@17 maven

Finally, you will also need to have Docker and Docker Compose installed. You can easily get both by installing the much recommended Docker Desktop.

โšก๏ธ Get started

First off, install the dependencies by running the following command:

$ npm install

Then, you will need to setup your environment variables. You can do this by copying the example file:

$ cp .env.example .env

Now, open your /etc/hosts file and add these lines to the end:

127.0.0.1 ssn.local id.ssn.local gk.ssn.local rcon.ssn.local cmd.ssn.local
::1       ssn.local id.ssn.local gk.ssn.local rcon.ssn.local cmd.ssn.local

You can now start all the containers by running this command:

$ npm run start

๐ŸŽ‰ You should now be able to join the Minecraft server using the IP ssn.local and open http://ssn.local in your browser.

๐Ÿงฐ Build

To build a plugin and copy the artifact to the server, you can run this command:

# npm run build:plugin-name
$ npm run build:catraca

To build (and publish) the server Docker images, run:

$ chmod +x ./scripts/build-and-publish.sh # once
$ ./scripts/build-and-publish.sh

๐Ÿš€ Deploy

For deploying in production, clone this repository to your server. Alternatively, copy only the following files to your server:

Setup the environment variables inside ".env" properly:

  • Generate random and strong passwords for the keys
  • Configure the memory allocation according to your server
  • Fill in external sevice keys (like Discord, Turnstile and SendGrid)
  • Update the volume mount points to local paths

You will need to expose the 25565 and 80 ports from your server according to your hosting provider instructions.

Then simply run:

$ chmod +x ./scripts/start.sh # once
$ ./scripts/start.sh

๐Ÿ”„ Auto restart

To enable automatic restarts, you'll need to setup a cron job to run the scripts/restart.sh script. Begin by making all scripts in the scripts directory executable:

$ find scripts -type f -iname "*.sh" -exec chmod +x {} \;

Then, get the full path to the restart script:

$ realpath ./scripts/restart.sh
# /path/to/restart.sh

Finally, you can use crontab to add your cron job as you wish. I like to run it every day, a minute before 6am (to account for the restart warning) โ€” remember to check your system time beforehand!

$ crontab -e
# if vim opens by default you can also use:
# EDITOR="nano" crontab -e
59 5 * * * /path/to/restart.sh

If you need help with cron, you can refer to crontab.guru.

๐Ÿค Contributing

First of all, thank you for your interest in making SSN better! Contributions are always welcomed. Feel free to open an issue with your suggestion or bug report, preferably in Brazilian Portuguese. Please, read our contribution guidelines before working on an issue.

๐Ÿ“ License

The SSN project is licensed under the GPLv3 License.

ssn's People

Contributors

doceazedo avatar maizenalegal avatar cherosin avatar wo231 avatar kropsk avatar al4sk4s avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.