Giter VIP home page Giter VIP logo

sinai-web's Introduction

The Sinai Scholars Website

To build locally (without Vagrant)

Check the project out from GitHub, package it and start it.

git clone https://github.com/UCLALibrary/sinai-web
cd sinai-web
mvn clean package
target/startup.sh --env <dev|test|stage|prod>

The --env argument allows for selection of the Solr core and IIIF image server to connect to:

--env Solr server IIIF image server
dev sinai.solr.server according to pom.xml https://sinai-images.library.ucla.edu
test http://test-solr.library.ucla.edu/solr/sinaimeta https://test-sinai-images.library.ucla.edu
stage http://solr.library.ucla.edu/solr/sinaistagemeta https://stage-sinai-images.library.ucla.edu
prod http://solr.library.ucla.edu/solr/sinaimeta https://sinai-images.library.ucla.edu

It generates a self-signed certificate, so when you visit

https://localhost:8443/

You will have to click through the security warning.

To build locally (using Ansible and Vagrant)

Check out the Library's restricted access 'ansible' project and run:

git clone https://github.com/UCLALibrary/ansible
cd ansible
PLAYBOOK=sinai_scholars_stage vagrant up

This also generates a self-signed certificate, so when you visit

https://localhost/

You will have to click through the security warning.

Connecting a JDWP agent or JMX monitor

You can build the project with support for connecting a JDWP agent by running with:

mvn clean install -Ddev.tools=JDWP_AGENTLIB

Or with support for a JMX monitor:

mvn clean install -Ddev.tools=JMX_REMOTE

Or with both:

mvn clean install -Ddev.tools="JDWP_AGENTLIB JMX_REMOTE"

You can also supply the dev.tools variable in a default Maven profile. See src/main/resources/settings.xml for an example.

Updating Mirador

The Sinai Scholar's site uses Mirador as its image viewer. We are maintaining a fork here. The build output of the code on the develop-prod branch of that repository is included in this repository (sinai-web) by the following process:

SINAI_PATH=/path/to/sinai-web
SINAI_MIRADOR_PATH=${SINAI_PATH}/src/main/webapp/mirador

git clone https://github.com/UCLALibrary/mirador
cd mirador
git checkout -b develop-prod origin/develop-prod
grunt && grunt uglify

rm -rf ${SINAI_MIRADOR_PATH}
cp -r ./mirador ${SINAI_MIRADOR_PATH}

Using a DDNS Domain with the startup.sh Script

If you want to login with the new EMEL auth system and a DDNS service, you can supply the Sinai host variable at the point of running the test startup script; for instance:

SINAI_HOST=lisforge.ddns.net target/startup.sh

This is probably only relevant to developers testing the system using an allowed domain name. When supplying the host in this fashion, it's assumed the service is running at port 443 rather than at the out of the box testing default, 8443.

Contact

Contact Kevin or Mark with any build, etc., questions you have.

sinai-web's People

Contributors

kirschbombe avatar kjallen avatar ksclarke avatar markmatney avatar sgurnick avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sinai-web's Issues

Looks like a PNG is being treated as a Handlebars template

Perhaps a routing configuration that needs to recognize that the PNG is a binary that should be served independent of the Handlebars handler.

[DEBUG] e.u.l.s.t.impl.HandlebarsTemplateEngineImpl | Loading Handlebars template 'templates/mirador/css/images/ui-bg_glass_65_ffffff_1x400.png' into cache
[ERROR] e.u.l.s.t.impl.HandlebarsTemplateEngineImpl | /webroot/templates/mirador/css/images/ui-bg_glass_65_ffffff_1x400.png.hbs
java.io.FileNotFoundException: /webroot/templates/mirador/css/images/ui-bg_glass_65_ffffff_1x400.png.hbs
at com.github.jknack.handlebars.io.URLTemplateLoader.sourceAt(URLTemplateLoader.java:70) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at com.github.jknack.handlebars.Handlebars.compile(Handlebars.java:385) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at com.github.jknack.handlebars.Handlebars.compile(Handlebars.java:371) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at edu.ucla.library.sinai.templates.impl.HandlebarsTemplateEngineImpl.render(HandlebarsTemplateEngineImpl.java:1151) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at edu.ucla.library.sinai.templates.impl.HandlebarsTemplateEngineImpl.render(HandlebarsTemplateEngineImpl.java:1112) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.handler.impl.TemplateHandlerImpl.handle(TemplateHandlerImpl.java:48) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.handler.impl.TemplateHandlerImpl.handle(TemplateHandlerImpl.java:28) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.impl.RouteImpl.handleContext(RouteImpl.java:225) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:120) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:133) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.handler.impl.UserSessionHandlerImpl.handle(UserSessionHandlerImpl.java:69) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.handler.impl.UserSessionHandlerImpl.handle(UserSessionHandlerImpl.java:29) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.impl.RouteImpl.handleContext(RouteImpl.java:225) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:120) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:133) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.handler.impl.StaticHandlerImpl.lambda$sendStatic$1(StaticHandlerImpl.java:213) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:79) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:289) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:339) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_181]
[ERROR] e.ucla.library.sinai.handlers.FailureHandler | {}
java.io.FileNotFoundException: /webroot/templates/mirador/css/images/ui-bg_glass_65_ffffff_1x400.png.hbs
at com.github.jknack.handlebars.io.URLTemplateLoader.sourceAt(URLTemplateLoader.java:70) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at com.github.jknack.handlebars.Handlebars.compile(Handlebars.java:385) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at com.github.jknack.handlebars.Handlebars.compile(Handlebars.java:371) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at edu.ucla.library.sinai.templates.impl.HandlebarsTemplateEngineImpl.render(HandlebarsTemplateEngineImpl.java:1151) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at edu.ucla.library.sinai.templates.impl.HandlebarsTemplateEngineImpl.render(HandlebarsTemplateEngineImpl.java:1112) [sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.handler.impl.TemplateHandlerImpl.handle(TemplateHandlerImpl.java:48) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.handler.impl.TemplateHandlerImpl.handle(TemplateHandlerImpl.java:28) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.impl.RouteImpl.handleContext(RouteImpl.java:225) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:120) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:133) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.handler.impl.UserSessionHandlerImpl.handle(UserSessionHandlerImpl.java:69) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.handler.impl.UserSessionHandlerImpl.handle(UserSessionHandlerImpl.java:29) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.impl.RouteImpl.handleContext(RouteImpl.java:225) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:120) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:133) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.ext.web.handler.impl.StaticHandlerImpl.lambda$sendStatic$1(StaticHandlerImpl.java:213) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:79) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:289) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:339) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[sinai-web-0.0.1-SNAPSHOT.jar:na]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_181]

Turn on browser caching to ease serving of /browse

Problem:

Client-side caching isn't turned on on the Vert.x HTTP responses by default. Turning it on would help the performance of the site. See Jiiify for how to turn it on... e.g.

response.putHeader(Metadata.CACHE_CONTROL, Metadata.DEFAULT_CACHE_CONTROL);

Acceptance:

  • When looking at the response headers of a GET request to /browse we see caching turned on

Home page returns 404 for HEAD request

Problem:

A HEAD request doesn't return the same status code that a GET request would. For instance:

[root@ip-172-31-46-116 avuong]# curl -I https://sinai.library.ucla.edu
HTTP/1.1 404 Not Found

while

kevin@kevin-laptop:~/Workspace/sinai-web$ curl -X GET -i https://sinai.library.ucla.edu
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 7348

Acceptance:

  • HEAD request responds with same status code as GET request would

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.