sam4413 / SELink

SELink is a powerful tool that allows Administrators easy access to their Space Engineers servers through an easy to use webpanel.
4 stars 1 forks source link

SELink Logo

SELink (Space Engineers Linker)

(Formally AMPLink)

We are currently going under a name change. Some stuff may be called AMPLink, but eventually it will all be called SELink.

SELink is a powerful tool that allows Administrators easy access to their Space Engineers servers through an easy to use webpanel.

SELink relies on a RestAPI plugin for Torch called "TorchRemote." You will need to have it installed in order to make the plugin work. https://torchapi.com/plugins/view/284017F3-9682-4841-A544-EB04DB8CB9BA

ROADMAP:

One unique thing about SELink is that you can give your users certain features. For instance, User A is registered as a Normal User, and can only:

But on the other hand, User B, which is a superuser can:

Clearly everything isnt added at the moment, but this is what I plan to add.

Installation

SELink relies on a MySQL database in order to function, and store the data nessesary for the users system. Obviously, because this is important, if the MySQL server and/or database is not found or running, SELink will throw a fatal error and not start up.

Step 1: Install XAMPP (easiest option) or WAMPServer (advanced). I will be going over how to install it using XAMPP.

Step 2: Once XAMPP is installed, start/install the Apache and MySQL services. This is how it should look: XAMPP

Step 3: Open phpMyAdmin by either navigating to http://localhost/phpmyadmin/ OR pressing "Admin" button by the MySQL section for XAMPP.

Step 4: Create the database by pressing "New" on the left hand panel. PHP1

Step 5: You may name the database anything you want, however for a more straightforward setup, just name the database "SELink". Because I already have a database named SELink, I'm using the name "SELink-server". The name won't matter. PHP2

Step 5: Copy and paste the contents of the users.sql file into the SQL tab for the database on phpMyAdmin. PHP3

Step 6: Navigate to the "Structure" tab. Ensure you see a table called "users". Inside of it, you should see a user named "root". If you see the table created, you have successfully made the Database for SELink. PHP4

Great! Now that you have created the database, you will now need to tell SELink what database should it run off of. If the database is not set correctly, the program will not start, and throw a fatal error.

Step 7: Go back to where you extracted the SELink folder and open the .env file. This is where you can configure all server-side SELink functions. Right-click it and open it with any text editor. I am using Notepad++. AMP1

Step 8: Find the config on where it says "DATABASE = SELink" If you have created a database with a different name, you will need to change the name accordingly. If your database has a "PASSWORD = ", you can fill it here. If not, leave it empty. If any other setting applies to the database, change the config accordingly there as well. Otherwise, you are good to go. AMP2

Step 9: You have successfully linked your MySQL database to SELink. However, if you boot up SELink, you will still be greated with another fatal error: this time with a 401 Unauthorized Error. This is because TorchRemote, the torch plugin which allows AMP to function needs the bearer token. To retrieve the bearer token, either navigate to the TorchRemote.cfg file, or go to "Plugins" then "TorchRemote" in your server window. After which, you can copy the "Security Token" and paste it into the "TORCHREMOTE_TOKEN = YOURTOKENHERE= " configuration string (replacing the YOUR TOKEN HERE with the TorchRemote security token from the Torch Instance.
Security Warning: Do NOT share your TorchRemote Security Token with ANYONE! If an attacker gains access to the token, they can easily remotely control your server without your knowledge! You can always go into the TorchRemote.cfg file to change said token to any other value, and is recommended to do that every 1-2 months, just as a extra precaution, especially for larger servers and communities. AMP3

Step 10: Now that you have linked up your TorchRemote token, you can now start linking up your TorchRemote API Address. This is usually set to 8080, and listener to Http.Sys. However, setting the listener to "Internal" will prevent crashes from occurring from the Torch Server. It is also recommended to change the port to something different for instance, 8000. Here is the recommended settings example: AMP4

Step 11: If your running SELink from the same box as the server, you would need to put in http://localhost:, not your box address. It is usually easier and more secure to keep AMP Running on the same box, as you don't have to port forward the API, preventing attackers from trying to attack the server. TIP: If your running SELink from a separate server box from the server, you will need to make sure that the address is set to the server's ip address+TorchRemote port. For example: http://123.456.789.0:8000 as well has having the API port forwarded. You can enter your address into the "TORCHREMOTE_ADDRESS = " Likewise, enter the same address into the "TORCHREMOTE_WEBSOCKET = " configuration string, but instead of having http:// it is ws:// AMP5

You are almost done with setting up SELink! You just need to edit a few more settings:

Step 12: Go back into the configuration file, and find the "AMP_PORT = 6689" setting. This determines what port AMP is running off of, and what port should be forwarded as well. Edit this if you want to change the port on SELink.

Step 13: Start the AMP.bat file. You should see a message saying that "[INFO] SELink started on port 6687 (or whatever port you set it to) If you don't encounter any issues, Congratulations! AMP is running.
Navigate to Your box address:the AMPPort to access it. (Make sure the SELink Port is Forwarded!) You will then be greeted by the login screen. The premade root users info is
Username: root
Password: 123
It is recommended that you go into the program and create a new username with a stronger password and username.

Compatibility

SELink can be ran from any box. For instance: SELink can run on box 123.456.789:5000 but the server is on 888.888.888:27016.

It is not recommended to run SELink if you are running it through a server host and already have a control panel to control your SE Server.
Anything using TCAdmin will cause conflicts with both panels and if your running a server and the provider already has a control panel to control your SE Server from, it's recommended to just stick with the provided panel from the provider.
This program is to allow servers that are running Space Engineers Torch on a Dedicated box, or their own server. On which they dont have their own panel.

Version 1.0 In Development

I am currently developing SELink version 1.0. Because this is a big update, development may be a bit slow. I plan on releasing it around New Years. Visit the SELink discord for more info.

Message @sam44 on discord if you have any questions.

SELink is currently in BETA, and several features don't work, or are unstable!


Main (Stable branch): SELink v0.3-beta Build
Staging (Unstable branch): SELink v0.2-beta Build