{"id":26475451,"url":"https://github.com/opencast/adopter-registration-server","last_synced_at":"2025-03-19T23:17:10.226Z","repository":{"id":39107135,"uuid":"167981649","full_name":"opencast/adopter-registration-server","owner":"opencast","description":"A server side application to receive and handle adopter statistics","archived":false,"fork":false,"pushed_at":"2025-01-29T20:40:32.000Z","size":191,"stargazers_count":1,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-29T21:25:39.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opencast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-28T15:04:59.000Z","updated_at":"2025-01-29T20:40:27.000Z","dependencies_parsed_at":"2025-01-29T21:23:07.154Z","dependency_job_id":null,"html_url":"https://github.com/opencast/adopter-registration-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencast%2Fadopter-registration-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencast%2Fadopter-registration-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencast%2Fadopter-registration-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencast%2Fadopter-registration-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opencast","download_url":"https://codeload.github.com/opencast/adopter-registration-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244520140,"owners_count":20465632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-19T23:17:09.657Z","updated_at":"2025-03-19T23:17:10.219Z","avatar_url":"https://github.com/opencast.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Adopter Statistics\n\nThis is a Flask server that is build to collect, store and administrate statistics reports and error events from \nopencast instances (adopters). \nIn future opencast versions the admin will be asked to\nregister the instance and allow sending error reports and monthly statistics reports.\n\n## Installation Guide\n\n- Clone Repository:\n\t```bash\n\tgit clone https://github.com/opencast/adopter-statistics-server.git\n\tcd adopter-statistics-server\n\t```\n- Create virtual enviroment:\n\t```bash\n\tpython -m venv venv\n\t```\n- Activate the environment:\n\t```bash\n\t. venv/bin/activate\n\t```\n- Install requirements:\n\t```bash\n\tpip install -r requirements.txt\n\t```\n- Configure TODOs in `config.py` (if you want to run it in production)\n- Run app:\n\t```bash\n\t// ignore following line if running in production\n\texport FLASK_ENV=development\n\n\tflask run\n\t// if you run into ModuleNotFound-Error try using\n\tvenv/bin/flask run\n\t```\n- Open http://127.0.0.1:5000 (redirect to the admin page)\n\n## Opencast Configuration\n\nBy default, Opencast will send data to register.opencast.org.\nFor testing, you can change that by adding the following configuration option to the `custom.properties`:\n\n```properties\norg.opencastproject.adopter.registration.server.url=http://127.0.0.1:5000\n```\n\n## User model / security:\nTo ensure security there is a role based user model implemented.\nBefore handling the first request this app will create the database, create the roles \"readonly\" and \"superuser\"\nand will create the default superuser defined in `config.py` (default: Email: \"admin\", \"Password\": \"admin\"). This default admin should be configured with a strong\npassword or be deleted after another superuser was created.\n\nTo access the admin page you need to create an account. The created user will not have any permissions.\nA superuser needs to edit and add a role to your user profile.\n\n**Roles:**\n* readonly: Can see Adopter, Error Event and Statistics Report tables\n* superuser: readonly + can edit and delete entries and read/edit/delete users\n\n## Api\n### Authentication\nUse BasicAuth for authentication.\n\n### Adopter\nMethod | Endpoint | Description | Auth | Query param \n------ | -------- | ----------- | ---- | -----------\n`POST` | `/api/1.0/adopter` | Create Adopter | [everybody] | \n`GET` | `/api/1.0/adopter` | Query all Adopters | [readonly/superuser] | `__limit` \u0026 `__offset`\n`GET` | `/api/1.0/adopter/\u003cadopter_key\u003e` | Query adopter by adopter_key | [everybody] |\n`PUT` | `/api/1.0/adopter/\u003cadopter_key\u003e` | Edit adopter | [everybody] |\n\n**Example:**\n```json\n{\n\t\"adopter_key\": \"C2B1262C424F905466FBCF2ACA1148CF\",\n\t\"organisation_name\": \"Example University\",\n\t\"department_name\": \"Mathematics and Computer Science\",\n\t\"gender\": null,\n\t\"first_name\": null,\n\t\"last_name\": null,\n\t\"mail\": null,\n\t\"country\": \"GER\",\n\t\"postal_code\": \"12345\",\n\t\"city\": \"Exampletown\",\n\t\"street\": \"Main Street\",\n\t\"street_no\": \"1A\",\n\t\"address_additional\": null,\n\t\"contact_me\": false,\n\t\"allows_statistics\": true,\n\t\"allows_error_reports\": true,\n\t\"allows_tech_data\": true\n}\n```\n\n### Statistics Report\nMethod | Endpoint | Description | Auth | Query param \n------ | -------- | ----------- | ---- | -----------\n`POST` | `/api/1.0/statistics_report` | Create statistics report (adopter_key needed) | [everybody] | \n`GET` | `/api/1.0/statistics_report` | Query all statistic reports | [readonly/superuser] | `__limit` \u0026 `__offset`\n`GET` | `/api/1.0/statistics_report/\u003cid\u003e` | Query statistic report by id | [readonly/superuser] | \n`GET` | `/api/1.0/adopter/\u003cadopter_key\u003e/statistics_report` | Query statistics reports from adopter | [everybody] | `__limit` \u0026 `__offset`\n\n**Example:**\n```json\n{\n\t\"from_date\": \"2019-01-01\",\n\t\"to_date\": \"2019-01-31\",\n\t\"opencast_version\": \"6.0.0\",\n\t\"adopter_key\": \"C2B1262C424F905466FBCF2ACA1148CF\"\n}\n```\n\n### Error Event\nMethod | Endpoint | Description | Auth | Query param \n------ | -------- | ----------- | ---- | -----------\n`POST` | `/api/1.0/error_event` | Create error event (adopter_key needed) | [everybody] | \n`GET` | `/api/1.0/error_event` | Query all error events | [readonly/superuser] | `__limit` \u0026 `__offset`\n`GET` | `/api/1.0/error_event/\u003cid\u003e` | Query error event by id | [readonly/superuser] | \n`GET` | `/api/1.0/adopter/\u003cadopter_key\u003e/error_event` | Query error events from adopter | [everybody] | `__limit` \u0026 `__offset`\n\n**Example:**\n```json\n{\n\t\"timestamp\": \"2019-02-24T12:34:56+0100\",\n\t\"adopter_key\": \"C2B1262C424F905466FBCF2ACA1148CF\",\n\t\"error_type\": \"Runtime Exception\",\n\t\"data\": \"{'some': 'json_data'}\",\n\t\"opencast_version\": \"6.0.0\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencast%2Fadopter-registration-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopencast%2Fadopter-registration-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencast%2Fadopter-registration-server/lists"}