This repository holds the configuration of my Caddy-only go-link service, used to have clean links in my genealogy data.
The service is deployed on Fly.io and its public URL is https://actes.williamblondel.fr.
Upon deployment, Fly builds a Docker image based on the official Caddy's Docker image. Caddy is configured to load the conf/caddy-config-loader.json configuration on start up.
This configuration tells Caddy to load via HTTP the configuration located at conf/caddy-config.json, which contains the defined links.
The links are managed via the Caddy API, exclusively through the Makefile.
Every 30 minutes, a workflow fetches the current Caddy configuration and commits it to the repository if changes were detected. This prevents the configuration from being lost when restarting the machine or Caddy.
The Fly.io CLI is required.
To get the list of available commands, execute make help
(or make
).
make short \
url=https://example.org \
shortcode=optional_shortcode \
title="Page title"
This command allows you to create a go link to a specific url
. A shortcode
can be provided, otherwise it will be generated automatically.
A title
is required. It will be encoded to Base64URL and saved into the @id
field.
make delete id="VGVzdCBQYWdl"
or
make delete shortcode="62f21770"
This command allows you to delete a URL by its id
(the encoded title) or by its shortcode
.
make show_config
This command pretty prints the JSON full Caddy configuration.
make output_format=table show_routes
This command shows the list of routes defined in the Caddy configuration.
The output_format
variable is optional and defaults to json
, which pretty prints the JSON.
Available output formats are json
, table
, and csv
.
make restart_app
This command restarts the Fly.io application.
make stop_caddy
This command gracefully shuts down Caddy and exits the process.