diff --git a/Makefile b/Makefile index cd0799d..38462bc 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .env: - uv run -- generate_secrets.py >> .env + uv run -- etc/generate_secrets.py >> .env .PHONY: debug debug: diff --git a/README.md b/README.md index 479dd77..8140564 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ligo.at -A decentralized links page on top of [AT Protocol][atproto]. +Decentralized and customizable links page on top of [AT Protocol][atproto]. ## dependencies @@ -8,7 +8,7 @@ Install [uv][uv] and run `uv sync`. ## generate secrets -Use the `generate_secrets.py` script or run `make .env`. +Use the `etc/generate_secrets.py` script or run `make .env`. ## synchronization @@ -20,10 +20,12 @@ Either start a debug server with `make debug` or a production one with `make run The Jetstream ingestor can be started with `make ingestor`. -### systemd +Some example configuration files are provided in the `etc` folder. They assume the code will live at `/var/www/ligoat`. Keep this in mind if you want to place it somewhere else. -Two systemd service files are found in the `dist` folder. They can be used to run both the server and the jetstream ingestor. +- A `Caddyfile` that configures a [caddy][caddy] reverse proxy. +- Two systemd service files. They can be used to run both the server and the jetstream ingestor. [atproto]: https://atproto.com -[uv]: https://docs.astral.sh/uv/ +[caddy]: https://caddyserver.com/ [jetstream]: https://atproto.wiki/en/wiki/reference/networking/jetstream +[uv]: https://docs.astral.sh/uv/ diff --git a/etc/Caddyfile b/etc/Caddyfile new file mode 100644 index 0000000..e2bdebb --- /dev/null +++ b/etc/Caddyfile @@ -0,0 +1,12 @@ +example.com { + handle_path /static/* { + # change this to where you have the code + root * /var/www/ligoat/src/static + file_sever + } + + handle { + # change this to the port you use + reverse_proxy :8080 + } +} diff --git a/generate_secrets.py b/etc/generate_secrets.py similarity index 100% rename from generate_secrets.py rename to etc/generate_secrets.py diff --git a/dist/ligoat.service b/etc/ligoat.service similarity index 100% rename from dist/ligoat.service rename to etc/ligoat.service diff --git a/dist/ligoatingestor.service b/etc/ligoatingestor.service similarity index 93% rename from dist/ligoatingestor.service rename to etc/ligoatingestor.service index b4fa56c..7621b5e 100644 --- a/dist/ligoatingestor.service +++ b/etc/ligoatingestor.service @@ -1,6 +1,6 @@ [Unit] Description = ligo.at jetstream ingestor -After = ligoat.service +After = network.target [Service] ExecStart = uv run -- ingestor