Code Monkey home page Code Monkey logo

osiris-team / autoplug-client Goto Github PK

View Code? Open in Web Editor NEW
51.0 3.0 21.0 52.45 MB

Server manager with automatic plugin- mod- server- java- self- updater, scheduled restarts, automatic backups, shared folders, and many more handy features to automate/boost your server maintenance.

Home Page: https://autoplug.one/

License: MIT License

Java 100.00%
minecraft server-wrapper updater automation update-checker maintenance administration background-service cli

autoplug-client's Introduction

AutoPlug-Client is a standalone, executable Java program that has multiple execution modes: Server-Wrapper, CLI-Tool, Background-Service. Its main purpose is to automate updating of any sofware related to servers and simplify server maintenance in general. While all server types are compatible (including Steam game servers), the majority of its features cater specifically to Minecraft, which is renowned as the world's top-selling game and boasts an exceptionally extensive modding community.

Links

What can it do?

  • Automated self, server-software, plugins, mods and JRE (Java Runtime Enviornment) updating
  • Scheduled server restarts
  • Automated, modularized backup creation
  • Fast, asynchronous, multithreaded task execution
  • Have synchronized (shared) folders
  • Web-Panel for starting, stopping restarting the server and viewing the last updating results summaries

Premium AutoPlug-Web features:

Community projects

Developers:

You can also use AutoPlug in your projects by adding it as a dependency via Maven/Gradle/Sbt/Leinigen. Some useful classes would be the AutoPlugConsole for example, which lets you execute AutoPlug commands programmatically:

AutoPlugConsole.executeCommand(".check plugins");
AutoPlugConsole.executeCommand(".check server");
// etc...

Contribute Build test

Thank you for considering to contribute, the community πŸ’™ that! Just keep these things in mind:

  • Create an issue first if you want to do big changes, so we can discuss it.
  • Remember that big changes also require you to write tests.
  • You can pick and work on any open issue. Let us know that you are working on it.
  • Avoid using and writing static methods/fields/classes to ensure minimal memory usage.

Beginners:

Bounties:

Some open issues are marked with a tag/label like this: bounty: 15€ (show the list), which means that the first person creating a pull request for fixing/closing that issue will receive the bounty (15€). Note that your code must have at least one test demonstrating that the implemented fix/feature is working. Also note that payments are only made via PayPal, so make sure that the public Github page of your profile, with which you commit the pull request, contains your PayPal email address somewhere. By commiting to an issue with the bounty tag you agree to these terms.

Details:

  • Written in Java, with JDK 8, inside of IntelliJ IDEA
  • Built with Maven, profiles: clean package to create the ./AP-TEST-SERVER/AutoPlug-Client.jar

Libraries

Note that this list may be outdated. Check the pom.xml file for our current dependencies.

  • AutoPlug-Core contains frequently used code accross all AutoPlug projects in one jar.
  • Dream-Yaml is used for handling YAML files.
  • Better-Thread enables display of 'live-tasks'.
  • For console coloring and task display Jansi and Jline is used.
  • Zip4j to unpack and handle jar/zips.
  • Server restarts are scheduled with Quartz.

autoplug-client's People

Contributors

cube707 avatar dependabot[bot] avatar gazpachoking avatar hsgamer avatar kastenklicker avatar lkkuma avatar osiris-team avatar raik176 avatar sirdank avatar sybenx avatar zackmtaylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

autoplug-client's Issues

Auto mc-server download

Automatically download latest paper.jar and run it, if there was no jar found in main directory

Add search through songodas API

Code a Java-Algorithm that returns a plugins download-url from the Songoda-Marketplace (by using their API). The plugin information provided is its name, author and version.
You can add the code here as a comment.
I'll add it to the webserver once checked.
Please use this class for making the API requests: https://github.com/Osiris-Team/AutoPlug-Core/blob/main/src/main/java/com/osiris/autoplug/core/json/JsonTools.java
(You can add AutoPlug-Core as dependency if you want)
More info on the API: https://marketplace.songoda.com/marketplace-api/api-documentation/api-v2

Premium plugins support

Add support for downloading/updating users premium plugins.

Currently, the problem is that we are using spiget for updating the plugins. Spiget does not provide functionality for updating premium plugins.

The only way of updating premium plugins, would be by simulating a browser in java (HtmlUnit), logging in with the users credentials, navigating to the premium plugins spigot page and pressing the download button.

