Docker and Ghost CMS overhaul
0
etc/ghost/.initialized
Normal file
0
etc/ghost/.restored
Normal file
29
etc/ghost/config.production.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
BIN
etc/ghost/content/images/2018/08/2-2.png
Normal file
|
After Width: | Height: | Size: 151 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
BIN
etc/ghost/content/images/2018/08/41124845.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 123 KiB |
|
Before Width: | Height: | Size: 422 KiB After Width: | Height: | Size: 422 KiB |
|
After Width: | Height: | Size: 784 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 468 KiB |
|
After Width: | Height: | Size: 468 KiB |
|
After Width: | Height: | Size: 648 KiB |
|
After Width: | Height: | Size: 363 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
BIN
etc/ghost/content/images/2018/08/cat.jpg
Normal file
|
After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 172 KiB |
BIN
etc/ghost/content/images/2018/08/homework.jpg
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
etc/ghost/content/images/2018/08/lol.png
Normal file
|
After Width: | Height: | Size: 169 KiB |
BIN
etc/ghost/content/images/2018/08/map.png
Normal file
|
After Width: | Height: | Size: 322 KiB |
|
Before Width: | Height: | Size: 371 KiB After Width: | Height: | Size: 371 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
BIN
etc/ghost/content/images/2018/08/project-1.png
Normal file
|
After Width: | Height: | Size: 334 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 693 KiB After Width: | Height: | Size: 693 KiB |
BIN
etc/ghost/content/images/2018/08/wod.png
Normal file
|
After Width: | Height: | Size: 693 KiB |
1
etc/ghost/content/logs
Symbolic link
@@ -0,0 +1 @@
|
||||
/opt/bitnami/ghost/logs
|
||||
|
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 147 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
1
etc/ghost/content/themes/casper
Symbolic link
@@ -0,0 +1 @@
|
||||
/opt/bitnami/ghost/current/content/themes/casper
|
||||
29
etc/ghost/ghost/config.production.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
119
etc/nginx/HTTPS_default.conf.BAK
Executable file
@@ -0,0 +1,119 @@
|
||||
upstream tomcat {
|
||||
server tomcat:8080;
|
||||
}
|
||||
|
||||
upstream ghost {
|
||||
server ghost:2368;
|
||||
}
|
||||
|
||||
# HTTP
|
||||
server {
|
||||
listen 8080 default_server;
|
||||
listen [::]:8080 default_server ipv6only=on;
|
||||
server_name ${NGINX_HOST};
|
||||
|
||||
error_log /opt/bitnami/nginx/logs/error.log;
|
||||
access_log /opt/bitnami/nginx/logs/access.log;
|
||||
|
||||
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
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name ${NGINX_HOST};
|
||||
|
||||
error_log /opt/bitnami/nginx/logs/error.log;
|
||||
access_log /opt/bitnami/nginx/logs/access.log;
|
||||
|
||||
add_header Strict-Transport-Security "max-age=31536000" always;
|
||||
ssl_session_cache shared:SSL:20m;
|
||||
ssl_session_timeout 10m;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_ciphers "ECDH+AESGCM:ECDH+AES256:ECDH+AES128:!ADH:!AECDH:!MD5;";
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
resolver 8.8.8.8 1.1.1.1;
|
||||
ssl_certificate /etc/letsencrypt/live/${NGINX_HOST}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/${NGINX_HOST}/privkey.pem;
|
||||
ssl_trusted_certificate /etc/letsencrypt/live/${NGINX_HOST}/chain.pem;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
# Certbot for HTTPS cert renewal
|
||||
location ~ ^/.well-known {
|
||||
root /data/letsencrypt/;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
# Nginx configuration for HTTPS
|
||||
|
||||
server_tokens off;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
|
||||
upstream dev_tomcat_1 {
|
||||
server tomcat;
|
||||
}
|
||||
|
||||
upstream dev_ghost_1 {
|
||||
server ghost:2368;
|
||||
}
|
||||
|
||||
# HTTP
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
gzip on;
|
||||
gzip_static on;
|
||||
gzip_vary on;
|
||||
gzip_http_version 1.1;
|
||||
gzip_min_length 700;
|
||||
gzip_comp_level 6;
|
||||
server_name ${NGINX_HOST};
|
||||
error_log /var/log/nginx/error.log;
|
||||
access_log /var/log/nginx/access.log;
|
||||
root /var/www/html/public;
|
||||
index index.html index.htm index.jsp;
|
||||
|
||||
# Redirect all requests to HTTPS on :443
|
||||
location / {
|
||||
rewrite ^ https://$host$request_uri? permanent;
|
||||
}
|
||||
|
||||
# Certbot for HTTPS cert renewal
|
||||
location ^~ /.well-known {
|
||||
allow all;
|
||||
root /data/letsencrypt/;
|
||||
}
|
||||
}
|
||||
|
||||
# HTTPS
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name ${NGINX_HOST};
|
||||
add_header Strict-Transport-Security "max-age=31536000" always;
|
||||
ssl_session_cache shared:SSL:20m;
|
||||
ssl_session_timeout 10m;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_ciphers "ECDH+AESGCM:ECDH+AES256:ECDH+AES128:!ADH:!AECDH:!MD5;";
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
resolver 8.8.8.8 1.1.1.1;
|
||||
ssl_certificate /etc/letsencrypt/live/openrsc.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/openrsc.com/privkey.pem;
|
||||
ssl_trusted_certificate /etc/letsencrypt/live/openrsc.com/chain.pem;
|
||||
index index.php index.html index.jsp;
|
||||
error_log /var/log/nginx/error.log;
|
||||
access_log /var/log/nginx/access.log;
|
||||
root /var/www/html/public;
|
||||
|
||||
####### Proxies #######
|
||||
# Ghost proxy
|
||||
location ~ {
|
||||
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://ghost:2368;
|
||||
}
|
||||
|
||||
# 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:8080;
|
||||
}
|
||||
|
||||
####### Protections and efficiencies #######
|
||||
# Deny access to files beginning with .ht, such as .htaccess and .htpasswd
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Block accidental directory listing
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
# Instructs visitor browser to cache files for 1 month
|
||||
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
|
||||
expires 1M;
|
||||
}
|
||||
|
||||
# Deny access to version control system directories.
|
||||
location ~ /\.git {
|
||||
deny all;
|
||||
internal;
|
||||
}
|
||||
|
||||
# Certbot for HTTPS cert renewal
|
||||
location ^~ /.well-known {
|
||||
allow all;
|
||||
root /data/letsencrypt/;
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
# Nginx configuration for HTTP
|
||||
|
||||
server_tokens off;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
|
||||
upstream dev_tomcat_1 {
|
||||
server tomcat;
|
||||
}
|
||||
|
||||
upstream dev_ghost_1 {
|
||||
server ghost:2368;
|
||||
}
|
||||
|
||||
# HTTP
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
gzip on;
|
||||
gzip_static on;
|
||||
gzip_vary on;
|
||||
gzip_http_version 1.1;
|
||||
gzip_min_length 700;
|
||||
gzip_comp_level 6;
|
||||
server_name localhost;
|
||||
error_log /var/log/nginx/error.log;
|
||||
access_log /var/log/nginx/access.log;
|
||||
root /var/www/html/public;
|
||||
index index.html index.htm index.jsp;
|
||||
|
||||
####### Proxies #######
|
||||
# Ghost proxy
|
||||
location ~ {
|
||||
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://ghost:2368;
|
||||
}
|
||||
|
||||
# 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:8080;
|
||||
}
|
||||
|
||||
####### Protections and efficiencies #######
|
||||
# Deny access to files beginning with .ht, such as .htaccess and .htpasswd
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Instructs visitor browser to cache files for 1 month
|
||||
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
|
||||
expires 1M;
|
||||
}
|
||||
|
||||
# Deny access to version control system directories.
|
||||
location ~ /\.git {
|
||||
deny all;
|
||||
internal;
|
||||
}
|
||||
|
||||
# Certbot for HTTPS cert renewal
|
||||
location ^~ /.well-known {
|
||||
allow all;
|
||||
root /data/letsencrypt/;
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
# Nginx configuration for HTTP
|
||||
|
||||
server_tokens off;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
|
||||
upstream dev_tomcat_1 {
|
||||
server tomcat;
|
||||
}
|
||||
|
||||
upstream dev_ghost_1 {
|
||||
server ghost:2368;
|
||||
}
|
||||
|
||||
# HTTP
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
gzip on;
|
||||
gzip_static on;
|
||||
gzip_vary on;
|
||||
gzip_http_version 1.1;
|
||||
gzip_min_length 700;
|
||||
gzip_comp_level 6;
|
||||
server_name ${NGINX_HOST};
|
||||
error_log /var/log/nginx/error.log;
|
||||
access_log /var/log/nginx/access.log;
|
||||
root /var/www/html/public;
|
||||
index index.html index.htm index.jsp;
|
||||
|
||||
####### Proxies #######
|
||||
# Ghost proxy
|
||||
location ~ {
|
||||
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://ghost:2368;
|
||||
}
|
||||
|
||||
# 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:8080;
|
||||
}
|
||||
|
||||
####### Protections and efficiencies #######
|
||||
# Deny access to files beginning with .ht, such as .htaccess and .htpasswd
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Instructs visitor browser to cache files for 1 month
|
||||
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
|
||||
expires 1M;
|
||||
}
|
||||
|
||||
# Deny access to version control system directories.
|
||||
location ~ /\.git {
|
||||
deny all;
|
||||
internal;
|
||||
}
|
||||
|
||||
# Certbot for HTTPS cert renewal
|
||||
location ^~ /.well-known {
|
||||
allow all;
|
||||
root /data/letsencrypt/;
|
||||
}
|
||||
}
|
||||
55
etc/nginx/nginx.conf
Executable file
@@ -0,0 +1,55 @@
|
||||
upstream tomcat {
|
||||
server tomcat:8080;
|
||||
}
|
||||
|
||||
upstream ghost {
|
||||
server ghost:2368;
|
||||
}
|
||||
|
||||
# HTTP
|
||||
server {
|
||||
listen 8080 default_server;
|
||||
listen [::]:8080 default_server ipv6only=on;
|
||||
server_name ${NGINX_HOST};
|
||||
|
||||
error_log /opt/bitnami/nginx/logs/error.log;
|
||||
access_log /opt/bitnami/nginx/logs/access.log;
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
}
|
||||