From 2e9c422888d48617e3f745bfeb3e0780f5ecd76b Mon Sep 17 00:00:00 2001 From: Marwolf Date: Thu, 12 Jul 2018 14:44:26 -0400 Subject: [PATCH] Cleanup, wiki add --- .env | 8 +++---- .gitignore | 3 +++ First time setup.cmd | 9 ++++++-- Makefile | 41 +++++++++++---------------------- docker-compose.yml | 4 +++- etc/nginx/default.conf | 14 +++-------- etc/nginx/default.template.conf | 14 +++-------- 7 files changed, 36 insertions(+), 57 deletions(-) diff --git a/.env b/.env index 760f38c..ec2ca62 100644 --- a/.env +++ b/.env @@ -1,17 +1,15 @@ #!/usr/bin/env bash # See https://docs.docker.com/compose/environment-variables/#the-env-file - # Nginx NGINX_HOST=localhost # PHP - # See https://hub.docker.com/r/nanoninja/php-fpm/tags/ -PHP_VERSION=latest +PHP_VERSION=7.2 -# MySQL -MYSQL_VERSION=5.7.22 +# MariaDB +MARIADB_VERSION=10.3.8 MYSQL_HOST=mysql MYSQL_DATABASE=test MYSQL_ROOT_USER=root diff --git a/.gitignore b/.gitignore index e6d1b0d..d5ecd22 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ Website # Game Game +# Wiki +Wiki + # Database data diff --git a/First time setup.cmd b/First time setup.cmd index 7f132a4..535291f 100644 --- a/First time setup.cmd +++ b/First time setup.cmd @@ -18,15 +18,20 @@ echo: Windows\make start cls -echo Downloading a copy of the Open-RSC Website repository +echo Downloading a copy of the Website repository echo: Windows\make clone-windows-website cls -echo Downloading a copy of the Open-RSC Game repository +echo Downloading a copy of the Game repository echo: Windows\make clone-windows-game +cls +echo Downloading a copy of the Wiki repository +echo: +Windows\make clone-windows-wiki + cls echo Importing the databases. echo: diff --git a/Makefile b/Makefile index 048b6eb..5d3722b 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,6 @@ -# Makefile for Docker Nginx PHP Composer MySQL - include .env - -# MySQL MYSQL_DUMPS_DIR=./data/db -help: - @echo "" - @echo "usage: make COMMAND" - @echo "" - @echo "Commands:" - @echo " first Perform first time setup" - @echo " clone Clone the git repository folders" - @echo " pull Get the latest git repository updates" - @echo " start Create and start containers" - @echo " stop Stop all containers" - @echo " restart Restart all containers" - @echo " logs Display log output" - @echo " import Import all databases from git repositories" - @echo " backup Create backup of all local databases" - @echo " restore Restore backup of all local databases" - @echo " flush Delete local git repository folders" - @echo "" - start: init docker-compose up -d @@ -36,23 +14,29 @@ restart: init clone: @$(shell git clone https://github.com/Open-RSC/Website.git) @$(shell git clone https://github.com/Open-RSC/Game.git) - @$(shell sudo chmod -R 777 Website && sudo chmod -R 777 Game && sudo chmod 644 Website/board/config.php) + @$(shell git clone https://github.com/Open-RSC/Wiki.git) + #@$(shell sudo chmod -R 777 Website && sudo chmod -R 777 Game && sudo chmod 644 Website/board/config.php) clone-windows-website: @git clone https://github.com/Open-RSC/Website.git - #icacls Website/Open-RSC-Website /grant Everyone:F /t + #icacls Website /grant Everyone:F /t clone-windows-game: @git clone https://github.com/Open-RSC/Game.git - #icacls Game/Open-RSC-Game /grant Everyone:F /t + #icacls Game /grant Everyone:F /t + +clone-windows-wiki: + @git clone https://github.com/Open-RSC/Wiki.git pull: @$(shell cd Website && git pull) @$(shell cd Game && git pull) + @$(shell cd Wiki && git pull) pull-windows: @cd Website && git pull @cd Game && git pull + @cd Wiki && git pull logs: @docker-compose logs -f @@ -76,18 +60,21 @@ import: @docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < 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/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/openrsc_forum.sql 2>/dev/null + @docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Wiki/openrsc_wiki.sql 2>/dev/null import-windows: - @docker exec -i mysql mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Website/openrsc_forum.sql @docker exec -i mysql mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Databases/openrsc_logs.sql @docker exec -i mysql mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Databases/openrsc_config.sql @docker exec -i mysql mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Databases/openrsc.sql + @docker exec -i mysql mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Website/openrsc_forum.sql + @docker exec -i mysql mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Wiki/openrsc_wiki.sql flush: - @$(shell rm -rf Website && rm -rf Game) + @$(shell rm -rf Website && rm -rf Game && rm -rf Wiki) flush-windows: @rmdir "Website" /s /Q @rmdir "Game" /s /Q + @rmdir "Wiki" /s /Q .PHONY: clean test code-sniff init diff --git a/docker-compose.yml b/docker-compose.yml index 1dc5aa8..19cc6fd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,7 @@ services: - "./etc/nginx/default.conf:/etc/nginx/conf.d/default.conf" - "./etc/ssl:/etc/ssl" - "./Website:/var/www/html/public" + - "./Wiki:/var/www/html/public/wiki" - "./etc/nginx/default.template.conf:/etc/nginx/conf.d/default.template" ports: - "80:80" @@ -23,6 +24,7 @@ services: volumes: - "./etc/php/php.ini:/usr/local/etc/php/conf.d/php.ini" - "./Website:/var/www/html/public" + - "./Wiki:/var/www/html/public/wiki" myadmin: image: phpmyadmin/phpmyadmin container_name: phpmyadmin @@ -35,7 +37,7 @@ services: depends_on: - mysqldb mysqldb: - image: mariadb:latest + image: mariadb:${MARIADB_VERSION} container_name: ${MYSQL_HOST} restart: always env_file: diff --git a/etc/nginx/default.conf b/etc/nginx/default.conf index f7149d0..7c32ba6 100755 --- a/etc/nginx/default.conf +++ b/etc/nginx/default.conf @@ -4,6 +4,7 @@ server_tokens off; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options nosniff; +# Website and PHPBB forum over HTTP server { listen 80 default_server; listen [::]:80 default_server; @@ -19,16 +20,6 @@ server { root /var/www/html/public; index index.php index.html index.htm; - location ~ \.php$ { - try_files $uri =404; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass php:9000; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - } - location ~ /\.ht { deny all; } @@ -87,7 +78,8 @@ server { } } -# server { #SSL configuration below +# Website and PHPBB forum over HTTP +# server { # server_name localhost; # listen 443 ssl; diff --git a/etc/nginx/default.template.conf b/etc/nginx/default.template.conf index df8d24a..1eed0af 100755 --- a/etc/nginx/default.template.conf +++ b/etc/nginx/default.template.conf @@ -4,6 +4,7 @@ server_tokens off; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options nosniff; +# Website and PHPBB forum over HTTP server { listen 80 default_server; listen [::]:80 default_server; @@ -19,16 +20,6 @@ server { root /var/www/html/public; index index.php index.html index.htm; - location ~ \.php$ { - try_files $uri =404; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass php:9000; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - } - location ~ /\.ht { deny all; } @@ -87,7 +78,8 @@ server { } } -# server { #SSL configuration below +# Website and PHPBB forum over HTTP +# server { # server_name ${NGINX_HOST}; # listen 443 ssl;