{"id":13686719,"url":"https://github.com/YoSev/private-ghp","last_synced_at":"2025-05-01T09:32:27.152Z","repository":{"id":53923279,"uuid":"478872808","full_name":"YoSev/private-ghp","owner":"YoSev","description":"publish github pages privately secured by github sso (oauth2)","archived":false,"fork":false,"pushed_at":"2023-02-13T13:35:36.000Z","size":28,"stargazers_count":28,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T18:12:25.804Z","etag":null,"topics":["github","go","golang","pages","protect","protected","secure","sso"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YoSev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-04-07T07:25:01.000Z","updated_at":"2025-03-10T19:47:53.000Z","dependencies_parsed_at":"2022-08-13T04:30:49.465Z","dependency_job_id":null,"html_url":"https://github.com/YoSev/private-ghp","commit_stats":null,"previous_names":["slev-dev/private-ghp","john-dev/private-ghp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YoSev%2Fprivate-ghp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YoSev%2Fprivate-ghp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YoSev%2Fprivate-ghp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YoSev%2Fprivate-ghp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YoSev","download_url":"https://codeload.github.com/YoSev/private-ghp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251852891,"owners_count":21654479,"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":["github","go","golang","pages","protect","protected","secure","sso"],"created_at":"2024-08-02T15:00:38.603Z","updated_at":"2025-05-01T09:32:26.882Z","avatar_url":"https://github.com/YoSev.png","language":"Go","readme":"# private-ghp\n\nServes static sites from private repositories to members with read access (or higher), secured using GitHub OAuth2.\\\nThe server is written in [Go](https://go.dev/).\n\n## Why\n\nGithub forces users to pay for an enterprise license in order to share github pages only with members of an organization.\\\nIt is not even included in the paid Team plan.\n\nThis repository is a workaround for that - it also works for free tier plans as it doesn't rely on github pages nor public repositories.\n## Features\n\n- Supports multiple pages, one per subdomain\n- Define your own branch\n- No need to publish a repository nor use of github pages\n- Works with github free tier\n- Selfhosted\n\n## Config\n\nYou need to create a [Github OAuth2 App](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app).\n\nCheck out the sample.config.yaml for more informations.\\\nThe callback URL must point to **http(s)://domain:publicPort/login/github/callback** (not subdomain).\n\n## Secure using HTTPs\n\nTo protect your site using SSL, we advice to use a reverse proxy like [Traefik](https://traefik.io/).\n\n## Usage\n- First, build using:\n  - make prepare\n  - make build+linux or \n  - make build+docker (optional)\n- Second, set up a configuration \n  - checkout sample.config.yaml for more informations\n- Third, execute the binary or docker image\n  - ./prviate-ghp --config=\\\u003cpath_to_config\\\u003e\n\n## localhost as domain does not work\nlocalhost does **not work** as the app uses cross origin resource sharing which is not applied to localhost. \\\nYou need to use a [FQDN](https://en.wikipedia.org/wiki/Fully_qualified_domain_name) like local.host to work.\n\n## Architecture\n\nThis is a high level explanation of how this project works.\n\nFor more information of how GitHub OAuth works, see [the official documentation](https://developer.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/).\n\n- The client requests a resource\n  - If the session cookie is present and valid, skip the next two steps\n  - Otherwise, redirects to the provider's OAuth page\n- Provider's (e.g. GitHub) OAuth page\n  - If successful, redirects to the callback URL (this service)\n- The callback request is received from the OAuth provider\n  - Get an OAuth token, then store it client-side in a cookie\n- A call is performed to the Github API using the token the client sends with each request (as cookie) to get the resource, which is then served to the client\n\n## Serving from a documentation directory\n\nGitHub Pages allows to serve from a **/docs** directory, which is supported by private-ghp too, if the hosted page uses /docs as basePath.\n\nFor any question, create an issue here on Github.\n\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYoSev%2Fprivate-ghp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYoSev%2Fprivate-ghp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYoSev%2Fprivate-ghp/lists"}