Giter Club home page Giter Club logo

bouncer's Introduction

bouncer

This is a Rack-based redirector. It serves 301s and 410s from mappings created by Transition.

Technical documentation

You can use the GOV.UK Docker environment to run the application and its tests with all the necessary dependencies. Follow the usage instructions to get started.

Use GOV.UK Docker to run any commands that follow.

Running the tests

bundle exec rake

Testing redirects

In order to test the redirect feature of this app, you can use a special bouncer-redirect.dev.gov.uk domain. We will create a mapping from this fake domain to GOV.UK.

  1. Setup the Transition repo.

One of the seeded organisations will be "Cabinet Office", which we will use in the next step.

  1. In the Transition app, under the Cabinet Office organisation, add a new site.
Abbreviated name: bouncer-redirect
TNA timestamp: 20141104112824
Homepage: https://www.gov.uk
Hostname: bouncer-redirect.dev.gov.uk
Global type: Redirect
... with Global new URL: https://www.gov.uk

This will create the site in the shared Transition / Bouncer DB.

  1. Start the Bouncer app and go to bouncer-redirect.dev.gov.uk.

You should see that it redirects to GOV.UK, as specified in the site file.

Testing on staging environment

In contrast to other GOV.UK applications, Bouncer isn't available at x.staging.publishing.service.gov.uk

This means that testing the application on our staging environment will require repointing the domains you wish to test by editing your computer’s host file to point them at Bouncer’s staging IP address. This should allow visiting the app in a web browser, for example. Alternatively, to make a request to our staging environment with curl:

curl -I -H"Host: www.attorneygeneral.gov.uk" http://0.0.0.0/aboutus/pages/civilcriminalpanels.aspx

Data storage

Lists of domain names, old URLs and URLs to redirect to are stored in a PostgreSQL database to which the application has read-only access.

Example application URLs

Here are some examples using a few of the many domain names which is served by Bouncer:

URL Description
http://www.attorneygeneral.gov.uk/aboutus/pages/civilcriminalpanels.aspx Serves a redirect to a page on GOV.UK
http://www.bonavacantia.gov.uk/output/accessibility.aspx Serves a 410 archive page
http://rdpenetwork.defra.gov.uk/i-made-this-up Serves a 404 not found page
http://www.attorneygeneral.gov.uk/sitemap.xml Serves a sitemap of all redirects for the domain
http://www.attorneygeneral.gov.uk/robots.txt Serves a minimal robots.txt

Licence

MIT License

bouncer's People

Contributors

1pretz1 avatar agadufrat avatar alangabbianelli avatar barrucadu avatar benthorner avatar brucebolt avatar catalinailie avatar cbaines avatar chao-xian avatar chrisbashton avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar edwardkerry avatar h-lame avatar hannako avatar issyl0 avatar jamiecobbett avatar jennyd avatar kevindew avatar murilodalri avatar rgarner avatar sengi avatar sihugh avatar tetrino avatar theseanything avatar thomasleese avatar tijmenb avatar tomsabin avatar tomstuart avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bouncer's Issues

Use of deprecated `ActiveRecord::Base.clear_active_connections!` causing severe logspew.

Bouncer is generating around 1.3M of these log messages per day (one per request I think), which has been using up a lot of log resources and causing us to go over quota.

DEPRECATION WARNING: Calling ActiveRecord::Base.clear_active_connections! is deprecated. Please call the method directly on the connection handler; for example: ActiveRecord::Base.connection_handler.clear_active_connections!. (called from call at /app/lib/active_record/rack/connection_management.rb:13)

We've blocked the spammy message for now to protect the logging infrastructure, but the deprecated usage still needs fixing to make it compatible with future versions of ActiveRecord.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.