forked from shirakumo/ex-lichat
A Lichat server implementation in Elixir
- Elixir 96.8%
- Shell 2.6%
- Dockerfile 0.6%
# ExLichat This is an implementation of a ''Lichat''(https://shirakumo.org/docs/lichat) server in Elixir, providing a very robust, scalable, and extensible chat server implementation. ## Supported Extensions In addition to the core protocol, ExLichat also supports many of the specified extensions: - shirakumo-backfill - shirakumo-block - shirakumo-bridge - shirakumo-channel-info - shirakumo-channel-trees - shirakumo-data - shirakumo-edit - shirakumo-emotes - shirakumo-icon - shirakumo-ip - shirakumo-last-read - shirakumo-leave-message - shirakumo-link - shirakumo-localization - shirakumo-pause - shirakumo-persistent-channels - shirakumo-quiet - shirakumo-reactions - shirakumo-replies - shirakumo-search - shirakumo-server-management - shirakumo-typing - shirakumo-user-info ## Running from a Release Binary Download the latest ''release''(https://shirakumo.org/project/ex-lichat/releases/latest) tarball and extract it to somewhere on your server. We highly recommend creating a custom user for it as well. You can then use the ``bin/lichat help`` command to get information about what you can do to the server. If you use Systemd, the distribution also includes a ``lichat.service`` file for you. It assumes that you created a user called ``lichat`` and that you extracted the release package to their home directory at ``/home/lichat``. You can then install the service to systemd with :: cp /home/lichat/lichat.service /etc/systemd/system/ systemctl enable --now lichat :: You'll likely also want to change the SSL keys in ``config/`` and configure the server with the ``config/secret.exs`` file. You can reference the ''``config/runtime.exs``''(link config/runtime.exs) file for the available options. To reload the configuration at runtime you can send ``SIGHUP`` to the server. To make the server restart gracefully, you can send ``SIGUSR1``. This will cause it to write a notice message to all connected users, and then exit with code 221. If run via Systemd, this exit code will automatically make it restart. A good way to upgrade a running server is thus to extract the new release on top of your installation, then send SIGUSR1 to the process. Like so: ::sh curl -L https://shirakumo.org/project/ex-lichat/releases/download/latest/lichat-linux.tar.gz | tar xfz -C /home/lichat/ kill -USR1 $(systemctl show --property MainPID --value lichat) :: ## Running via OCI/Docker A container image is also available, which you can get via ''codeberg.org/shirakumo/ex-lichat''(link https://codeberg.org/shirakumo/-/packages/container/ex-lichat/latest). The image exposes ports 1111 and 1112, as well as a volume that contains all the configuration files and other data files for the server. ## Running a Development Server Setting up a Lichat server is very simple. :: pacman -S elixir git clone https://shirakumo.org/project/ex-lichat cd ex-lichat mix deps.get iex -S mix :: You can configure and override settings from the ''config''(config/runtime.exs) in the ``config/secret.exs`` file. Alternatively, you can use Docker Compose to launch the server together with a postgres instance, which is required for testing history. In this case, you can configure the server with the ``dev/secret.exs`` file. The server listens on localhost. To start: :: docker compose up -d :: To rebuild the image and restart the server with any local changes: :: docker compose down lichat docker compose up -d lichat :: When you're finished: :: docker compose down ::