From 8905b5e3d1252b3d6efcad87e393117efc929703 Mon Sep 17 00:00:00 2001 From: Ronmi Ren Date: Mon, 13 Jan 2025 15:45:42 +0800 Subject: [PATCH] update readme --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5c74c68..8c628cd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A simple static page service for Forgejo/Gitea. ### Repo setup -Everything in branch `static-pages` (if you have not changed it by assigning `-b` flag) will be served as-is. +Everything in branch `static-pages` (if you have not changed it by assigning `--branch` flag) will be served as-is. There are two mode you can use: serve mode and webhook mode. @@ -10,8 +10,6 @@ There are two mode you can use: serve mode and webhook mode. Serve mode starts an HTTP server listens on specified port. When you visit `http://ip:port/user/repo/path/to/file`, it ask forgejo server for `path/to/file` in branch `static-pages` of repository `user/repo` via api, then forward the response to client. -In other words, anything you push to branch `static-pages` will be provided as-is. - This mode is good for simple setup, like, you have small number of viewers, or you use other powerful cache/proceting service like Cloudflare. ### Webhook mode @@ -23,9 +21,9 @@ To serve downloaded pages, you'll have to use a web server like Nginx. ### Example ``` -forgejo-pages serve -k my-secret-token -s https://git.example.com -a :8080 -b static-pages +forgejo-pages serve --token my-secret-token --server https://git.example.com --bind :8080 --branch static-pages -forgejo-pages listen -u myuser -k my-secret-token -s https://git.example.com -a :8080 -b static-pages -d ./data +forgejo-pages listen --user myuser --token my-secret-token --server https://git.example.com --bind :8080 --branch static-pages --dir ./data ``` Flags can be assigned through environmental variables like `PAGES_BIND`, `PAGES_BRANCH`, or config file @@ -63,12 +61,12 @@ server { ### Will it support SSL for security? -No, just use reverse proxy. You might also need LetsEncrypt or Cloudflare to apply for a free SSL certificate. +No, use reverse proxy or webhook mode. You might also need LetsEncrypt or Cloudflare to apply for a free SSL certificate. If you need all-in-one solution, take a look at https://codeberg.org/Codeberg/pages-server/ ### Will it support caching -No. It does provide very basic cache (etag, last-modified and related HTTP headers) as it just forward request to your git server. If your need more, use reverse proxy. +No. Serve mode does provide very basic cache (etag, last-modified and related HTTP headers) as it just forward request to your git server. If your need more, use reverse proxy or webhook mode. If you need all-in-one solution, take a look at https://codeberg.org/Codeberg/pages-server/ # License -MPLv2 +MPLv2. There is a copy of source at https://github.com/Ronmi/forgejo-pages