Skip to content

A local-first personal finance app

Update https.md (#335)

qmph22dd788aceae40
diff --git a/docs/config/https.md b/docs/config/https.md
index cdd5bf48aa..d6aa87cae6 100644
--- a/docs/config/https.md
+++ b/docs/config/https.md
@@ -2,9 +2,11 @@
title: Activating HTTPS
---
-You’ll need to enable HTTPS on your home server in order to safely use all of Actual’s features. **You don’t need to follow these steps** if you run the server on your own computer and only access it through `localhost`, or if you’re using a cloud provider that handles HTTPS for you. There are a few different ways to get HTTPS to work, depending on what you’d prefer to do.
+You’ll need to enable HTTPS on your server in order to safely use all of Actual’s features. **You don’t need to follow these steps** if you run the server on your own computer and only access it through `localhost`, or if you’re using a cloud provider that handles HTTPS for you.
-Both methods refer to not exposing Actual on the internet. If this is desired refer to [Using a Reverse Proxy](reverse-proxies).
+# 1. Acquire a certificate to use on your server
+
+There are two methods to do this and both refer to not exposing Actual on the internet. If this is desired, refer to [Using a Reverse Proxy](reverse-proxies).
## Use a self-signed certificate
@@ -12,13 +14,19 @@ Use a self-signed certificate. This is the easiest way to get HTTPS working, but
- A command line tool like [mkcert](https://github.com/FiloSottile/mkcert) can automate this process.
- Alternately, you can manually generate the certificates. Install OpenSSL for your operating system, then run `openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout selfhost.key -out selfhost.crt` in a terminal to generate the certificate and private key. You’ll need to enter a two-letter country code to get the `.crt` file to be generated, but you can leave the rest of the fields blank (just hit enter at each prompt). Move the `selfhost.key` and `selfhost.crt` files a location accessible to the Actual server.
-## Obtain certificate without exposing to the internet
+## Obtain a certificate without exposing to the internet
Use a service like [Tailscale](https://tailscale.com/kb/1153/enabling-https/) or [Caddy](https://caddyserver.com/docs/automatic-https#dns-challenge) that allows you to create a valid HTTPS certificate without having to expose your server to the wider internet.
-## Update Actual Configuration
-Once you have the certificate, you’ll need to configure Actual to use it. There are two ways to do this:
+# 2. Configure Actual to use the certificate
+Once you have the certificate, you’ll need to configure Actual to use it. There are two methods to do this:
+
+## Configuring with `config.json`:
+Create a `config.json` file in the same folder where you run Actual. Put the paths to the `.key` and `.crt` files in the file. Note: if you’re using Docker or a similar container environment, make sure the paths are accessible to the container.
+
+If using a Docker container, this folder is `/data` within the container. If you mounted a volume for the container, the folder on the host where `/data` is mounted is where you can place the `config.json` file.
+
+`config.json`:
-1. **Configuring with `config.json`**: Create a `config.json` file in the same folder where you run Actual (or `/data` if you’re using a Docker container). Put the paths to the `.key` and `.crt` files in the file. Note: if you’re using Docker or a similar container environment, make sure the paths are accessible to the container. For example:
```json
{
"https": {
@@ -27,6 +35,9 @@ Once you have the certificate, you’ll need to configure Actual to use it. Ther
}
}
```
-2. **Configuring with environment variables**: If you can’t easily create new files, you can also configure HTTPS using environment variables. Set the `ACTUAL_HTTPS_KEY` and `ACTUAL_HTTPS_CERT` environment variables to the contents of the `.key` and `.crt` files, respectively. If you’re unable to include newlines in the environment variable values, you can replace any newlines with `\n` and Actual will automatically convert them back to newlines.
+
+## Configuring with environment variables:
+If you can’t easily create new files, you can also configure HTTPS using environment variables. Set the `ACTUAL_HTTPS_KEY` and `ACTUAL_HTTPS_CERT` environment variables to the contents of the `.key` and `.crt` files, respectively. If you’re unable to include newlines in the environment variable values, you can replace any newlines with `\n` and Actual will automatically convert them back to newlines.
-Once one of the above configuration methods have been applied, make sure to access your instance using `https` instead of refreshing the web page.
+# 3. Test HTTPS!
+Once you have acquired a certificate and configured Actual to use it, attempt to access your instance ensuring you are using `https`. It is recommended to also either re-enter the URL to your server or making a new tab/window instead of refreshing the page where you saw the error.