~benji/charms/precise/juju-gui/fix-cache-headers

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!--
README.md
Copyright 2013 Canonical Ltd.
This work is licensed under the Creative Commons Attribution-Share Alike 3.0
Unported License. To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative
Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
-->

# Juju GUI Charm #

This charm makes it easy to deploy a Juju GUI into an existing environment.

## Supported Browsers ##

The Juju GUI supports recent releases of the Chrome, Chromium and Firefox web
browsers.

## Demo and Staging Servers ##

The Juju GUI runs the Juju Charm Store on 
[jujucharms.com](http://jujucharms.com).  From there,  you can browse charms,
try the GUI, and build an example environment to export for use elsewhere.

A [staging server](http://comingsoon.jujucharms.com/) is also available,
running the latest and greatest version.

## Deploying the Juju GUI ##

Deploying the Juju GUI is accomplished using Juju itself.

You need a configured and bootstrapped Juju environment: see the Juju docs
about [getting started](https://juju.ubuntu.com/docs/getting-started.html),
and then run the usual bootstrap command.

    juju bootstrap

Next, you simply need to deploy the charm and expose it.  (See also "Deploying
with Jitsu" below, for another option.)

    juju deploy juju-gui
    juju expose juju-gui

Finally, you need to identify the GUI's URL. It can take a few minutes for the
GUI to be built and to start; this command will let you see when it is ready
to go by giving you regular status updates:

    watch juju status

Eventually, at the end of the status you will see something that looks like
this:

    services:
      juju-gui:
        charm: cs:precise/juju-gui-7
        exposed: true
        relations: {}
        units:
          juju-gui/0:
            agent-state: started
            machine: 1
            open-ports:
            - 80/tcp
            - 443/tcp
            public-address: ec2-www-xxx-yyy-zzz.compute-1.amazonaws.com

That means you can go to the public-address in my browser via HTTPS
(https://ec2-www-xxx-yyy-zzz.compute-1.amazonaws.com/ in this example), and
start configuring the rest of Juju with the GUI.  You should see a similar
web address.  Accessing the GUI via HTTP will redirect to using HTTPS.

By default, the deployment uses self-signed certificates. The browser will ask
you to accept a security exception once.

You will see a login form with the username fixed to "user-admin" (for juju-
core) or "admin" (for pyjuju). The password is the same as your Juju
environment's `admin-secret`, found in `~/.juju/environments.yaml`.

### Deploying behind a firewall ###

While we may change this in the future to make firewall deploys simpler, this
charm pulls the latest release from the Juju GUI page on Launchpad.  If you
are behind a firewall, however, this may not be available to you.  In this case,
you can configure the charm to pull the GUI release from a location you specify.

For both Juju Core and PyJuju, you must simply do the following steps.  Note
that PyJuju must do these steps, plus another set described further below.

The config variable `juju-gui-source` allows a `url:` prefix which understands
both `http://` and `file://` protocols.  We will use this to load a local copy
of the GUI source.

1. Download the latest release of the Juju GUI Source from [the Launchpad
downloads page](https://launchpad.net/juju-gui/+download) and save it to a
location that will be accessible to the *unit* either via filesystem or HTTP.
2. Set the config variable to that location using a command such as

    `juju set juju-gui juju-gui-source=url:...`

    where the ellipsis after the `url:` is your `http://` or `file://` URI.  This
    may also be done during the deploy step using `--config`.

3. If you had already tried to deploy the GUI and received an install error due
to not being able to retrieve the source, you may also need to retry the unit
with the following command (using the unit the GUI is deployed on):

    `juju resolved --retry juju-gui/0`

These steps are sufficient for Juju Core.  If you are using PyJuju, you need to
do another set of steps in addition.

1. Use bzr to branch lp:~hazmat/juju/rapi-rollup locally ("bzr branch
lp:~hazmat/juju/rapi-rollup") and copy the branch to the gui service machine.

2. Use "juju set juju-gui juju-api-branch=PATH_TO_LOCAL_BZR_BRANCH" (where the
path is *not* a file:// URI).

3. Retry as described in the step 3 above (`juju resolved --retry juju-gui/0`).

### Deploying to a chosen machine ###

The instructions above cause you to use a separate machine to work with the
GUI.  If you'd like to reduce your machine footprint (and perhaps your costs),
you can colocate the GUI with the Juju bootstrap node.

This approach might change in the future (possibly with the Juju shipped with
Ubuntu 13.10), so be warned.

The instructions differ depending on the Juju implementation.

#### juju-core ####

Replace "juju deploy cs:precise/juju-gui" from the previous
instructions with this:

    juju deploy --force-machine 0 cs:precise/juju-gui

#### pyjuju ####

Colocation support is not included by default in the pyjuju implementation; to
activate it, you will need to install Jitsu:

    sudo apt-get install juju-jitsu

and then replace "juju deploy cs:precise/juju-gui" from the previous
instructions with this:

    jitsu deploy-to 0 cs:precise/juju-gui

## Contacting the Developers ##

If you run into problems with the charm, please feel free to contact us on the
[Juju mailing list](https://lists.ubuntu.com/mailman/listinfo/juju), or on
Freenode's IRC network on #juju.  We're not always around (working hours in
Europe and North America are your best bets), but if you send us a mail or
ping "jujugui" we will eventually get back to you.

If you want to help develop the charm, please see the charm's `HACKING.md`.