Commit Graph
989 Commits
Author SHA1 Message Date
Lewis Marshall 9202f110ab Fix wildcard TLS domain detection
As per RFC 2818 [0], a CN of *.dokku.me will only match direct
subdomains of dokku.me, not sub-subdomains like www.test.dokku.me, but
Dokku currently enables TLS for subdomains of all levels.

I have changed the regex from .*\.dokku\.me to [^.]*\.dokku\.me so TLS
is only enabled for direct subdomains.

[0] - http://tools.ietf.org/html/rfc2818#section-3.1

Signed-off-by: Lewis Marshall <lewis@lmars.net>
2015-03-08 21:32:31 +00:00
Lewis Marshall 3a7e1bfa16 Fix URL schemes in dokku urls output
Previously, the presence of TLS certificates would cause `dokku urls` to
output all https URLs, even for domains which were not configured to use
TLS.

This change introduces a URLS file in the app's directory which contains
the URLs with schemes based on whether they have been configured to use
TLS in the nginx config.

Signed-off-by: Lewis Marshall <lewis@lmars.net>
2015-03-01 01:29:38 +00:00
Lewis Marshall a4d79e2de9 Support multiple domains using a wildcard TLS certificate
Previous to this change, each TLS domain would be written to nginx.conf
using the nginx.ssl.conf template (lines 69-73) but with an empty
"server_name" directive (because NOSSL_SERVER_NAME was not set).

This would then become irrelevant because nginx.conf would get truncated
on line 88, and a single parsing of the template would then be written to
nginx.conf on line 89, meaning only the last TLS domain would be set up to
actually use TLS.

This patch changes this behaviour so that all TLS domains get added to
nginx.conf using the nginx.ssl.conf template (which includes redirecting
HTTP -> HTTPS), and all non-TLS domains get added using the nginx.conf
template, so do not get redirected to a TLS domain.

Signed-off-by: Lewis Marshall <lewis@lmars.net>
2015-02-26 01:58:17 +00:00
Michael Hobbs 12777d9bf0 simplify SSL hostname handling and avoid overwriting variables. refs #971 2015-02-12 13:27:47 -08:00
Michael Hobbs 043b055558 don't use set to guard against pipefail 2015-02-11 17:48:55 -08:00
Michael Hobbs ef583eef66 use consistent bash shebang. closes #959 2015-02-08 22:34:35 -08:00
Michael Hobbs 9164740117 rename log functions with dokku_log_ prefix 2015-02-06 08:28:14 -08:00
Michael Hobbs 6ad65dd9b4 first stab at a common functions library. include argument parsing and a few definitions wired up. closes #932. closes #945 2015-02-05 11:32:46 -08:00
Michael Hobbs 5fb30ab934 source global env prior to app env. closes #931 2015-02-03 13:47:20 -08:00
Vincent Fretin 955f95e899 enable ssl_prefer_server_ciphers
Since we create /etc/nginx/nginx.conf we don't have "ssl_prefer_server_ciphers on" option enabled anymore, enable it in dokku.conf
2015-02-03 09:52:18 +01:00
Jose Diaz-Gonzalez 19871fe81d Merge pull request #900 from progrium/mh-nginx-ssl-san-hostname
support extracting SANs from SSL certificates and adding them to nginx config
2015-01-16 15:22:15 -05:00
Michael Hobbs 6cd89fa72a support extracting SANs from SSL certificates and adding them to nginx config 2015-01-15 12:08:27 -08:00
Jose Diaz-Gonzalez 55129cb9f6 Keep existing configuration files when installing nginx. Refs #886 2015-01-13 22:42:33 -05:00
Jose Diaz-Gonzalez 938a16de53 Merge pull request #880 from progrium/879-mh-port-based-fix
disable VHOST deployment if global VHOST file is missing and an app domain has not been added
2015-01-11 18:14:55 -05:00
Michael Hobbs 80d13c0005 allow users to add a domain to an app if there is no global vhost 2015-01-11 14:35:02 -08:00
Michael Hobbs c63be44989 IP and PORT are likely to get clobbered. rename them 2015-01-09 12:12:52 -08:00
Michael Hobbs da465a61dd disable VHOST deployment if global VHOST file is missing 2015-01-08 15:58:08 -08:00
Jose Diaz-Gonzalez 8502881633 Merge pull request #868 from expa/mh-circle-ci
use circleci for automated testing
2015-01-06 23:44:15 -05:00
Michael Hobbs 896ce50c93 support pre deployment usage of domains plugin. fixes interface binding issue 2015-01-06 12:42:21 -08:00
Michael Hobbs 9d81dda524 try circle again 2015-01-05 17:03:06 -08:00
Jose Diaz-Gonzalez 566cc15081 Merge pull request #864 from progrium/860-mh-bind-to-internal-ip
bind docker container to internal port if using vhosts
2015-01-05 19:58:18 -05:00
Michael Hobbs 441d212ef2 add ipv6 detection for external port binding 2015-01-05 10:47:20 -08:00
Jose Diaz-Gonzalez ab7f9f1161 Move server_tokens off to the global nginx conf 2015-01-03 21:41:18 -05:00
Michael Hobbs 948d7902f2 bind docker container to internal port if using vhosts 2015-01-02 16:27:19 -08:00
Jose Diaz-Gonzalez 2a51301a5d Disable server tokens in nginx. Closes #857 2015-01-01 15:03:43 -05:00
Michael Hobbs de09260c33 add certificate CN to app VHOST if it's not already 2014-12-23 23:08:22 -08:00
Michael Hobbs e8b4bd5a89 lintball 2014-12-21 14:51:42 -08:00
Michael Hobbs 9322200eae lintball 2014-12-21 14:51:41 -08:00
Michael Hobbs 606bbda66c make tests work 2014-12-21 14:51:40 -08:00
Michael Hobbs 3706392e65 test with wercker 2014-12-21 14:51:40 -08:00
Michael Hobbs 56472bd08c VHOST fallback 2014-12-16 23:01:32 -08:00
Michael Hobbs e99e2201cb mv default VHOST creation to core install 2014-12-16 20:25:44 -08:00
Jose Diaz-Gonzalez 5bf1ba7ed7 Merge pull request #783 from progrium/nginx-cleanup
New domains plugin and nginx extension
2014-12-16 17:15:30 -05:00
Michael Hobbs 59f047bb45 include SSL_VHOSTS in NOSSL_SERVER_NAME so we can redirect from http to https on the secure hostname as well 2014-12-16 12:15:10 -08:00
Michael Hobbs 1b208778f3 bugfixes
- don't match substrings in VHOSTS
 - handle case where NOSSL_SERVER_NAME is \' \'
 - rebuild nginx config on ssl import
 - prevent cwd errors after we rm the temp dir
