2018-03-19 14:14:37 -07:00
|
|
|
Brozzler Job Configuration
|
2016-09-29 16:15:44 -07:00
|
|
|
**************************
|
2016-09-29 12:03:16 -07:00
|
|
|
|
2019-04-30 10:49:48 -07:00
|
|
|
Jobs are used to brozzle multiple seeds and/or apply settings and scope rules,
|
|
|
|
as defined byusing YAML files. At least one seed URL must be specified.
|
2018-07-06 15:24:12 -04:00
|
|
|
All other configurartions are optional.
|
2016-09-29 12:03:16 -07:00
|
|
|
|
2018-03-19 14:14:37 -07:00
|
|
|
.. contents::
|
|
|
|
|
|
|
|
Example
|
|
|
|
=======
|
2016-09-29 12:03:16 -07:00
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
id: myjob
|
|
|
|
time_limit: 60 # seconds
|
2018-03-19 14:14:37 -07:00
|
|
|
proxy: 127.0.0.1:8000 # point at warcprox for archiving
|
2016-09-29 12:03:16 -07:00
|
|
|
ignore_robots: false
|
2018-03-01 17:17:54 -08:00
|
|
|
max_claimed_sites: 2
|
2016-09-29 12:03:16 -07:00
|
|
|
warcprox_meta:
|
|
|
|
warc-prefix: job1
|
|
|
|
stats:
|
|
|
|
buckets:
|
|
|
|
- job1-stats
|
|
|
|
metadata: {}
|
|
|
|
seeds:
|
|
|
|
- url: http://one.example.org/
|
|
|
|
warcprox_meta:
|
|
|
|
warc-prefix: job1-seed1
|
|
|
|
stats:
|
|
|
|
buckets:
|
|
|
|
- job1-seed1-stats
|
|
|
|
- url: http://two.example.org/
|
|
|
|
time_limit: 30
|
|
|
|
- url: http://three.example.org/
|
|
|
|
time_limit: 10
|
|
|
|
ignore_robots: true
|
|
|
|
scope:
|
|
|
|
surt: http://(org,example,
|
|
|
|
|
2018-03-19 14:14:37 -07:00
|
|
|
How inheritance works
|
2016-09-29 16:15:44 -07:00
|
|
|
=====================
|
2016-09-29 12:03:16 -07:00
|
|
|
|
2018-03-19 16:54:17 -07:00
|
|
|
Most of the settings that apply to seeds can also be specified at the top
|
|
|
|
level, in which case all seeds inherit those settings. If an option is
|
2019-04-30 10:49:48 -07:00
|
|
|
specified both at the top level and at the seed level, the results are merged.
|
2018-07-06 15:24:12 -04:00
|
|
|
In cases of coflict, the seed-level value takes precedence.
|
2016-09-29 12:03:16 -07:00
|
|
|
|
|
|
|
In the example yaml above, ``warcprox_meta`` is specified at the top level and
|
|
|
|
at the seed level for the seed http://one.example.org/. At the top level we
|
|
|
|
have::
|
|
|
|
|
|
|
|
warcprox_meta:
|
|
|
|
warc-prefix: job1
|
|
|
|
stats:
|
|
|
|
buckets:
|
|
|
|
- job1-stats
|
|
|
|
|
|
|
|
At the seed level we have::
|
|
|
|
|
|
|
|
warcprox_meta:
|
|
|
|
warc-prefix: job1-seed1
|
|
|
|
stats:
|
|
|
|
buckets:
|
|
|
|
- job1-seed1-stats
|
|
|
|
|
|
|
|
The merged configuration as applied to the seed http://one.example.org/ will
|
|
|
|
be::
|
|
|
|
|
|
|
|
warcprox_meta:
|
|
|
|
warc-prefix: job1-seed1
|
|
|
|
stats:
|
|
|
|
buckets:
|
|
|
|
- job1-stats
|
|
|
|
- job1-seed1-stats
|
|
|
|
|
2018-07-06 15:24:12 -04:00
|
|
|
In this example:
|
2016-09-29 12:03:16 -07:00
|
|
|
|
|
|
|
- There is a collision on ``warc-prefix`` and the seed-level value wins.
|
|
|
|
- Since ``buckets`` is a list, the merged result includes all the values from
|
|
|
|
both the top level and the seed level.
|
2016-09-29 16:15:44 -07:00
|
|
|
|
2018-03-20 17:31:42 -07:00
|
|
|
Settings
|
|
|
|
========
|
2016-09-29 16:15:44 -07:00
|
|
|
|
2018-03-19 14:14:37 -07:00
|
|
|
Top-level settings
|
|
|
|
------------------
|
|
|
|
|
2017-06-23 13:56:25 -07:00
|
|
|
``id``
|
2018-03-19 14:14:37 -07:00
|
|
|
~~~~~~
|
|
|
|
+--------+----------+--------------------------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+==========================+
|
|
|
|
| string | no | *generated by rethinkdb* |
|
|
|
|
+--------+----------+--------------------------+
|
2016-09-29 16:15:44 -07:00
|
|
|
An arbitrary identifier for this job. Must be unique across this deployment of
|
|
|
|
brozzler.
|
|
|
|
|
2018-03-01 17:17:54 -08:00
|
|
|
``max_claimed_sites``
|
2018-03-19 14:14:37 -07:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| number | no | *none* |
|
|
|
|
+--------+----------+---------+
|
2018-03-01 17:17:54 -08:00
|
|
|
Puts a cap on the number of sites belonging to a given job that can be brozzled
|
|
|
|
simultaneously across the cluster. Addresses the problem of a job with many
|
|
|
|
seeds starving out other jobs.
|
|
|
|
|
2018-03-19 14:14:37 -07:00
|
|
|
``seeds``
|
|
|
|
~~~~~~~~~
|
|
|
|
+------------------------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========================+==========+=========+
|
|
|
|
| list (of dictionaries) | yes | *n/a* |
|
|
|
|
+------------------------+----------+---------+
|
|
|
|
List of seeds. Each item in the list is a dictionary (associative array) which
|
|
|
|
defines the seed. It must specify ``url`` (see below) and can additionally
|
2018-03-19 16:54:17 -07:00
|
|
|
specify any seed settings.
|
2018-03-19 14:14:37 -07:00
|
|
|
|
|
|
|
Seed-level-only settings
|
|
|
|
------------------------
|
2018-07-06 15:24:12 -04:00
|
|
|
These settings can be specified only at the seed level, unlike the settings
|
|
|
|
below that can also be specified at the top level.
|
2018-03-19 14:14:37 -07:00
|
|
|
|
2017-06-23 13:56:25 -07:00
|
|
|
``url``
|
2018-03-19 14:14:37 -07:00
|
|
|
~~~~~~~
|
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| string | yes | *n/a* |
|
|
|
|
+--------+----------+---------+
|
2018-07-06 15:24:12 -04:00
|
|
|
The seed URL. Brozzling starts here.
|
2016-09-29 16:15:44 -07:00
|
|
|
|
2018-03-19 14:14:37 -07:00
|
|
|
``username``
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| string | no | *none* |
|
|
|
|
+--------+----------+---------+
|
2018-03-19 16:54:17 -07:00
|
|
|
If set, used to populate automatically detected login forms. See explanation at
|
|
|
|
"password" below.
|
2018-03-19 14:14:37 -07:00
|
|
|
|
|
|
|
``password``
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| string | no | *none* |
|
|
|
|
+--------+----------+---------+
|
2018-03-19 16:54:17 -07:00
|
|
|
If set, used to populate automatically detected login forms. If ``username``
|
|
|
|
and ``password`` are configured for a seed, brozzler will look for a login form
|
|
|
|
on each page it crawls for that seed. A form that has a single text or email
|
|
|
|
field (the username), a single password field (``<input type="password">``),
|
2018-07-06 15:24:12 -04:00
|
|
|
and has ``method="POST"`` is considered to be a login form. When forms have
|
|
|
|
other fields like checkboxes and/or hidden fields, brozzler will leave
|
2018-05-15 11:01:09 -07:00
|
|
|
the default values in place. Brozzler submits login forms after page load.
|
|
|
|
Then brozzling proceeds as usual.
|
2018-03-19 14:14:37 -07:00
|
|
|
|
|
|
|
Seed-level / top-level settings
|
|
|
|
-------------------------------
|
2018-07-06 15:24:12 -04:00
|
|
|
These are seed settings that can also be specified at the top level, in which
|
2018-03-19 14:14:37 -07:00
|
|
|
case they are inherited by all seeds.
|
|
|
|
|
2017-06-23 13:56:25 -07:00
|
|
|
``metadata``
|
2018-03-19 14:14:37 -07:00
|
|
|
~~~~~~~~~~~~
|
|
|
|
+------------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+============+==========+=========+
|
2018-05-15 11:01:09 -07:00
|
|
|
| dictionary | no | *none* |
|
2018-03-19 14:14:37 -07:00
|
|
|
+------------+----------+---------+
|
2019-04-30 10:49:48 -07:00
|
|
|
Information about the crawl job or site. Could be useful for external
|
|
|
|
descriptive or informative metadata, but not used by brozzler in the course of
|
2018-07-06 15:24:12 -04:00
|
|
|
archiving.
|
2017-06-23 13:56:25 -07:00
|
|
|
|
|
|
|
``time_limit``
|
2018-03-19 14:14:37 -07:00
|
|
|
~~~~~~~~~~~~~~
|
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| number | no | *none* |
|
|
|
|
+--------+----------+---------+
|
2018-05-15 11:01:09 -07:00
|
|
|
Time limit in seconds. If not specified, there is no time limit. Time limit is
|
2016-09-29 16:15:44 -07:00
|
|
|
enforced at the seed level. If a time limit is specified at the top level, it
|
|
|
|
is inherited by each seed as described above, and enforced individually on each
|
|
|
|
seed.
|
|
|
|
|
2018-03-19 14:14:37 -07:00
|
|
|
``proxy``
|
|
|
|
~~~~~~~~~
|
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| string | no | *none* |
|
|
|
|
+--------+----------+---------+
|
|
|
|
HTTP proxy, with the format ``host:port``. Typically configured to point to
|
|
|
|
warcprox for archival crawling.
|
|
|
|
|
2017-06-23 13:56:25 -07:00
|
|
|
``ignore_robots``
|
2018-03-19 14:14:37 -07:00
|
|
|
~~~~~~~~~~~~~~~~~
|
|
|
|
+---------+----------+-----------+
|
|
|
|
| type | required | default |
|
|
|
|
+=========+==========+===========+
|
|
|
|
| boolean | no | ``false`` |
|
|
|
|
+---------+----------+-----------+
|
2019-04-30 10:49:48 -07:00
|
|
|
If set to ``true``, brozzler will fetch pages that would otherwise be blocked
|
|
|
|
by `robots.txt rules
|
2018-07-06 15:24:12 -04:00
|
|
|
<https://en.wikipedia.org/wiki/Robots_exclusion_standard>`_.
|
2016-09-29 16:15:44 -07:00
|
|
|
|
2017-06-23 13:56:25 -07:00
|
|
|
``user_agent``
|
2018-03-19 14:14:37 -07:00
|
|
|
~~~~~~~~~~~~~~
|
|
|
|
+---------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+=========+==========+=========+
|
|
|
|
| string | no | *none* |
|
|
|
|
+---------+----------+---------+
|
2016-10-05 04:25:09 +11:00
|
|
|
The ``User-Agent`` header brozzler will send to identify itself to web servers.
|
2018-07-06 15:24:12 -04:00
|
|
|
It is good ettiquette to include a project URL with a notice to webmasters that
|
2019-04-30 10:49:48 -07:00
|
|
|
explains why you are crawling, how to block the crawler via robots.txt, and how
|
2018-07-06 15:24:12 -04:00
|
|
|
to contact the operator if the crawl is causing problems.
|
2016-10-05 04:25:09 +11:00
|
|
|
|
2017-06-23 13:56:25 -07:00
|
|
|
``warcprox_meta``
|
2018-03-19 14:14:37 -07:00
|
|
|
~~~~~~~~~~~~~~~~~
|
|
|
|
+------------+----------+-----------+
|
|
|
|
| type | required | default |
|
|
|
|
+============+==========+===========+
|
|
|
|
| dictionary | no | ``false`` |
|
|
|
|
+------------+----------+-----------+
|
2018-05-30 18:06:39 -07:00
|
|
|
Specifies the ``Warcprox-Meta`` header to send with every request, if ``proxy``
|
|
|
|
is configured. The value of the ``Warcprox-Meta`` header is a json blob. It is
|
|
|
|
used to pass settings and information to warcprox. Warcprox does not forward
|
2019-04-30 10:49:48 -07:00
|
|
|
the header on to the remote site. For further explanation of this field and
|
|
|
|
its uses see
|
2018-07-06 15:24:12 -04:00
|
|
|
https://github.com/internetarchive/warcprox/blob/master/api.rst
|
2016-09-29 16:15:44 -07:00
|
|
|
|
|
|
|
Brozzler takes the configured value of ``warcprox_meta``, converts it to
|
|
|
|
json and populates the Warcprox-Meta header with that value. For example::
|
|
|
|
|
|
|
|
warcprox_meta:
|
|
|
|
warc-prefix: job1-seed1
|
|
|
|
stats:
|
|
|
|
buckets:
|
|
|
|
- job1-stats
|
|
|
|
- job1-seed1-stats
|
|
|
|
|
|
|
|
becomes::
|
|
|
|
|
|
|
|
Warcprox-Meta: {"warc-prefix":"job1-seed1","stats":{"buckets":["job1-stats","job1-seed1-stats"]}}
|
|
|
|
|
2017-06-23 13:56:25 -07:00
|
|
|
``scope``
|
2018-03-19 14:14:37 -07:00
|
|
|
~~~~~~~~~
|
|
|
|
+------------+----------+-----------+
|
|
|
|
| type | required | default |
|
|
|
|
+============+==========+===========+
|
|
|
|
| dictionary | no | ``false`` |
|
|
|
|
+------------+----------+-----------+
|
2018-03-19 17:23:49 -07:00
|
|
|
Scope specificaion for the seed. See the "Scoping" section which follows.
|
2017-06-23 13:56:25 -07:00
|
|
|
|
2018-03-19 14:14:37 -07:00
|
|
|
Scoping
|
|
|
|
=======
|
|
|
|
|
2019-04-30 10:49:48 -07:00
|
|
|
The scope of a seed determines which links are scheduled for crawling ("in
|
2018-07-06 15:24:12 -04:00
|
|
|
scope") and which are not. For example::
|
2018-03-19 17:23:49 -07:00
|
|
|
|
|
|
|
scope:
|
|
|
|
accepts:
|
2018-05-14 17:31:45 -07:00
|
|
|
- ssurt: com,example,//https:/
|
2018-03-19 17:23:49 -07:00
|
|
|
- parent_url_regex: ^https?://(www\.)?youtube.com/(user|channel)/.*$
|
|
|
|
regex: ^https?://(www\.)?youtube.com/watch\?.*$
|
2018-05-14 16:59:55 -07:00
|
|
|
- surt: http://(com,google,video,
|
|
|
|
- surt: http://(com,googlevideo,
|
2018-03-19 17:23:49 -07:00
|
|
|
blocks:
|
|
|
|
- domain: youngscholars.unimelb.edu.au
|
|
|
|
substring: wp-login.php?action=logout
|
|
|
|
- domain: malware.us
|
|
|
|
max_hops: 20
|
2018-03-22 17:18:36 -07:00
|
|
|
max_hops_off: 0
|
2018-03-19 14:14:37 -07:00
|
|
|
|
2018-03-20 17:31:42 -07:00
|
|
|
Toward the end of the process of brozzling a page, brozzler obtains a list of
|
|
|
|
navigational links (``<a href="...">`` and similar) on the page, and evaluates
|
|
|
|
each link to determine whether it is in scope or out of scope for the crawl.
|
|
|
|
Then, newly discovered links that are in scope are scheduled to be crawled, and
|
|
|
|
previously discovered links get a priority bump.
|
|
|
|
|
2018-05-15 11:01:09 -07:00
|
|
|
How brozzler applies scope rules
|
|
|
|
--------------------------------
|
2018-05-14 17:31:45 -07:00
|
|
|
|
|
|
|
Each scope rule has one or more conditions. If all of the conditions match,
|
|
|
|
then the scope rule as a whole matches. For example::
|
|
|
|
|
|
|
|
- domain: youngscholars.unimelb.edu.au
|
|
|
|
substring: wp-login.php?action=logout
|
|
|
|
|
2018-07-06 15:24:12 -04:00
|
|
|
This rule applies if the domain of the URL is "youngscholars.unimelb.edu.au" or
|
2018-05-14 17:31:45 -07:00
|
|
|
a subdomain, and the string "wp-login.php?action=logout" is found somewhere in
|
2018-07-06 15:24:12 -04:00
|
|
|
the URL.
|
2018-05-14 17:31:45 -07:00
|
|
|
|
2018-07-06 15:24:12 -04:00
|
|
|
Brozzler applies these logical steps to decide whether a URL is in or out of
|
2018-05-15 11:01:09 -07:00
|
|
|
scope:
|
2018-05-14 17:31:45 -07:00
|
|
|
|
2018-07-06 15:24:12 -04:00
|
|
|
1. If the number of hops from seed is greater than ``max_hops``, the URL is
|
2018-05-14 17:31:45 -07:00
|
|
|
**out of scope**.
|
2018-07-06 15:24:12 -04:00
|
|
|
2. Otherwise, if any ``block`` rule matches, the URL is **out of scope**.
|
|
|
|
3. Otherwise, if any ``accept`` rule matches, the URL is **in scope**.
|
|
|
|
4. Otherwise, if the URL is at most ``max_hops_off`` hops from the last page
|
|
|
|
that was in scope because of an ``accept`` rule, the url is **in scope**.
|
2018-05-14 17:31:45 -07:00
|
|
|
5. Otherwise (no rules match), the url is **out of scope**.
|
2018-05-14 16:59:55 -07:00
|
|
|
|
2018-07-06 15:24:12 -04:00
|
|
|
In cases of conflict, ``block`` rules take precedence over ``accept`` rules.
|
2018-05-14 17:31:45 -07:00
|
|
|
|
2018-07-06 15:24:12 -04:00
|
|
|
Scope rules may be conceived as a boolean expression. For example::
|
2018-05-14 17:31:45 -07:00
|
|
|
|
|
|
|
blocks:
|
|
|
|
- domain: youngscholars.unimelb.edu.au
|
|
|
|
substring: wp-login.php?action=logout
|
|
|
|
- domain: malware.us
|
|
|
|
|
2018-07-06 15:24:12 -04:00
|
|
|
means block the URL IF::
|
2018-05-14 17:31:45 -07:00
|
|
|
|
2018-05-15 11:01:09 -07:00
|
|
|
("domain: youngscholars.unimelb.edu.au" AND "substring: wp-login.php?action=logout") OR "domain: malware.us"
|
2018-05-14 16:59:55 -07:00
|
|
|
|
2018-07-06 15:24:12 -04:00
|
|
|
Automatic scoping based on seed URLs
|
2018-05-14 16:59:55 -07:00
|
|
|
------------------------------------
|
2018-07-06 15:24:12 -04:00
|
|
|
Brozzler usually generates an ``accept`` scope rule based on the seed URL. It
|
2018-05-15 11:01:09 -07:00
|
|
|
does this to fulfill the usual expectation that everything "under" the seed
|
|
|
|
will be crawled.
|
2018-05-14 16:59:55 -07:00
|
|
|
|
2018-07-06 15:24:12 -04:00
|
|
|
To generate the rule, brozzler canonicalizes the seed URL using the `urlcanon
|
2018-05-14 16:59:55 -07:00
|
|
|
<https://github.com/iipc/urlcanon>`_ library's "semantic" canonicalizer, then
|
2018-05-15 11:01:09 -07:00
|
|
|
removes the query string if any, and finally serializes the result in SSURT
|
2018-07-06 15:24:12 -04:00
|
|
|
[1]_ form. For example, a seed URL of
|
2018-03-20 17:31:42 -07:00
|
|
|
``https://www.EXAMPLE.com:443/foo//bar?a=b&c=d#fdiap`` becomes
|
2019-04-30 10:49:48 -07:00
|
|
|
``com,example,www,//https:/foo/bar``.
|
2018-03-20 17:31:42 -07:00
|
|
|
|
2019-04-30 10:49:48 -07:00
|
|
|
Brozzler derives its general approach to the seed surt from `heritrix
|
2018-07-06 15:24:12 -04:00
|
|
|
<https://github.com/internetarchive/heritrix3>`_, but differs in a few respects.
|
2018-03-20 17:31:42 -07:00
|
|
|
|
|
|
|
1. Unlike heritrix, brozzler does not strip the path segment after the last
|
|
|
|
slash.
|
|
|
|
2. Canonicalization does not attempt to match heritrix exactly, though it
|
2018-05-14 16:59:55 -07:00
|
|
|
usually does match.
|
2019-05-16 14:03:43 -07:00
|
|
|
3. Brozzler does no scheme munging. (When generating a SURT for an HTTPS URL,
|
|
|
|
heritrix changes the scheme to HTTP. For example, the heritrix SURT for
|
|
|
|
``https://www.example.com/`` is ``http://(com,example,www,)`` and this means
|
|
|
|
that all of ``http://www.example.com/*`` and ``https://www.example.com/*``
|
|
|
|
are in scope. It also means that a manually specified SURT with scheme
|
|
|
|
"https" does not match anything.)
|
2018-07-06 15:24:12 -04:00
|
|
|
4. Brozzler identifies seed "redirects" by retrieving the URL from the
|
2018-03-20 17:31:42 -07:00
|
|
|
browser's location bar at the end of brozzling the seed page, whereas
|
2019-04-30 10:49:48 -07:00
|
|
|
heritrix follows HTTP 3XX redirects. If the URL in the browser
|
|
|
|
location bar at the end of brozzling the seed page differs from the seed
|
|
|
|
URL, brozzler automatically adds a second ``accept`` rule to ensure the
|
|
|
|
site is in scope, as if the new URL were the original seed URL. For example,
|
|
|
|
if ``http://example.com/`` redirects to ``http://www.example.com/``, the
|
2018-07-06 15:24:12 -04:00
|
|
|
rest of the ``www.example.com`` is in scope.
|
|
|
|
5. Brozzler uses SSURT instead of SURT.
|
2018-05-15 11:01:09 -07:00
|
|
|
6. There is currently no brozzler option to disable the automatically generated
|
|
|
|
``accept`` rules.
|
2018-05-14 16:59:55 -07:00
|
|
|
|
|
|
|
Scope settings
|
|
|
|
--------------
|
2017-06-23 13:56:25 -07:00
|
|
|
|
|
|
|
``accepts``
|
2018-03-19 14:14:37 -07:00
|
|
|
~~~~~~~~~~~
|
|
|
|
+------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+======+==========+=========+
|
|
|
|
| list | no | *none* |
|
|
|
|
+------+----------+---------+
|
2018-07-06 15:24:12 -04:00
|
|
|
List of scope rules. If any of the rules match, the URL is within
|
2019-04-30 10:49:48 -07:00
|
|
|
``max_hops`` from seed, and none of the ``block`` rules apply, then the URL is
|
2018-07-06 15:24:12 -04:00
|
|
|
in scope and brozzled.
|
2017-06-23 13:56:25 -07:00
|
|
|
|
|
|
|
``blocks``
|
2018-03-19 14:14:37 -07:00
|
|
|
~~~~~~~~~~~
|
|
|
|
+------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+======+==========+=========+
|
|
|
|
| list | no | *none* |
|
|
|
|
+------+----------+---------+
|
2019-04-30 10:49:48 -07:00
|
|
|
List of scope rules. If any of the rules match, then the URL is deemed out
|
2018-07-06 15:24:12 -04:00
|
|
|
of scope and NOT brozzled.
|
2018-03-19 14:14:37 -07:00
|
|
|
|
2018-03-19 17:23:49 -07:00
|
|
|
``max_hops``
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| number | no | *none* |
|
|
|
|
+--------+----------+---------+
|
2018-05-15 11:01:09 -07:00
|
|
|
Maximum number of hops from seed.
|
2018-03-19 17:23:49 -07:00
|
|
|
|
2018-03-22 17:18:36 -07:00
|
|
|
``max_hops_off``
|
2018-05-14 17:31:45 -07:00
|
|
|
~~~~~~~~~~~~~~~~
|
2018-03-19 17:23:49 -07:00
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| number | no | 0 |
|
|
|
|
+--------+----------+---------+
|
2018-07-06 15:24:12 -04:00
|
|
|
Expands the scope to include URLs up to this many hops from the last page that
|
|
|
|
was in scope because of an ``accept`` rule.
|
2018-03-19 14:14:37 -07:00
|
|
|
|
2018-05-14 17:31:45 -07:00
|
|
|
Scope rule conditions
|
|
|
|
---------------------
|
2018-03-19 14:14:37 -07:00
|
|
|
|
|
|
|
``domain``
|
|
|
|
~~~~~~~~~
|
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| string | no | *none* |
|
|
|
|
+--------+----------+---------+
|
2018-07-06 15:24:12 -04:00
|
|
|
Matches if the host part of the canonicalized URL is ``domain`` or a
|
2018-05-15 11:01:09 -07:00
|
|
|
subdomain.
|
2018-03-19 14:14:37 -07:00
|
|
|
|
|
|
|
``substring``
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| string | no | *none* |
|
|
|
|
+--------+----------+---------+
|
2018-07-06 15:24:12 -04:00
|
|
|
Matches if ``substring`` value is found anywhere in the canonicalized URL.
|
2018-03-19 14:14:37 -07:00
|
|
|
|
|
|
|
``regex``
|
|
|
|
~~~~~~~~~
|
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| string | no | *none* |
|
|
|
|
+--------+----------+---------+
|
2018-07-06 15:24:12 -04:00
|
|
|
Matches if the full canonicalized URL matches a regular expression.
|
2018-03-19 14:14:37 -07:00
|
|
|
|
|
|
|
``ssurt``
|
|
|
|
~~~~~~~~~
|
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| string | no | *none* |
|
|
|
|
+--------+----------+---------+
|
2019-04-30 10:49:48 -07:00
|
|
|
Matches if the canonicalized URL in SSURT [1]_ form starts with the ``ssurt``
|
2018-07-06 15:24:12 -04:00
|
|
|
value.
|
2017-06-23 13:56:25 -07:00
|
|
|
|
2018-03-19 14:14:37 -07:00
|
|
|
``surt``
|
|
|
|
~~~~~~~~
|
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| string | no | *none* |
|
|
|
|
+--------+----------+---------+
|
2019-04-30 10:49:48 -07:00
|
|
|
Matches if the canonicalized URL in SURT [2]_ form starts with the ``surt``
|
2018-07-06 15:24:12 -04:00
|
|
|
value.
|
2018-03-19 14:14:37 -07:00
|
|
|
|
|
|
|
``parent_url_regex``
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
|
|
+--------+----------+---------+
|
|
|
|
| type | required | default |
|
|
|
|
+========+==========+=========+
|
|
|
|
| string | no | *none* |
|
|
|
|
+--------+----------+---------+
|
2019-04-30 10:49:48 -07:00
|
|
|
Matches if the full canonicalized parent URL matches a regular expression.
|
2018-07-06 15:24:12 -04:00
|
|
|
The parent URL is the URL of the page in which a link is found.
|
2017-06-23 13:56:25 -07:00
|
|
|
|
2018-05-30 18:06:39 -07:00
|
|
|
Using ``warcprox_meta``
|
|
|
|
=======================
|
2019-04-30 10:49:48 -07:00
|
|
|
``warcprox_meta`` plays a very important role in brozzler job configuration.
|
|
|
|
It sets the filenames of the WARC files created by a job. For example, if each
|
|
|
|
seed should have a different WARC filename prefix, you might configure a job
|
2018-07-06 15:24:12 -04:00
|
|
|
this way::
|
2018-05-30 18:06:39 -07:00
|
|
|
|
|
|
|
seeds:
|
|
|
|
- url: https://example.com/
|
|
|
|
warcprox_meta:
|
|
|
|
warc-prefix: seed1
|
|
|
|
- url: https://archive.org/
|
|
|
|
warcprox_meta:
|
|
|
|
warc-prefix: seed2
|
|
|
|
|
2019-04-30 10:49:48 -07:00
|
|
|
``warcprox_meta`` may also be used to limit the size of the job. For example,
|
|
|
|
this configuration will stop the crawl after about 100 MB of novel content has
|
2018-07-06 15:24:12 -04:00
|
|
|
been archived::
|
2018-05-30 18:06:39 -07:00
|
|
|
|
|
|
|
seeds:
|
|
|
|
- url: https://example.com/
|
|
|
|
- url: https://archive.org/
|
|
|
|
warcprox_meta:
|
|
|
|
stats:
|
|
|
|
buckets:
|
|
|
|
- my-job
|
|
|
|
limits:
|
|
|
|
my-job/new/wire_bytes: 100000000
|
|
|
|
|
2018-07-06 15:24:12 -04:00
|
|
|
To prevent any URLs from a host from being captured, it is not sufficient to use
|
2018-05-30 18:06:39 -07:00
|
|
|
a ``scope`` rule as described above. That kind of scoping only applies to
|
2019-04-30 10:49:48 -07:00
|
|
|
navigational links discovered in crawled pages. To make absolutely sure that no
|
2018-07-06 15:24:12 -04:00
|
|
|
url from a given host is fetched--not even an image embedded in a page--use
|
2018-05-30 18:06:39 -07:00
|
|
|
``warcprox_meta`` like so::
|
|
|
|
|
|
|
|
warcprox_meta:
|
|
|
|
blocks:
|
|
|
|
- domain: spammy.com
|
|
|
|
|
|
|
|
For complete documentation on the ``warcprox-meta`` request header, see
|
|
|
|
https://github.com/internetarchive/warcprox/blob/master/api.rst#warcprox-meta-http-request-header
|
|
|
|
|
2018-05-15 11:01:09 -07:00
|
|
|
.. [1] SSURT is described at https://github.com/iipc/urlcanon/blob/master/ssurt.rst
|
|
|
|
.. [2] SURT is described at http://crawler.archive.org/articles/user_manual/glossary.html
|