The problem in this case is, that HtmlUnit fails to pass the cloudflare protection because of missing javascript support (#14)

To sum it up: Either wait for HtmlUnit gaining javascript support to pass cloudflare, or hope that Spigot releases their own api where its possible to get the users premium plugins

Perform plugin data collection on client directly.

Previously the plugin data was collected by our AutoPlugPlugin, which ran when the server started up, collected the data and send it over to our client.

This would delay the startup time by a lot (incase there where updates available), because the server first needs to boot up and then restart to install the updates.

By pushing the data collection over to the client (by implementing an own plugin data collector) we can skip this step and perform all tasks directly before starting the server. This results in a significantly lower startup time.

Server performance sharing

When a mc-server is at its performance limit for some time, it will request load sharing from our servers. Our servers will search for another registered mc-server that had a low load for a certain amount of time and share its performance.

Cooldown nullpointer in first run and wrong cooldown activation

[27-02-2021 19:44:46][AutoPlug][WARN] Message: null
[27-02-2021 19:44:46][AutoPlug][WARN] Details: null
[27-02-2021 19:44:46][AutoPlug][WARN] Type: java.lang.NullPointerException
[27-02-2021 19:44:46][AutoPlug][WARN] Stacktrace: 
[27-02-2021 19:44:46][AutoPlug][WARN] java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1439)
[27-02-2021 19:44:46][AutoPlug][WARN] java.text.DateFormat.parse(DateFormat.java:364)
[27-02-2021 19:44:46][AutoPlug][WARN] com.osiris.autoplug.client.utils.ConfigUtils.checkIfOutOfCoolDown(ConfigUtils.java:41)
[27-02-2021 19:44:46][AutoPlug][WARN] com.osiris.autoplug.client.BeforeStartupActions.<init>(BeforeStartupActions.java:52)
[27-02-2021 19:44:46][AutoPlug][WARN] com.osiris.autoplug.client.minecraft.Server.start(Server.java:36)
[27-02-2021 19:44:46][AutoPlug][WARN] com.osiris.autoplug.client.Main.main(Main.java:117)

IOException when losing connection!

Describe the bug
After losing connection to AutoPlug-Web this happens.

Error-Message:

[20-05-2021 19:53:40][AutoPlug][WARN] ================================
[20-05-2021 19:53:40][AutoPlug][WARN] Message: Lost connection to AutoPlug-Web! Reconnecting in 30 seconds...
[20-05-2021 19:53:40][AutoPlug][WARN] Details: null
[20-05-2021 19:53:40][AutoPlug][WARN] Type: java.io.EOFException
[20-05-2021 19:53:40][AutoPlug][WARN] Stacktrace: 
[20-05-2021 19:53:40][AutoPlug][WARN] java.base/java.io.DataInputStream.readBoolean(DataInputStream.java:248)
[20-05-2021 19:53:40][AutoPlug][WARN] com.osiris.autoplug.client.network.online.MainConnection.run(MainConnection.java:74)
[20-05-2021 19:53:40][AutoPlug][WARN] ================================
java.io.IOException: Write end dead
        at java.base/java.io.PipedInputStream.read(PipedInputStream.java:310)
        at java.base/java.io.PipedInputStream.read(PipedInputStream.java:377)
        at java.base/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:297)
        at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
        at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188)
        at java.base/java.io.InputStreamReader.read(InputStreamReader.java:181)
        at java.base/java.io.BufferedReader.fill(BufferedReader.java:161)
        at java.base/java.io.BufferedReader.readLine(BufferedReader.java:326)
        at java.base/java.io.BufferedReader.readLine(BufferedReader.java:392)
        at com.osiris.autoplug.client.utils.NonBlockingPipedInputStream.lambda$new$1(NonBlockingPipedInputStream.java:27)
        at java.base/java.lang.Thread.run(Thread.java:832)

Mods updater

Should be easy to implement, since a mods jar contains all the information we need just like plugins jars.
Example mcmod.info file:

[
{
  "modid": "jei",
  "name": "Just Enough Items",
  "description": "Simple recipe and item helper.",
  "version": "4.16.1.301",
  "mcversion": "1.12.2",
  "url": "https://github.com/mezz/JustEnoughItems",
  "updateUrl": "",
  "authorList": ["mezz"],
  "logoFile": "",
  "screenshots": [],
  "dependencies": []
}
]

[Feature Request] Update Plugins via GitHub

