• Stars
    star
    531
  • Rank 83,526 (Top 2 %)
  • Language
    Python
  • License
    Other
  • Created over 15 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

REDbot is lint for HTTP resources.

REDbot

REDbot is lint for HTTP resources.

It checks HTTP resources for feature support and common protocol problems. You can use the public instance on https://redbot.org/, or you can install it locally and use it on the command line, or even self-host your own Web checker.

Test

Contributing to REDbot

Your ideas, questions and other contributions are most welcome. See CONTRIBUTING.md for details.

Setting Up Your Own REDbot

Requirements

REDbot needs:

  1. Python 3.7 or greater
  2. thor
  3. markdown
  4. netaddr
  5. Jinja2

Once you have Python, you can install the required libraries with:

pip install -r requirements.txt

Installation

Unpack the REDbot tarball. The relevant files are:

  • bin/redbot_cgi.py - the Web CGI script for running REDbot
  • bin/redbot_cli - the command-line interface
  • redbot/ - REDbot's Python library files
  • redbot/assets/ - REDbot's CSS stylesheet and JavaScript library

To install from source (e.g., if you clone from github):

pip install .

installs REDbot's libraries as well as the command-line version as redbot_cli.

Setting up your Web Server

To run REDbot as a CGI script, place redbot_cgi.py where you wish it to be served from by the Web server, and place config.txt in the same directory.

For example, with Apache you can put it in a directory and add these configuration directives (e.g., in `.htaccess, if enabled):

  AddHandler cgi-script .py
  DirectoryIndex redbot_cgi.py

If the directory is the root directory for your server "example.com", this will configure REDbot to be at the URI "http://example.com/".

You can also locate config.txt somewhere else, and indicate its path in an environment variable:

 SetEnv REDBOT_CONFIG /path/to/config.txt

The contents of the assets directory also need to be made available on the server; by default, they're in the 'static' subdirectory of the script's URI. This can be changed using the 'static_root' configuration variable in config.txt.

You should also create the directory referenced by the 'save_dir' configuration variable, and make sure that it's writable to the Web server process. This is where RED stores state files, and you should configure a cron job to regularly clean it. For example:

0 * * * * find /var/state/redbot/ -mmin +360 -exec rm {} ;

Running REDbot as a systemd Service

REDbot can run as a standalone service, managed by systemd. This offers a degree of sandboxing and resource management, as well as process monitoring (including a watchdog function).

To do this, clone the repo to your system and copy extra/redbot.service into the appropriate directory (on most systems, /etc/systemd/system/.)

Modify the file appropriately; this is only a sample. In particular, you will need to adjust the first part of BindReadOnlyPaths to suit the location of the REDbot directory for you.

Then, as root:

systemctl reload-daemon

systemctl enable redbot

systemctl start redbot

By default, REDbot will listen on localhost port 8000. This can be adjusted in config.txt. Running REDbot behind a reverse proxy is recommended, if it is to be exposed to the Internet.

Running REDbot with Docker

If you wish to run REDbot using Docker, get a local copy of the repository, then:

docker build -t redbot .

Start the webserver:

docker run -p 8000:8000 redbot

Or, just:

make docker

to run REDbot on port 8000.

Credits

Icons by Font Awesome. REDbot includes code from tippy.js and prettify.js.

More Repositories

1

htracr

HTTP sniffing and low-level visualisation
JavaScript
531
star
2

hinclude

declarative client-side inclusion for the Web
JavaScript
307
star
3

nbhttp

non-blocking HTTP. All further development will be at mnot/thor.
Python
231
star
4

rfc.fyi

Browseable, searchable RFC index
JavaScript
118
star
5

thor

Easy Evented Intermediation
Python
115
star
6

I-D

My Internet-Drafts
HTML
98
star
7

wadl_stylesheets

XSLT stylesheets to create HTML documentation from WADL files
77
star
8

avoiding-internet-centralization

Internet-Draft about avoiding internet centralization
Makefile
42
star
9

sparta

a Simple API for RDF
Python
29
star
10

web_caching_tutorial

The Caching Tutorial for Web Authors and Webmasters
HTML
17
star
11

sweet

Interoperable Content-Disposistion headers for Node.JS
JavaScript
15
star
12

http_sfv

Parse and serialise HTTP structured field values
Python
13
star
13

squid-director

Squid helper to canonicalise and rewrite URLs
Python
13
star
14

squid-channels

Cache Channels for Squid
Python
10
star
15

squidpeek

Per-URL Squid logfile statistics and sparklines
Python
9
star
16

squid-lci

Linked Cache Invalidation for Squid
Python
8
star
17

isitrestful

Source for isitrestful.com
Python
6
star
18

photoweb

Templated HTML galleries based on in-photo metadata
Python
6
star
19

httplint

Python library to lint HTTP messages
Python
5
star
20

http-test

Tests for HTTP implementations
JavaScript
5
star
21

pipeline-surveyor

Check to see if HTTP pipelining is safe
JavaScript
5
star
22

http-sf

HTTP Structured Fields for Python
Python
5
star
23

tarawa

Tarawa is a Toolkit for RESTful Webapps; a set of Python libraries for server-side, client-side and intermediary HTTP communications, with an emphasis on conformance to RFC2616 and the principles of REST.
Python
5
star
24

variants-toy

Proving the algorithms in draft-nottingham-variants
Python
4
star
25

ietf-comments

Automating IETF comment handling
Python
4
star
26

rfc-http-validate

Validate HTTP messages in XML2RFC documents
Python
4
star
27

xhr-test

xmlhttprequest tests
Assembly
3
star
28

hdrgrab

Grab HTTP headers
JavaScript
3
star
29

header-explorer

Rummaging around HTTP Archive dumps to see what's interesting
Python
3
star
30

meetingbot

XMPP / Jabber bot to help run a meeting
Python
3
star
31

RFCbootstrap

Bootstrap-based XML2RFC stylesheet
XSLT
2
star
32

v3grammar

Tracking evolution of the XML2RFCv3 grammar
2
star
33

friends2feeds

Taking Feeds Back from Social Media
Python
2
star
34

dotfiles

just my dot files
Shell
1
star
35

conn-sniff

basic TCP connection sniffing
JavaScript
1
star
36

theme

Theme for GitHub Pages
HTML
1
star
37

book-club

Discussion of papers and books about Internet governance, regulation, privacy, and law
1
star
38

rfc-refs

References between RFCs in JSON format
Python
1
star
39

pyproject-tmpl

Template for Python projects
Python
1
star
40

w3c-community

Visualisation of W3C community groups
HTML
1
star