Skip to content
This repository has been archived by the owner on Oct 27, 2018. It is now read-only.

small config changes; added env variable to enable temp login in prod… #145

Merged
merged 8 commits into from Apr 11, 2017
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .rubocop.yml
Expand Up @@ -80,3 +80,7 @@ RSpec/ExampleLength:

RSpec/MultipleExpectations:
Enabled: false

# as discussed in issue#144
Style/ParenthesesAroundCondition:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbarnett already fixed this in Master haha. Not sure if that was clear sorry alex.

https://github.com/ualbertalib/Hydranorth2/blob/master/.rubocop.yml#L74-L75

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@astrilet this is already fixed, you don't need to include it in your PR.

Enabled: false
23 changes: 23 additions & 0 deletions Dockerfile
@@ -0,0 +1,23 @@
FROM ualibraries/ruby_plus2.3.3
# https://github.com/ualbertalib/DIDockerImages/blob/master/RubyPlus/Dockerfile
RUN apt-get update -qq && \
apt-get install -y libpq-dev \
nodejs \
libreoffice-core \
libreoffice-base-core \
libreoffice-common \
imagemagick \
unzip && \
rm -rf /var/lib/apt/lists/*

RUN mkdir /app
WORKDIR /app
ADD . /app
RUN echo "gem 'tinymce-rails-imageupload', github: 'PerfectlyNormal/tinymce-rails-imageupload'" >> /app/Gemfile
RUN cd /app && bundle install
RUN cd /app && rake assets:precompile

CMD rake db:migrate && rails server -b 0.0.0.0

EXPOSE 3000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With Nginx configured, do we still need to expose port 3000 explicitly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we need to expose it inside docker image. This instruction means that other containers can connect to this one to the port 3000. This is what Nginx will do - will connect to instance of hydranorth2 running container and redirect port 3000 to its own port 80 which in turn will be redirected to atomic host port pointed by HOSTPORT environment variable.


12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -92,3 +92,15 @@ This is not ideal and hopefully a temporary solution. But currently in developme
Some helpful links for more information:
* http://www.jeesty.com/shibboleth
* https://docs.gitlab.com/ce/integration/shibboleth.html

## Building docker image

You can build docker image for Hydranorth2 following precedure below.
There is a copy of ualibraries/hydranorth2 image that can be pulled
from [dockerhub](https://hub.docker.com/r/ualibraries/hydranorth2/)

```shell
docker build -t ualibraries/hydranorth2 .
```


3 changes: 2 additions & 1 deletion app/controllers/users/omniauth_callbacks_controller.rb
@@ -1,6 +1,7 @@
class Users::OmniauthCallbacksController < ApplicationController
# TODO: Remove this once we figure out IST, this is only required for the omniauth developer provider
skip_before_action :verify_authenticity_token, only: :complete unless Rails.env.production?
skip_before_action :verify_authenticity_token, only: :complete if (Rails.env.development? ||
ENV['ENABLE_TMP_LOGINS'].present?)

def complete
auth_hash = request.env['omniauth.auth']
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/sessions/new.html.erb
Expand Up @@ -6,7 +6,7 @@
<%= t('.login_button_text') %>
</a>

<%- if Rails.env.development? %>
<%- if Rails.env.development? || ENV['ENABLE_TMP_LOGINS'] %>
<%# TODO: Temporary login form for local development until IST shibboleth issues gets resolved %>
<a href="/auth/developer" class='btn btn-primary'>
Sign in with Developer Account
Expand Down
4 changes: 2 additions & 2 deletions config/blacklight.yml
@@ -1,9 +1,9 @@
development:
adapter: solr
url: <%= ENV['SOLR_DEVELOPMENT_URL'] || 'http://localhost:8983/solr/hydra-development' %>
url: <%= ENV['SOLR_URL'] || 'http://localhost:8983/solr/hydra-development' %>
test: &test
adapter: solr
url: <%= ENV['SOLR_TEST_URL'] || 'http://localhost:8985/solr/hydra-test' %>
url: <%= ENV['SOLR_URL'] || 'http://localhost:8985/solr/hydra-test' %>
production:
adapter: solr
url: <%= ENV['SOLR_URL'] || 'http://localhost:8983/solr/blacklight-core' %>
Expand Down
6 changes: 3 additions & 3 deletions config/fedora.yml
@@ -1,15 +1,15 @@
development:
user: fedoraAdmin
password: fedoraAdmin
url: <%= ENV['FCREPO_DEVELOPMENT_URL'] || 'http://localhost:8984/rest' %>
url: <%= ENV['FCREPO_URL'] || 'http://localhost:8984/rest' %>
base_path: /dev
test:
user: fedoraAdmin
password: fedoraAdmin
url: <%= ENV['FCREPO_TEST_URL'] || 'http://localhost:8986/rest' %>
url: <%= ENV['FCREPO_URL'] || 'http://localhost:8986/rest' %>
base_path: /test
production:
user: fedoraAdmin
password: fedoraAdmin
url: <%= ENV['FCREPO_PROD_URL'] || 'http://localhost:8983/rest' %>
url: <%= ENV['FCREPO_URL'] || 'http://localhost:8983/rest' %>
base_path: /prod
2 changes: 1 addition & 1 deletion config/initializers/omniauth.rb
Expand Up @@ -12,7 +12,7 @@
},
name: 'CCID'

provider :developer unless Rails.env.production?
provider :developer if (Rails.env.development? || ENV['ENABLE_TMP_LOGINS'].present?)

# By default in development mode, omniauth raises an exception when authentication fails
# comment this line if you want to see the stacktrace from the actual provider when in `development`
Expand Down
6 changes: 3 additions & 3 deletions config/solr.yml
@@ -1,7 +1,7 @@
# This is a sample config file that points to a solr server for each environment
development:
url: <%= ENV['SOLR_DEVELOPMENT_URL'] || 'http://localhost:8983/solr/hydra-development' %>
url: <%= ENV['SOLR_URL'] || 'http://localhost:8983/solr/hydra-development' %>
test:
url: <%= ENV['SOLR_TEST_URL'] || 'http://localhost:8985/solr/hydra-test' %>
url: <%= ENV['SOLR_URL'] || 'http://localhost:8985/solr/hydra-test' %>
production:
url: http://your.production.server:8080/bl_solr/core0
url: <%= ENV['SOLR_URL'] || 'http://your.production.server:8080/bl_solr/core0' %>