Cleanup, wiki add

This commit is contained in:
Marwolf
2018-07-12 14:44:26 -04:00
parent 0d550e3c90
commit 2e9c422888
7 changed files with 36 additions and 57 deletions

8
.env
View File

@@ -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

3
.gitignore vendored
View File

@@ -8,6 +8,9 @@ Website
# Game
Game
# Wiki
Wiki
# Database
data

View File

@@ -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:

View File

@@ -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

View File

@@ -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:

View File

@@ -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;

View File

@@ -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;