Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaa committed Jan 30, 2024
1 parent 1f8674f commit d60d387
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 21 deletions.
17 changes: 10 additions & 7 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@
- [Getting Started](./users/getting-started.md)
- [Feed](./users/feed.md)
- [Redirecting](./users/redirecting.md)
- [with Static files and Markup](./users/redirecting-with-static-files-and-markup.md)
- [with Redirects file](./users/redirecting-with-redirects-file.md)
- [with Platform-Specific Configuration](./users/redirecting-with-platform-specific-config.md)
- [with Aoba (Lume & Hono)](./users/redirecting-with-aoba.md)
- [with Static files and Markup](./users/redirecting-with-static-files-and-markup.md)
- [with Redirects file](./users/redirecting-with-redirects-file.md)
- [with Platform-Specific Configuration](./users/redirecting-with-platform-specific-config.md)
- [with Aoba (Lume & Hono)](./users/redirecting-with-aoba.md)
- [Backfeed](./users/backfeed.md)
- [based on Webmention (TODO)](./users/backfeed-based-on-webmention.md)
- [based on Mastodon Comments (WIP)](./users/backfeed-based-on-mastodon-comments.md)
- [based on Webmention (TODO)](./users/backfeed-based-on-webmention.md)
- [based on Mastodon Comments (WIP)](./users/backfeed-based-on-mastodon-comments.md)

# for Admins

- [Install with Docker](./admins/install-with-docker.md)
- [Install](./admins/install.md)
- [Docker Installation](./admins/install-docker.md)
- [Binary Installation](./admins/install-binary.md)
- [Environments](./admins/environments.md)
- [Create Account](./admins/create-account.md)

# for Developers
Expand Down
2 changes: 1 addition & 1 deletion docs/src/admins/create-account.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Create Account

Ensure you set `HATSU_ACCESS_TOKEN` correctly in the [previous section](./install-with-docker.md) first, otherwise you will not be able to use the Hatsu Admin API.
Ensure you set `HATSU_ACCESS_TOKEN` correctly in the [previous section](./environments.md#hatsu_access_token-optional) first, otherwise you will not be able to use the Hatsu Admin API.

## just

Expand Down
61 changes: 61 additions & 0 deletions docs/src/admins/environments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Environments

Hatsu supports dotenv, and you can set environment variables via the `.env` file.

It is required unless it has a suffix (optional).

However, it may exist as a built-in preset (in the source code) or an example preset (in [`.env.example`](https://github.com/importantimport/hatsu/blob/main/.env.example))

## DATABASE_URL

- default: `sqlite::memory:`
- example: `sqlite://hatsu.sqlite3`

Should be a valid `sqlite:` or `postgres:` URL. see [sea-ql.org](https://www.sea-ql.org/SeaORM/docs/install-and-config/connection/#connection-string)

`sqlite::memory:` is used by default to ensure that hatsu does not report errors as a result.

If you're not using a Postgres database, I recommend keeping the `sqlite://hatsu.sqlite3`.

## HATSU_DOMAIN

- default: None
- example: `hatsu.local`

The domain name you assigned to this Hatsu instance.

## HATSU_LISTEN_HOST

- default: `127.0.0.1`
- example: `0.0.0.0`

The hostname on which the Hatsu server listens.

## HATSU_LISTEN_PORT

- default: `3939`
- example: `3939`

The port on which the Hatsu server listens.

## HATSU_PRIMARY_ACCOUNT

- default: None
- example: None

The primary account for this Hatsu instance, which cannot be removed and is used as a `signed_fetch_actor`.

## HATSU_ACCESS_TOKEN (optional)

- default: None
- example: None

For accessing Admin API.

If this value is not set, the Hatsu Admin API will not be available.

This can be any string, but I recommend generating a random uuid v4.

```bash
echo "\nHATSU_ACCESS_TOKEN = \"$(cat /proc/sys/kernel/random/uuid)\"" >> .env
```
13 changes: 13 additions & 0 deletions docs/src/admins/install-binary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Binary Installation

## Stable

Doesn't have a stable version yet.

## Nightly

Hatsu provides nightly Binary builds.

Please note that it is unstable and may contain breaking changes.

You can find the latest artifacts on the [Workflow runs page](https://github.com/importantimport/hatsu/actions/workflows/nightly.yml) (containing `x86_64-unknown-linux-gnu` and `aarch64-unknown-linux-gnu`).
35 changes: 35 additions & 0 deletions docs/src/admins/install-docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Docker Installation

## Stable

Doesn't have a stable version yet.

## Nightly

Hatsu provides nightly Docker image builds.

Please note that it is unstable and may contain breaking changes.

```bash
docker pull ghcr.io/importantimport/hatsu:nightly
```

Run with `docker run`:

```bash
docker run -d \
--name hatsu \
--restart unless-stopped \
-p 3939:3939 \
-v /opt/hatsu/hatsu.sqlite3:/app/hatsu.sqlite3 \
-e DATABASE_URL=sqlite://hatsu.sqlite3 \
-e HATSU_DOMAIN={{hatsu-instance-domain}} \
-e HATSU_LISTEN_HOST=0.0.0.0 \
-e HATSU_PRIMARY_ACCOUNT={{your-static-site}} \
-e HATSU_ACCESS_TOKEN=edc7e5a7-f2ce-44a6-a57e-b7706503f642 \
ghcr.io/importantimport/hatsu:nightly
```

You need to specify all environment variables at once. For more information, see [Environments](./environments.md).

<!-- You can also use the docker-compose example in examples. (TODO) -->
13 changes: 0 additions & 13 deletions docs/src/admins/install-with-docker.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/src/admins/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Install

0 comments on commit d60d387

Please sign in to comment.