You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+108-4
Original file line number
Diff line number
Diff line change
@@ -50,19 +50,123 @@ forem.pub
50
50
setup.yml
51
51
```
52
52
53
-
### Deploy to DigitalOcean
53
+
### Deploying to DigitalOcean
54
54
55
55
[Create an auth token](https://docs.digitalocean.com/reference/api/create-personal-access-token/) and store it in a local (to this repo) file called `.digitalocean-access-token`
56
56
57
-
#### Build the DigitalOcean deployment Image
57
+
#### Build the DigitalOcean deployment image
58
58
59
59
```
60
60
make build-forem-selfhost-digitalocean
61
61
```
62
62
63
-
#### Deploy to DigitalOcean
64
-
63
+
#### Do the deploy
65
64
```
66
65
make deploy-to-digitalocean
67
66
```
68
67
68
+
#### Update your DNS and restart the traefik service
69
+
70
+
Complete [steps 10 & 11 in the Quick Start guide](https://github.com/forem/selfhost/blob/5e5ce60a5df738cd36261c80e94dac917e78868f/README.md#quick-start):
71
+
> 10. Once your Forem VM is set up with your chosen cloud provider, you will need to point DNS at the IP address that is output at the end of the provider playbook.
72
+
> 11. Once DNS is pointed at your Forem VM, you will need to restart the Forem Traefik service (sudo systemctl restart forem-traefik.service) via SSH on your Forem server to generate a TLS cert.
73
+
74
+
You can use `make digitalocean-service-restart-traefik` to do the restart, after which you should be able to surf over to your domain and see something cool!
75
+
76
+
77
+
#### Interact with the server
78
+
79
+
##### Show the IP address
80
+
```
81
+
make digitalocean-ip
82
+
```
83
+
84
+
##### Start an SSH session
85
+
```
86
+
make digitalocean-shell
87
+
```
88
+
89
+
##### Connect to the PostgreSQL console
90
+
```
91
+
make digitalocean-db-shell
92
+
```
93
+
94
+
##### Show the status of related services
95
+
```
96
+
make digitalocean-service-status
97
+
```
98
+
99
+
##### Restart a service
100
+
```
101
+
make digitalocean-service-restart-forem
102
+
```
103
+
```
104
+
make digitalocean-service-restart-traefik
105
+
```
106
+
107
+
##### List all of the containers
108
+
```
109
+
make digitalocean-container-list
110
+
```
111
+
112
+
##### Tail the logs of a specific container
113
+
```
114
+
make digitalocean-container-imgproxy-logs
115
+
```
116
+
```
117
+
make digitalocean-container-openresty-logs
118
+
```
119
+
```
120
+
make digitalocean-container-postgres-logs
121
+
```
122
+
```
123
+
make digitalocean-container-rails-logs
124
+
```
125
+
```
126
+
make digitalocean-container-redis-logs
127
+
```
128
+
```
129
+
make digitalocean-container-traefik-logs
130
+
```
131
+
```
132
+
make digitalocean-container-worker-logs
133
+
```
134
+
135
+
#### Some notes about my experience
136
+
137
+
##### Failed initial traefik restart
138
+
139
+
If the `traefik` service restart fails, run `make digitalocean-service-status` to see how things look.
140
+
141
+
A normal, healthy state looks like:
142
+
143
+
```
144
+
UNIT LOAD ACTIVE SUB DESCRIPTION
145
+
forem-imgproxy.service loaded active running Forem Imgproxy Service
146
+
forem-openresty.service loaded active running Forem OpenResty Service
147
+
forem-pod.service loaded active running Forem pod service
148
+
forem-postgresql.service loaded active running Forem Postgresql Service
149
+
forem-rails.service loaded active running Forem Rails Service
150
+
forem-redis.service loaded active running Forem Redis Service
151
+
forem-traefik.service loaded active running Forem Traefik Service
152
+
forem-worker.service loaded active running Forem Worker Service
153
+
forem.service loaded active exited Forem Service
154
+
```
155
+
156
+
An unhealthy state shows `inactive`s and `dead`s.
157
+
158
+
There was a bug ([which looks to have been fixed](https://github.com/forem/selfhost/commit/ccd1063e0a27f26e784d25fe22cbc51d7eea4e53)) in which the `container` service didn't do what it was supposed to. I was able to resolve this by SSHing in and doing a `sudo systemctl start forem-container.service`
159
+
160
+
##### HTTPS-only caused problems with SSL certificate registration
161
+
162
+
As I understand it, the `traefik` service attempts to register an SSL cert via Let's Encrypt in order to enable HTTPS.
163
+
The problem is that, during the registration process, Let's Encrypt needs to be able to access the `/.well-known/acme-challenge/` path on your site using plain ol' HTTP. If you have something like "Always use HTTP" (e.g. on Cloudflare) enabled, it's not going to work.
164
+
165
+
In Cloudflare, I fixed this as follows:
166
+
167
+
- In `SSL/TLS` -> `Edge Certificates`:
168
+
- Disable `Always use HTTPs`
169
+
- Disable `Automatic HTTPS Rewrites` (maybe not necessary?)
170
+
- In `Rules`
171
+
- Create two rules - one to prevent SSL on the `acme-challenge` path, and another to enforce `HTTPS` everywhere else
0 commit comments