From c58c8ac2d4b06075e68f16e03d8c238d6d35f78b Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Fri, 10 Nov 2023 17:33:29 +0000 Subject: [PATCH] Update docs --- README.md | 12 +++++++----- docs/full-bf2-stack-example/README.md | 13 +++++++++++++ ...-to-3.2.md => upgrading-docker-images-to-3.3.md} | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) rename docs/{upgrading-docker-images-to-3.2.md => upgrading-docker-images-to-3.3.md} (97%) diff --git a/README.md b/README.md index 42298990..bc6a273a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The new BF2Statistics 3.0 ASP, currently in public Beta. The GameSpy server to m ## Usage (docker) ```sh -docker run --rm -it -p 80:80 -e DB_HOST=db -e DB_HOST=db -e DB_PORT=3306 -e DB_NAME=bf2stats -e DB_USER=admin -e DB_PASS=admin startersclan/asp:3.3.0 +docker run --rm -it -p 80:80 -e DB_HOST=db -e DB_PORT=3306 -e DB_NAME=bf2stats -e DB_USER=root -e DB_PASS=ascent startersclan/asp:3.2.0 ``` See [this](docs/full-bf2-stack-example) example showing how to deploy [Battlefield 2 1.5 server](https://github.com/startersclan/docker-bf2), [PRMasterserver](https://github.com/startersclan/PRMasterServer) as the master server, and `ASP` as the stats web server, using `docker-compose`. @@ -21,12 +21,12 @@ See [here](docs/upgrading-docker-images-to-3.3.md). ## Development ```sh -# 1. Start BF2 server, Gamespy server, and bf2stats ASP +# 1. Start docker-compose up --build # ASP available at http://localhost:8081/ASP. Username: admin, password admin. See ./config/ASP/config.php # phpmyadmin available at http://localhost:8083. Username: root, password: ascent. See ./config/ASP/config.php config file -# 2. Once everything has started, restart the BF2 server to ensure begin recording stats +# 2. Once everything has started, restart the BF2 server to begin recording stats docker-compose restart bf2 # 3. Before launching the BF2 client, spoof gamespy DNS by adding these entries in C:\Windows\system32\drivers\etc\hosts. This is needed for the BF2 client to work correctly. @@ -46,7 +46,7 @@ docker-compose restart bf2 # 4. Launch BF2 client and connect to the BF2 server # - To use BF2Hub as the Gamespy server, launch BF2.exe, and login to your BF2Hub account, and connect to the BF2 server using MULTIPLAYER > CONNECT TO IP # - To use PRMasterserver in docker-compose as the Gamespy server, if you have previously patched BF2.exe using the BF2Hub patcher, you must unpatch BF2.exe. Then launch BF2.exe (do not use BF2Hub), create a new Online account, login, and connect to the BF2 server using MULTIPLAYER > CONNECT TO IP. -# At the end of a round, the BF2 server will send a stats snapshot to the ASP. View stats in ASP and bf2sclone. +# At the end of a round, the BF2 server will send a stats snapshot to the ASP. View stats in ASP. # Development - Install vscode extensions # Once installed, set breakpoints in code, and press F5 to start debugging. @@ -75,6 +75,8 @@ docker exec -it $( docker-compose ps -q asp ) sh docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/backups # asp - List cache docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/cache +# asp - List config +docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/config # asp - List logs docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/logs # asp - List snapshots @@ -92,7 +94,7 @@ docker exec $( docker-compose ps -q db ) mysqldump -uroot -pascent bf2stats | gz # Restore the DB zcat bf2stats.sql.gz | docker exec -i $( docker-compose ps -q db ) mysql -uroot -pascent bf2stats -# Stop BF2 server, gamespy server and bf2stats +# Stop docker-compose down # Cleanup diff --git a/docs/full-bf2-stack-example/README.md b/docs/full-bf2-stack-example/README.md index 06e6b791..087ec353 100644 --- a/docs/full-bf2-stack-example/README.md +++ b/docs/full-bf2-stack-example/README.md @@ -186,6 +186,19 @@ docker attach asp_bf2_1 # Copy logs from bf2 server to this folder docker cp asp_bf2_1:/server/bf2/python/bf2/logs . +# asp - Exec into container +docker exec -it $( docker-compose ps -q asp ) sh +# asp - List backups +docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/backups +# asp - List cache +docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/cache +# asp - List config +docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/config +# asp - List logs +docker exec -it $( docker-compose ps -q asp ) ls -al /src/ASP/system/logs +# asp - List snapshots +docker exec -it $( docker-compose ps -q asp ) ls -alR /src/ASP/system/snapshots/ + # Dump the DB docker exec $( docker-compose ps | grep db | awk '{print $1}' ) mysqldump -uroot -pascent bf2stats | gzip > bf2stats.sql.gz diff --git a/docs/upgrading-docker-images-to-3.2.md b/docs/upgrading-docker-images-to-3.3.md similarity index 97% rename from docs/upgrading-docker-images-to-3.2.md rename to docs/upgrading-docker-images-to-3.3.md index e1df7c72..e06df6ea 100644 --- a/docs/upgrading-docker-images-to-3.2.md +++ b/docs/upgrading-docker-images-to-3.3.md @@ -1,6 +1,6 @@ # Upgrading docker images from previous versions -In <= v3.2.0, `asp` had separate `nginx` and `php` images. +In v3.1.0 and v3.2.0, `asp` had separate `nginx` and `php` images. Since v3.3.0: `asp` image containing both `nginx` and `php`, with environment variable support, and entrypoint that sets the correct permissions.