Changes to support new design

This commit is contained in:
Marwolf
2018-08-18 12:12:37 -04:00
parent b8c12d935f
commit 3c7a2da359
7 changed files with 43 additions and 95 deletions

1
.env
View File

@@ -1,7 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Ghost # Ghost
GHOST_HOST=localhost/ghost
GHOST_EMAIL=admin@openrsc.com GHOST_EMAIL=admin@openrsc.com
GHOST_PASSWORD=malwareinfection GHOST_PASSWORD=malwareinfection
GHOST_DATABASE_NAME=ghost GHOST_DATABASE_NAME=ghost

View File

@@ -547,32 +547,43 @@ elif [ "$choice" == "2" ]; then
unzip -o Game/client/cache.zip -d ~/OpenRSC unzip -o Game/client/cache.zip -d ~/OpenRSC
echo "" echo ""
echo "" echo ""
echo "Importing the databases."
echo ""
sudo make import-game
sudo make import-ghost
echo ""
echo ""
echo "Creating a backup of your current databases as \"Docker-Home/data/db/db.sql\""
echo ""
sudo make backup
echo ""
echo ""
echo "Next is manual file editing for the website domain and SQL user/pass." echo "Next is manual file editing for the website domain and SQL user/pass."
echo "" echo ""
echo "It is suggested that you first navigate to your VPS's http://domain:9000"
echo ""
echo "Create a new SQL user and password, grant all permissions, then remove the others."
echo ""
echo ""
echo "When finished, it will be time to edit the files that rely on that new SQL user."
echo ""
echo "(Use Ctrl + X to save each file when done editing) - Press enter when ready." echo "(Use Ctrl + X to save each file when done editing) - Press enter when ready."
read next read next
sudo nano .env sudo nano .env
sudo nano Game/client/src/org/openrsc/client/Config.java sudo nano Game/client/src/org/openrsc/client/Config.java
sudo nano Game/Launcher/src/Main.java sudo nano Game/Launcher/src/Main.java
sudo nano Game/server/config/config.xml sudo nano Game/server/config/config.xml
sudo nano etc/ghost/config.production.json
echo "" echo ""
echo "" echo ""
echo "File edits complete. Restarting Docker containers." echo "File edits complete."
echo ""
echo ""
echo "Importing the databases."
echo ""
sudo make import-game
sudo make import-ghost
echo ""
echo ""
echo "Restarting Docker containers"
echo "" echo ""
sudo make stop && sudo make start sudo make stop && sudo make start
echo "" echo ""
echo "" echo ""
echo "Creating a backup of your current databases as \"Docker-Home/data/db/db.sql\""
echo ""
sudo make backup
echo ""
echo ""
echo "Ready to launch \"./Linux_Fetch_Updates_Production.sh\" - Press enter when ready." echo "Ready to launch \"./Linux_Fetch_Updates_Production.sh\" - Press enter when ready."
echo "" echo ""
echo "" echo ""

View File

@@ -38,7 +38,9 @@ services:
user: root user: root
command: chown -R 1001:1001 /bitnami command: chown -R 1001:1001 /bitnami
volumes: volumes:
- "./data/db/mysq:/bitnami/mariadb" - "./data/db/mysq:/bitnami/mariadb"
depends_on:
- nginx
mysqldb: mysqldb:
image: bitnami/mariadb:latest image: bitnami/mariadb:latest
@@ -60,7 +62,7 @@ services:
- "./data/db/mysq:/bitnami/mariadb" - "./data/db/mysq:/bitnami/mariadb"
- "./etc/mariadb/innodb.cnf:/bitnami/mariadb/conf/innodb.cnf:ro" - "./etc/mariadb/innodb.cnf:/bitnami/mariadb/conf/innodb.cnf:ro"
depends_on: depends_on:
- nginx - fix-mariadb-permissions
tomcat: tomcat:
image: tomcat:latest image: tomcat:latest
@@ -79,7 +81,10 @@ services:
user: root user: root
command: chown -R 1001:1001 /bitnami/ghost command: chown -R 1001:1001 /bitnami/ghost
volumes: volumes:
- "./etc/ghost:/bitnami/ghost" - "./etc/ghost:/bitnami/ghost"
depends_on:
- mysqldb
- nginx
ghost: ghost:
image: bitnami/ghost:latest image: bitnami/ghost:latest
@@ -98,12 +103,10 @@ services:
- GHOST_DATABASE_PASSWORD=${MARIADB_ROOT_PASSWORD} - GHOST_DATABASE_PASSWORD=${MARIADB_ROOT_PASSWORD}
- GHOST_DATABASE_NAME=${GHOST_DATABASE_NAME} - GHOST_DATABASE_NAME=${GHOST_DATABASE_NAME}
- ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD} - ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD}
- GHOST_HOST=${GHOST_HOST}
- GHOST_EMAIL=${GHOST_EMAIL} - GHOST_EMAIL=${GHOST_EMAIL}
- GHOST_PASSWORD=${GHOST_PASSWORD} - GHOST_PASSWORD=${GHOST_PASSWORD}
depends_on: depends_on:
- mysqldb - fix-ghost-permissions
- nginx
php: php:
image: bitnami/php-fpm:latest image: bitnami/php-fpm:latest

