This application leverages ORCID services and ORCID iDs for researchers in the Princeton community.
This is an updated version of ORCID Princeton written on the Hanami platform.
The original code for the rails application is located at https://github.com/pulibrary/orcid_princeton
- Ruby: 3.4.2
- nodejs: 22.14.0
- yarn: 1.22.22
- Lando: 3.6.2
Update the the environment variables either via Princeton Ansible for long term changes or by modifying the ~deploy/app_configs/orcid_princeton
on each server and restarting passenger/nginx (sudo service nginx restart
) on each server for short term changes.
- A Mailinator account is required for you to be able to verify your ORCID account. "Setup" your Mailinator your email:
- visit https://www.mailinator.com/v4/public/inboxes.jsp
- put a fake email address (e.g., myname) into the search box at the top of the page.
- your email wil include
@mailinator.com
(e.g.myname@mailinator.com
) even though you do not need to put@mailinator.com
in the search box
- your email wil include
- Click go and you will be taken to the "inbox" for that email.
- Use the mailinator email address (e.g.
myname@mailinator.com
) to register an account at https://sandbox.orcid.org/register - Record your login and password in a password manager so you can find them again.
- Now in mailinator respond to the verification email.
- If you do not see your email make sure the search box has your email. You do not need to include
mailinator.com
- Click the verify button in the email
- If you do not see your email make sure the search box has your email. You do not need to include
- Your account should now be verified in the OCRID Sandbox
Prior to utilizing the rails database for the hanami application you need convert the tokens in the rails application and to update the migrations table.
In development to convert your rails database to be able to run with Hanami you need to run (the commands below assume the port returned in lando info is 51512 )
cd orcid_princeton
bundle exec rake tokens:openssl
cd orcid_princeton_hanami
lando info
psql --host 127.0.0.1 --username=postgres --port 51512 -d development_db < config/db/update_rails_migration.sql
Before deploying the hanami application for the first time or in a rails release of the application on the server run the following to update the the encrypted tokens.
cd /opt/orcid_princeton/current
bundle exec rake tokens:openssl
In staging and production the database information is stored in environment variables. To update the database you should run
cd /opt/orcid_princeton/current
echo $APP_DB_PASSWORD
psql --host $APP_DB_HOST --username=$APP_DB_USERNAME -d $APP_DB < config/db/update_rails_migration.sql
- Check out code and
cd
- Install tool dependencies; If you've worked on other PUL projects they will already be installed.
- Install asdf dependencies with asdf
asdf plugin add ruby
asdf plugin add node
asdf plugin add yarn
asdf install
- ... but because asdf is not a dependency manager, if there are errors, you may need to install other dependencies. For example:
brew install gpg
- Or, if you are using
ruby-install
andchruby
(instead ofasdf
):ruby-install 3.2.0 -- --with-openssl-dir=$(brew --prefix openssl@1.1)
- close the terminal window and open a new terminal
chruby 3.2.0
ruby --version
- Install language-specific dependencies
bundle install
yarn install
We use lando to run services required for both test and development environments.
Start and initialize database services with:
lando start
hanami db create
hanami db migrate
To stop database services:
lando stop
- Fast:
bundle exec rspec spec
- Run in browser:
RUN_IN_BROWSER=true bundle exec rspec spec
The application can be run in development mode by running bin/dev
from the hanami application directory.
Hanami runs by default at the port 2300, but we have made this application run at the default rails port 3000 localhost
bin/dev
- Access application at http://localhost:3000/
You need to have the following variables in your environment to connect with the ORCID sandbox. Actual values are in lastpass under "ORCID Local API key". export ORCID_CLIENT_ID="xxx" export ORCID_CLIENT_SECRET="xxx"
With Hanami environment variables for development and test are put in .env
& .env.test
or .env.dev
files. You can keep secret information in .env.dev.local
if you like or set them up as environment variables/
RDSS uses the same release and deployment process for all projects.
You can view the ORCID Honeybadger Uptime check. Currently it checks every minute and will report downtime when two checks fail in a row (i.e. we should know within 2 minutes).
To be notified of downtime enable notifications in Honeybadger under: Settings + Alerts & Integrtions + email (Edit). Enable notifications for "Uptime Events" for "ORCID Production". Notice that email notifications settings are per project.
In compliance with ORCID's general brand guidance around capitalization of the ORCID organization name and ORCID identifier information, we use the following written style to refer to ORCID and ORCID identifiers:
- ORCID - (noun) the ORCID organization; (adjective) part of a noun phrase that refers to things that are about ORCID, but not by the organization itself
- Noun example: "ORCID is a global, not-for-profit organization."
- Adjective example: "Click here to view your ORCID record"
- ORCID identifer or ORCID iD (abbreviation) - unique identifer offered by the ORCID organization