/opfw-admin

💻 A web interface to help with administrative duties at the FiveM server: Legacy Roleplay. Currently compatible with the OP-FW framework.

Primary LanguagePHPMIT LicenseMIT

OP-FW Logo

opfw-admin

100% FREE + OPEN SOURCE.

A web interface to help with administrative duties at the FiveM server: Legacy Roleplay. Written in PHP using Laravel Framework and Tailwindcss for the frontend.

See #contributing for more details on how you can help shape opfw-admin. We're always down to improve and receive feedback.

Note

It is recommended that you use Firefox, Chrome or Edge as your web browser for the best experience.

Features

  • See and search server logs.
  • See and search players.
  • Warn and ban players, also temporarily.
  • See and edit characters.
  • And many more detailed features...
  • ... open issue to request a feature.

License

Please refer to LICENSE.md for this project's license.

Contributors

This list only contains some of the most notable contributors. For the full list, refer to GitHub's contributors graph.

  • ExpDev07 (Marius) - Original creator.
  • coalaura (Laura) - Maintainer of both frontend and backend.

Pictures

Logging in

Logging in

Dashboard

Dashboard

Players

Players

Viewing player

View Player

Characters

Characters

Viewing character

View Character

Server Logs

Logs

Panel Logs

Panel Logs

Server List

Server List

Live-Map

Live-Map

New Players

New Players

Contributing

This section describes how you can help contribute.

Prerequisites

  • An OPFW-Server.
  • PHP 8.0+.
  • Composer.
  • Node (and npm).
  • MySQL/MariaDB (database).
  • Optimally nginx

Setting up project

Install php and composer:

# Add the php repository
add-apt-repository ppa:ondrej/php

# Install PHP and dependencies (should be all i think)
apt install php8.2 php8.2-cli php8.2-simplexml php8.2-dom php8.2-curl php8.2-gmp php8.2-mysql php8.2-gd php8.2-mbstring php8.2-imagick -y
apt install php8.2-fpm -y

# Install composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer

Grab yourself a copy of this repository:

$ git clone https://github.com/coalaura/opfw-admin.git

Install all the required dependencies (we use both npm and composer):

$ composer install
$ npm install

Create a new file called envs/c1/.env and copy the contents from .env.example over to it, then apply your configurations. (Replace "c1" with your cluster)

$ cp .env.example envs/c1/.env

Create a private and unique application key:

$ php artisan key:generate

Run database migrations so that we can store things (Replace "c1" with your cluster):

$ php artisan migrate --cluster=c1

Create a symbolic link at public/storage so that it points to storage/app/public:

$ php artisan storage:link

Install, configure and run the socket server from admin-panel-socket

Compile frontend assets (use "dev" for development and "prod" for production):

$ npm run dev/prod

Finally, set up nginx:

server {
    # Replace this with your domain, important is that the subdomain is the exact same as your cluster.
    # The panel uses the subdomain to determine what .env file should be used.
    server_name c1.legacy-roleplay.com;

    # Change this to point to the "public" folder inside the opfw-admin repository
    root /path/to/opfw-admin/public;

    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    # This would be the socket server's configuration.
    # If you are not running it on the standard port you will have to change it here.
    location ~ ^/(socket|socket\.io) {
        proxy_pass http://127.0.0.1:9999;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;
    }

    location ~ ^/_data {
        expires 30d;
        add_header Pragma "public";
        add_header Cache-Control "public";
    }

    # If you are not using php8.2 you need to replace "php8.2-fpm" with the correct version
    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php8.2-fpm.sock;
        fastcgi_index index.php;
        include fastcgi.conf;
    }

    # This is depending on how you are setting up ssl certificates.
    # This example would be using lets-encrypt.
    listen 443 ssl;

    ssl_certificate /etc/letsencrypt/live/c1.legacy-roleplay.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/c1.legacy-roleplay.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}