From 2e09f7f0f8de5e70bb58d453d1cfebe7e0730bf0 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sat, 4 Jan 2020 17:06:08 +0100 Subject: [PATCH] Refs #265 Make vhost ssl type configurable --- docker-compose.yml | 4 ++-- docs/configuration-files/env-file.rst | 21 +++++++++++++++++++++ env-example | 17 +++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8ac74fed..bf8d035a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -245,7 +245,7 @@ services: - MAIN_VHOST_ENABLE=${DEVILBOX_UI_ENABLE} - MAIN_VHOST_STATUS_ENABLE=1 - MAIN_VHOST_STATUS_ALIAS=/devilbox-httpd-status - - MAIN_VHOST_SSL_TYPE=both + - MAIN_VHOST_SSL_TYPE=${HTTPD_VHOST_SSL_TYPE:-both} - MAIN_VHOST_SSL_GEN=1 - MAIN_VHOST_SSL_CN=${DEVILBOX_UI_SSL_CN:-localhost} @@ -256,7 +256,7 @@ services: - MASS_VHOST_TLD=.${TLD_SUFFIX} - MASS_VHOST_DOCROOT=${HTTPD_DOCROOT_DIR} - MASS_VHOST_TPL=${HTTPD_TEMPLATE_DIR} - - MASS_VHOST_SSL_TYPE=both + - MASS_VHOST_SSL_TYPE=${HTTPD_VHOST_SSL_TYPE:-both} - MASS_VHOST_SSL_GEN=1 ## diff --git a/docs/configuration-files/env-file.rst b/docs/configuration-files/env-file.rst index 29b0d7a3..747e4126 100644 --- a/docs/configuration-files/env-file.rst +++ b/docs/configuration-files/env-file.rst @@ -1235,6 +1235,27 @@ This will then output ``development``. Web server ---------- +HTTPD_SSL_TYPE +^^^^^^^^^^^^^^ + +SSL (HTTP/HTTPS) settings for automated vhost generation. + +By default each project will have two vhosts (one for HTTP and one for HTTPS). +You can control the SSL settings for your projects via the below stated values. + +This is internally achieved via the ``-m`` argument of |ext_lnk_project_vhost_gen| + +* ``both`` will serve HTTP and HTTPS for all projects +* ``redir`` will always redirect HTTP to HTTPS +* ``ssl`` will only serve HTTPS +* ``plain`` will only serve HTTP + ++-----------------------+-----------------------------------------+------------------+ +| Name | Allowed values | Default value | ++=======================+=========================================+==================+ +| ``HTTPD_SSL_TYPE`` | ``both``, ``redir``, ``ssl``, ``plain`` | ``both`` | ++-----------------------+-----------------------------------------+------------------+ + .. _env_httpd_docroot_dir: HTTPD_DOCROOT_DIR diff --git a/env-example b/env-example index d832d827..562605a0 100644 --- a/env-example +++ b/env-example @@ -510,6 +510,23 @@ HOST_PORT_HTTPD=80 HOST_PORT_HTTPD_SSL=443 +### +### SSL (HTTP/HTTPS) settings for automated vhost generation +### +### By default each project will have two vhosts (one for HTTP and one for HTTPS). +### You can control the SSL settings for your projects via the below stated values. +### +### This is internally achieved via the '-m' argument of https://github.com/devilbox/vhost-gen +### +### Values: +### * both: Serve HTTP and HTTPS for all projects +### * redir: HTTP always redirects to HTTPS +### * ssl: Only serve HTTPS +### * plain: Only serve HTTP +### +HTTPD_VHOST_SSL_TYPE=both + + ### ### Document Root Subdirectory ###