{"id":13452954,"url":"https://github.com/42wim/caddy-gitea","last_synced_at":"2025-04-14T16:16:38.318Z","repository":{"id":62866305,"uuid":"559529994","full_name":"42wim/caddy-gitea","owner":"42wim","description":"Github pages (and more) for gitea using caddy","archived":false,"fork":false,"pushed_at":"2023-07-30T20:27:46.000Z","size":108,"stargazers_count":141,"open_issues_count":4,"forks_count":11,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T04:51:15.414Z","etag":null,"topics":["caddy-plugin","gitea"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/42wim.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}},"created_at":"2022-10-30T12:07:18.000Z","updated_at":"2025-03-26T18:40:47.000Z","dependencies_parsed_at":"2024-01-15T09:04:03.250Z","dependency_job_id":"606f8e64-dfb4-4b47-a8f3-b904bd2c14f4","html_url":"https://github.com/42wim/caddy-gitea","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42wim%2Fcaddy-gitea","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42wim%2Fcaddy-gitea/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42wim%2Fcaddy-gitea/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42wim%2Fcaddy-gitea/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/42wim","download_url":"https://codeload.github.com/42wim/caddy-gitea/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246273533,"owners_count":20750904,"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":["caddy-plugin","gitea"],"created_at":"2024-07-31T08:00:29.181Z","updated_at":"2025-03-30T03:31:46.522Z","avatar_url":"https://github.com/42wim.png","language":"Go","funding_links":[],"categories":["Go","Applications","Unmaintained"],"sub_categories":["Web Hosting","Applications"],"readme":"# caddy-gitea\n\n[Gitea](https://gitea.io) plugin for [Caddy v2](https://github.com/caddyserver/caddy).\n\nThis allows you to have github pages (with more features) in Gitea.\nThis also requires you to setup a wildcard CNAME to your gitea host.\n\nFor now markdown files (with `.md` extension) will also be automatically generated to HTML.\n\n\u003c!-- TOC --\u003e\n\n- [caddy-gitea](#caddy-gitea)\n    - [Getting started](#getting-started)\n        - [Caddy config](#caddy-config)\n        - [DNS config](#dns-config)\n        - [Gitea config](#gitea-config)\n            - [gitea-pages repo](#gitea-pages-repo)\n            - [any repo with configurable allowed branch/tag/commits](#any-repo-with-configurable-allowed-branchtagcommits)\n            - [any repo with all branches/tags/commits exposed](#any-repo-with-all-branchestagscommits-exposed)\n    - [Building caddy](#building-caddy)\n\n\u003c!-- /TOC --\u003e\n\n## Getting started\n\n### Caddy config\n\nThe Caddyfile below creates a webserver listening on :3000 which will interact with gitea on \u003chttps://yourgitea.yourdomain.com\u003e using `agiteatoken` as the token.\nThe agiteatoken should be a token from gitea that has the necessary read rights on the repo's that you want to expose.\n\n```Caddyfile\n{\n        order gitea before file_server\n}\n:3000\ngitea {\n        server https://yourgitea.yourdomain.com\n        token agiteatoken\n        domain pages.yourdomain.com #this is optional\n}\n```\n\n### DNS config\n\nThis works with a wildcard domain. So you'll need to make a *.pages.yourdomain.com CNAME to the server you'll be running caddy on.\n(this doesn't need to be the same server as gitea).\n\nDepending on the gitea config below you'll be able to access your pages using:\n\n- \u003chttp://org.pages.yourdomain.com:3000/repo/file.html\u003e (org is the organization or username)\n- \u003chttp://org.pages.yourdomain.com:3000/repo/file.html?ref=abranch\u003e (org is the organization or username)\n- \u003chttp://repo.org.pages.yourdomain.com:3000/file.html\u003e\n- \u003chttp://branch.repo.org.pages.yourdomain.com:3000/file.html\u003e\n- \u003chttp://org.pages.yourdomain.com:3000/\u003e (if you have created a gitea-pages repo it'll be served on the root)\n\n### Gitea config\n\nThere are multiple options to expose your repo's as a page, that you can use both at the same time.\n\n- creating a gitea-pages repo with a gitea-pages branch and a gitea-pages topic\n- adding a gitea-pages branch to any repo of choice and a gitea-pages topic\n- adding a gitea-pages-allowall topic to your repo (easiest, but less secure)\n\n#### gitea-pages repo\n\ne.g. we'll use the `yourorg` org.\n\n1. create a `gitea-pages` repo in `yourorg` org\n2. Add a `gitea-pages` topic to this `gitea-pages` repo (this is used to opt-in your repo),\n3. Create a `gitea-pages` branch in this `gitea-pages` repo.\n4. Put your content in this branch. (eg file.html)\n\nYour content will now be available on \u003chttp://yourorg.pages.yourdomain.com:3000/file.html\u003e\n\n#### any repo with configurable allowed branch/tag/commits\n\ne.g. we'll use the `yourrepo` repo in the `yourorg` org and there is a `file.html` in the `master` branch and a `otherfile.html` in the `dev` branch. The `master` branch is your default branch.\n\n1. Add a `gitea-pages` topic to the `yourrepo` repo (this is used to opt-in your repo).\n2. Create a `gitea-pages` branch in this `yourrepo` repo.\n3. Put a `gitea-pages.toml` file in this `gitea-pages` branch of `yourrepo` repo. (more info about the content below)\n\nThe `gitea-pages.toml` file will contain the git reference (branch/tag/commit) you allow to be exposed.\nTo allow everything use the example below:\n\n```toml\nallowedrefs=[\"*\"]\n```\n\nTo only allow main and dev:\n\n```toml\nallowedrefs=[\"main\",\"dev\"]\n```\n\n- Your `file.html` in the `master` branch will now be available on \u003chttp://yourorg.pages.yourdomain.com:3000/yourrepo/file.html\u003e\n- Your `file.html` in the `master` branch will now be available on \u003chttp://yourrepo.yourorg.pages.yourdomain.com:3000/file.html\u003e\n- Your `otherfile.html` in the `dev` branch will now be available on \u003chttp://yourorg.pages.yourdomain.com:3000/yourrepo/file.html?ref=dev\u003e\n- Your `otherfile.html` in the `dev` branch will now be available on \u003chttp://dev.yourrepo.yourorg.pages.yourdomain.com:3000/file.html\u003e\n\n#### any repo with all branches/tags/commits exposed\n\ne.g. we'll use the `yourrepo` repo in the `yourorg` org and there is a `file.html` in the `master` branch and a `otherfile.html` in the `dev` branch. The `master` branch is your default branch.\n\n1. Add a `gitea-pages-allowall` topic to the `yourrepo` repo (this is used to opt-in your repo).\n\n- Your `file.html` in the `master` branch will now be available on \u003chttp://yourorg.pages.yourdomain.com:3000/yourrepo/file.html\u003e\n- Your `file.html` in the `master` branch will now be available on \u003chttp://yourrepo.yourorg.pages.yourdomain.com:3000/file.html\u003e\n- Your `otherfile.html` in the `dev` branch will now be available on \u003chttp://yourorg.pages.yourdomain.com:3000/yourrepo/file.html?ref=dev\u003e\n- Your `otherfile.html` in the `dev` branch will now be available on \u003chttp://dev.yourrepo.yourorg.pages.yourdomain.com:3000/file.html\u003e\n\n## Building caddy\n\nAs this is a 3rd party plugin you'll need to build caddy (or use the binaries).\nTo build with this plugin you'll need to have go1.19 installed.\n\n```go\ngo install github.com/caddyserver/xcaddy/cmd/xcaddy@latest #this will install xcaddy in ~/go/bin\n~/go/bin/xcaddy build --with github.com/42wim/caddy-gitea@v0.0.4\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42wim%2Fcaddy-gitea","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F42wim%2Fcaddy-gitea","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42wim%2Fcaddy-gitea/lists"}