Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

# NZ-ORCID-Hub [![Build Status](https://travis-ci.org/Royal-Society-of-New-Zealand/NZ-ORCID-Hub.svg?branch=master)](https://travis-ci.org/Royal-Society-of-New-Zealand/NZ-ORCID-Hub)[![Coverage Status](https://coveralls.io/repos/github/Royal-Society-of-New-Zealand/NZ-ORCID-Hub/badge.svg)](https://coveralls.io/github/Royal-Society-of-New-Zealand/NZ-ORCID-Hub)[![RTD Status](https://readthedocs.org/projects/nz-orcid-hub/badge/)](http://docs.orcidhub.org.nz/)
The home of development for the New Zealand ORCID Hub.

- [Application Docker Image](#application-docker-image)
* [Usage](#usage)
* [Environment Variables](#environment-variables)
- [Steps to execute this application](#steps-to-execute-this-application)
- [Development Environment](#development-environment)


## Application Docker Image

Application Docker Image ([orcidhub/app](https://hub.docker.com/r/orcidhub/app/)) is packaged with:
- CentOS 7
- Apache 2.4
- Python 3.6
- mod_wsgi (Pythgon/WSGI Apache module)
- psycopg2 (native PostgreSQL Python DB-API 2.0 driver)
- PyPI packages necessary for the application

### Environment Variables

The application image uses several environment variables which are easy to miss. These ariable should be set up for the specific runtime environment.

| Variable | Example | Description |
|-----------------------------|-----------------------|------------------------|
|ENV |test | The runtime environment name |
|SHIB_SP_DOMAINNAME |${ENV}.<container domainname> | Your **Service Provider** domain name |
|SHIB_IDP_DOMAINNAME |http://directory.tuakiri.ac.nz | Your **Idendtity Provider** domain name |
|SHIB_SSO_DS_URL |https://${SHIB_IDP_DOMAINNAME}/ds/DS | SSO discovery service URL |
|SHIB_METADATA_PROVIDER_URI |https://engine.surfconext.nl/authentication/idp/metadata| **Shibboleth** SAML 2.0 meta data provider URI [NativeSPMetadataProvider](https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPMetadataProvider) |
|SHIB_METADATA_CERT_FILE |conf/tuakiri-test-metadata-cert.pem | Meta data signig certificate |
|ORCID_CLIENT_ID |0000-1234-2922-7589 |Orcid API client ID and secret |
|ORCID_CLIENT_SECRET |b2aab710-89a1-49e8-65e4-8df4f038dce9 |Orcid API client ID and secret |

### Usage

1 - run application containers:

docker-compose up -d

2 - find container IP address:

docker inspect --format '{{.NetworkSettings.IPAddress}}' app

3 - verify it's running:

http $(docker inspect --format '{{.NetworkSettings.IPAddress}}' app)

## Steps to execute this application

If you are running this application for the first time then follow steps a to d:

a. From the project directory run

pip3 install -r requirement.txt

b. to install postgress and required libraries do

sh ./install_package.sh

c. Create database and user in postgres

CREATE USER orcidhub WITH PASSWORD '*****';
CREATE DATABASE orcidhub;
GRANT ALL PRIVILEGES ON DATABASE orcidhub to orcidhub;

d. Run initializedb.py to create table in postgres

python application.py

Open link https://test.orcidhub.org.nz/index

## Development Environment

It is possible to run the application as stand-alone Python Flask application using another remote application instance for Tuakiri user authentication. For example, if the remote
(another application instance) url is https://dev.orcidhub.org.nz, all you need is to set up environment varliable `export EXTERNAL_SP=https://dev.orcidhub.org.nz/Tuakiri/SP`.

In order to siplify the development environment you can use Sqlite3 DB for the backend.

To set up the database use environment variable DATABASE_URL, e.g. `export DATABASE_URL=sqlite:///data.db` and run application either directly invoking it with `python application.py` or using Flask CLI (http://flask.pocoo.org/docs/0.12/cli/):

export EXTERNAL_SP=https://dev.orcidhub.org.nz/Tuakiri/SP
export DATABASE_URL=sqlite:///data.db
export FLASK_APP=/path/to/main.py
export PYTHONPATH=$(dirname $FLASK_APP) ## flask run has problems with setting up search paths
export FLASK_DEBUG=1
flask run

You can add these setting to you virtual environment activation script, e.g. (assuming it's located in the root directory):

export FLASK_APP=$(dirname $VIRTUAL_ENV)/main.py
export PYTHONPATH=$(dirname $FLASK_APP)
export EXTERNAL_SP=https://dev.orcidhub.org.nz/Tuakiri/SP
export DATABASE_URL=sqlite:///data.db
export FLASK_DEBUG=1

To connect to the PostgreSQL node:

export PGHOST=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker-compose ps -q db))
export DATABASE_URL=postgresql://orcidhub:p455w0rd@${PGHOST}:5432/orcidhub

Metadata

Release files for ORCID-Hub 3.0.1.dev757

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ORCID-Hub 3.0.1.dev757
File Size Uploaded Provenance Actions
ORCID-Hub-3.0.1.dev757.tar.gz 1.1 MB Without provenance Details for ORCID-Hub-3.0.1.dev757.tar.gz

Release files / ORCID-Hub-3.0.1.dev757.tar.gz

Download URL ORCID-Hub-3.0.1.dev757.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
68dc404ef38c4f856070578a08225099a84e10b6c7e6638e764cc210a2b14184
BLAKE2b-256 checksum
How to use checksums
3b534765ac717db0f3f32ba88beebccf7f14a114890290ac823afbd502a54340
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ORCID-Hub 3.0.1.dev757

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page