View File

@@ -9,7 +9,7 @@
"database": "ghost" "database": "ghost"
} }
}, },
"url": "http://localhost:2368/blog", "url": "http://localhost/blog",
"server": { "server": {
"port": 2368, "port": 2368,
"host": "0.0.0.0" "host": "0.0.0.0"

View File

@@ -1,29 +0,0 @@
{
"database": {
"client": "mysql",
"connection": {
"host": "mysql",
"port": 3306,
"password": "root",
"user": "root",
"database": "ghost"
}
},
"url": "http://localhost:2368/blog",
"server": {
"port": 2368,
"host": "0.0.0.0"
},
"mail": {
"transport": "Direct"
},
"logging": {
"transports": [
"file"
]
},
"process": "local",
"paths": {
"contentPath": "/opt/bitnami/ghost/content"
}
}

View File

@@ -17,41 +17,6 @@ server {
rewrite ^ https://$http_host$request_uri? permanent; #Redirect traffic to HTTPS rewrite ^ https://$http_host$request_uri? permanent; #Redirect traffic to HTTPS
root /app;
index index.html index.htm index.php index.jsp;
client_max_body_size 100M;
location / {
try_files $uri $uri/index.html;
}
####### Proxies #######
# PHP proxy
location ~ \.php$ {
fastcgi_pass php:9001;
fastcgi_index index.php;
include fastcgi.conf;
}
# Ghost proxy
location /blog {
proxy_pass http://ghost;
proxy_set_header Host $http_host; # required for docker client's sake
proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 900;
}
# Tomcat proxy
location ~ \.(do|jspa|obr|jsp|txt|zip) {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://tomcat;
}
} }
# HTTPS # HTTPS
@@ -77,20 +42,21 @@ server {
ssl_trusted_certificate /etc/letsencrypt/live/${NGINX_HOST}/chain.pem; ssl_trusted_certificate /etc/letsencrypt/live/${NGINX_HOST}/chain.pem;
root /app; root /app;
index index.html index.htm index.php index.jsp; index index.jsp index.html index.htm index.php;
client_max_body_size 100M; client_max_body_size 100M;
location / { location / {
try_files $uri $uri/index.html; try_files $uri $uri/ =404;
} }
####### Proxies ####### ####### Proxies #######
# PHP proxy # PHP proxy
location ~ \.php$ { location ~ \.php$ {
fastcgi_pass php:9001; proxy_set_header X-Forwarded-Host $host;
fastcgi_index index.php; proxy_set_header X-Forwarded-Server $host;
include fastcgi.conf; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://php;
} }
# Ghost proxy # Ghost proxy
@@ -104,7 +70,7 @@ server {
} }
# Tomcat proxy # Tomcat proxy
location ~ \.(do|jspa|obr|jsp|txt|zip) { location ~ \.jsp$ {
proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

View File

@@ -15,15 +15,13 @@ server {
error_log /opt/bitnami/nginx/logs/error.log; error_log /opt/bitnami/nginx/logs/error.log;
access_log /opt/bitnami/nginx/logs/access.log; access_log /opt/bitnami/nginx/logs/access.log;
#rewrite ^ https://$http_host$request_uri? permanent; #Redirect traffic to HTTPS
root /app; root /app;
index index.html index.htm index.php index.jsp; index index.jsp index.html index.htm index.php;
client_max_body_size 100M; client_max_body_size 100M;
location / { location / {
try_files $uri $uri/index.html; try_files $uri $uri/ =404;
} }
####### Proxies ####### ####### Proxies #######
@@ -45,7 +43,7 @@ server {
} }
# Tomcat proxy # Tomcat proxy
location ~ \.(do|jspa|obr|jsp|txt|zip) { location ~ \.jsp$ {
proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;