1
0
Fork 0

Reorganizing the Documentation

This commit is contained in:
Joao Gilberto Magalhaes 2022-08-26 20:03:11 -05:00
parent 7a1fc46f00
commit 25c3db7070
18 changed files with 734 additions and 466 deletions

75
docs/ssl.md Normal file
View file

@ -0,0 +1,75 @@
# Setup your own certificates
You can use your certificates with EasyHAProxy.
There is two ways to do that.
## Setup certificate as a label definition in docker container
1. First, Create a single PEM from the certificate and the key.
```bash
cat example.com.crt example.com.key > single.pem
cat single.pem
-----BEGIN CERTIFICATE-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC5ZheHqmBnEJP+
U9r1gxYWKLzdqrMrcxtQN6M1hIH9n0peuJeIrybdcV7sMbStMXI=
-----END CERTIFICATE-----
-----BEGIN PRIVATE KEY-----
MIIEojCCA4qgAwIBAgIUegW2BimwuL4RzRZ2WYkHA6U5nkAwDQYJKoZIhvcNAQEL
3j4wz8/I5fdsk090j4s5KA==
-----END PRIVATE KEY-----
```
2. Convert the `single.pem` to BASE64 in a single line:
```bash
cat single.pem | base64 -w0
```
3. Use this string to define the label `easyhaproxy.[definition].sslcert`
## Map the certificate as docker volume
EasyHAProxy stores the certificates inside the folder `/certs/haproxy`.
1. Run EasyHAProxy with the volume for the certificates:
```bash
docker volume create certs_haproxy
docker run \
/* other parameters */
-v certs_haproxy:/certs/haproxy \
-d byjg/easy-haproxy
```
2. Create a single PEM from the certificate and the key.
```bash
cat example.com.crt example.com.key > single.pem
cat single.pem
-----BEGIN CERTIFICATE-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC5ZheHqmBnEJP+
U9r1gxYWKLzdqrMrcxtQN6M1hIH9n0peuJeIrybdcV7sMbStMXI=
-----END CERTIFICATE-----
-----BEGIN PRIVATE KEY-----
MIIEojCCA4qgAwIBAgIUegW2BimwuL4RzRZ2WYkHA6U5nkAwDQYJKoZIhvcNAQEL
3j4wz8/I5fdsk090j4s5KA==
-----END PRIVATE KEY-----
```
3. Copy this certificate to EasyHAProxy volume
```bash
docker cp single.pem easyhaproxy:/certs/haproxy
```
----
[Open source ByJG](http://opensource.byjg.com)