mirror of
https://github.com/deStrO/eBot-docker.git
synced 2025-12-10 03:22:49 +01:00
Initial version
This commit is contained in:
commit
5060c85fd8
27
.README
Normal file
27
.README
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# eBot Docker
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
It is a containerized version of eBot, which is a full managed server-bot written in PHP and nodeJS. eBot features easy match creation and tons of player and matchstats. Once it's setup, using the eBot is simple and fast.
|
||||||
|
|
||||||
|
## How to run it
|
||||||
|
You should download the repository content, place it in a folder, and then execute the following commands in the specified order:
|
||||||
|
```
|
||||||
|
docker-compose build
|
||||||
|
docker-compose up
|
||||||
|
```
|
||||||
|
|
||||||
|
## What needs to be changed
|
||||||
|
To ensure everything works correctly, you must configure the external addresses for the web and socket services.
|
||||||
|
|
||||||
|
### Web
|
||||||
|
To configure the web service, navigate to etc/eBotWeb and update the ebot_ip property with your external address.
|
||||||
|
|
||||||
|
## Socket
|
||||||
|
To configure the socket service, go to etc/eBotSocket and update the LOG_ADDRESS_SERVER property with your external address.
|
||||||
|
|
||||||
|
## Security
|
||||||
|
To improve security, you should set the web socket secret key in two specific configuration files:
|
||||||
|
|
||||||
|
For the web service, go the etc/eBotWeb directory and open the app_user.yml file. Inside this file, locate the WEBSOCKET_SECRET_KEY parameter and replace its value with a strong and unique secret key
|
||||||
|
|
||||||
|
For the socket service, navigate to the etc/eBotSocket directory and open the config.ini file. Within this file, find the websocket_secret_key property and update its value with the same key used for the web service.
|
||||||
60
docker-compose.yml
Normal file
60
docker-compose.yml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
ebotweb:
|
||||||
|
build:
|
||||||
|
context: ./ebotweb
|
||||||
|
volumes:
|
||||||
|
- "eBotWebVolume:/app/eBot-CSGO-Web"
|
||||||
|
- "./etc/eBotWeb/app_user.yml:/app/eBot-CSGO-Web/config/app_user.yml"
|
||||||
|
- "./etc/eBotWeb/databases.yml:/app/eBot-CSGO-Web/config/databases.yml"
|
||||||
|
depends_on:
|
||||||
|
- mysqldb
|
||||||
|
ebotsocket:
|
||||||
|
build:
|
||||||
|
context: ./ebotsocket
|
||||||
|
ports:
|
||||||
|
- "12360:12360"
|
||||||
|
volumes:
|
||||||
|
- "./etc/eBotSocket/config.ini:/app/eBot-CSGO/config/config.ini"
|
||||||
|
depends_on:
|
||||||
|
- mysqldb
|
||||||
|
- ebotweb
|
||||||
|
- redis
|
||||||
|
ebotlogreceiver:
|
||||||
|
build:
|
||||||
|
context: ./ebotlogreceiver
|
||||||
|
ports:
|
||||||
|
- "12345:12345"
|
||||||
|
volumes:
|
||||||
|
- "./etc/eBotLogReceiver/config.json:/app/ebot-project/configs/config.json"
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
mysqldb:
|
||||||
|
image: biarms/mysql:5.7
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- MYSQL_DATABASE=ebotv3
|
||||||
|
- MYSQL_ROOT_PASSWORD=7w£6GfV0z92
|
||||||
|
- MYSQL_USER=ebotv3
|
||||||
|
- MYSQL_PASSWORD=7w£6GfV0z92
|
||||||
|
volumes:
|
||||||
|
- "./data/db/mysql:/var/lib/mysql"
|
||||||
|
redis:
|
||||||
|
image: redis:alpine
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./data/redis:/data
|
||||||
|
nginx:
|
||||||
|
image: nginx:alpine
|
||||||
|
volumes:
|
||||||
|
- "./etc/nginx/default.conf:/etc/nginx/conf.d/default.conf"
|
||||||
|
- "eBotWebVolume:/app/eBot-CSGO-Web"
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
- ebotweb
|
||||||
|
- mysqldb
|
||||||
|
volumes:
|
||||||
|
eBotWebVolume:
|
||||||
15
ebotlogreceiver/Dockerfile
Normal file
15
ebotlogreceiver/Dockerfile
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
FROM node:18
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --force-yes git && apt-get clean
|
||||||
|
|
||||||
|
RUN npm install -g typescript ts-node
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN git clone https://github.com/deStrO/ebot-project.git
|
||||||
|
|
||||||
|
WORKDIR /app/ebot-project
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
CMD ["ts-node", "src/logs-receiver", "./configs/config.json"]
|
||||||
9
ebotsocket/Dockerfile
Normal file
9
ebotsocket/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
FROM creativeprojects/php-nodejs:7.4
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY ./setup.sh .
|
||||||
|
|
||||||
|
RUN chmod +x setup.sh
|
||||||
|
|
||||||
|
CMD ["./setup.sh"]
|
||||||
29
ebotsocket/setup.sh
Normal file
29
ebotsocket/setup.sh
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Check if the .installed file exists
|
||||||
|
if [ ! -f .installed ]; then
|
||||||
|
|
||||||
|
git clone https://github.com/deStrO/eBot-CSGO.git temp
|
||||||
|
|
||||||
|
cp -n -R temp/* eBot-CSGO && rm -rf temp
|
||||||
|
|
||||||
|
cd eBot-CSGO
|
||||||
|
|
||||||
|
npm install
|
||||||
|
|
||||||
|
composer install
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
touch .installed
|
||||||
|
|
||||||
|
cd eBot-CSGO
|
||||||
|
|
||||||
|
sleep 120
|
||||||
|
|
||||||
|
php bootstrap.php
|
||||||
|
else
|
||||||
|
echo "eBot Socket is already installed. Skipping setup."
|
||||||
|
cd eBot-CSGO
|
||||||
|
php bootstrap.php
|
||||||
|
fi
|
||||||
17
ebotweb/Dockerfile
Normal file
17
ebotweb/Dockerfile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
FROM php:5.6.20-fpm
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN docker-php-ext-install mysqli pdo pdo_mysql && docker-php-ext-enable pdo_mysql
|
||||||
|
|
||||||
|
RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --force-yes git && apt-get clean
|
||||||
|
|
||||||
|
RUN echo 'date.timezone = Europe/Paris' >> /usr/local/etc/php/conf.d/timezone.ini
|
||||||
|
|
||||||
|
COPY setup.sh .
|
||||||
|
|
||||||
|
RUN chmod +x setup.sh
|
||||||
|
|
||||||
|
CMD ["./setup.sh"]
|
||||||
32
ebotweb/setup.sh
Normal file
32
ebotweb/setup.sh
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Check if the .installed file exists
|
||||||
|
if [ ! -f .installed ]; then
|
||||||
|
|
||||||
|
git config --global http.sslverify false
|
||||||
|
|
||||||
|
git clone https://github.com/deStrO/eBot-CSGO-Web.git temp
|
||||||
|
|
||||||
|
cp -n -R temp/* eBot-CSGO-Web && rm -rf temp
|
||||||
|
|
||||||
|
cd eBot-CSGO-Web
|
||||||
|
|
||||||
|
sleep 30
|
||||||
|
|
||||||
|
php symfony cc
|
||||||
|
|
||||||
|
php symfony doctrine:build --all --no-confirmation
|
||||||
|
|
||||||
|
php symfony guard:create-user --is-super-admin admin@ebot admin admin
|
||||||
|
|
||||||
|
rm -rf web/installation
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
touch .installed
|
||||||
|
|
||||||
|
php-fpm
|
||||||
|
else
|
||||||
|
echo "eBot Web is already installed. Skipping setup."
|
||||||
|
php-fpm
|
||||||
|
fi
|
||||||
45
etc/eBotLogReceiver/config.json
Normal file
45
etc/eBotLogReceiver/config.json
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"logger": {
|
||||||
|
"name": "Logs #1",
|
||||||
|
"level": "debug"
|
||||||
|
},
|
||||||
|
"udp": {
|
||||||
|
"enabled": true,
|
||||||
|
"ip": "0.0.0.0",
|
||||||
|
"port": 12345
|
||||||
|
},
|
||||||
|
"http": {
|
||||||
|
"enabled": true,
|
||||||
|
"ip": "0.0.0.0",
|
||||||
|
"port": 12345
|
||||||
|
},
|
||||||
|
"queues": [
|
||||||
|
{
|
||||||
|
"type": "redis",
|
||||||
|
"config": {
|
||||||
|
"mode": "channel",
|
||||||
|
"channelName" : "ebot-logs",
|
||||||
|
"connection": {
|
||||||
|
"url": "redis://redis:6379"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
{
|
||||||
|
"path": "src/logs-receiver/plugins/logger.ts",
|
||||||
|
"config": {
|
||||||
|
"path": "logs",
|
||||||
|
"split": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src/logs-receiver/plugins/mapper.ts",
|
||||||
|
"config": {
|
||||||
|
"mapping": {
|
||||||
|
"127.0.0.1:27015": "192.168.0.1:27015"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
60
etc/eBotSocket/config.ini
Normal file
60
etc/eBotSocket/config.ini
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
; eBot - A bot for match management for CS:GO
|
||||||
|
; @license http://creativecommons.org/licenses/by/3.0/ Creative Commons 3.0
|
||||||
|
; @author Julien Pardons <julien.pardons@esport-tools.net>
|
||||||
|
; @version 3.0
|
||||||
|
; @date 21/10/2012
|
||||||
|
|
||||||
|
[BDD]
|
||||||
|
MYSQL_IP = "mysqldb"
|
||||||
|
MYSQL_PORT = "3306"
|
||||||
|
MYSQL_USER = "ebotv3"
|
||||||
|
MYSQL_PASS = "7w£6GfV0z92"
|
||||||
|
MYSQL_BASE = "ebotv3"
|
||||||
|
|
||||||
|
[Config]
|
||||||
|
BOT_IP = "0.0.0.0" ; leave it as is (Docker)
|
||||||
|
BOT_PORT = 12360
|
||||||
|
SSL_ENABLED = false
|
||||||
|
SSL_CERTIFICATE_PATH = "ssl/cert.pem"
|
||||||
|
SSL_KEY_PATH = "ssl/key.pem"
|
||||||
|
EXTERNAL_LOG_IP = "" ; use this in case your server isn't binded with the external IP (behind a NAT)
|
||||||
|
MANAGE_PLAYER = 1
|
||||||
|
DELAY_BUSY_SERVER = 120
|
||||||
|
NB_MAX_MATCHS = 0
|
||||||
|
PAUSE_METHOD = "nextRound" ; nextRound or instantConfirm or instantNoConfirm
|
||||||
|
NODE_STARTUP_METHOD = "node" ; binary file name or none in case you are starting it with forever or manually
|
||||||
|
LOG_ADDRESS_SERVER = "http://127.0.0.1:12345" ; change the address to your extenral one
|
||||||
|
WEBSOCKET_SECRET_KEY = "helloworld"
|
||||||
|
|
||||||
|
[Redis]
|
||||||
|
REDIS_HOST = "redis"
|
||||||
|
REDIS_PORT = 6379
|
||||||
|
REDIS_AUTH_USERNAME =
|
||||||
|
REDIS_AUTH_PASSWORD =
|
||||||
|
REDIS_CHANNEL_LOG = "ebot-logs"
|
||||||
|
REDIS_CHANNEL_EBOT_FROM_WS = "ebot-from-ws"
|
||||||
|
REDIS_CHANNEL_EBOT_TO_WS = "ebot-to-ws"
|
||||||
|
|
||||||
|
[Match]
|
||||||
|
LO3_METHOD = "restart" ; restart or csay or esl
|
||||||
|
KO3_METHOD = "restart" ; restart or csay or esl
|
||||||
|
DEMO_DOWNLOAD = true ; true or false :: whether gotv demos will be downloaded from the gameserver after matchend or not
|
||||||
|
REMIND_RECORD = false ; true will print the 3x "Remember to record your own POV demos if needed!" messages, false will not
|
||||||
|
DAMAGE_REPORT = true ; true will print damage reports at end of round to players, false will not
|
||||||
|
USE_DELAY_END_RECORD = false ; use the tv_delay to record postpone the tv_stoprecord & upload
|
||||||
|
|
||||||
|
[MAPS]
|
||||||
|
MAP[] = "de_dust2"
|
||||||
|
MAP[] = "de_inferno"
|
||||||
|
MAP[] = "de_overpass"
|
||||||
|
MAP[] = "de_nuke"
|
||||||
|
MAP[] = "de_vertigo"
|
||||||
|
MAP[] = "de_ancient"
|
||||||
|
MAP[] = "de_anubis"
|
||||||
|
|
||||||
|
[WORKSHOP IDs]
|
||||||
|
|
||||||
|
[Settings]
|
||||||
|
COMMAND_STOP_DISABLED = true
|
||||||
|
RECORD_METHOD = "matchstart" ; matchstart or knifestart
|
||||||
|
DELAY_READY = true
|
||||||
36
etc/eBotWeb/app_user.yml
Normal file
36
etc/eBotWeb/app_user.yml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# white space are VERY important, don't remove it or it will not work
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
log_match: ../../ebot-csgo/logs/log_match
|
||||||
|
log_match_admin: ../../ebot-csgo/logs/log_match_admin
|
||||||
|
demo_path: ../../ebot-csgo/demos
|
||||||
|
|
||||||
|
default_max_round: 15
|
||||||
|
default_rules: rules
|
||||||
|
default_overtime_max_round: 3
|
||||||
|
default_overtime_startmoney: 16000
|
||||||
|
|
||||||
|
# true or false, whether demos will be downloaded by the ebot server
|
||||||
|
# the demos can be downloaded at the matchpage, if it's true
|
||||||
|
|
||||||
|
demo_download: true
|
||||||
|
|
||||||
|
ebot_ip: 127.0.0.1 # Change to your external IP
|
||||||
|
ebot_port: 12360
|
||||||
|
|
||||||
|
# lan or net, it's to display the server IP or the GO TV IP
|
||||||
|
# net mode display only started match on home page
|
||||||
|
mode: net
|
||||||
|
|
||||||
|
# set to 0 if you don't want a refresh
|
||||||
|
refresh_time: 30
|
||||||
|
|
||||||
|
# Toornament Configuration
|
||||||
|
toornament_id:
|
||||||
|
toornament_secret:
|
||||||
|
toornament_api_key:
|
||||||
|
toornament_plugin_key: test-123457890
|
||||||
|
|
||||||
|
# Same as eBot config
|
||||||
|
websocket_secret_key: helloworld
|
||||||
10
etc/eBotWeb/databases.yml
Normal file
10
etc/eBotWeb/databases.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# You can find more information about this file on the symfony website:
|
||||||
|
# http://www.symfony-project.org/reference/1_4/en/07-Databases
|
||||||
|
|
||||||
|
all:
|
||||||
|
doctrine:
|
||||||
|
class: sfDoctrineDatabase
|
||||||
|
param:
|
||||||
|
dsn: mysql:host=mysqldb;dbname=ebotv3
|
||||||
|
username: ebotv3
|
||||||
|
password: 7w£6GfV0z92
|
||||||
34
etc/nginx/default.conf
Normal file
34
etc/nginx/default.conf
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
server {
|
||||||
|
listen 80 ;
|
||||||
|
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
root /app/eBot-CSGO-Web/web;
|
||||||
|
|
||||||
|
location ~ .php($|/) {
|
||||||
|
set $script $uri;
|
||||||
|
set $path_info "";
|
||||||
|
|
||||||
|
if ($uri ~ "^(.+.php)(/.+)") {
|
||||||
|
|
||||||
|
set $script $1;
|
||||||
|
set $path_info $2;
|
||||||
|
}
|
||||||
|
fastcgi_split_path_info ^(.+.php)(/.+)$;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
|
||||||
|
fastcgi_param HTTPS off;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
||||||
|
fastcgi_pass eBotWeb:9000;
|
||||||
|
fastcgi_read_timeout 120;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
index index.php;
|
||||||
|
try_files $uri /index.php?$args;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_log /var/log/nginx/project_error.log;
|
||||||
|
access_log /var/log/nginx/project_access.log;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user