Skip to content

Commit 79743e6

Browse files
author
James Amner
authored
Merge pull request #305 from boxuk/BWP-120
[BWP-120] Docs Updates
2 parents 4ac2473 + 4e23d4c commit 79743e6

File tree

3 files changed

+6
-89
lines changed

3 files changed

+6
-89
lines changed

docs/skeleton/https.md

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,56 +6,6 @@ The issue with self-signed certificates is browsers (quite rightly) deem them un
66

77
## Using a local certificate authority (CA)
88

9-
[The general recommended approach for not relying on self-signed certificates is to set up a local CA](https://web.dev/how-to-use-local-https/). There are several tools for doing this, but perhaps the easiest is [mkcert](https://github.com/FiloSottile/mkcert).
9+
You should not use a local certificate authority to have a signed certificate that is validated. A local CA will contaminate your trusted CAs. This means, if your local environment is compromised, or mkcert, then your entire HTTPS trust chain can easily be compromised too. It is for this reason we do not set this up by default and cannot recommend this approach.
1010

11-
Before some basic instructions for setting this up, here is some information/disclaimer:
12-
13-
**Installing a local CA is at your own risk. Although it will only be trusted by you, a local CA will contaminate your trusted CAs. This means, if your local environment is compromised, or mkcert, then your entire HTTPS trust chain can easily be compromised too. It is for this reason we do not set this up by default and cannot recommend this approach.**
14-
15-
If you're comfortable with all that and still want to go ahead, here's how you can do it with mkcert.
16-
17-
### Install mkcert
18-
19-
On Mac:
20-
```bash
21-
brew install mkcert
22-
brew install nss # if you use Firefox
23-
```
24-
25-
For other platforms see: https://github.com/FiloSottile/mkcert#installation
26-
27-
### Add mkcert to your local root CAs
28-
29-
```bash
30-
mkcert -install
31-
```
32-
33-
### Generate a certificate
34-
35-
```bash
36-
mkcert my-project.local -cert-file docker/nginx/local_https_cert.pem -key-file docker/nginx/local_https_key.pem # Change the host accordingly
37-
```
38-
39-
### Update docker config
40-
41-
Add the following volumes to the `nginx` container within `docker-compose.yml`
42-
43-
```yaml
44-
- './docker/nginx/local_https_cert.pem:/etc/pki/tls/certs/local_https_cert.pem:delegated'
45-
- './docker/nginx/local_https_key.key:/etc/pki/tls/private/local_https_key.key:delegated'
46-
```
47-
48-
Update `docker/nginx/conf/app.conf` to point to your certificate and key:
49-
50-
```ini
51-
ssl_certificate /etc/pki/tls/certs/local_https_cert.pem;
52-
ssl_certificate_key /etc/pki/tls/local_https_key.pem;
53-
```
54-
55-
### Rebuild containers
56-
57-
`docker-compose stop; docker-compose build; docker-compose up`
58-
59-
## Any other options?
60-
61-
There are, this page from the chromium site lists a few other things you might want to try also: https://www.chromium.org/Home/chromium-security/deprecating-powerful-features-on-insecure-origins#TOC-Testing-Powerful-Features
11+
If you require a trusted local certificate, you should raise this with your project lead to outline the reasons for the requirements and discuss potential solutions. Setting up a local CA should be considered a last resort, though documented solutions to do this are easily found online you should carefuly consider the risks.

docs/skeleton/quickstart.md

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
## TL;DR
1313

14-
If you just want a ready to go environment you can just use the following commands, if you're after more detail read
15-
the [docker setup](docker-setup.md) or [non docker setup](non-docker-setup.md) docs instead
16-
14+
If you just want a ready to go environment you can just use the following commands.
1715

1816
```
1917
bin/install [project_name] [docker_network_name] [php_version]
@@ -27,23 +25,4 @@ bin/install [project_name] [docker_network_name] [php_version]
2725
2826
> Note: This will start the containers in detached mode, use `docker-compose stop` if you wish to stop them.
2927
30-
<details>
31-
<summary>Install details</summary>
32-
33-
```
34-
cp .env.dist .env; cp ./docker/database/.env.dist ./docker/database/.env; cp ./docker/app/.env.dist ./docker/app/.env;
35-
docker network create --subnet=192.168.35.0/24 boxuk-docker;
36-
docker-compose stop;
37-
docker-compose build;
38-
docker-compose up -d;
39-
bin/docker/composer install;
40-
cp wp-content/plugins/memcached/object-cache.php wp-content/object-cache.php;
41-
bin/docker/wp core install --url="https://$PROJECT_NAME.local" --title="Box UK WordPress Project" --admin_user=admin [email protected] --skip-email;
42-
bin/docker/wp site empty;
43-
bin/docker/wp dictator impose site-state.yml;
44-
bin/docker/wp package install [email protected]:nlemoine/wp-cli-fixtures.git;
45-
bin/docker/wp fixtures load;
46-
bin/docker/wp cache flush;
47-
echo '127.0.0.1 $PROJECT_NAME.local | sudo tee -a /etc/hosts;
48-
```
49-
</details>
28+
If you're after more detail read the [docker setup](docker-setup.md) or [non docker setup](non-docker-setup.md) docs instead.

docs/skeleton/troubleshooting.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
## WP install fails
44

5-
Sometimes the WordPress install in the `bin/install` script can fail. This is usually fixed by increasing the sleep time:
5+
Sometimes the WordPress install in the `bin/install` script can fail. This is usually fixed by increasing the sleep time to allow the MySQL server to start accepting connections.
66

77
```bash
88
# ...
9-
echo 'Please hold...';
10-
119
sleep 10; # Increase this and retry, it may need to go as high as 30.
1210
# ...
1311
```
@@ -16,22 +14,16 @@ sleep 10; # Increase this and retry, it may need to go as high as 30.
1614

1715
> ERROR: readlink /var/lib/docker/overlay2: invalid argument
1816
19-
Often this is due to a corrupted image that needs to be rebuilt sans cache.
17+
Often this is due to a corrupted image that needs to be rebuilt without any caches.
2018

2119
`docker-compose build --no-cache`
2220

2321
Or you can amend the install script to include the `--no-cache` option, e.g.
2422

2523
```diff
26-
if [ ! -z "${STYLEGUIDE_DIR}" ]; then
27-
- docker-compose -f docker-compose.yml -f docker-compose-styleguide.yml build;
28-
+ docker-compose -f docker-compose.yml -f docker-compose-styleguide.yml build --no-cache;
29-
docker-compose -f docker-compose.yml -f docker-compose-styleguide.yml up -d;
30-
else
3124
- docker-compose build;
3225
+ docker-compose build --no-cache;
3326
docker-compose up -d;
34-
fi
3527
```
3628

3729
## Permission errors
@@ -45,10 +37,6 @@ If you are on a Linux machine, you will need to uncomment the following within t
4537

4638
> Note: You will need to stop and rebuild the containers when changing env vars, e.g. `docker-compose stop; docker-compose up --build`
4739
48-
## Certificate warnings
49-
50-
On chrome you will need to type `thisisunsafe` to bypass the certificate warning (make sure your cursor isn't in the url bar). Othe browsers usually give you a button you can use to bypass.
51-
5240
## Slow local env
5341

5442
## Composer autoloader optimisations

0 commit comments

Comments
 (0)