Skip to content

Commit

Permalink
Consolidate services
Browse files Browse the repository at this point in the history
  • Loading branch information
leafac committed Oct 13, 2018
1 parent 03856db commit c5df883
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Caddyfile.example.production
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ www.kill-the-newsletter.com {
rewrite / /public{path}
git github.com/leafac/kill-the-newsletter {
hook /deploy MY-SECRET
then_long env GOPATH=/root/go/packages /root/go/bin/go run kill-the-newsletter.go
then systemctl restart kill-the-newsletter
}
}
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,21 @@ $ env GOPATH=/root/go/packages go/bin/go get github.com/jhillyerd/enmime github.
$ git clone https://github.com/leafac/kill-the-newsletter.git
```

Configure **Kill the Newsletter!**:
Configure Caddy and **Kill the Newsletter!**:

| File | Example | |
|-|-|-|
| `Caddyfile.production` | `Caddyfile.example.production` | |
| `/etc/systemd/system/caddy.service` | `caddy.example.service` | |
| `kill-the-newsletter.json` | `kill-the-newsletter.example.json` | [Settings](#settings) |
| `/etc/systemd/system/kill-the-newsletter.service` | `kill-the-newsletter.example.service` | |

Load, start and enable the service (so that it starts at boot):
Load, start and enable the services (so that they start at boot):

```console
$ systemctl daemon-reload
$ systemctl start kill-the-newsletter
$ systemctl enable kill-the-newsletter
$ systemctl start caddy kill-the-newsletter
$ systemctl enable caddy kill-the-newsletter
```

Create a GitHub webhook with `Content type` `application/json` for automatic deployments.
Expand Down
14 changes: 14 additions & 0 deletions caddy.example.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Caddy

[Service]
ExecStart=/root/caddy/caddy -agree=true -email=kill-the-newsletter@leafac.com -conf=Caddyfile.production
WorkingDirectory=/root/kill-the-newsletter
LimitNOFILE=8192
Restart=always
RestartSec=120
StartLimitInterval=5
StartLimitBurst=10

[Install]
WantedBy=multi-user.target
3 changes: 2 additions & 1 deletion kill-the-newsletter.example.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
Description=Kill the Newsletter!

[Service]
ExecStart=/root/caddy/caddy -agree=true -email=kill-the-newsletter@leafac.com -conf=Caddyfile.production
ExecStart=/root/go/bin/go run kill-the-newsletter.go
WorkingDirectory=/root/kill-the-newsletter
Environment=GOPATH=/root/go/packages
LimitNOFILE=8192
Restart=always
RestartSec=120
Expand Down

0 comments on commit c5df883

Please sign in to comment.