Added support for Windows
This commit is contained in:
3
Backup Databases.cmd
Normal file
3
Backup Databases.cmd
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
@echo off
|
||||||
|
Windows\make backup-windows
|
||||||
5
Delete Local Repositories.cmd
Normal file
5
Delete Local Repositories.cmd
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
@echo off
|
||||||
|
Windows\make flush-windows
|
||||||
|
cls
|
||||||
|
echo Local repositories have been deleted.
|
||||||
29
First time setup.cmd
Normal file
29
First time setup.cmd
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
@echo off
|
||||||
|
cls
|
||||||
|
docker login
|
||||||
|
cls
|
||||||
|
echo Attempting to stop any running Docker containers.
|
||||||
|
echo:
|
||||||
|
Windows\make stop
|
||||||
|
cls
|
||||||
|
echo Starting Docker containers and downloading what is needed. This may take a while the first time.
|
||||||
|
echo:
|
||||||
|
Windows\make start
|
||||||
|
|
||||||
|
cls
|
||||||
|
echo Downloading a copy of the Open-RSC-Website repository
|
||||||
|
echo:
|
||||||
|
Windows\make clone-windows-website
|
||||||
|
cls
|
||||||
|
echo Downloading a copy of the Open-RSC-Game repository
|
||||||
|
echo:
|
||||||
|
Windows\make clone-windows-game
|
||||||
|
cls
|
||||||
|
echo Waiting for 5 seconds to give the MySQL server time to start before importing the databases.
|
||||||
|
echo:
|
||||||
|
timeout 5
|
||||||
|
Windows\make import-windows
|
||||||
|
|
||||||
|
cls
|
||||||
|
echo First time setup is now complete. Visit http://localhost in your browser to verify.
|
||||||
31
Makefile
31
Makefile
@@ -36,30 +36,57 @@ restart: init
|
|||||||
clone:
|
clone:
|
||||||
@$(shell cd Website && git clone https://github.com/Marwolf/Open-RSC-Website.git)
|
@$(shell cd Website && git clone https://github.com/Marwolf/Open-RSC-Website.git)
|
||||||
@$(shell mkdir Game && cd Game && git clone https://github.com/Marwolf/Open-RSC-Game.git)
|
@$(shell mkdir Game && cd Game && git clone https://github.com/Marwolf/Open-RSC-Game.git)
|
||||||
@$(shell sudo chmod -R 777 Website/Open-RSC-Website && sudo chmod -R 777 Game/Open-RSC-Game && sudo chmod 644 Website/Open-RSC-Website/board/config.php)
|
#@$(shell sudo chmod -R 777 Website/Open-RSC-Website && sudo chmod -R 777 Game/Open-RSC-Game && sudo chmod 644 Website/Open-RSC-Website/board/config.php)
|
||||||
|
|
||||||
|
clone-windows-website:
|
||||||
|
@git clone https://github.com/Marwolf/Open-RSC-Website.git Website/Open-RSC-Website
|
||||||
|
#icacls Website/Open-RSC-Website /grant Everyone:F /t
|
||||||
|
|
||||||
|
clone-windows-game:
|
||||||
|
@git clone https://github.com/Marwolf/Open-RSC-Game.git Game/Open-RSC-Game
|
||||||
|
#icacls Game/Open-RSC-Game /grant Everyone:F /t
|
||||||
|
|
||||||
pull:
|
pull:
|
||||||
@$(shell cd Website/Open-RSC-Website && git pull)
|
@$(shell cd Website/Open-RSC-Website && git pull)
|
||||||
@$(shell cd Game/Open-RSC-Game && git pull)
|
@$(shell cd Game/Open-RSC-Game && git pull)
|
||||||
|
|
||||||
|
pull-windows:
|
||||||
|
@cd Website/Open-RSC-Website && git pull
|
||||||
|
@cd Game/Open-RSC-Game && git pull
|
||||||
|
|
||||||
logs:
|
logs:
|
||||||
@docker-compose logs -f
|
@docker-compose logs -f
|
||||||
|
|
||||||
backup:
|
backup:
|
||||||
@mkdir -p $(MYSQL_DUMPS_DIR)
|
@mkdir -p $(MYSQL_DUMPS_DIR)
|
||||||
@docker exec $(shell docker-compose ps -q mysqldb) mysqldump --all-databases -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" > Website/$(MYSQL_DUMPS_DIR)/db.sql 2>/dev/null
|
@docker exec $(shell docker-compose ps -q mysqldb) mysqldump --all-databases -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" > Website/$(MYSQL_DUMPS_DIR)/db.sql 2>/dev/null
|
||||||
@make resetOwner
|
|
||||||
|
backup-windows:
|
||||||
|
@docker exec -i mysql mysqldump --all-databases -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" > Website/$(MYSQL_DUMPS_DIR)/db.sql
|
||||||
|
|
||||||
restore:
|
restore:
|
||||||
@docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Website/$(MYSQL_DUMPS_DIR)/db.sql 2>/dev/null
|
@docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Website/$(MYSQL_DUMPS_DIR)/db.sql 2>/dev/null
|
||||||
|
|
||||||
|
restore-windows:
|
||||||
|
@docker exec -i mysql mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Website/$(MYSQL_DUMPS_DIR)/db.sql
|
||||||
|
|
||||||
import:
|
import:
|
||||||
@docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Open-RSC-Game/Databases/openrsc_config.sql 2>/dev/null
|
@docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Open-RSC-Game/Databases/openrsc_config.sql 2>/dev/null
|
||||||
@docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Open-RSC-Game/Databases/openrsc_logs.sql 2>/dev/null
|
@docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Open-RSC-Game/Databases/openrsc_logs.sql 2>/dev/null
|
||||||
@docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Open-RSC-Game/Databases/openrsc.sql 2>/dev/null
|
@docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Open-RSC-Game/Databases/openrsc.sql 2>/dev/null
|
||||||
@docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Website/Open-RSC-Website/openrsc_forum.sql 2>/dev/null
|
@docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Website/Open-RSC-Website/openrsc_forum.sql 2>/dev/null
|
||||||
|
|
||||||
|
import-windows:
|
||||||
|
@docker exec -i mysql mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Website/Open-RSC-Website/openrsc_forum.sql
|
||||||
|
@docker exec -i mysql mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Open-RSC-Game/Databases/openrsc_logs.sql
|
||||||
|
@docker exec -i mysql mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Open-RSC-Game/Databases/openrsc_config.sql
|
||||||
|
@docker exec -i mysql mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Open-RSC-Game/Databases/openrsc.sql
|
||||||
|
|
||||||
flush:
|
flush:
|
||||||
@$(shell rm -rf Website/Open-RSC-Website && rm -rf Game/Open-RSC-Game)
|
@$(shell rm -rf Website/Open-RSC-Website && rm -rf Game/Open-RSC-Game)
|
||||||
|
|
||||||
|
flush-windows:
|
||||||
|
@rmdir "Website/Open-RSC-Website" /s /Q
|
||||||
|
@rmdir "Game/Open-RSC-Game" /s /Q
|
||||||
|
|
||||||
.PHONY: clean test code-sniff init
|
.PHONY: clean test code-sniff init
|
||||||
|
|||||||
6
Pull Repository Updates.cmd
Normal file
6
Pull Repository Updates.cmd
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
@echo off
|
||||||
|
cls
|
||||||
|
echo Attempting to pull the latest repository updates.
|
||||||
|
echo:
|
||||||
|
Windows\make pull-windows
|
||||||
84
README.md
84
README.md
@@ -10,25 +10,12 @@ ___
|
|||||||
|
|
||||||
## Install prerequisites
|
## Install prerequisites
|
||||||
|
|
||||||
This project has been created for `(Linux/MacOS)`.
|
This project has been created for `(Windows, Linux, and OS X)`.
|
||||||
|
|
||||||
Requisites:
|
Requisites:
|
||||||
|
|
||||||
* [Git](https://git-scm.com/downloads)
|
* [Git](https://git-scm.com/downloads)
|
||||||
* [Docker](https://docs.docker.com/engine/installation/)
|
* [Docker](https://docs.docker.com/engine/installation/)
|
||||||
* [Docker Compose](https://docs.docker.com/compose/install/)
|
|
||||||
|
|
||||||
Check if `docker-compose` is already installed by entering the following command:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
which docker-compose
|
|
||||||
```
|
|
||||||
|
|
||||||
On Ubuntu and Debian these are available in the meta-package build-essential. On other distributions, you may need to install the GNU C++ compiler separately.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
sudo apt install build-essential
|
|
||||||
```
|
|
||||||
|
|
||||||
This project uses the following ports:
|
This project uses the following ports:
|
||||||
|
|
||||||
@@ -54,6 +41,13 @@ Go to the project directory:
|
|||||||
cd Open-RSC-Docker
|
cd Open-RSC-Docker
|
||||||
```
|
```
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## Important!
|
||||||
|
|
||||||
|
If you are using Windows, open Docker and make your drives available to your Docker containers:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
@@ -62,7 +56,11 @@ ___
|
|||||||
1. Perform first time setup and start the Docker application:
|
1. Perform first time setup and start the Docker application:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./first-time-setup.sh
|
OS X/Linux: ./first-time-setup.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
Windows: "First time setup.cmd"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Please wait this might take a several minutes...**
|
**Please wait this might take a several minutes...**
|
||||||
@@ -75,39 +73,73 @@ ___
|
|||||||
3. Backup your databases:
|
3. Backup your databases:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./backup-database.sh
|
OS X/Linux: ./backup-database.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
Windows: "Backup Databases.cmd"
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Restore your databases:
|
4. Restore your databases:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./restore-database.sh
|
OS X/Linux: ./restore-database.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Get help:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo make help
|
Windows: "Restore Databases.cmd"
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Stop the application:
|
5. Stop the application:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./stop.sh
|
OS X/Linux: ./stop.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
7. Start the application:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./start.sh
|
Windows: "Stop Containers.cmd"
|
||||||
```
|
```
|
||||||
|
|
||||||
8. Restart the application:
|
6. Start the application:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
OS X/Linux: ./start.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
Windows: "Start Containers.cmd"
|
||||||
|
```
|
||||||
|
|
||||||
|
7. Restart the application:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./restart.sh
|
./restart.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
Windows: "Restart Containers.cmd"
|
||||||
|
```
|
||||||
|
|
||||||
|
8. View container logs:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./view-logs.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
Windows: "View Container Logs.cmd"
|
||||||
|
```
|
||||||
|
|
||||||
|
9. Pull repository updates:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./pull-updates.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
Windows: "Pull Repository Updates.cmd"
|
||||||
|
```
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
## Additional commands for troubleshooting use
|
## Additional commands for troubleshooting use
|
||||||
|
|||||||
3
Restart Containers.cmd
Normal file
3
Restart Containers.cmd
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
@echo off
|
||||||
|
Windows\make restart
|
||||||
3
Restore Databases.cmd
Normal file
3
Restore Databases.cmd
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
@echo off
|
||||||
|
Windows\make restore-windows
|
||||||
4
Start Containers.cmd
Normal file
4
Start Containers.cmd
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
@echo off
|
||||||
|
Windows\make start
|
||||||
|
|
||||||
3
Stop Containers.cmd
Normal file
3
Stop Containers.cmd
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
@echo off
|
||||||
|
Windows\make stop
|
||||||
3
View Container Logs.cmd
Normal file
3
View Container Logs.cmd
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
@echo off
|
||||||
|
Windows\make logs
|
||||||
BIN
Windows/libgcc_s_dw2-1.dll
Normal file
BIN
Windows/libgcc_s_dw2-1.dll
Normal file
Binary file not shown.
BIN
Windows/libiconv-2.dll
Normal file
BIN
Windows/libiconv-2.dll
Normal file
Binary file not shown.
BIN
Windows/libintl-8.dll
Normal file
BIN
Windows/libintl-8.dll
Normal file
Binary file not shown.
BIN
Windows/make.exe
Normal file
BIN
Windows/make.exe
Normal file
Binary file not shown.
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
docker login
|
||||||
sudo make stop
|
sudo make stop
|
||||||
sudo make start
|
sudo make start
|
||||||
sudo make clone
|
sudo make clone
|
||||||
|
|||||||
3
pull-updates.sh
Normal file
3
pull-updates.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
sudo make pull
|
||||||
Reference in New Issue
Block a user