Skip to content

Commit 07f641a

Browse files
committed
Move project config to "Preventing Abuse" in usage
1 parent 6f840ec commit 07f641a

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

docs/config.rst

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
11
Configuration
22
=============
33

4-
We must first configure the client to allow certain hosts to report
5-
errors. This prevents abuse so somebody else couldn't start sending
6-
errors to your account from their site.
4+
To get started, you need to configure Raven.js to use your Sentry DSN:
75

8-
**Note**: Without setting this, all messages will be rejected!
9-
10-
This can be found under the *Project Details* page in Sentry.
11-
12-
Now need to set up Raven.js to use your Sentry DSN.
13-
14-
.. code-block:: javascript
6+
.. sourcecode:: javascript
157

168
Raven.config('___PUBLIC_DSN___').install()
179

1810
At this point, Raven is ready to capture any uncaught exception.
1911

20-
Although, this technically works, this is not going to yield the greatest
21-
results. It's highly recommended to next check out :doc:`usage`.
22-
2312
Optional settings
2413
-----------------
2514

26-
``Raven.config()`` can be passed an optional object for extra configuration.
15+
``Raven.config()`` can optionally be passed an additional argument for extra configuration:
16+
17+
.. sourcecode:: javascript
18+
19+
Raven.config('___PUBLIC_DSN___', {
20+
release: '1.3.0'
21+
}).install()
22+
23+
Those configuration options are documented below:
2724

2825
.. describe:: logger
2926

docs/index.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,6 @@ scripts. For all details see :doc:`install`.
2828

2929
<script src="https://cdn.ravenjs.com/2.0.4/raven.min.js"></script>
3030

31-
Configuring the Project
32-
-----------------------
33-
34-
We must first configure Sentry to allow certain hosts to report errors.
35-
This prevents abuse so somebody else couldn't start sending errors to your
36-
account from their site.
37-
38-
This can be found under the **Project Settings** page in Sentry. You'll need
39-
to add each domain that you plan to report from into the **Allowed Domains**
40-
box. Alternatively if you're not worried about CORS security, you can simply
41-
enter ``*`` to whitelist all domains.
4231

4332
Configuring the Client
4433
----------------------

docs/usage.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,3 +289,16 @@ deduplicate by taking into account the URL:
289289
.. sentry:edition:: hosted, on-premise
290290
291291
For more information, see :ref:`custom-grouping`.
292+
293+
Preventing Abuse
294+
----------------
295+
296+
By default, the Sentry server accepts errors from any host. This can lead to an abuse
297+
scenario where a malicious party triggers JavaScript errors from a different website that are
298+
accepted by your Sentry Project. To prevent this, it is recommended to whitelist known hosts where your
299+
JavaScript code is operating.
300+
301+
This setting can be found under the **Project Settings** page in Sentry. You'll need
302+
to add each domain that you plan to report from into the **Allowed Domains**
303+
box. When an error is collected by Raven.js and transmitted to Sentry, Sentry will verify the ``Origin`` and/or
304+
``Referer`` headers of the HTTP request to verify that it matches one of your allowed hosts.

0 commit comments

Comments
 (0)