|
All checks were successful
Build Docker image / push-backend-image (push) Successful in 3m50s
|
||
|---|---|---|
| .forgejo/workflows | ||
| .idea | ||
| config | ||
| utils | ||
| .gitignore | ||
| config.example.json | ||
| docker-compose.yml | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
| reverseProxy.go | ||
| staticHandler.go | ||
kitty-pages
A simple, lightweight static page that also provides a reverse proxy service.
Getting started
- Use the provided docker-compose.yml:
curl https://git.ctrlalt.cat/maxim/kitty-pages/raw/branch/main/docker-compose.yml > docker-compose.yml - Create your
config.jsonfile. You can find an example configuration file in this repo. Or download it withcurl https://git.ctrlalt.cat/maxim/kitty-pages/raw/branch/main/config.example.json > config.example.json - Run
docker compose up -d - Recommended: add a 404.html file in the
errorsfolder. That way, when no static sites nor reverse proxies are registered on the given domain, this file is shown. It's useful if you want to show a better page than just "404: Not found"
Hosting a website
To host your static website, a simple http request is all you need for both publishing and updating your website.
You first have to zip your static files.
Here's an example request made with CURL:
curl "https://<domain_pointing_to_a_kitty_pages_instance>/_/upload" -F "domain=domainwhereyouwanttohostyourstaticsite.com" -F "key=yoursecretkey" -F "file=@file.zip"
Every time you upload a new zip file for a domain, existing files will be completely deleted before your zip file is extracted.
Create a new reverse proxy host
Kitty Pages can also act as a reverse proxy. To do so, edit the config.json file.
You will find the following configuration by default:
{
"reverse_proxy": {
"hosts": [
{
"host": "example.com",
"dest": "http://somewhere:port"
}
]
}
}
You can add as much hosts as you want.
Quick Reload
By default, you need to restart the server to apply changes. This can be changed by enabling quick_reload in the configuration file.
When quick reload is enabled, the configuration will be updated every time you make changes to the config.json file.