Skip to content

Commit b9b33cf

Browse files
authored
Merge pull request #5 from vfalies/release-2.2
Release 2.2
2 parents a06bd52 + e81448a commit b9b33cf

File tree

15 files changed

+194
-13
lines changed

15 files changed

+194
-13
lines changed

.env.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
MAILDEV_PORT=1080
22
DBADMIN_PORT=9090
33
WEB_PORT=80
4+
WEBSSL_PORT=443
45
PHP_VERSION=7.2-fpm-alpine
56
DB=mysql
67
WEB_SERVER=nginx

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ conf/apache/vhosts/*
44
conf/nginx/vhosts/*
55
!conf/nginx/vhosts/default.conf
66
!conf/nginx/vhosts/envdev_home.conf
7+
conf/ssl/*
8+
!conf/ssl/envdev.crt
9+
!conf/ssl/envdev.key
10+
!conf/ssl/envdev.csr
711
projects/*
812
!projects/index.php
913
!projects/phpinfo.php

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [2.2] - 2018-05-18
9+
10+
### Added
11+
12+
- Add SSL support
13+
- Add script to create and renew self-signed certificate
14+
- Add EnvDev version on homepage
15+
16+
### Changed
17+
18+
- Update Makefile actions and add help
19+
- Fix CSS homepage
20+
821
## [2.1.1] - 2018-05-01
922

1023
### Added

Makefile

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,35 @@ export GROUP_ID=$(shell id -g)
33

44
include .env
55

6-
servers:
7-
docker-compose up -d --build --remove-orphans
6+
help: ## Show this help
7+
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
88

9-
stop:
10-
docker-compose down
9+
servers: ## Start all containers
10+
@echo '******** Starting all containers... ********'
11+
@docker-compose up -d --build --remove-orphans
1112

12-
install:
13-
docker-compose build --force-rm --no-cache && docker run --rm -v $(shell pwd):/var/www/html -u "$(USER_ID):$(GROUP_ID)" vfac/envdevphpbase:$(PHP_VERSION) sh -c "cd /var/www/html/home/envdev; composer update --lock"
13+
start: ## Start all containers
14+
start: servers
1415

15-
homepage:
16-
x-www-browser envdev.localhost
16+
stop: ## Stop all containers
17+
@echo '******** Stopping all containers... ********'
18+
@docker-compose down
19+
20+
restart: ## Restart all containers
21+
restart: stop servers
22+
23+
certificate: ## Generate a SSL certificate
24+
@echo '******** Generate a SSL certificate ********'
25+
@docker run -ti --rm -v $(shell pwd)/conf/ssl:/app/ssl vfac/certificates /app/certificate.sh
26+
27+
renewal: ## Renewal a knowed SSL certificate
28+
@echo '******** Renew a SSL certificate ********'
29+
@docker run -ti --rm -v $(shell pwd)/conf/ssl:/app/ssl vfac/certificates /app/regenerate_certificate.sh
30+
31+
install: ## Install EnvDev container environment
32+
@echo '******** Install EnvDev container environment ********'
33+
@docker-compose build --force-rm --no-cache && docker run --rm -v $(shell pwd):/var/www/html -u "$(USER_ID):$(GROUP_ID)" vfac/envdevphpbase:$(PHP_VERSION) sh -c "cd /var/www/html/home/envdev; composer update --lock"
34+
35+
homepage: ## Launch EnvDev homepage in default browser
36+
@echo '******** Launch Homepage in browser ********'
37+
@x-www-browser envdev.localhost

README.md

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ This environment provies the following tools to develop in PHP :
1010

1111
Available version :
1212

13-
- `5.6`
1413
- `7.0`
1514
- `7.1`
1615
- `7.2`
@@ -64,6 +63,36 @@ All of them are in Alpine version
6463

6564
- [NodeJs](https://nodejs.org/en) : JavaScript runtime
6665

66+
#### Makefile
67+
68+
A `Makefile` is available in command line to manage several actions.
69+
70+
Type following command to display help :
71+
72+
```shell
73+
make
74+
```
75+
76+
or
77+
78+
```shell
79+
make help
80+
```
81+
82+
Output:
83+
84+
```shell
85+
help: Show this help
86+
servers: Start all containers
87+
start: Start all containers
88+
stop: Stop all containers
89+
restart: Restart all containers
90+
certificate: Generate a SSL certificate
91+
renewal: Renewal a knowed SSL certificate
92+
install: Install EnvDev container environment
93+
homepage: Launch EnvDev homepage in default browser
94+
```
95+
6796
### Optional tools
6897

6998
Optional tools are available to use in EnvDev. They are not included by default but can be added easily.
@@ -106,6 +135,12 @@ To start the environment, type the following command:
106135
make servers
107136
```
108137

138+
or
139+
140+
```shell
141+
make start
142+
```
143+
109144
Several containers are created from `.env` configuration:
110145

111146
| Description | Container's name |
@@ -185,6 +220,56 @@ In `conf/apache/vhosts` directory, all your `yourhost.conf` file. A default host
185220
</VirtualHost>
186221
```
187222

223+
### SSL support
224+
225+
The SSL support is possible during development. To activate it on one of your vhosts, you must follow steps:
226+
227+
- Create the SSL self-signed certificate
228+
229+
you can use the command:
230+
231+
```shell
232+
make certificate
233+
```
234+
235+
- Add the activation of SSL in VHost file
236+
237+
On Nginx:
238+
239+
```
240+
listen 443 ssl;
241+
242+
ssl_certificate /etc/nginx/ssl/envdev.crt;
243+
ssl_certificate_key /etc/nginx/ssl/envdev.key;
244+
```
245+
246+
On Apache:
247+
248+
```
249+
<VirtualHost *:80 *:443>
250+
...
251+
252+
SSLEngine on
253+
SSLCertificateFile /usr/local/apache2/conf/custom/envdev.crt
254+
SSLCertificateKeyFile /usr/local/apache2/conf/custom/envdev.key
255+
256+
...
257+
```
258+
259+
where `envdev` is the name chosen during the step of the certificate creation.
260+
261+
Don't forget to restart `web` container to restart the web server
262+
263+
```shell
264+
docker restart web
265+
```
266+
267+
Tips: If you certificate is out of date, you can renew it with the command:
268+
269+
```shell
270+
make renewal
271+
```
272+
188273
## Configuration
189274

190275
You can create `.env` file to manage applications and tools.
@@ -194,11 +279,12 @@ The following versions, paths and ports can be configured :
194279

195280
| Description | Variable name | Possible values | Default |
196281
|:-------------|:---------------:|:-----------------:|:---------:|
197-
| PHP Version | PHP_VERSION | `5.6`, `7.0`, `7.1`, `7.2` | `7.2` |
282+
| PHP Version | PHP_VERSION | `7.0`, `7.1`, `7.2` | `7.2` |
198283
| Database type | DB | `mariadb`, `mysql`, `mongodb` | `mysql` |
199284
| Cache server type | CACHE_SERVER | `redis`, `memcached` | `redis` |
200285
| Projects Path | PROJECTS_PATH | any | `/your/projects/directory/path` |
201286
| HTTP web port | WEB_PORT | any | `80` |
287+
| HTTPS web port | WEBSSL_PORT | any | `443` |
202288
| MailDev port | MAILDEV_PORT | any | `1080` |
203289
| PHPMyAdmin port | PHPMYADMIN_PORT | any | `9090` |
204290
| MongoExpress port | MONGOEXPRESS_PORT | any | `8081` |

conf/apache/httpd.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ServerRoot "/usr/local/apache2"
5050
#
5151
#Listen 12.34.56.78:80
5252
Listen 80
53-
53+
Listen 443
5454
#
5555
# Dynamic Shared Object (DSO) Support
5656
#

conf/apache/vhosts/envdev_home.conf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
<VirtualHost *:80>
1+
<VirtualHost *:80 *:443>
22
ServerName envdev.localhost
33
ServerAlias envdev
44

5+
SSLEngine on
6+
SSLCertificateFile /usr/local/apache2/conf/custom/envdev.crt
7+
SSLCertificateKeyFile /usr/local/apache2/conf/custom/envdev.key
8+
59
DocumentRoot /var/www/html/envdev_home/envdev/public
610

711
<Directory "/var/www/html/envdev_home/envdev/public">

conf/nginx/vhosts/envdev_home.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
server {
22

33
listen 80;
4+
5+
listen 443 ssl;
6+
7+
ssl_certificate /etc/nginx/ssl/envdev.crt;
8+
ssl_certificate_key /etc/nginx/ssl/envdev.key;
9+
410
server_name envdev.localhost envdev;
511
root /var/www/html/envdev_home/envdev/public;
612
index index.php index.html index.htm;

conf/ssl/envdev.crt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIICDzCCAXgCCQDcva593INAITANBgkqhkiG9w0BAQsFADBMMQswCQYDVQQGEwJG
3+
UjETMBEGA1UECAwKU29tZS1TdGF0ZTENMAsGA1UECgwEVkZBQzEZMBcGA1UEAwwQ
4+
ZW52ZGV2LmxvY2FsaG9zdDAeFw0xODA1MTgxMzU1NDZaFw0xOTA1MTgxMzU1NDZa
5+
MEwxCzAJBgNVBAYTAkZSMRMwEQYDVQQIDApTb21lLVN0YXRlMQ0wCwYDVQQKDARW
6+
RkFDMRkwFwYDVQQDDBBlbnZkZXYubG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUA
7+
A4GNADCBiQKBgQCugJaBsmHXRMNayI1ZDfeSjMoK8taLKEjmz2Godc4LAzRzyRD7
8+
0MPYbX3LYBfTxgXh9jTUeczKWzWmcxaWUCZf/u3n7E528BNo2h3vHq8iLW6Rs6lv
9+
qTsmbvToAB09XvX0ZbroQZc3GtSP2x20mzPdvX1D6sUrkT+TVe4UhRET+wIDAQAB
10+
MA0GCSqGSIb3DQEBCwUAA4GBAKtmIYK73FyPWhs8GFlOwLyqZrIHTEiXOzuDoAZd
11+
EBTGTs0uD2hRtZg+QYGa0t7ZtMng7WigkgeluSs3Oa52hN3ul4kTzPnGbMH7jC6v
12+
Qp8FKkKA4J9KyVUitnhCjCOgxJozpUoMBTwns5eWWnuWcgYSfhRGNN8kOLT4VjW5
13+
C8c4
14+
-----END CERTIFICATE-----

conf/ssl/envdev.csr

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
-----BEGIN CERTIFICATE REQUEST-----
2+
MIIBizCB9QIBADBMMQswCQYDVQQGEwJGUjETMBEGA1UECAwKU29tZS1TdGF0ZTEN
3+
MAsGA1UECgwEVkZBQzEZMBcGA1UEAwwQZW52ZGV2LmxvY2FsaG9zdDCBnzANBgkq
4+
hkiG9w0BAQEFAAOBjQAwgYkCgYEAroCWgbJh10TDWsiNWQ33kozKCvLWiyhI5s9h
5+
qHXOCwM0c8kQ+9DD2G19y2AX08YF4fY01HnMyls1pnMWllAmX/7t5+xOdvATaNod
6+
7x6vIi1ukbOpb6k7Jm706AAdPV719GW66EGXNxrUj9sdtJsz3b19Q+rFK5E/k1Xu
7+
FIURE/sCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4GBAJnnODAo01hkOPfxmWPMSSM0
8+
dj9q7uw96FK06zOgX7rCSWFAdhHeYJR7T3BTDE8s7AFboUf64a0DvUjzstOxcEfN
9+
tX3IJ6I5+ZKH2YqiErWsex/vXoNYAxvsK+O/zZBpqZPefDmDwJF8Igyvm9BxL21L
10+
rv1G3OCMSXkEiCRSCYm7
11+
-----END CERTIFICATE REQUEST-----

0 commit comments

Comments
 (0)