Skip to content

Commit 5c845bf

Browse files
committed
Update deployment page
1 parent 03bbc64 commit 5c845bf

21 files changed

+543
-87
lines changed
1.06 KB
Binary file not shown.
12.4 KB
Binary file not shown.

_build/doctrees/deployment.doctree

935 Bytes
Binary file not shown.

_build/doctrees/environment.pickle

732 Bytes
Binary file not shown.

_build/doctrees/index.doctree

1 Byte
Binary file not shown.

_build/html/_sources/authentication.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,9 @@ For those situations where it is not possible to group users in this
280280
way it is possible to selectively allow access on a per-user basis. How
281281
this is done depends on whether you are using Google, GitHub or GitLab
282282
as OAuth2 provider for user login.
283+
284+
285+
.. _user roles:
286+
287+
User Roles
288+
----------
File renamed without changes.

_build/html/_sources/deployment.txt

Lines changed: 79 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ Deployment
66
WSGI Server
77
-----------
88

9-
There are many ways to deploy Alerta. It can be run as ``alertad`` during development or testing but when run in a production environment, it should `always be deployed`_ as a WSGI application. See the list of `real world`_ examples below for different ways to run Alerta as a WSGI application.
9+
There are many ways to deploy Alerta. It can be run as ``alertad``
10+
during development or testing but when run in a production environment,
11+
it should `always be deployed`_ as a WSGI application. See the list
12+
of `real world`_ examples below for different ways to run Alerta as
13+
a WSGI application.
1014

1115
.. _always be deployed: http://flask.pocoo.org/docs/0.10/deploying/
1216
.. _WSGI: http://www.fullstackpython.com/wsgi-servers.html
@@ -16,17 +20,24 @@ There are many ways to deploy Alerta. It can be run as ``alertad`` during develo
1620
Web Proxy
1721
---------
1822

19-
Running the Alerta API behind a web proxy can greatly simplify the Web UI setup which means you can completely `avoid`_ the potential for any cross-origin issues.
23+
Running the Alerta API behind a web proxy can greatly simplify the
24+
Web UI setup which means you can completely `avoid`_ the potential
25+
for any cross-origin issues.
2026

2127
.. _avoid: http://oskarhane.com/avoid-cors-with-nginx-proxy_pass/
2228

23-
Also, if you run the API on an HTTPS/SSL endpoint then it can reduce the possibility of `mixed content`_ errors when a web application hosted on a HTTP endpoint tries to access resources on an HTTPS endpoint.
29+
Also, if you run the API on an HTTPS/SSL endpoint then it can
30+
reduce the possibility of `mixed content`_ errors when a web
31+
application hosted on a HTTP endpoint tries to access resources
32+
on an HTTPS endpoint.
2433

2534
.. _mixed content: https://developer.mozilla.org/en-US/docs/Security/MixedContent/How_to_fix_website_with_mixed_content
2635

2736
**Example API configuration (extract)**
2837

29-
This example nginx server is configured to serve the web UI from the root ``/`` path and reverse-proxy API requests to ``/api`` to the WSGI application running on port 8080::
38+
This example nginx server is configured to serve the web UI from
39+
the root ``/`` path and reverse-proxy API requests to ``/api`` to
40+
the WSGI application running on port 8080::
3041

3142
server {
3243

@@ -50,24 +61,29 @@ This example nginx server is configured to serve the web UI from the root ``/``
5061
server localhost:8080 fail_timeout=0;
5162
}
5263

53-
The web UI configuration file :file:`config.js` for this setup would simply be ``/api`` for the ``endpoint`` value, as follows::
64+
The web UI configuration file :file:`config.js` for this setup would
65+
simply be ``/api`` for the ``endpoint`` value, as follows::
5466

5567
'use strict';
68+
5669
angular.module('config', [])
5770
.constant('config', {
5871
'endpoint' : "/api",
5972
'provider' : "basic"
60-
})
61-
.constant('colors', {});
73+
});
6274

6375
.. _static website:
6476

6577
Static Website
6678
--------------
6779

68-
The Alerta web UI is just a directory of static assets that can be served from any location. An easy and cheap way to serve the web UI is from an `Amazon S3 bucket`_ as a static website.
80+
The Alerta web UI is just a directory of static assets that can be
81+
served from any location. An easy and cheap way to serve the web UI
82+
is from an `Amazon S3 bucket`_ as a static website.
6983

70-
.. note:: Serving the Alerta web UI from a static web hosting site **will not work** unless that domain is listed in the ``CORS_ORIGINS`` Alerta API server configuration settings.
84+
.. note:: Serving the Alerta web UI from a static web hosting site
85+
**will not work** unless that domain is listed in the
86+
``CORS_ORIGINS`` Alerta API server configuration settings.
7187

