Giter VIP home page Giter VIP logo

adopter-registration-server's Introduction

Adopter Statistics

This is a Flask server that is build to collect, store and administrate statistics reports and error events from opencast instances (adopters). In future opencast versions the admin will be asked to register the instance and allow sending error reports and monthly statistics reports.

Installation Guide

  • Clone Repository:
     git clone https://github.com/opencast/adopter-statistics-server.git
     cd adopter-statistics-server
  • Create virtual enviroment:
     python -m venv venv
  • Activate the environment:
     . venv/bin/activate
  • Install requirements:
     pip install -r requirements.txt
  • Configure TODOs in config.py (if you want to run it in production)
  • Run app:
     // ignore following line if running in production
     export FLASK_ENV=development
    
     flask run
     // if you run into ModuleNotFound-Error try using
     venv/bin/flask run
  • Open http://127.0.0.1:5000 (redirect to the admin page)

Opencast Configuration

By default, Opencast will send data to register.opencast.org. For testing, you can change that by adding the following configuration option to the custom.properties:

org.opencastproject.adopter.registration.server.url=http://127.0.0.1:5000

User model / security:

To ensure security there is a role based user model implemented. Before handling the first request this app will create the database, create the roles "readonly" and "superuser" and will create the default superuser defined in config.py (default: Email: "admin", "Password": "admin"). This default admin should be configured with a strong password or be deleted after another superuser was created.

To access the admin page you need to create an account. The created user will not have any permissions. A superuser needs to edit and add a role to your user profile.

Roles:

  • readonly: Can see Adopter, Error Event and Statistics Report tables
  • superuser: readonly + can edit and delete entries and read/edit/delete users

Api

Authentication

Use BasicAuth for authentication.

Adopter

Method Endpoint Description Auth Query param
POST /api/1.0/adopter Create Adopter [everybody]
GET /api/1.0/adopter Query all Adopters [readonly/superuser] __limit & __offset
GET /api/1.0/adopter/<adopter_key> Query adopter by adopter_key [everybody]
PUT /api/1.0/adopter/<adopter_key> Edit adopter [everybody]

Example:

{
	"adopter_key": "C2B1262C424F905466FBCF2ACA1148CF",
	"organisation_name": "Example University",
	"department_name": "Mathematics and Computer Science",
	"gender": null,
	"first_name": null,
	"last_name": null,
	"mail": null,
	"country": "GER",
	"postal_code": "12345",
	"city": "Exampletown",
	"street": "Main Street",
	"street_no": "1A",
	"address_additional": null,
	"contact_me": false,
	"allows_statistics": true,
	"allows_error_reports": true,
	"allows_tech_data": true
}

Statistics Report

Method Endpoint Description Auth Query param
POST /api/1.0/statistics_report Create statistics report (adopter_key needed) [everybody]
GET /api/1.0/statistics_report Query all statistic reports [readonly/superuser] __limit & __offset
GET /api/1.0/statistics_report/<id> Query statistic report by id [readonly/superuser]
GET /api/1.0/adopter/<adopter_key>/statistics_report Query statistics reports from adopter [everybody] __limit & __offset

Example:

{
	"from_date": "2019-01-01",
	"to_date": "2019-01-31",
	"opencast_version": "6.0.0",
	"adopter_key": "C2B1262C424F905466FBCF2ACA1148CF"
}

Error Event

Method Endpoint Description Auth Query param
POST /api/1.0/error_event Create error event (adopter_key needed) [everybody]
GET /api/1.0/error_event Query all error events [readonly/superuser] __limit & __offset
GET /api/1.0/error_event/<id> Query error event by id [readonly/superuser]
GET /api/1.0/adopter/<adopter_key>/error_event Query error events from adopter [everybody] __limit & __offset

Example:

{
	"timestamp": "2019-02-24T12:34:56+0100",
	"adopter_key": "C2B1262C424F905466FBCF2ACA1148CF",
	"error_type": "Runtime Exception",
	"data": "{'some': 'json_data'}",
	"opencast_version": "6.0.0"
}

adopter-registration-server's People

Contributors

dependabot[bot] avatar edmundodelgusto avatar gregorydlogan avatar lkiesow avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

adopter-registration-server's Issues

Pip Install Fails

In checking this so we can finally get it deployed somewhere, I ran into this getting it started:


The conflict is caused by:
    The user requested marshmallow==2.18.0
    flask-marshmallow 0.9.0 depends on marshmallow>=2.0.0
    marshmallow-sqlalchemy 0.25.0 depends on marshmallow>=3.0.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies```

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.