Skip to content

Commit 5ad1fc0

Browse files
committed
feat(router): route deis.domain to controller
Forwards requests to deis.domain to the controller. TESTING: rebuild the router and controller with this change: $ make -C router build restart $ make -C controller build restart Test that deis.domain routes to the controller and that other requests to the domain route to the app. Also, send several requests to the API and be sure that nothing broke related to auth because of the proxying of requests. The integration tests were updated to test the controller and the app routing, so you can also `cd test && bundle exec rake`. Also, try creating an app with the name of 'deis' - it should be rejected. replaces #974 part of #535
1 parent 2fa11dd commit 5ad1fc0

14 files changed

Lines changed: 43 additions & 44 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ $ cd client && python setup.py install
119119
Use the Deis Client to register a new user.
120120

121121
```console
122-
$ deis register http://local.deisapp.com:8000
122+
$ deis register http://deis.local.deisapp.com
123123
$ deis keys:add
124124
```
125125

client/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ version of the Deis client for Mac OS X, Windows, or Debian Linux:
8585

8686
.. code-block:: console
8787
88-
$ deis register http://local.deisapp.com:8000
88+
$ deis register http://deis.local.deisapp.com
8989
$ deis keys:add
9090
9191

contrib/ec2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ you configure your own DNS records using a domain you own. See [Configuring DNS]
8383
## Use Deis!
8484
After that, register with Deis!
8585
```console
86-
$ deis register deis.example.org:8000
86+
$ deis register http://deis.example.org
8787
username: deis
8888
password:
8989
password (confirm):

contrib/rackspace/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ You'll need to configure DNS records so you can access applications hosted on De
7878
### Use Deis!
7979
After that, register with Deis!
8080
```console
81-
$ deis register deis.example.org:8000
81+
$ deis register http://deis.example.org
8282
username: deis
8383
password:
8484
password (confirm):

controller/api/serializers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,14 @@ class Meta:
129129

130130
def validate_id(self, attrs, source):
131131
"""
132-
Check that the ID is all lowercase
132+
Check that the ID is all lowercase and not 'deis'
133133
"""
134134
value = attrs[source]
135135
match = re.match(r'^[a-z0-9-]+$', value)
136136
if not match:
137137
raise serializers.ValidationError("App IDs can only contain [a-z0-9-]")
138+
if value == 'deis':
139+
raise serializers.ValidationError("App IDs cannot be 'deis'")
138140
return attrs
139141

140142

docs/contributing/localdev.rst

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,23 +132,14 @@ receive full admin permissions.
132132

133133
.. code-block:: console
134134
135-
$ deis register http://local.deisapp.com:8000
135+
$ deis register http://deis.local.deisapp.com
136136
username: myuser
137137
password:
138138
password (confirm):
139139
email: myuser@example.com
140140
Registered myuser
141141
Logged in as myuser
142142
143-
.. note::
144-
145-
As of v0.5.1, the proxy was removed for Deis platform services. It has yet to be added
146-
back in. See `issue 535`_ for more details.
147-
148-
As a workaround, use the following:
149-
150-
:code:`deis register http://local.deisapp.com:8000`
151-
152143
Once the user is registered, add your SSH key for ``git push``
153144
access using:
154145

@@ -252,4 +243,3 @@ ensure the pull request doesn't break any tests or reduce code coverage.
252243
.. _`VirtualBox`: https://www.virtualbox.org/
253244
.. _`fork the Deis repository`: https://github.com/deis/deis/fork
254245
.. _`pull request`: https://github.com/deis/deis/pulls
255-
.. _`issue 535`: https://github.com/deis/deis/issues/535

docs/developer/deploy-application.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Deploy an Application
77
=====================
8-
An :ref:`Application` is deployed to Deis using ``git push`` or the ``deis`` client.
8+
An :ref:`Application` is deployed to Deis using ``git push`` or the ``deis`` client.
99

1010
Supported Applications
1111
----------------------
@@ -21,7 +21,7 @@ Before deploying an application, users must first authenticate against the Deis
2121

2222
.. code-block:: console
2323
24-
$ deis login http://example.com:8000
24+
$ deis login http://deis.example.com
2525
username: deis
2626
password:
2727
Logged in as deis
@@ -50,4 +50,4 @@ Learn how to use deploy applications on Deis :ref:`using-dockerfiles`.
5050
.. _`twelve-factor methodology`: http://12factor.net/
5151
.. _`Heroku Buildpacks`: https://devcenter.heroku.com/articles/buildpacks
5252
.. _`Dockerfiles`: http://docs.docker.io/en/latest/use/builder/
53-
.. _`Docker Image`: http://docs.docker.io/introduction/understanding-docker/
53+
.. _`Docker Image`: http://docs.docker.io/introduction/understanding-docker/

