# Handmade Revolt
Fork of Revolt (now Stoat chat) maintained by the handmade cities community.

## Deploying a new release (TODO: Adjust this for handmadecities)

Ensure `.env.local` points to `https://app.revolt.chat/api`.

```bash
cd ~/deployments/revite
git pull
git submodule update

# check:
git status

export REVOLT_SAAS_BRANCH=revite/main
export REMOTE=root@production
scripts/publish.sh

# SSH in and restart revite:
ssh $REMOTE
tmux a -t 4
```

## Container image

Releases publish a linux/amd64 image to the Gitea package registry at
`git.handmadecities.com/HMC/handmade-revolt-web-client` (tags: `<version>`,
`<major>.<minor>`, and `latest`).

The registry requires authentication even for pulls (anonymous pull is not
supported by Gitea). On a host that needs to pull the image, log in once with a
**read-only** token (a token scoped to `read:package`); the credentials are
saved to `~/.docker/config.json` (or `/root/.docker/config.json`) and persist across reboots:

```bash
echo '<PACKAGE_PULL_TOKEN>' | docker login git.handmadecities.com -u <pull-username> --password-stdin

docker pull git.handmadecities.com/HMC/handmade-revolt-web-client:latest
```

Notes:

-   `~/.docker/config.json` is per-user so you'll need to log in separately from all users that will need to pull images.
-   Credentials are stored base64-encoded, not encrypted; keep the file at `chmod 600` and use a `read:package`-only token so a leak can't push.
-   Rotate by running `docker login` again, or `docker logout git.handmadecities.com` to remove the stored credential.

# Revite

## Description

This is the web client for Revolt, which is also available live at [app.revolt.chat](https://app.revolt.chat).

## Pending Rewrite

The following code is pending a partial or full rewrite:

-   `src/components`: components are being migrated to [revoltchat/components](https://github.com/revoltchat/components)
-   `src/styles`: needs to be migrated to [revoltchat/components](https://github.com/revoltchat/components)
-   `src/lib`: this needs to be organised

## Stack

-   [Preact](https://preactjs.com/)
-   [Vite](https://vitejs.dev/)

## Submodule Hint

This project contains submodules. Run `git submodule init` after you clone this repository to initialize the submodules.
It is also recommended to run `git submodule update` after you pull from upstream.

## Resources

### Revite

-   [Revite Issue Board](https://github.com/revoltchat/revite/issues)
-   [Google Drive Folder with Screenshots](https://drive.google.com/drive/folders/1Ckhl7_9OTTaKzyisrWHzZw1hHj55JwhD)

### Revolt

-   [Revolt Project Board](https://github.com/revoltchat/revolt/discussions) (Submit feature requests here)
-   [Revolt Testers Server](https://app.revolt.chat/invite/Testers)
-   [Contribution Guide](https://developers.revolt.chat/contributing)

## Quick Start

Get revite up and running locally.

```
git clone --recursive https://github.com/revoltchat/revite
cd revite
yarn
yarn build:deps
yarn dev
```

You can now access the client at http://local.revolt.chat:3000.

## CLI Commands

| Command                                 | Description                                  |
| --------------------------------------- | -------------------------------------------- |
| `yarn pull`                             | Setup assets required for Revite.            |
| `yarn dev`                              | Start the Revolt client in development mode. |
| `yarn build`                            | Build the Revolt client.                     |
| `yarn build:deps`                       | Build external dependencies.                 |
| `yarn preview`                          | Start a local server with the built client.  |
| `yarn lint`                             | Run ESLint on the client.                    |
| `yarn fmt`                              | Run Prettier on the client.                  |
| `yarn typecheck`                        | Run TypeScript type checking on the client.  |
| `yarn start`                            | Start a local sirv server with built client. |
| `yarn start:inject`                     | Inject a given API URL and start server.     |
| `yarn lint \| egrep "no-literals" -B 1` | Scan for untranslated strings.               |

## License

Revite is licensed under the [GNU Affero General Public License v3.0](https://github.com/revoltchat/revite/blob/master/LICENSE).
