The research software directory is configured using a file with environment
variables called .env
. An example config file
(rsd-secrets.env.example
) is available, use it as a starting point.
cd research-software-directory
cp rsd-secrets.env.example .env
The config file has some placeholder values (changeme
); they must be set by
editing the rsd-secrets.env
file. Below are instructions on how to get the
different tokens and keys.
This is a prefix that docker-compose uses in naming its images, containers, and
volumes in order to avoid name clashes. Its default value is rsd
.
These environment variables are used for authenticating a user, such that they can be granted access to the admin interface to create, read, update, and delete items in the Research Software Directory.
These are the steps to assign values:
- Go to https://github.com/settings/developers
- Click the
New OAuth App
button - Under
Application name
, write something like The Research Software Directory's admin interface on localhost - Under
Homepage URL
fill in some URL, for example, let it point to this readme on GitHub. Despite the fact that it is a required field, its value is not used as far as I can tell. - Optionally add a description. This is especially useful if you have multiple OAuth apps
- The most important setting is the value for
Authorization callback url
. Set it to http://localhost/auth/get_jwt for now. We will revisitAUTH_GITHUB_CLIENT_ID
andAUTH_GITHUB_CLIENT_SECRET
in the section about deployment below - Click
Register application
- Assign the
Client ID
as value forAUTH_GITHUB_CLIENT_ID
and assign theClient Secret
as value forAUTH_GITHUB_CLIENT_SECRET
Data is entered into the Research Software Directory via the admin interface.
Set AUTH_GITHUB_ORGANIZATION
to the name of the GitHub organization whose
members should be allowed access to the admin interface. Most likely, it is the
name of the organization where you forked this repository to.
Note: members should make their membership of the GitHub organization public. Go to https://github.com/orgs/<your-github-organization>/people to see which users are a member of <your-github-organization>, and whether their membership is public or not.
To query GitHub's API programmatically, we need an access token. Here's how you can get one:
- Go to https://github.com/settings/tokens
- Click
Generate new token
- Under
Token description
, fill in something like Key to programmatically retrieve information from GitHub's API - Verify that all scopes are unchecked
- Use token as value for
GITHUB_ACCESS_TOKEN
To query Zenodo's API programmatically, we need an access token. Here's how you can get one:
- Go to https://zenodo.org/account/settings/applications/tokens/new/
- For name, fill in something like Key to retrieve data from Zenodo
- Make sure all scopes are unselected
- Click Create
- Fill in the long string you get as value for
ZENODO_ACCESS_TOKEN
When getting the references data from Zotero, this environment variable
determines which library on Zotero is going to be harvested. Go to
https://www.zotero.org/groups/ to see which Zotero groups you are a member of.
If you click on the Group library
link there, the URL will change to
something like
https://www.zotero.org/groups/1689348/netherlands_escience_center/items, where
1689348
is the value you need to assign to ZOTERO_LIBRARY
.
To query Zotero's API programmatically, we need an API key. Here's how you can get one:
- https://www.zotero.org/settings/keys
- Click
Create new private key
- Type a description of the key, e.g. API key to access library X on Zotero
- Under
Personal library
, make sure onlyAllow library access
is checked. - Under
Default group permissions
, chooseNone
- Under
Specific groups
, checkPer group permissions
- Set
Read only
for the group that you want to harvest your references data from; verify that any other groups are set toNone
- Click the
Save Key
button at the bottom of the page. - On the
Key Created
page, you will see a string of random character, something likebhCJSBCcjzptBvd3fvliYOoE
. This is the key; assign it toZOTERO_API_KEY
This environment variable is used for making a daily backup of the database with software, people, projects, etc. As it is typically only used during deployment, leave its value like it is for now; we will revisit it in the page about deployment.
The JWT_SECRET
is simply a string of random characters. You can generate one
yourself using the openssl
command line tool, as follows:
openssl rand -base64 32
Assign the result to JWT_SECRET
.
These environment variables are not relevant when you're running your instance
locally. Leave their values like they are in rsd-secrets.env.example
for the
time being. We will revisit them in the page about deployment.