2015-08-31 01:53:16 +02:00
|
|
|
ghost
|
|
|
|
=====
|
|
|
|
|
2016-05-05 14:11:54 +02:00
|
|
|
[Ghost][1] is a free and open source blogging platform written in JavaScript.
|
|
|
|
|
2015-08-31 01:53:16 +02:00
|
|
|
## docker-compose.yml
|
|
|
|
|
2016-05-05 14:11:54 +02:00
|
|
|
```yaml
|
2015-08-31 01:53:16 +02:00
|
|
|
ghost:
|
2017-04-30 17:36:09 +02:00
|
|
|
image: ghost:alpine
|
2016-05-05 14:11:54 +02:00
|
|
|
ports:
|
|
|
|
- "127.0.0.1:2368:2368"
|
2017-04-30 17:36:09 +02:00
|
|
|
volumes:
|
|
|
|
- ./data:/var/lib/ghost
|
2016-05-05 14:11:54 +02:00
|
|
|
restart: always
|
2015-08-31 01:53:16 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## Up and Running
|
|
|
|
|
2016-05-05 14:11:54 +02:00
|
|
|
```bash
|
2015-08-31 01:53:16 +02:00
|
|
|
$ docker-compose up -d
|
2017-04-30 17:36:09 +02:00
|
|
|
$ cd data
|
|
|
|
$ sed -i 's@http://localhost:2368@https://blog.easypi.info@' config.js
|
|
|
|
$ grep -rIl 'googleapis' core content | xargs sed -i 's/googleapis/useso/g'
|
2015-08-31 01:53:16 +02:00
|
|
|
$ docker-compose restart
|
|
|
|
```
|
2016-05-05 14:11:54 +02:00
|
|
|
|
2016-06-06 12:24:00 +02:00
|
|
|
> :warning: `useso.com` doesn't support https!
|
|
|
|
|
2016-05-05 14:11:54 +02:00
|
|
|
## Setup SSL
|
|
|
|
|
|
|
|
> Read [this][2] to setup SSL.
|
|
|
|
|
|
|
|
```
|
|
|
|
server {
|
|
|
|
listen 80 default;
|
|
|
|
server_name _;
|
|
|
|
location / {
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 443 ssl;
|
|
|
|
server_name easypi.info blog.easypi.info;
|
|
|
|
ssl_certificate ssl/easypi.info.crt;
|
|
|
|
ssl_certificate_key ssl/easypi.info.key;
|
|
|
|
location / {
|
|
|
|
if ($host = 'easypi.info') {
|
|
|
|
return 301 $scheme://blog.$host$request_uri;
|
|
|
|
}
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_pass http://127.0.0.1:2368;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2016-05-06 05:41:17 +02:00
|
|
|
## Ghost Setup
|
|
|
|
|
|
|
|
[Ghost][3] allows you to inject code into the top and bottom of your theme
|
|
|
|
files without editing them.
|
|
|
|
|
|
|
|
```css
|
|
|
|
<style>
|
|
|
|
pre code, pre tt {
|
|
|
|
white-space: pre !important;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
```
|
|
|
|
|
2016-05-05 14:11:54 +02:00
|
|
|
[1]: https://ghost.org/
|
|
|
|
[2]: http://support.ghost.org/setup-ssl-self-hosted-ghost/
|
2016-05-06 05:41:17 +02:00
|
|
|
[3]: https://blog.easypi.info/ghost/settings/code-injection/
|