Skip to content
/ rdr Public
forked from duke-libraries/rdr

A generated Hyrax-based Research Data Repository application

Notifications You must be signed in to change notification settings

simonmchoy/rdr

 
 

Repository files navigation

rdr

A generated Hyrax-based Research Data Repository application

Note that this application is intended to run within the rdr-vagrant virtual machine

Prerequisites (vagrant / virtualbox)

  • Vagrant version 1.8.5+

    You can quickly check to see if you have a suitable version of vagrant installed by running vagrant -v

    If you don't have vagrant installed, you can download it -- it's available for both Mac and Windows, as well as Debian and Centos.

  • VirtualBox

    Vagrant runs inside of a Virtual Machine (VM) hosted by VirtualBox, which is made by Oracle and is free to download. They have version for Mac and Windows, as well as Linux and Solaris.

    You can quickly check to see if you have VirtualBox installed by running vboxmanage --version

Setup the Environment

Vagrant

  1. clone the rdr-vagrant repository git clone --recursive https://github.com/duke-libraries/rdr-vagrant.git

  2. move to the rdr-vagrant folder cd rdr-vagrant

  3. startup vagrant vagrant up

    This will run through provisioning the new Virtual Machine. The first time it runs, it will take a while to complete. In the future when you want to startup the dev environment, you'll run the same command but it will startup much more quickly

    Vagrant creates a shared folder that you can access both inside the VM and on your workstation. We've found it's best to do your git operations exclusively via the workstation folder.

rdr application

  1. This repo (rdr) is included as a submodule in rdr-vagrant, so the folder and files are there already.

    However, we need to specify that we will be using the develop branch.

    move to the rdr folder cd rdr

    specify the branch git checkout develop

    move back to the rdr-vagrant folder cd ..

  2. shell into vagrant box vagrant ssh

  3. change to the new folder cd /vagrant/rdr

7. Copy the role map config file cp config/role_map.yml.sample config/role_map.yml no longer needed -- see below

  1. grab the bunder gem gem install bundler

  2. run bundle install --without production

  3. setup Postgres (see confluence documentation]:

    a. Create a 'hydra' postgres user (role): psql -c "CREATE USER hydra WITH PASSWORD 'hydra' CREATEDB;" postgres

    b. Create a development postgres database: psql -c "CREATE DATABASE development WITH OWNER hydra;" postgres

    c. Create a test postgres database: psql -c "CREATE DATABASE test WITH OWNER hydra;" postgres

    d. Set up the development and test databases: rake db:schema:load

  4. run database migrations rake db:migrate

  5. load default workflow rake hyrax:workflow:load

  6. start the server(s) bin/rails hydra:server

    This starts Solr, Fedora, and Rails

  7. create default admin set — open a new terminal tab (Ctrl-T or ⌘-T), shell into vagrant vagrant ssh, and move to the correct folder cd /vagrant/rdr

    then run bin/rails hyrax:default_admin_set:create

    you can close the tab when it's done

  8. The application should now be running at localhost:3000. You can try to do some things like creating a new user account and depositing an object

    *Note that if you would like to give your user account admin rights, you'll need follow the instructions below

Shut down the application

  • to shut down the app, stop the rails server by pressing Ctrl-C, logout of vagrant logout, and then shutdown the VM vagrant halt

Start up the application

  • to startup again, run vagrant up, vagrant ssh, cd /vagrant/rdr, and bin/rails hydra:server

Solr and Fedora

Environment (via rdr-vagrant)

References

Instructions are based on the Samvera Hyrax installation instructions

Addenda

3/21/2018 -- Changes to role management

Previously we were using the default role management in Hyrax which used config/role_map.yml to assign users to roles. We're no longer using the yml file and are instead using the hydra-role-management gem so there are a few extra steps you'll need to take to get things to work.

  1. run database migrations using: rake db:migrate

  2. add a user to the admin group via the rails console

    use rails c to start the console

    then enter:

    admin = Role.create(name: "admin")

    admin.users << User.find_by_user_key( "your_admin_user_name" )

    admin.save

    and then exit the console: exit

  3. start up the server bin/rails hydra:server, sign in using the 'admin' user you assigned above, and visit localhost:3000/roles which should allow you to view existing roles, create new ones, and assign users to them.

    Note: if you had established other user roles in the role_map.yml file, you'll need to manually assign those users using this process

  4. If you have any problems, you can test whether a user has been assigned to either the admin or curator groups (as these have defined methods on the User class) using the rails console as follows:

    u = User.find_by_user_key( "your_user_id_name" )

    u.admin?

    u.curator?

    If either returns true, you know your user is in that group.

About

A generated Hyrax-based Research Data Repository application

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 77.7%
  • HTML 8.5%
  • CSS 8.3%
  • XSLT 5.1%
  • JavaScript 0.4%