docs/developer/register-user.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ to create a new account. You will be logged in automatically.
1414

1515
.. code-block:: console
1616
17-
$ deis register http://deis.example.com:8000
17+
$ deis register http://deis.example.com
1818
username: myuser
1919
password:
2020
password (confirm):
@@ -52,13 +52,11 @@ If you already have an account, use ``deis login`` to authenticate against the D
5252

5353
.. code-block:: console
5454
55-
$ deis login http://example.com:8000
55+
$ deis login http://deis.example.com
5656
username: deis
5757
password:
5858
Logged in as deis
5959
6060
.. note::
6161

6262
Deis session information is stored in your user's ~/.deis directory.
63-
64-
.. _`issue 535`: https://github.com/deis/deis/issues/535

docs/operations/configure-dns.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Configure DNS
99
For local clusters, we've created the DNS record ``local.deisapp.com`` which resolves to the IP of the first VM, 172.17.8.100.
1010
You can use ``local.deisapp.com`` to both log into the controller and to access applications that you've deployed (they will be subdomains of ``local.deisapp.com``, like ``happy-unicorn.local.deisapp.com``). Similarly, you can use ``local3.deisapp.com`` or ``local5.deisapp.com`` for 3- and 5-node clusters, respectively. No DNS configuration is necessary for local clusters.
1111

12-
For Deis clusters hosted elsewhere (EC2, Rackspace, bare metal, etc.), DNS records will need to be created to point to the cluster. For a one-node cluster, we schedule and launch one router, and deis-router and deis-controller will run on the same host. So, both DNS records specified below can be configured to point to this one machine.
12+
For Deis clusters hosted elsewhere (EC2, Rackspace, bare metal, etc.), DNS records will need to be created to point to the cluster. For a one-node cluster, we schedule and launch one router, and deis-router and deis-controller will run on the same host. So, the DNS record specified below can be configured to point to this one machine.
1313

1414
On a multi-node cluster, however, there are probably multiple routers, and the controller will likely be scheduled on a separate machine. As mentioned in :ref:`configure-load-balancers`, a load balancer is recommended in this scenario.
1515

@@ -18,8 +18,9 @@ Note that the controller will eventually live behind the routers so that all ext
1818
Necessary DNS records
1919
---------------------
2020

21-
The DNS records for Deis should be configured as such:
22-
* ``deis.example.org`` should resolve to the IP of the machine that runs ``deis-controller``
23-
* ``*.deis.example.org`` (a wildcard DNS entry) should point to the load balancer (or the same machine for 1-node Vagrant, or any single instance of ``deis-router`` if one likes to live life on the edge)
21+
Deis requires one wildcard DNS record. Assuming ``myapps.com`` is the top-level domain apps will live under:
22+
* ``*.myapps.com`` should have A-record entries for each of the load balancer IP addresses
2423

25-
These records are necessary for all deployments of Deis (EC2, Rackspace, bare metal, etc.). Local clusters can use the hostnames ``local.deisapp.com``, ``local3.deisapp.com``, or ``local5.deiaspp.com``.
24+
Apps can then be accessed via ``appname.myapps.com``, and the Deis controller can be accessed at ``deis.myapps.com``.
25+
26+
This record is necessary for all deployments of Deis (EC2, Rackspace, bare metal, etc.). Local clusters can use the domain ``local.deisapp.com``, ``local3.deisapp.com``, or ``local5.deiaspp.com``.

docs/operations/register-admin-user.rst

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,13 @@ Now that the client is installed, create a user account on the Deis :ref:`Contro
4242

4343
.. code-block:: console
4444
45-
$ deis register http://deis.example.com:8000
45+
$ deis register http://deis.example.com
4646
username: myuser
4747
password:
4848
password (confirm):
4949
email: myuser@example.com
5050
Registered myuser
5151
Logged in as myuser
5252
53-
.. note::
54-
55-
As of v0.5.1, the proxy was removed for Deis platform services. It has yet to be added
56-
back in. See `issue 535`_ for more details.
57-
58-
As a workaround, use the following:
59-
60-
:code:`deis register http://deis.example.com:8000`
61-
62-
6353
.. _pip: http://www.pip-installer.org/en/latest/installing.html
6454
.. _Python: https://www.python.org/
65-
.. _`issue 535`: https://github.com/deis/deis/issues/535

0 commit comments

Comments
 (0)