Git Product home page Git Product logo

o2r-platform's Introduction

⚠️ Project discontinued ⚠️

See https://github.com/o2r-project/o2r-UI for the successor.


The o2r platform

Leveraging reproducible research by providing a powerful user interface for the o2r Web API.

Libraries

  • AngularJS
  • Bootstrap

Dependencies

Install

bower install

Run only platform project in a container

docker build --tag platform .

docker run -d -p 80:80 platform

Configure

Create a copy of the file client/app/config/configSample.js and name it client/app/config/config.js. You can configure the required application settings in this file ../config.js:

window.__env.server = /*String containing server address*/;
window.__env.api = /*String containing base api*/;
window.__env.sizeRestriction = /*integer*/;
window.__env.disableTracking = /*true/false, default is true*/;
window.__env.enableDebug = /*true/false, default is false*/;
window.__env.piwik = /*String containing Piwik server address*/;
window.__env.userLevels = {};
window.__env.userLevels.admin = /*Integer containing the required user level for admin status*/;
window.__env.userLevels.regular = /*Integer containing the required user level for regular status*/;
window.__env.userLevels.restricted = /*Integer containing the required user level for restricted status*/;

Development environment with Docker Compose

You can start all required o2r microservices (using latest images from Docker Hub) with just two commands using docker-compose (version 1.9.0+) and Docker (version 1.13.0+).

First, read the instructions on "Basics" and "Prerequisites" to prepare your host machine in the reference-implementation project.

This project contains one docker-compose configuration (file docker-compose.yml) to run all microservices & databases, and mount the client application directly from the source directory client. If you see an error related to the MongoDB in the first "up", abort and restart.

The client must be build on the host!

Running the platform

The services can be started using docker-compose on the following platforms

  • Unix based systems
  • Windows with Docker for Windows

by running:

docker-compose up

The platform is available at http://localhost.

Configuration (optional)

The platform provides two options to pass on environment variables to configure authorization, remote repositories and the Slack monitoring bot:

  1. The .env file contains default values to configure the platform to work with the offline OAuth server [o2r-guestlister]https://github.com/o2r-project/o2r-guestlister). Note that quotation marks are not parsed but instead treated as part of the variable value. For more information on how the .env file works, see the docker-compose documentation.
  2. Environment variables defined in the shell have priority over the values set in the .env file and can to override the default configuration, for example to use ORCID as the OAuth server:
OAUTH_CLIENT_ID=<...> OAUTH_CLIENT_SECRET=<...> OAUTH_URL_CALLBACK=<...> SHIPPER_REPO_TOKENS=<...> docker-compose up

Strings containing quotation marks (e.g. SHIPPER_REPO_TOKENS) have to be escaped when used in the shell. For details on configuring the platform to use ORCID instead of the o2r-guestlister, see the ORCID section in the reference implementation documentation.

The environment parameters are as follows:

  • OAUTH_CLIENT_ID identifier for the platform with auth provider
  • OAUTH_CLIENT_SECRET password for identification with the auth provider
  • OAUTH_URL_CALLBACK the URL that the authentication service redirects the user to, important to complete the authentication, probably http://localhost/api/v1/auth/login
  • SHIPPER_REPO_TOKENS a JSON object, that holds the authentication tokens for shipping to remote repositories such as Zenodo (optional). Must have the (unescaped) form {"zenodo": "$ZENODO_TOKEN", "zenodo_sandbox": "$ZENODO_SANDBOX_TOKEN", "download": "" }. Replace $ZENODO_TOKEN etc. with your personal access token.
  • SLACK_BOT_TOKEN and SLACK_VERIFICATION_TOKEN, required for monitoring with Slack (optional)

Configuration with Docker for Windows

When using the shell to provide environmental variables, these must be passed separately on Windows, followed by the docker-compose commands:

$env:OAUTH_CLIENT_ID = <...>
$env:OAUTH_CLIENT_SECRET = <...>
$env:OAUTH_URL_CALLBACK = <...>
$env:ZENODO_TOKEN = <...>
docker-compose up

