···11+# Deploying Lasa
22+33+Lasa can be deployed as a standalone binary or inside a container.
44+55+## Standalone binary
66+77+Clone the repo with:
88+```bash
99+git clone -b <tag> https://tangled.org/anhgelus.world/lasa .
1010+```
1111+where `<tag>` is the tag that you want to use.
1212+1313+We recommend you to install `just` (a command runner).
1414+Of course, you can manually execute commands.
1515+If you want to have the man pages installed, ensure that `scdoc` is here too.
1616+1717+Then, you can run
1818+```bash
1919+just install
2020+```
2121+to install the binaries and the man pages in `/usr/local/`.
2222+If `/usr/local/man/man1` doesn't exist, it tries to create it.
2323+You can create it before to avoid running the command as root.
2424+2525+If you don't have a supported Go version (e.g., the version installed is too old), you can use the environment variable
2626+`GOTOOLCHAIN` to set it, e.g.,
2727+```bash
2828+GOTOOLCHAIN=go1.26.2 just install
2929+```
3030+3131+Then, you can generate the config file with `lasad gen-config` at `/etc/lasad.toml`.
3232+See `lasad(1)` for more information.
3333+3434+## Container
3535+3636+The official image is `atcr.io/anhgelus.world/lasa` and is based on Alpine Linux.
3737+Sadly, to download it, you must be connected to `actr.io`.
3838+3939+You can also build the image by yourself by simply cloning the repo and running:
4040+```bash
4141+docker build -t lasa .
4242+```
4343+4444+An example `compose.yml` is available in the repo.
4545+The profile `prod` uses the official image.
4646+4747+The config file is stored in `/etc/lasad/config.toml`.
4848+You can mount it with `-v ./config:/etc/lasad/`.
4949+The default config file is already generated.
5050+The exposed port is `8000`.
5151+5252+## Configuration
5353+5454+The config file only requires two informations: the port and the domain (for security headers).
5555+```toml
5656+domain = "lasa.example.org"
5757+port = 8000
5858+```
5959+6060+You can specify the legal notice with
6161+```toml
6262+legal_notice_url = "https://example.org/legal"
6363+```
6464+6565+If you want to log 400 and 404 as warning, uncomment these lines:
6666+```toml
6767+# if you want to log HTTP 404 responses
6868+log_not_found = true
6969+# if you want to log HTTP 400 responses
7070+log_bad_request = true
7171+```
7272+7373+### Redis
7474+7575+Lasa supports Redis as a cache.
7676+You can connect it by uncommenting and filling the required information in `cache` section of the config file, e.g.
7777+```toml
7878+[cache]
7979+host = "localhost"
8080+port = 6379
8181+db = 0
8282+duration = 60 # cache duration in minutes
8383+```
8484+8585+If your Redis server requires auth, you can fill these information in `cache.auth` section, e.g.
8686+```toml
8787+[cache.auth]
8888+username = "foo"
8989+password = "bar"
9090+client_name = "baz"
9191+```
+2
README.md
···5050Lasa is a standalone binary that requires nothing.
5151You can use Redis as a cache.
52525353+Check [DEPLOYMENT.md](./DEPLOYMENT.md) for more information.
5454+5355### Building
54565557Building binaries: