Skip to content

DFE-Digital/accessibility-scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Accessibility Crawler

Accessibility crawler is a Ruby application which raps the Pa11y accessibility scanner. Enabling multi-site scanning from a docker container.

Requirements

If you want to run without Docker then the Pa11y application needs to be installed in accordance with GitHub Pa11y

Usage

Sitemap

Sitemap mode enables the scanner to read a simple sitemap and parse through the listed URLs

   ruby axe-crawler.rb --sitemap  "https://www.bbc.co.uk/news/localnews/locations/sitemap.xml"

File Mode

When no site map is available the scanner can be used to process a list of URLS from a file.

ruby axe-crawler.rb --file  /apt/test/test.file

Authentication

In either mode if the site requires authentication, then the Username and Password can be entered using the -P and -U options.

ruby axe-crawl.rb --sitemap  "https://www.bbc.co.uk/news/localnews/locations/sitemap.xml" -U ${HTTP_USERNAME} -P ${HTTP_PASSWORD}

Options

--help     , -h Help Page
--sitemap  , -s Site Map Mode
--file     , -f File Mode
--username , -U HTTP Authentication User
--password , -P HTTP Authentication Password 
--verbose  , -v Verbose Logging
--stdout   , -o Send logging to stdout

Docker

Repository

[Docker](https://hub.docker.com/repository/docker/dfedigital/accessibility_crawler) holds versions of the image

Build

make build

Execute

To execute with docker the parameters are passed in, the username and password can be passed in as environment variables

HTTP_USERNAME
HTTP_PASSWORD

To run with file mode the directory with the test file needs to be mounted as a volume:

docker run -t --rm  -v $(PWD):/apt/test accessibility_crawler:v1 -U ${HTTP_USERNAME} -P ${HTTP_PASSWORD} --file  /apt/test/test.file  

To run in sitemap mode is simply:

docker run -t --rm accessibility_crawler:v1 --sitemap  "https://www.bbc.co.uk/news/localnews/locations/sitemap.xml"