diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cf197e7a0b93a3c254203851cfc60d7a8966186c..9d991e7b108da5e61b75e3d27e6793ec00c2e2ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,15 +14,18 @@ For contributions made as discussions and suggestions, you can at any time open ## Branches We maintain master as the production branch and tag it with release names. If you wish to contribute to Kotahi then you need to make a branch and then issue a pull request following this procedure: -Create a user account on Coko's GitLab: http://gitlab.coko.foundation -Clone master with `git clone git@gitlab.coko.foundation:kotahi/kotahi.git` -Create a new branch and work off of that. Please name the branch which sensibly identifies the feature you are working on. You can push the branch to GitLab at anytime. + +- Create a user account on Coko's GitLab: http://gitlab.coko.foundation +- Clone master with `git clone git@gitlab.coko.foundation:kotahi/kotahi.git` +- Create a new branch and work off of that. Please name the branch to sensibly identify which feature you are working on. You can push the branch to GitLab at anytime. ## Getting your contributions merged This is a two part process, first ask for comments, then ask for the changes to be merged. -Ask for feedback generate a Merge Request (Pull Request) from the GitLab interface but do not assign this request to anyone. You do this from the Gitlab UI on your branch. + +To ask for comments, generate a Merge Request (Pull Request) from the GitLab interface but do not assign this request to anyone. You do this from the Gitlab UI on your branch. Look at the feedback and alter your branch as necessary. + To merge with master - generate a merge request (Pull Request). You do this from the Gitlab UI on your branch. We encourage feedback and discussion from as many people as possible on Merge Requests! diff --git a/FAQ.md b/FAQ.md index 941ae5ec6a488a748f226ec3ee6f5eb386969c6d..2a4e5e24c9122d839338c15a6bc7a5b351f2d470 100644 --- a/FAQ.md +++ b/FAQ.md @@ -7,7 +7,7 @@ eg. if your app is at `kotahi.myorg.com`, go to `kotahi.myorg.com/login` ## How do I setup ORCID for development? -Getting past the login screen can be a challenge if you haven't set this up correctly. You need two things: an account at `sandbox.orcid.org` and a `mailinator` email. When `NODE_ENV` is set to `development`, the app will expect you to be using a sanbox account. Orcid's sandbox in turn will only send emails to mailinator accounts, so if you don't use mailinator, you won't be able to verify your email (and consequently not be able to set this up). +Getting past the login screen can be a challenge if you haven't set this up correctly. You need two things: an account at `sandbox.orcid.org` and a `mailinator` email. When `NODE_ENV` is set to `development`, the app will expect you to be using a sandbox account. Orcid's sandbox in turn will only send emails to mailinator accounts, so if you don't use mailinator, you won't be able to verify your email (and consequently not be able to set this up). So here's how to set this up in less than 20 easy steps: @@ -26,7 +26,7 @@ So here's how to set this up in less than 20 easy steps: 13. Under "Redirect URIs", add the url of your kotahi client plus `/auth/orcid/callback`. So if in your browser you can see your app under `http://localhost:4000`, the value here should be `http://localhost:4000/auth/orcid/callback`. [1] 14. Click on the floating save icon on the right. 15. You should now be presented with a gray box that gives you a client id and a client secret. -16. Go to your application's environment file and the values you just got. +16. Go to your application's environment file and enter the values you just got. ```sh export ORCID_CLIENT_ID=your-orcid-client-id @@ -40,3 +40,18 @@ You should now be able to use the login. _Disclaimer: ORCID is a separate organisation from Coko and we are in no way affiliated with them. This is meant as a guide to make a developer's life easier. If you encounter issues with ORCID services not working as expected, please contact their support._ [1] Even though this URL does not exist for the client (ie. it isn't handled by our `react-router` setup), it will be redirected to the server via `webpack-dev-server`'s proxy. + +## Why is ORCID's login page not loading? + +ORCID seems to be reliant on Google Tag Manager, so ad-blocker or tracker-blocker extensions in your browser may interfere with authentication. + +## How can I create an admin user? + +Once you're logged in, go to the "My profile" page and copy the username (a string of digits). Open a terminal within your Docker **server** container, and perform the following, substituting your username: + +```sh +yarn console +x = await User.query().where({username:"0000000210481437"}).first() +x.admin = true +x.save() +``` diff --git a/README.md b/README.md index 9145376d0a59d694a09e31a11f8cdf124f0ead2b..4a937bd12aa709ac6d66ae4eb7f378733797009d 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,10 @@ Developer beware! This project is currently under very heavy development, so thi ### Running the app -We provide docker-compose and docker files to ensure consistency across environments. This of course means that the following instructions assume that you have `docker` and/or `docker-compose` installed on your system. +We provide docker-compose and docker files to ensure consistency across environments. The following instructions assume that you have `docker` and/or `docker-compose` installed on your system. You can use the `docker-compose.yml` and `docker-compose.production.yml` files as a reference for the environment variables that are needed, as well as a kind of installation guide if for some reason you wish to not use docker. - -There is also the assumption that you have loaded the environment variables into your shell (eg. via `source your_environment_file.env`). If you place a file named `.env` in the project root folder, the `docker-compose` cli will automatically pick that up. +Environment variables must be loaded into your shell. The `docker-compose` cli will automatically load any environment variables specified in the file `<project root>/.env`. You can also load these manually (e.g. via `source .env` on linux). To set up ORCID variables for login, read [FAQ.md](FAQ.md). #### Development @@ -28,7 +27,7 @@ This will: - Run the server with `nodemon`, so that changes auto restart the server - Run the client with webpack dev server, with hot reload enabled - Bring up a postgres container for use in development -- Register the `job-xsweet` service +- Register the `job-xsweet` service (which converts .docx files to HTML) #### Production @@ -47,6 +46,11 @@ For production, we are making the assumption that you have a running postgres da Depending on your needs and setup, it might not be a good idea to use the `docker-compose` cli in production. If this is the case, and your container management solution cannot read `docker-compose` files, simply use the `docker-compose.production.yml` file as a reference for what is needed. +### Further setup and development info + +See [FAQ.md](FAQ.md). +Conventions for code changes, branching and merge requests are covered in [CONTRIBUTING.md](CONTRIBUTING.md). + # Other credits The real-time chat functionality was heavily inspired by https://github.com/withspectrum/spectrum, from data model approach to copying and adapting certain bits of their React app. Thank you, Spectrum!