csgo-league-web
csgo-league-web copied to clipboard
League web panel
CS:GO League Web
A web application for PUG statistics.
Our support discord can be found here.
Author
B3none - Developer / Maintainer
Watch for releases
So as to keep the latest version of the plugin I recommend watching the repository
Share the love
If you appreciate the project then please take the time to star our repository.
Recommendations
The steps below are all written with the presumption that you're using Ubuntu.
Installation
Prerequisites
- Apache2
- Composer
- NPM
- ~ PHP 7
- Gulp
- Node 10 or newer.
- Zip and Unzip
- MySQL 5.7 or MariaDB 10.4
- OpenSSL
Default Install
sudo apt install apache2 composer openssl php php-mysql php-json php-simplexml mysql-server zip unzip -y
Ubuntu 18.04 Install
sudo apt install apache2 composer openssl php7.2 php7.2-mysql php7.2-json php7.2-simplexml mariadb-server zip unzip -y
Debian 10.3 Install
sudo apt install apache2 composer openssl php7.3 php7.3-mysql php7.3-json php7.3-simplexml mariadb-server zip unzip -y
Installing NodeJS 10
- Download and install NodeJS repo:
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
- Install NodeJS version 10:
sudo apt-get install nodejs
- Check installed version:
npm -v
- Check installed version:
node -v
Installing NodeJS Version Manager (https://github.com/nvm-sh/nvm)
- Download and install NodeJS repo:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
- Install NodeJS version 10:
nvm install 10.19
- Set NodeJS version to 10:
nvm use 10.19
- Check installed version:
npm -v
- Check installed version:
node -v
Installing the Web Interface
- Change directory to web default
cd /var/www/
- Remove the html directory with
rm -rf html/
- Disable the default site
sudo a2dissite 000-default.conf
. - Enable mod_rewrite
sudo a2enmod rewrite
. - Clone repo:
git clone https://github.com/csgo-league/csgo-league-web
- Change directory to repo:
cd csgo-league-web/
- Install requirements:
composer install
- Install NodeJS requirements:
npm i
- Install gulp globally:
sudo npm i -g gulp
- Build:
gulp build
Database Setup
- We need to secure our MySQL installation, to do this run the command
mysql_secure_installation
. - Follow the steps and make sure to disable remote root login and disable the default database.
Setting up our user
- Login to MYSQL with the command
mysql -u root -p
. - Now we need to make our database and a user that can connect to it.
CREATE USER 'league'@'%' IDENTIFIED BY '{password}';
CREATE DATABASE panel CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON panel.* TO 'league'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Then edit your MYSQL Conf to allow external connections to the database.
nano /etc/mysql/mysql.conf.d/mysqld.cnf
and change the bind-address
to 0.0.0.0
Now restart the MySQL service with sudo service mysql restart
Next we'll configure the web panel to use our database and communicate with the bot and game servers.
cd /var/www/csgo-league-web
cp env.example.php env.php
nano env.php
Fill out all of the fields with your information like MySQL, Servers, RCON, and Unique API Key. You can generate your API Key with the link provided in the env.php
file.
Once finished Migrate your DB with ./vendor/bin/phpmig migrate
Server
- Point the
league
CNAME at your dedicated server. -
cd /etc/apache2/sites-available
-
nano csgo-league-web.conf
- Use the following config:
<VirtualHost *:80>
ServerName league.your.domain
DocumentRoot /var/www/csgo-league-web/web
<Directory /var/www/csgo-league-web/web>
Options -Indexes
AllowOverride All
FallbackResource /index.php
</Directory>
</VirtualHost>
-
sudo a2ensite csgo-league-web.conf
Finally make sure to chown -R www-data:www-data app
in the /csgo-league-web
directory.
You should be all set!
429 (Too many requests) fix for projects with lots of website visits.
- Download
https://github.com/Rob--W/cors-anywhere
orgit clone https://github.com/Rob--W/cors-anywhere.git
- Use
screen
or alternative to run this code in background - Launch it
cd cors-anywhere
node server.js
- Edit
/var/www/csgo-league-web/assets/scripts/listeners/steam-profile.js
,
change line 14 to
axios.get(`http://{YOUR IP}:8080/https://steamcommunity.com/profiles/${steam}?xml=true`)
Don't forget to change{YOUR IP}
to IP of server. - Build web side again
cd /var/www/csgo-league-web/
gulp build
P.S.: Don't forget to clean cache of your web browser.
Debugging
- if you get
too many redirects
error try change inenv.php
'WEBSITE' => '/home'
to'WEBSITE' => ''