GithubHelp home page GithubHelp logo

jhu-library-applications / catalyst-ansible Goto Github PK

View Code? Open in Web Editor NEW
2.0 6.0 4.0 1.51 MB

Builds and deploys Catalyst (Johns Hopkins University Libraries blacklight-based library catalogue) using Ansible

License: Creative Commons Zero v1.0 Universal

Ruby 0.87% Jinja 99.13%
ansible blacklight ruby-on-rails

catalyst-ansible's Issues

RFC: "test" block in apache config

There's a small block in catalyst's /etc/httpd/conf.d/01_catalyst.conf labeled "TODO: test". Is it needed or helpful?

  ### TODO: test
  # Cache Rails finger-printed assets, as per
  # http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets
  # Try only match if the asset actually has a fingerprint in it.
  <LocationMatch "^/assets/.*-[0-9a-f]{32}.*$">
  #<Location /assets/>
    # Use of ETag is discouraged when Last-Modified is present
    Header unset ETag
    FileETag None
    # RFC says only cache for 1 year
    ExpiresActive On
    ExpiresDefault "access plus 1 year"
  </LocationMatch>

test connectivity between catalyst and hip server

add ability to automatically test connectivity upon configuration. something as simple as curling the homepage and searching for a string would do, but there may be a more ansible-y way to get feedback on the success of our configuration

Performance on services VM is poor

After installation of JRuby, a java process (apparently JRuby) gets started whenever ansible is doing work on the VM. CPU usage climbs to over 100% before dropping, only to climb again. Ansible task completion is noticeably slower than usual, despite having nothing to do with JRuby itself (e.g. gathering facts or deploying ssh keys. To resolve, I suggest we start by troubleshooting JRuby, as described here: https://github.com/jruby/jruby/wiki/Troubleshooting-Performance

RFC: "somewhat experimental"

Objective: Determine usefulness / necessity for the following code block in catalyst's /etc/httpd/conf.d/01_catalyst.conf:

  ### TODO: research
  # Let apache serve the pre-compiled .gz version of static assets,
  # if available, and the user-agent can handle it. Set all headers
  # correctly when doing so.
  #
  # SOMEWHAT EXPERIMENTAL. If you think it's causing problems,
  # just remove the following three LocationMatch.
  <LocationMatch "^/assets/.*\.(css|js)$">
    RewriteEngine on

    # Make sure the browser supports gzip encoding before we send it,
    # and that we have a precompiled .gz version.
    RewriteCond %{HTTP:Accept-Encoding} \b(x-)?gzip\b
    RewriteCond %{REQUEST_FILENAME}.gz -s
    RewriteRule ^(.+)$ $1.gz
  </LocationMatch>

  # Make sure Content-Type is set for 'real' type, not gzip,
  # and Content-Encoding is there to tell browser it needs to
  # unzip to get real type.
  #
  # Make sure Vary header is set; while apache docs suggest it
  # ought to be set automatically by our RewriteCond that uses an HTTP
  # header, does not seem to be reliably working.
  <LocationMatch "^/assets/.*\.css\.gz$">
      ForceType text/css
      Header set Content-Encoding gzip
      Header add Vary Accept-Encoding
  </LocationMatch>

  <LocationMatch "^/assets/.*\.js\.gz$">
      ForceType application/javascript
      Header set Content-Encoding gzip
      Header add Vary Accept-Encoding
  </LocationMatch>

Catalyst HTTPS redirect

Topic: the HTTPS redirect on catalyst
Both -prod and -stage use the following code in /etc/httpd/conf.d/01_catalyst.conf:

# BEGIN http redirect
  # We run Catalyst/Blacklight in the main virtual host, and we require
  # https access. So this :80 virtual host insists on redirects to https.
  #
  # This could also be put in <Location> directives if it wasn't the whole
  # server that was so restricted.
  #
  # Except Refworks sometimes refuses to make callbacks to https, so we
  # have to allow refworks-formatted exports in http.
  RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteCond %{REQUEST_URI} !refworks_marc_txt$
  RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

# END http redirect

The proposed change/simplification is:

# BEGIN http redirect
  Redirect "/" "https://{{ hostname | default('myapp') }}.{{ domainname | default('test.test') }}"
# END http redirect

Is this ok? Will some rare condition not be fulfilled? Will something be lost?

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.