Restart from scratch

You can remove all containers and images by o2r with the following two commands on Linux:

docker ps -a | grep o2r | awk '{print $1}' | xargs docker rm -f
docker images | grep o2r | awk '{print $3}' | xargs docker rmi --force

Use non-default version of o2r-meta and containerit

Two core steps for compendium creation are provided by the standalone tools o2r-meta and containerit. These tools are used in a containerized version with different version tags (o2r-meta, containerit) and the specific tool can be selected via an environment variable for both muncher and loader in the compose configuration (see comments in the file).

For metadata extraction and brokering, see the respective loader configuration property LOADER_META_TOOL_CONTAINER and muncher configuration property MUNCHER_META_TOOL_CONTAINER. For testing metadata tools under development setting the property to o2rproject/o2r-meta:dev can be useful.

For container manifest creation, see the muncher configuration property MUNCHER_CONTAINERIT_IMAGE.

Note

(Re-)starting containers manually might cause problems with the platform due to newly assigned IP-addressees. To avoid this problem, restart the platform container after (re-)starting other containers manually.

User levels

The o2r microservices require users to have specific user level to be allowed certain tasks. By default, users may create compendia, but if you want to develop features for editors or admins, you can adjust a user's level in the admin view.

Proxy for o2r microservices

If you run the o2r microservices locally as a developer (e.g. by manually starting each microservice via npm start), it is useful to run a local nginx to make all API endpoints available under one port (80), and use the same nginx to serve the application in this repo. A nginx configuration file to achieve this is dev/nginx-microservices.conf.

docker run --rm --name o2r-platform --network="host" -p 80:80 -v $(pwd)/dev/nginx-microservices.conf:/etc/nginx/nginx.conf:ro -v $(pwd)/client:/usr/share/nginx/html:ro -v $(pwd)/dev:/etc/nginx/html/dev:ro nginx:stable-alpine

# bash inside the container for debugging IPs:
docker exec -it o2r-platform /bin/bash
# get the host machine IP from inside the container (use this if the default 172.17.0.1 does not work):
ip addr show docker0 | grep -Po 'inet \K[\d.]+'

Note: If you want to run this in a Makefile, $(CURDIR) will come in handy to create the mount paths instead of using $(pwd).

WebSocket testing

The compose configuration also makes a simple test page for WebSockets available at http://localhost/dev/socket.html (based on file dev/socket.html).

Platform Version

1.0.2

License

o2r-platform is licensed under Apache License, Version 2.0, see file LICENSE. Copyright © 2018 - o2r project.

o2r-platform's People

Contributors

dependabot[bot] avatar jansule avatar lukaslohoff avatar nuest avatar rehans516 avatar tekraft avatar timmimim avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

o2r-platform's Issues

Better intro/help for new visitors on landing page

If a user opens our demo platform at https://o2r.uni-muenster.de/, she could be better guided what to do.

Here are my suggestions, feedback welcome!

  • highlight "you have to login first", maybe add a popover to the login button that is always visible
  • add a couple of links to example folders we already have on Sciebo so that a user can either copy and paste working public share URLs, or click on a link to put them in the form. May also be added as a popover or in a box underneath the two Create/Inspect boxes, with a short welcome text and some description of the respective examples.
  • add welcome text pointing to o2r.info
  • add a help pop-op to mentions of ERC directing to http://www.dlib.org/dlib/january17/nuest/01nuest.html
  • [ ] after registration, tell users they must send us an Email so that we can increase their rights on the platform!

Ship to Zenodo Button missing

Since the last redesign of the ercView, the Ship to Zenodo-Button is missing. It should be added again to the ercView.

Show error messages at failed upload

The server sends a concrete message if an upload fails, which should be displayed. E.g. if a user level does not allow upload, then it reponds with

401

{"error":"user level does not allow compendium creation"}

but the UI only tells the user "File upload failed!".

Inspect ERC: homeView

If you enter a not existing ID in the field Inspect ERC you will be forwarded to a crashing ercView. There should be some logic to prevent this behaviour. If an ERC is not found, we should redirect to the main page, maybe.