7288
.. _Amazon S3 bucket: http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html
7389

@@ -76,39 +92,52 @@ The Alerta web UI is just a directory of static assets that can be served from a
7692
Authentication & SSL
7793
--------------------
7894

79-
Alerta supports several authentication mechanisms for both the API and the web UI and some key features of the web UI, like :ref:`watching alerts <watched alerts>`, are only available if authentication is enabled.
95+
Alerta supports several authentication mechanisms for both the API
96+
and the web UI and some key features of the web UI, like
97+
:ref:`watching alerts <watched alerts>`, are only available if
98+
authentication is enabled.
8099

81-
The API can be secured using :ref:`API keys` and the web UI can be secured using :ref:`Basic Auth <basic auth>` or an :ref:`OAuth <oauth2>` provider from either Google or Github.
100+
The API can be secured using :ref:`API keys` and the web UI can
101+
be secured using :ref:`Basic Auth <basic auth>` or an :ref:`OAuth <oauth2>`
102+
provider from either Google or Github.
82103

83-
If you plan to make the web UI accessible from a public URL it is strongly advised to :ref:`enforce authentication <Authentication>` and use HTTPS/SSL connections to the Alerta API to protect private alert data.
104+
If you plan to make the web UI accessible from a public URL it is
105+
strongly advised to :ref:`enforce authentication <Authentication>`
106+
and use HTTPS/SSL connections to the Alerta API to protect private
107+
alert data.
84108

85109
.. _auth_cv:
86110

87111
Authorisation & Customer Views
88112
------------------------------
89113

90-
To restrict access to certain features use roles and customer views.
91-
92-
93-
114+
To restrict access to certain features use :ref:`roles <user roles>`
115+
and :ref:`customer views <customer views>`.
94116

95117
.. _scalability:
96118

97119
Scalability
98120
-----------
99121

100-
Alerta can scale horizontally, in the same way any other web application scales horizontally -- a load balancer handles the HTTP requests and distributes those requests between all available application servers.
122+
Alerta can scale horizontally, in the same way any other web
123+
application scales horizontally -- a load balancer handles the
124+
HTTP requests and distributes those requests between all available
125+
application servers.
101126

102127
.. _scale horizontally: https://blog.openshift.com/best-practices-for-horizontal-application-scaling/
103128

104-
.. note:: If using multiple API servers ensure the same ``SECRET_KEY`` is used across all servers otherwise there will be problems with web UI user logins.
129+
.. note:: If using multiple API servers ensure the same ``SECRET_KEY``
130+
is used across all servers otherwise there will be problems
131+
with web UI user logins.
105132

106133
.. _high availability:
107134

108135
High Availability
109136
-----------------
110137

111-
To achieve high system availability the Alerta API should be deployed to scale out :ref:`horizontally <scalability>` and the MongoDB database should be deployed as a `replica set`_.
138+
To achieve high system availability the Alerta API should be
139+
deployed to scale out :ref:`horizontally <scalability>` and
140+
the MongoDB database should be deployed as a `replica set`_.
112141

113142
.. _replica set: http://docs.mongodb.org/manual/tutorial/deploy-replica-set/#overview
114143

@@ -117,32 +146,53 @@ To achieve high system availability the Alerta API should be deployed to scale o
117146
House Keeping
118147
-------------
119148

120-
There are some jobs that should be run periodically to keep the Alerta console clutter free. To timeout *expired* alerts and delete old *closed* alerts run a contributed MongoDB script_ called :file:`housekeepingAlerts.js` at regular intervals via ``cron``.
149+
There are some jobs that should be run periodically to keep the
150+
Alerta console clutter free. To timeout *expired* alerts and
151+
delete old *closed* alerts run a contributed MongoDB script_
152+
called :file:`housekeepingAlerts.js` at regular intervals
153+
via ``cron``.
121154

122155
.. _script: https://github.com/guardian/alerta/blob/master/contrib/mongo/housekeepingAlerts.js
123156

124157
.. _stale heartbeats:
125158

126-
:ref:`Heartbeats <heartbeats>` can be sent from any source to ensure that a system is 'alive'. To generate alerts for stale heartbeats the ``alerta`` command-line tool can be used::
159+
:ref:`Heartbeats <heartbeats>` can be sent from any source to
160+
ensure that a system is 'alive'. To generate alerts for stale
161+
heartbeats the ``alerta`` command-line tool can be used::
127162

128163
$ alerta heartbeats --alert
129164