Would you be able to add support to updating plugins through GitHub instead of SpiGet?
Maybe with 3 options like stable, unstable and live?

(Of course fixing updating plugins is higher priority)

Plugin verification / Malicious code scanner

Problem
Plugins or executable jar files in general, kind of can do whatever they want to your system, for example deleting or encrypting your files, and get away with it, undetected by your antivirus.

Solution
Add commands which would scan folders for malicious jar files and give each of them a "safety score" from 0-100%.

.scan   | Scans the current working directory for malicious jar files. (Shortcut: .sc)
.scan <folder-path>   | Scans the provided folder for malicious jar files. Folder path can be relative or absolute. (.sc <folder-path>)
.scan plugins   | Scans the ./plugins folder for malicious jar files. (.scp)

Solution details

  1. Unpack jar file into a temp directory
  2. Decompile its .class files
  3. Check each class for specific imports like java.io
  4. If the class contains such an import, do an in-depth check of the whole class

How can a Java program harm your system? Ranked from easiest -> hardest to detect.

Description Detection
The easiest and most obvious way is by using methods/classes provided by the Java API. Decompile the jars' .class files and search for dangerous Java imports/classes/methods.
You could use Javas' ProcessBuilder to execute/abuse any kind of program installed on your machine.
You could use Javas' ProcessBuilder to execute terminal commands like rmdir <directory-path> (on Linux and if the user under which the Java program is running, has permission).
You could write code in another programming language and execute it.
You could download and inject malicious Java code at runtime.

Dangerous imports/packages provided by the Java API

  • java.io to read/delete/create/modify files
  • java.nio to read/list files and listen to file events

Note that at the moment these are notes of some brainstorming without deeper research done yet.

AutoPlug Stop with /stop

Since in many server panels the server is still shown as online when anything is running, there are some complications with AutoPlug. When the "Stop" button is executed, only the server is stopped, not AutoPlug. In short: So that AutoPlug is also restarted, the question is whether you can add the function that AutoPlug is also stopped after the server has stopped? So also with /stop?
Since you will not always need this, it would be quite good if you could switch this function on and off in the Config.

Thank you,
BLACK

Can this be self hosted? Yes!

First I would like to say this looks amazing. The web interface is so clean and responsive.
I would however prefer to self host this- is that possible and what steps would I need to take to get this done? I have Minecraft server and webserver hosted on a VPS.

AutoPlug-Launcher

Create own launcher which downloads latest versions and performs updates on AutoPlug

Global task cooldown

Customizable cooldown before executing the same task again.
Useful if there are problems starting the server and multiple restarts are needed.

JVM/JDK Auto-Updater

Auto-Updater for the JVM/JDK.

Idea: Add a jdks folder in /autoplug-system, where the jdks are saved for running the Minecraft server.

Include/Exclude specific files/folders from the backup

Is your feature request related to a problem? Please describe.
I guess the Dynmap plugins folder can get pretty big, and excluding that would make sense.
Theamazinggenko β€” heute um 18:03 Uhr
yea it is
any idea for blacklisting folders to plugin backups?

Describe the solution you'd like
Include/Exclude files/folders individually for each backup manager.

Add support for stopping proxies

Currently, AutoPlug uses the stop command to shut down the server. Since proxies use other commands, AutoPlug won't be able to stop them.
Support could be added by letting the user define the stop command in a config.

Download via spiget api

A possible fix for our current problem of downloading jars via htmlunit.
The only downside is that only jars hosted on spigot are supported. All jars hosted externally won't be downloaded.
SpiGetOrg/Spiget#27

Website is down

As the title says:

This site can’t be reachedThe web page at https://autoplug.ddns.net/ might be temporarily down or it may have moved permanently to a new web address.
ERR_TUNNEL_CONNECTION_FAILED

SSL support

Use ssl to comunicate between Server(autoplug.ddns.net) and Client.

HtmlUnit javascript error prevents plugin update downloading

We are facing some issues downloading updates for plugins.
That issue is related to a dependency AutoPlug is using and some changes spigot did to its download page.
At the moment there are multiple ways to fix our issue.

  1. Fix the core of our dependency (would take ages; for further details see this: HtmlUnit/htmlunit#201).
  2. Download jars located on spigot via spiget api (Details: #21)

Website fixes

Please make us not require a 10 digit password to register.

Additionally please add cursor: pointer to the buttons

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.