https://github.com/asmfreak/pages-server
:books: pages-server is a simple server that serves pages from Gitea repositories.
https://github.com/asmfreak/pages-server
gitea pages pages-server server
Last synced: 25 days ago
JSON representation
:books: pages-server is a simple server that serves pages from Gitea repositories.
- Host: GitHub
- URL: https://github.com/asmfreak/pages-server
- Owner: asmfreak
- License: mit
- Created: 2024-08-13T12:42:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-02T13:29:41.000Z (over 1 year ago)
- Last Synced: 2025-10-25T23:33:30.414Z (3 months ago)
- Topics: gitea, pages, pages-server, server
- Language: Go
- Homepage:
- Size: 1.59 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pages-server
[](https://github.com/ASMfreaK/pages-server/actions/workflows/ci.yml)
`pages-server` is a simple server that serves pages from Gitea repositories.
It works in three modes:
1. Repository with `pages-branch` topic should have `gh-pages` or `gh-pages-VERSION` branched, where `VERSION` is a version of the docs
2. Repository with `pages-release` topic should have release with `docs.zip` attachment with a zipped pages site.
3. Repository with `pages-packages` topic should have corresponding Gitea package with a zipped pages site with `docs.zip` name.
E.g. for `gitea.com/owner/repo` there should be a generic package repository `repo` in `gitea.com/owner` with a file called `docs.zip` containing the site.
This server will **not** build any content on its own. It will only serve existing code.
## Pages flow
1. Every valid Gitea user is authenticated with Gitea using OAuth2 (configured using `AUTH_GITEA_OAUTH_CLIENT_ID` and `AUTH_GITEA_OAUTH_CLIENT_SECRET`).
1. `pages-server` uses the users' oauth token to check if the user has access to the repository.
1. If the user has access to the repository, `pages-server` fetches the latest version of the repository using `GITEA_ADMIN_TOKEN` and caches it in the bbolt database.
1. `pages-server` serves the pages from the bbolt database.
## Usage
```
pages-server dev
pages-server simple pages server for small-to-medium gitea installations
USAGE:
pages-server [global options] [arguments...]
GLOBAL OPTIONS:
--pages-url value url for pages server (default: "http://localhost:8000") [$PAGES_URL]
--pages-title value title for pages server (default: "Gitea Pages") [$PAGES_TITLE]
--gitea-url value url for Gitea (default: "http://localhost:3000") [$GITEA_URL]
--gitea-admin-token value admin token for Gitea [$GITEA_ADMIN_TOKEN]
--gitea-hook-secret value secret for gitea webhooks [$GITEA_HOOK_SECRET]
--gitea-pages-addr-from-gitea value url for pages server as viewed from gitea (default: "http://localhost:8000") [$GITEA_PAGES_ADDR_FROM_GITEA]
--database-filename value path to database (default: "pages-server.db") [$DATABASE_FILENAME]
--auth-cookie-name value name of cookie for oauth state (default: "__i_love_pages_server") [$AUTH_COOKIE_NAME]
--auth-secret value secret for auth (default: "CHANGEME") [$AUTH_SECRET]
--auth-gitea-oauth-client-id value oauth2 app client id from Gitea [$AUTH_GITEA_OAUTH_CLIENT_ID]
--auth-gitea-oauth-client-secret value oauth2 app client secret from Gitea [$AUTH_GITEA_OAUTH_CLIENT_SECRET]
--server-addr value address to listen on (default: "localhost:8000") [$SERVER_ADDR]
--help, -h show help
--version, -v print the version
```