{"id":21479291,"url":"https://github.com/rycus86/github-proxy","last_synced_at":"2025-06-14T11:06:43.400Z","repository":{"id":66144732,"uuid":"94037258","full_name":"rycus86/github-proxy","owner":"rycus86","description":"Python Flask application to proxy calls to the GitHub API.","archived":false,"fork":false,"pushed_at":"2024-10-30T23:50:05.000Z","size":35,"stargazers_count":0,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T08:46:26.395Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rycus86.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":"2017-06-11T23:11:39.000Z","updated_at":"2017-06-11T23:12:54.000Z","dependencies_parsed_at":"2023-02-22T01:16:29.405Z","dependency_job_id":"4a258bbf-ac60-4d7f-95cc-9eb0506bb307","html_url":"https://github.com/rycus86/github-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rycus86/github-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fgithub-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fgithub-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fgithub-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fgithub-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rycus86","download_url":"https://codeload.github.com/rycus86/github-proxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fgithub-proxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259804870,"owners_count":22913903,"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":"2024-11-23T11:24:31.776Z","updated_at":"2025-06-14T11:06:43.382Z","avatar_url":"https://github.com/rycus86.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Proxy\n\nA simple `Python` [Flask](http://flask.pocoo.org) *REST* server to proxy calls to *GitHub*.\n\n[![Build Status](https://travis-ci.org/rycus86/github-proxy.svg?branch=master)](https://travis-ci.org/rycus86/github-proxy)\n[![Build Status](https://img.shields.io/docker/build/rycus86/github-proxy.svg)](https://hub.docker.com/r/rycus86/github-proxy)\n[![Coverage Status](https://coveralls.io/repos/github/rycus86/github-proxy/badge.svg?branch=master)](https://coveralls.io/github/rycus86/github-proxy?branch=master)\n[![Code Climate](https://codeclimate.com/github/rycus86/github-proxy/badges/gpa.svg)](https://codeclimate.com/github/rycus86/github-proxy)\n\n## Usage\n\nThe *GitHub* API is implemented using [agithub](https://github.com/jpaugh/agithub) and supports\nauthenticated calls (with better rate limiting) using these environment variables:\n\n- `GITHUB_USERNAME`: a valid *GitHub* username\n- `GITHUB_PASSWORD`: password for the same *GitHub* account\n- `GITHUB_TOKEN`: alternatively an authenticated *GitHub* token can be used instead of\n  username and password\n\nTo get a reference to the `ApiClient` class use something like:\n```python\napi = ApiClient(username=os.environ.get('GITHUB_USERNAME'),\n                password=os.environ.get('GITHUB_PASSWORD'),\n                token=os.environ.get('GITHUB_TOKEN'))\n```\n\nThe `api.ApiClient` class wraps endpoints with the following methods:\n\n- `list_repos(username)`: returns a list of *all* repositories for the *GitHub* user\n  identified by `username` - regardless of pagination (e.g. from all pages)\n- `get_readme_html(owner, repository)`: returns the *HTML README* of the\n  `owner/repository` *GitHub* repository\n- `get_readme_raw(owner, repository)`: returns the *raw plain text README* of the\n  `owner/repository` *GitHub* repository\n- `get_commit_stats(owner, repository)`: returns a dictionary containing the total number\n  of commits in the `owner/repository` *GitHub* repository plus the author, date and message\n  of the last commit\n\nThe `app` module is responsible for the *REST* presentation layer exposing *JSON* endpoints.\nThe exposed endpoints are cached using [Flask-Cache](https://pythonhosted.org/Flask-Cache).\n\nConfiguration options:\n\n- `HTTP_HOST`: the host (interface) for *Flask* to bind to (default: `127.0.0.1`)\n- `HTTP_PORT`: the port to bind to (default: `5000`)\n- `CORS_ORIGINS`: comma separated list of *origins* to allow *cross-domain* `GET` requests from\n  (default: `http://localhost:?.*`)\n\nTo allow connections from other hosts apart from `localhost` set the `HTTP_PORT` environment\nvariable to `0.0.0.0` or as appropriate.\n\nList of endpoints:\n\n- `/repos/\u003cusername\u003e`: lists the repositories of the `\u003cusername\u003e` *GitHub* user  \n  This will be a list of objects with a reduced set of properties from\n  `ApiClient.list_repos(\u003cusername\u003e)`\n- `/repos/\u003cusername\u003e/\u003crepository\u003e/readme` or  \n  `/repos/\u003cusername\u003e/\u003crepository\u003e/readme/html`: an *HTML* endpoint returning the \n  rendered *README* markup for the `\u003cusername\u003e/\u003crepository\u003e` *GitHub* repository\n- `/repos/\u003cusername\u003e/\u003crepository\u003e/readme/raw`: an *plain text* endpoint returning the \n  raw *README* contents for the `\u003cusername\u003e/\u003crepository\u003e` *GitHub* repository\n- `/repos/\u003cusername\u003e/\u003crepository\u003e/commit-stats`: returns the commit statistics for the\n  `\u003cusername\u003e/\u003crepository\u003e` *GitHub* repository  \n  The object is the same as the return value of `ApiClient.get_commit_stats(owner, repository)`\n\n## Docker\n\nThe web application is built as a *Docker* image too based on *Alpine Linux*\nfor 3 architectures with the following tags:\n\n- `latest`: for *x86* hosts  \n  [![Layers](https://images.microbadger.com/badges/image/rycus86/github-proxy.svg)](https://microbadger.com/images/rycus86/github-proxy \"Get your own image badge on microbadger.com\")\n- `armhf`: for *32-bits ARM* hosts  \n  [![Layers](https://images.microbadger.com/badges/image/rycus86/github-proxy:armhf.svg)](https://microbadger.com/images/rycus86/github-proxy:armhf \"Get your own image badge on microbadger.com\")\n- `aarch64`: for *64-bits ARM* hosts  \n  [![Layers](https://images.microbadger.com/badges/image/rycus86/github-proxy:aarch64.svg)](https://microbadger.com/images/rycus86/github-proxy:aarch64 \"Get your own image badge on microbadger.com\")\n\n`latest` is auto-built on [Docker Hub](https://hub.docker.com/r/rycus86/github-proxy)\nwhile the *ARM* builds are uploaded from [Travis](https://travis-ci.org/rycus86/github-proxy).\n\nTo run it:\n```shell\ndocker run -d --name=\"github-proxy\" -p 5000:5000           \\\n  -e GITHUB_USERNAME='user' -e GITHUB_PASSWORD='pass'      \\\n  -e CORS_ORIGINS='http://site.example.com,*.website.com'  \\\n  rycus86/github-proxy:latest\n```\n\nOr with *docker-compose* (for a *Raspberry Pi* for example):\n```yaml\nversion: '2'\nservices:\n\n  github-proxy:\n    image: rycus86/github-proxy:armhf\n    read_only: true\n    expose:\n      - \"5000\"\n    restart: always\n    environment:\n      - HTTP_HOST=0.0.0.0\n    env_file:\n      - github-secrets.env\n```\n\nThis way you can keep the secrets in the `env_file` instead of passing them to the *Docker*\nclient from the command line.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frycus86%2Fgithub-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frycus86%2Fgithub-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frycus86%2Fgithub-proxy/lists"}