Skip to content

Commit 732d135

Browse files
Fixed SSL renew and updated the port configuration
1 parent 8da8166 commit 732d135

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

docs/sova/server-installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ nano config.toml
9696
```
9797

9898
{: .important }
99-
When using Docker to run Parley chat server, don't change the port in config.toml, instead, edit `docker-compose.yml` and change the port where there is a comment that says `To change the port, change the first part of the port before :`
99+
When using Docker to run Parley chat server, don't change the port in config.toml, instead, create a .env file with content like this `PORT=YOUR PORT` (replace `YOUR PORT` with your port)
100100

101101
{: .note }
102102
If you have set a URI Prefix, you have to also set it in the `docker-compose.yml` file health check URL for health check to work properly

docs/sova/ssl-certificates.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,31 @@ sudo chown $USER:$USER certs/*.pem
6464
### Automatic Renewal Setup
6565

6666
**Set up automatic renewal:**
67+
6768
```sh
6869
sudo crontab -e
6970
```
7071

71-
Add this line to check for renewal twice daily:
72-
```
73-
0 12,0 * * * certbot renew --quiet --deploy-hook "cp /etc/letsencrypt/live/your-domain.com/fullchain.pem /path/to/Parley-Chat/Backend/certs/cert.pem && cp /etc/letsencrypt/live/your-domain.com/privkey.pem /path/to/Parley-Chat/Backend/certs/key.pem && chown $USER:$USER /path/to/Parley-Chat/Backend/certs/*.pem && cd /path/to/Parley-Chat/Backend && docker compose restart nginx"
72+
Add this line to check for renewal twice daily (midnight and noon):
73+
74+
```cron
75+
0 0,12 * * * /usr/bin/certbot renew --quiet \
76+
--pre-hook "/usr/bin/docker compose -f /path/to/Parley-Chat/Sova/docker-compose.yml stop nginx" \
77+
--post-hook "/usr/bin/docker compose -f /path/to/Parley-Chat/Sova/docker-compose.yml start nginx" \
78+
--deploy-hook "cp /etc/letsencrypt/live/your-domain.com/fullchain.pem /path/to/Parley-Chat/Sova/certs/cert.pem && \
79+
cp /etc/letsencrypt/live/your-domain.com/privkey.pem /path/to/Parley-Chat/Sova/certs/key.pem && \
80+
chown appuser:appuser /path/to/Parley-Chat/Sova/certs/*.pem && \
81+
/usr/bin/docker compose -f /path/to/Parley-Chat/Sova/docker-compose.yml exec -T nginx nginx -s reload"
7482
```
7583

7684
{: .note }
77-
The `certbot renew` command only attempts renewal when certificates are within 30 days of expiration, so running it frequently doesn't hit Let's Encrypt's rate limits.
85+
Replace `/path/to/Parley-Chat/Sova` with your actual installation path.
86+
87+
{: .note }
88+
The `pre-hook` and `post-hook` temporarily stop nginx so Certbot in **standalone mode** can bind to port 80 for domain validation. If you switch to `webroot` mode later, you can drop these two hooks and avoid downtime entirely.
7889

7990
{: .note }
80-
Replace `/path/to/Parley-Chat/Backend` with your actual installation path. The deploy-hook ensures certificates are copied and nginx is restarted when renewed.
91+
`certbot renew` only renews certificates that are within 30 days of expiration, so running it twice a day is safe and avoids hitting Let's Encrypt rate limits.
8192

8293
### Verification
8394

0 commit comments

Comments
 (0)