Cypress 3 Initial Setup - projectcypress/cypress GitHub Wiki

These instructions are for Cypress v3 which is not the latest version of Cypress. For Cypress v4, please see our updated instructions.

Cypress Bundle Install

You will need an NLM VSAC account to download value set definitions and finalize the installation of the VM. You can sign up for an NLM VSAC account at https://uts.nlm.nih.gov/home.html. Click the 'Sign Up' link in the upper right of the page.

Bundles are now installed through the Cypress web interface:

  1. Download your bundle of choice. You will be prompted for your NLM VSAC credentials before the download begins:
  1. Navigate to the IP address/URL of your Cypress install. This will vary based on your installation method.
  2. Sign into the Cypress web application.
  3. In the navigation bar at the top of the page, click the "Admin" button. If you don't see this button, you do not have sufficient privileges to install bundles. Skip to the section below to upgrade your account privileges, then resume the bundle install process.
  4. Select the "Bundles" tab and then the "Import Bundle" button.
  5. In the file selector, select the bundle downloaded in Step 1, then click the "Import Bundle" button.
  6. Cypress will download the bundle in the background. When it is done will be able to begin testing in Cypress.

These steps can be repeated for multiple bundles.

##Optional Steps

Don't see the admin button?

In order to grant a user account admin access, you will need access to the underlying server.

  1. Once you have installed the Cypress application, you will need to SSH into the server. You can connect to the server using the following username and password:

    Username: ubuntu Password: CypressPwd

  2. Navigate to the cypress application directory and grant the permissions using the follow command. Replace EMAIL with the email address of the Cypress user account.

sudo su - cypress
cd /opt/cypress
/opt/ruby_build/builds/opt/cypress/bin/bundle exec rake cypress:add_admin[EMAIL] RAILS_ENV=production

NOTE: If you followed the custom install instructions then the commands must instead be as follows (where your secret key is still loaded into the $secret_key environment variable):

cd /home/cypress/cypress
bundle exec rake cypress:add_admin[EMAIL] RAILS_ENV=production SECRET_KEY_BASE=$secret_key
  1. Confirm the user can now view the "Admin" button in the navigation bar at the top of the page.

Need TLS/SSL?

If you are deploying Cypress to a publicly available server, it is recommended you use TLS/SSL encryption to protect user data. The Cypress VMs and AMIs use NGINx to proxy requests to the Cypress tool and CVU (if installed). The following instructions will walk you through setting up SSL on your server.

  1. Get a SSL Certificate from the provider of your choice. For any instructions that ask for information about your web server, choose NGINX.
  2. Follow the instructions from your provider to build the certificate bundle.
  3. Update your config file located at /etc/nginx/sites-enabled/default as follows, replacing yourdomain.com with your the domain you have purchased the SSL certificates for.

For Cypress Standalone

  upstream primary {
    server localhost:8000;
  }
  server {
    listen         80;
    server_name    yourdomain.com;
    return         301 https://$server_name$request_uri;
  }

  server {
    listen 443;

    ssl on;
    ssl_certificate    /etc/ssl/yourdomain.pem; # (or yourdomain.crt)
    ssl_certificate_key    /etc/ssl/yourdomain.key;

    server_name yourdomain.com;

    root /opt/cypress/public; # This should be /home/cypress/cypress/public if you installed via the custom install instructions.

    try_files $uri/index.html $uri @app;

    location @app {
      proxy_pass http://primary;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_redirect off;
    }

    error_page 500 502 503 504 /500.html;
    client_max_body_size 4G;
    keepalive_timeout 10;
  }

For CVU Standalone

  upstream primary {
    server localhost:8001;
  }
  server {
    listen         80;
    server_name    yourdomain.com;
    return         301 https://$server_name$request_uri;
  }

  server {
    listen 443;

    ssl on;
    ssl_certificate    /etc/ssl/yourdomain.pem; # (or yourdomain.crt)
    ssl_certificate_key    /etc/ssl/yourdomain.key;

    server_name yourdomain.com;

    root /opt/cypress-validation-utility/public; # This should be /home/cypress/cypress-validation-utility/public if you installed via the custom install instructions.

    try_files $uri/index.html $uri @app;

    location @app {
      proxy_pass http://primary;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_redirect off;
    }

    error_page 500 502 503 504 /500.html;
    client_max_body_size 4G;
    keepalive_timeout 10;
  }

For Cypress + CVU

  upstream primary {
    server localhost:8000;
  }

  upstream secondary {
    server localhost:8001;
  }

  server {
    listen         80;
    server_name    yourdomain.com;
    return         301 https://$server_name$request_uri;
  }

  server {
    listen 443;

    ssl on;
    ssl_certificate    /etc/ssl/yourdomain.pem; # (or yourdomain.crt)
    ssl_certificate_key    /etc/ssl/yourdomain.key;

    server_name yourdomain.com;

    root /opt/cypress/public; # This should be /home/cypress/cypress/public if you installed via the custom install instructions.

    try_files $uri/index.html $uri @app;

    location @app {
      proxy_pass http://primary;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_redirect off;
    }

    location /cvu {
      return 301 http://$host:8080;
    }

    error_page 500 502 503 504 /500.html;
    client_max_body_size 4G;
    keepalive_timeout 10;
  }

  server {
    listen         8080;
    server_name    yourdomain.com;
    return         301 https://$server_name:4343$request_uri;
  }

  server {
    listen 4343;

    ssl on;
    ssl_certificate    /etc/ssl/yourdomain.pem; # (or yourdomain.crt)
    ssl_certificate_key    /etc/ssl/yourdomain.key;

    server_name yourdomain.com;

    error_page 497  https://$host:$server_port$request_uri; # Required so uploads to CVU do not try to load the non-https version of the results page

    root /opt/cypress-validation-utility/public; # This should be /home/cypress/cypress-validation-utility/public if you installed via the custom install instructions.

    try_files $uri/index.html $uri @app;

    location @app {
      proxy_pass http://secondary;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_redirect off;
    }

    error_page 500 502 503 504 /500.html;
    client_max_body_size 4G;
    keepalive_timeout 10;
  }
  1. Once you have updated your configuration, run sudo systemctl restart nginx in order to reload the NGINX server.