All checks were successful
Build Docker image / push-backend-image (push) Successful in 3m43s
|
||
---|---|---|
.forgejo/workflows | ||
config | ||
utils | ||
.gitignore | ||
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 an empty config.json file:
touch config.json
- Run
docker compose up
- Wait for the
Config file generated. Please edit the config.json file and restart the server.
message. - Once the message appears, hit
^C
(CTRL + C) to exit and stop the container. - Edit the
config.json
file. The server won't start unless you change your ACME email address to a valid one. - Recommended: add a 404.html file in the
errors
folder. 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.