diff --git a/README.md b/README.md index 6a19f86..ec45354 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ Edit the generated `.env` files to fill in the required fields: - `./vaultwarden/.env` - `./wg_easy/.env` - `./blinko/.env` +- `./ghost/.env` - `./caddy/.env` - `./caddy/Caddyfile.private` diff --git a/caddy/.env.example b/caddy/.env.example index 3a0e995..3781b0e 100644 --- a/caddy/.env.example +++ b/caddy/.env.example @@ -37,3 +37,8 @@ GLANCE_CRT= GLANCE_KEY= GLANCE_USERNAME= GLANCE_PASSWORD= + +############# Ghost ############# +GHOST_DOMAIN= +GHOST_CRT= +GHOST_KEY= diff --git a/caddy/Caddyfile b/caddy/Caddyfile index 31e196a..bc44b1b 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -139,6 +139,24 @@ } } +############## ghost ############## +{$GHOST_DOMAIN} { + tls /etc/ssl/custom/{$GHOST_CRT} /etc/ssl/custom/{$GHOST_KEY} + + request_body { + max_size 124MB + } + + reverse_proxy http://ghost:2368 { + header_up X-Real-IP {http.request.header.Cf-Connecting-Ip} + header_up X-Forwarded-For {http.request.header.Cf-Connecting-Ip} + header_up X-Country-Code {http.request.header.Cf-Ipcountry} + header_up X-Forwarded-Proto {http.request.scheme} + header_up Host {http.request.host} + header_up -CF-* + } +} + import Caddyfile.private diff --git a/ghost/.env.example b/ghost/.env.example new file mode 100644 index 0000000..b1bf2e8 --- /dev/null +++ b/ghost/.env.example @@ -0,0 +1 @@ +url= \ No newline at end of file diff --git a/ghost/.gitignore b/ghost/.gitignore new file mode 100644 index 0000000..394be19 --- /dev/null +++ b/ghost/.gitignore @@ -0,0 +1,2 @@ +/data/* +!.gitkeep diff --git a/ghost/data/.gitkeep b/ghost/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ghost/docker-compose.yml b/ghost/docker-compose.yml new file mode 100644 index 0000000..cbfdfc0 --- /dev/null +++ b/ghost/docker-compose.yml @@ -0,0 +1,21 @@ +networks: + caddy: + name: caddy + driver: bridge + external: true + +services: + ghost: + image: ghost:5-alpine + container_name: ghost + networks: + - caddy + environment: + database__client: sqlite3 + database__connection__filename: content/data/ghost.db + NODE_ENV: production + volumes: + - ./data:/var/lib/ghost/content + +volumes: + ghost: diff --git a/main.sh b/main.sh index 8b9c957..f15ac10 100755 --- a/main.sh +++ b/main.sh @@ -61,6 +61,7 @@ generate_env_files() { cp --update=none ./caddy/.env.example ./caddy/.env cp --update=none ./glance/.env.example ./glance/.env cp --update=none ./blinko/.env.example ./blinko/.env + cp --update=none ./ghost/.env.example ./ghost/.env cp --update=none ./caddy/Caddyfile.private.example ./caddy/Caddyfile.private # cp --update=none ./slash/.env.example ./slash/.env # cp --update=none ./grafana/.env.example ./grafana/.env @@ -162,6 +163,15 @@ start_services() { exit 1 fi + echo "Starting ghost..." + $DOCKER_COMPOSE_COMMAND -f ./ghost/docker-compose.yml up -d + if [ $? -eq 0 ]; then + print_success "Ghost started successfully." + else + print_error "failed to start Ghost!" + exit 1 + fi + echo "Starting caddy..." $DOCKER_COMPOSE_COMMAND -f ./caddy/docker-compose.yml up -d if [ $? -eq 0 ]; then @@ -263,6 +273,15 @@ stop_services() { exit 1 fi + echo "Stopping ghost..." + $DOCKER_COMPOSE_COMMAND -f ./ghost/docker-compose.yml down + if [ $? -eq 0 ]; then + print_success "Ghost stopped successfully." + else + print_error "failed to stop Ghost!" + exit 1 + fi + echo "Stopping caddy..." $DOCKER_COMPOSE_COMMAND -f ./caddy/docker-compose.yml down if [ $? -eq 0 ]; then