Update inspection user interaction

This issue concerns two scenarios:

1. Inspecting remote ERC on the platform

The "Inspect" form should accept full Zenodo URLs as well as DOIs (as full links or resolved internally).

A user might manually enter these while reading a paper or copying a link from a document/website, which is not linked to an o2r platform instance.

2. Inspecting remote ERC coming from another platform

To inspect an ERC that is stored in a remote repository, we would like to be able to pre-fill the inspect form with a suitable value. This way, a button on a third party website can say "Inspect this ERC" and the user does not have to manually transfer an ID into the o2r platform start page.

URL examples, coming from third party sites could be

  • http://.../#/?inspect=10.124/sg22sdfsa (DOI)
  • http://.../#/?inspect=https://zenodo.org/record/1
  • http://.../#/?inspect=https://doi.org/10.124/sg22sdfsa

API updates

The server currently only has an API for loading workspaces, not for inspection. See https://github.com/o2r-project/o2r-loader/issues/12

The server API must accept all allowed inputs, see above.

@LukasLohoff @jansule @MarkusKonk Comments/clarifications welcome!

ERC upload vs. login message

After logging in (see right hand top corner) the "Create ERC" box still says "You have to login first". This is also the case after refreshing. What helps is clicking on my username, and then going back to the start page.

image

I'm on Firefox 52.0.2.

pdf is not scrollable v2

https://github.com/o2r-project/o2r-platform/blob/master/templates/author.html#L28-L47

When loading .pdf-files, there occurs an error: "offsetParent is not set -- cannot scroll". This error only occurs, if the object-tag is placed inside another element like div.
By default offsetParent is referring to the body-tag of a html.
OffsetParent is usually changed by adding a "position: relative" tag to an related html-element.

Somehow, the error doesn't disappear when adding the "position: relative" tag to a parent element.

EditMetadataView - scope.meta undefined

Somewhere in the directive scope.meta will be changed to undefined. This results in an error when clicking on the Edit-Button. The code of o2rEditMetadata.directive.js needs to be revised and fixed.

create strings in arrays to objects

AngularJS has problems binding to primitives. Therefore arrays containing strings should be changed to objects to work properly on client side. I suggest following schema:

"key": [{"name": String}, {"name": String}]

Here an example for the keywords-attribute:

"keywords": [{"name": "reproducible"}, {"name": "research"}]

Login feature

After the authentication microservice is implemented, see https://github.com/o2r-project/o2r-bouncer, add a "Login with ORCID" button to the page. Add a "?" button or some kind of link to a page with details about

Loading indication when submitting public share

When uploading large files via public share, it's not possible to see an indication that something is happening/loading.

I guess a "progress bar" similar to the zip upload won't be possible - there is no way to find out the progress.

What do you think?

Error and cancellation handling on file upload

When cancelling the upload, or an error occurs, the user will be redirected to the view for inserting metadata anyway. I think, if the upload is not successful (on cancel or error) the upload modal should just close, without redirecting.

Display .RData content

.Rdata files will not be displayed correctly, since they are stored as binaries and not as text files (R is needed to read their content). It should be considered to convert .Rdata into a text file format, server side. Otherwise it will not be able to display them.

Show session cookie in user settings

If users (or we...) want to experiment with the API, then it would be useful to be able to copy the current session cookie string from the user details page.

The information is the same as in the connect.sid cookie, so nothing that is not already with the client.

Add constant "version"

To track the currently deployed version on the server, it would be very helpful if the current version would be shown unobtrusively in the website footer.

The server deployment script sets a variable in the config file as follows:

app.constant('version', 'dc75853 @ 2016-08-20T10:37:25+02:00');

It would be great if the app would display it (if present)

Simplify license selection

[as discussed during the workshop last month]

The UI should offer a minimal and simple solution for licenses first, and only on user interaction provide the full UI with four drop-downs etc. So, the o2r platform should have "open" defaults so that the creator might not have to change anything.

Similar to http://choosealicense.com/ we can abstract from the details and be opinionated.

