# atproto-static-web

A simple web viewer for AT Proto. Javascript is _not_ required!

> [!WARNING]
> This project is a work-in-progress. Expect bugs and UI weirdness. Contributions welcome!

## Configuration

The server is configured using environment variables.

- `ADDRESS`: the IP address on which the server will listen for connections. Defaults to `"[::]"`, the "unspecified" IPv6 address.
- `HOST`: the domain name where the front-end is hosted, e.g. `example.com`. Must be provided.
- `HTTP_PORT`: the port on which the server will listen for HTTP connections. Defaults to `8080`.
- `LOG_LEVEL`: the level at which log messages should be printed to the console. Must be one of `error`, `warn`, `info`, `debug`, or `trace`. Defaults to `warn` in Release mode and `debug` in Development mode.
- `PDS_URL`: the URL which should receive AT Proto API calls, e.g. `https://public.api.bsky.app/`. Must be provided.
- `SITE_NAME`: the name which the front-end should call this web service. Defaults to `"AT Proto Static"`.

When building in Development mode, environment values are read from a `.env` file in the current working directory, if one exists. In Release mode, you should provide env values another way.

## Installation

### Using Docker Compose

Create a `compose.yml` file similar to the [`compose.example.yml`](compose.example.yml) file provided, then run the following:

```sh
docker compose pull
docker compose up -d
```

### Build from source

With [`cargo`](https://www.rust-lang.org/tools/install) installed, clone the repo and run the following:

```sh
export HOST='example.com'
export PDS_URL='https://public.api.bsky.app/'
cargo run --release
```