130-
Again, this should be run at regular intervals via ``cron`` or some other scheduler.
165+
Again, this should be run at regular intervals via ``cron`` or
166+
some other scheduler.
131167

132168
.. _metrics:
133169

134170
Management & Metrics
135171
--------------------
136172

137-
Use the management endpoint :file:`/management/status` to keep track of realtime statistics on the performance of the Alerta API like alert counts and average processing time. For convenience, these statistics can be viewed in the *About* page of the Alerta web UI or using the `alerta` command-line tool :ref:`status <cli_status>` command.
173+
Use the management endpoint :file:`/management/status` to keep
174+
track of realtime statistics on the performance of the Alerta API
175+
like alert counts and average processing time. For convenience,
176+
these statistics can be viewed in the *About* page of the Alerta
177+
web UI or using the ``alerta`` command-line tool
178+
:ref:`status <cli_status>` command.
138179

139180
Web UI Analytics
140181
----------------
141182

142-
Google analytics can be used to track usage of the Alerta web UI console. Just create a new tracking code with the `Google analytics`_ console and replace the ``@@TRACKING_ID`` placeholder in the `index.html` file during deployment of the web UI::
183+
Google analytics can be used to track usage of the Alerta web UI
184+
console. Just create a new tracking code with the `Google analytics`_
185+
console and add it to the ``config.js`` web console configuration
186+
file::
143187

144-
$ export GOOGLE_TRACKING_ID=UA-xxxxxxxx-x
145-
$ sed -i s/@@TRACKING_ID/${GOOGLE_TRACKING_ID}/ index.html
188+
'use strict';
189+
190+
angular.module('config', [])
191+
.constant('config', {
192+
'endpoint' : "/api",
193+
'provider' : "basic",
194+
'tracking_id' : "UA-NNNNNN-N" // Google Analytics tracking ID
195+
});
146196

147197
.. _Google analytics: https://analytics.google.com/analytics/web/
148198

@@ -151,7 +201,9 @@ Google analytics can be used to track usage of the Alerta web UI console. Just c
151201
Real World Examples
152202
-------------------
153203

154-
Below are several different examples of how to run Alerta in production from a Debian `vagrant box`_, an `AWS EC2 instance`_, `RedHat Openshift PaaS`_ to a `Docker container`_.
204+
Below are several different examples of how to run Alerta in production
205+
from a Debian `vagrant box`_, an `AWS EC2 instance`_,
206+
`RedHat Openshift PaaS`_ to a `Docker container`_.
155207

156208
.. _vagrant box: https://docs.vagrantup.com/v2/boxes.html
157209
.. _AWS EC2 instance: https://aws.amazon.com/ec2/

_build/html/_sources/index.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The API Explorer website can be used to query for, and send alerts to, the http:
5151
authentication
5252
configuration
5353
deployment
54-
customerviews
54+
customer-views
5555
conventions
5656
development
5757
Tutorials <tutorials>

_build/html/authentication.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,9 @@ <h3>GitLab OAuth2<a class="headerlink" href="#gitlab-oauth2" title="Permalink to
299299
this is done depends on whether you are using Google, GitHub or GitLab
300300
as OAuth2 provider for user login.</p>
301301
</div>
302+
<div class="section" id="user-roles">
303+
<span id="id7"></span><h2>User Roles<a class="headerlink" href="#user-roles" title="Permalink to this headline"></a></h2>
304+
</div>
302305
</div>
303306

304307

@@ -367,11 +370,12 @@ <h3>Navigation</h3>
367370
<li class="toctree-l2"><a class="reference internal" href="#oauth2-authentication">OAuth2 Authentication</a></li>
368371
<li class="toctree-l2"><a class="reference internal" href="#api-keys">API Keys</a></li>
369372
<li class="toctree-l2"><a class="reference internal" href="#user-authorisation">User Authorisation</a></li>
373+
<li class="toctree-l2"><a class="reference internal" href="#user-roles">User Roles</a></li>
370374
</ul>
371375
</li>
372376
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
373377
<li class="toctree-l1"><a class="reference internal" href="deployment.html">Deployment</a></li>
374-
<li class="toctree-l1"><a class="reference internal" href="customerviews.html">Customer Views</a></li>
378+
<li class="toctree-l1"><a class="reference internal" href="customer-views.html">Customer Views</a></li>
375379
<li class="toctree-l1"><a class="reference internal" href="conventions.html">Conventions</a></li>
376380
<li class="toctree-l1"><a class="reference internal" href="development.html">Development</a></li>
377381
<li class="toctree-l1"><a class="reference internal" href="tutorials.html">Tutorials</a></li>

0 commit comments

Comments
 (0)