Code Monkey home page Code Monkey logo

beammp-admin's Introduction

BeamMP admin

Web interface for BeamMP server

.github/workflows/main.yml

Now complete with log rotate, saving users from rotated logs to database, uploading and deleting mods, config switching and much more! Feature flipping comming soon.

Screenshot

Screenshot

Screenshot

Screenshot

Screenshot

Installation

Requirements

You need one or two linux server / VPS / Raspberrypi (Debian 10+, Ubuntu 18+, Raspbian)

You can also deploy this admin app on Vercel.

You need nodejs version 12 or greater.

Install BeamMP server on a linux server

You can find the procedure here.

The recommended way if you have an ubuntu server is to download the latest binary for ubuntu on BeamMP-Server GitHub release page

You must set it up in a beammp-server folder at the root of the folder of the user which will launch BeamMP server.

Install the admin app on the same server or another linux server

  • Clone this repository:
git clone https://github.com/levg34/beammp-admin.git
  • Install node libraries:
cd beammp-admin
npm install
  • Build the project
npm run build
  • Create your config:

Create a .env.local file in beammp-admin folder root with the following content:

HOST=193.201.31.49                       # replace with your beamMP server IP adress
USERNAME=youruser                        # replace with the username which runs BeamMP server on your remote server
PRIVATE_KEY=/home/localuser/.ssh/id_rsa  # replace with the path to your private key

If you want to change from the default locale (en-uk), add this like in your .env.local file:

NEXT_PUBLIC_LOCALE=fr                    # replace with your locale
  • Add your key to authorized ssh keys

Copy the public key from where you run this server to the remote server (where you run beammp server) in ~/.ssh/authorized_keys

cat /home/localuser/.ssh/id_rsa.pub | ssh youruser@beammpserver: -T "cat >> ~/.ssh/authorized_keys"
  • Create a directory for log rotation (feature flipping comming soon)
mkdir ~/logs
  • Start the server
npm start

⚠️ To run the server in the background indefinitely, run this command instead:

nohup npx next start &

Advanced use

Supabase (feature flipping comming soon)

If you want to use supabase to save the users between server restart, save configs, etc, you need to add the following lines in your .env.local file:

SUPABASE_URL=https://yoursupabaseurl.supabase.co  # replace with your supabase URL
SUPABASE_KEY=yoursupabasekey                      # replace with your supabase key

You need to create the following tables:

  • config: represents a ServerCOnfig.toml content, here is mine but you should be ready to adapt yours:

Table config

  • logfiles:

Table logfiles

  • users

Table user

OAuth (feature flipping comming soon)

To be able to authenticate users, you need to create an OAuth app in GitHub and/or Google, and add the following to your .env.local file:

NEXTAUTH_SECRET=createasupercomplicatedsecretlocally

GITHUB_ID=githubappid
GITHUB_SECRET=githubsecret

GOOGLE_CLIENT_ID=googleclientid
GOOGLE_CLIENT_SECRET=googleclientsecret

Then define which users can use your app by creating config/usersConfig.json based on config/usersConfig.example.json:

{
    "admins": [
        "[email protected]",
        "[email protected]"
    ]
}

⚠️ For security reasons, you need to rebuild the project after changing this file.

More

I will try to keep this readme up to date, but I add so much new features, that it may not be up to date when you read it.

License

This project is under the GNU v3 licence (see LICENSE.md file)

beammp-admin's People

Contributors

levg34 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

beammp-admin's Issues

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.