@7048730 @MarkusKonk (just going through my workshop notes:) Do you have anything to add?

Failed upload still redirects to metadata form

When I just tried and upload and it failed, I was still redirected to the metadata form, which is confusing.

To replicate, manually stop the loader container/service and then try to submit a workspace via zip file.

Create Dockerfile

In our deployment, we currently copy the complete codebase from client to server. That is not feasible anymore (material-design-icons is over 60 MB !), it just takes to long. Therefore a Dockerfile should be created which can be run on the server.

User notification if upload via sciebo fails

If the upload via sciebo is successful, the user gets redirected to the entering of missing metadata. However, if the upload via sciebo fails, the user does not get any error message/information about what did go wrong, etc. Therefore, some popup, toast, etc. should be added to inform the user.

platform documentation does not refer to supported docker-compose versions + elasticsearch configuration

Hi,
I just tried to set up the o2r platform using docker-compose on Ubunto Xenial 16.04 LTS
It seems like my docker-compose installation is not supported, but the documentation is missing out information on the installation requirements.

This is what I did:

matthiashinz@xxx:~/o2r-platform$ docker-compose --version
docker-compose version 1.5.2, build unknown
matthiashinz@xxx:~/o2r-platform$ docker-compose --file test/docker-compose-db.yml up -d
ERROR: In file './test/docker-compose-db.yml' service 'version' doesn't have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.

Add minimal shipment UI for Zenodo

The ERC has four licenses for all of the components, but Zenodo only has one metadata for everything.

Therefore after clicking on "Ship to Zenodo", a modal should be shown where a user is told he has to choose one license for the whole shipment. This should be a dropdown.

The use must also be shown the already selected licenses for the parts of a compendium.

This is of course different for other recipients.

Admin backend

An administrative backend where admin users (high enough levels) can easily change other users's levels would be useful. No more directly going to the database.

It should contain the user information (link to ORCID profile, full name from ORCID, current level), and a nice UI for using some pre-defined user levels, or alternatively entering a specific user level manually.

Reducing a user's level or making her admin should require a confirmation before saving.

API endpoint already exists, see http://o2r.info/o2r-web-api/user/#edit-user

Should we integrate this in this app, or have an independent one?

Add option to unhide BagIt and metadata files

For most users, the BagIt-specific files and metadata files are not relevant when they view the compendium in the browser. There should be a unobtrusive link to display them, but by default they should be either (a) hidden, or (b) shown in "grey" or somehow less prominent.

This could be done with a fixed whitelist in the UI, based on filenames/paths. If this "hiding" is limited to BagIt, we could even show the contents of the data folder by default, and only show the full folder tree when BagIt display is enabled.

The list of files would currently comprise

  • .erc - everything within the directory data/.erc in a Bagit compendium
  • manifest-<alg>.txt
  • bagit.txt
  • tagmanifest-<alg>.txt
  • bag-info.txt
  • fetch.txt

Make api url configurable

It must be easier to switch between different environments (localhost, deployment). Ideally, we could set the constant via a environment variable when calling npm start, e.g.

API_URL="http://localhost/api/v1" npm start

Don't really know if these help - seems hard to find a "best" practice for this.

ercView - copy link bug with external links

If an external link is shown in the copy path field in ercView, http://localhost will be prepended. There should be some logic to detect external links and prevents prepending them.
See here:
linkerror

Add highlighting to log output

The output logs are rather hard to read, especially if the run through quickly. There should be some highlighting of keywords, such as "done" or "step n of m". This comprises two aspects

  • highlighting generic logs (e.g. Docker build output)
  • highlighting "special ERC" output, e.g. validation results

TravisCI has great live updates of logs (including folding of completed sections for example), maybe their code can help us. https://github.com/travis-ci/travis-web/blob/master/app/components/log-content.js might be a starting point.

Use simple white logo for header

In the header, I think a simple, plain white version of the o2r logo might look much nicer. It works better with the rest of the menu and we don't need the light coloured borders, which make the logo look strange. It could also be a bit smaller then!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.