2014-12-15 18:10:14 -08:00
Michael Hobbs 78d3921a6f don't break other nginx plugins like nginx-alt 2014-12-15 13:15:40 -08:00
Michael Hobbs 4e0670f1ac rebuild nginx config on domain change 2014-12-12 17:53:30 -08:00
Andre Bossard 79788e5690 Please increase the server_names_hash_bucket_size
I use Dokku in a private environment with very long hostname.... 64 was always a lot to short.
2014-12-11 09:59:13 +01:00
Jose Diaz-Gonzalez 11b126a845 Do not overwrite URL file 2014-12-11 02:14:52 -05:00
Jose Diaz-Gonzalez 605ba27eeb Use a one-liner for the "Configuring" echo statement 2014-12-11 02:12:46 -05:00
Jose Diaz-Gonzalez 8109c9c569 Delete the VHOST file, not the URL file, when NO_VHOST is set
The URL file is useful for understanding what port docker decided to host our app internally on.
2014-12-11 02:10:49 -05:00
Jose Diaz-Gonzalez 4955f9c600 Fix test for file 2014-12-11 01:36:44 -05:00
Jose Diaz-Gonzalez e84526490e Move VHOST file creation to a single domains:setup command
This helps remove duplication and also ensures that all hosts have a proper setup after running `make copyfiles`

Note that this command is not exposed in help as it is not generally useful to developers
2014-12-11 01:36:44 -05:00
Jose Diaz-Gonzalez f23809e75f Implement the ability to set multiple server names for a given application
Adding a hostname to the $APP/VHOST file will enable it as a virtualhost for the application.

In addition, any hostname set that matches an associated ssl certificate will also be set as an ssl host. Note that if a hostname does not have a matching SSL host, then it will result in an erroring application.

For the moment, running `dokku url` on an app may not correctly display the current hostnames for said app.
2014-12-11 01:36:44 -05:00
Jose Diaz-Gonzalez b967514c55 Allow overriding of the nginx.conf template via nginx.conf.template 2014-12-11 01:36:44 -05:00
Jose Diaz-Gonzalez a6c34ddd6f Use a template to create an application's nginx.conf 2014-12-11 01:36:44 -05:00
Jose Diaz-Gonzalez 8f0e794893 Remove extra dash 2014-12-11 01:36:44 -05:00
Jose Diaz-Gonzalez 68a1d1af38 one-liner 2014-12-11 01:36:44 -05:00
Jose Diaz-Gonzalez eeff3d52eb Combine calls to restart nginx into a single command 2014-12-11 01:36:44 -05:00
Jose Diaz-Gonzalez 8aa196c660 Remove extra reload command 2014-12-11 01:36:44 -05:00