@ -67,4 +67,32 @@ To use them as-is, follow these steps after [initial setup](#initial-setup):
Simply `git pull` or `git rebase` the latest changes and rerun any installation commands (`npm install`, `pip install -Ur ...`).
These instructions describe how to run the bridge with Docker containers.
* Any `docker` commands mentioned below need to be run with `sudo` unless you have configured your system otherwise. See [Docker docs](https://docs.docker.com/engine/install/linux-postinstall/) for details.
* All configuration files created by the Docker containers will be `chown`ed to UID/GID 1337. Use `sudo` access on the host to edit them.
* The `docker` commands below mount the working directory as `/data`, so make sure you always run them in the correct directory.
* Images must be built manually for now. It is planned for there to be prebuilt images available to pull.
## Initial setup
1. `cd` to the directory where you cloned this repository
1. Ensure that the repository root and `node` directories are writable by UID/GID 1337. A coarse way to achieve this is with `chmod o+w . node`
1. `cd` to the `node` directory, and build the image for the Node module with `docker build . -t matrix-appservice-kakaotalk-node`
1. Run a container for the Node module for the first time, so it can create a config file for you: `docker run --rm -v $(pwd):/data:z matrix-appservice-kakaotalk-node`
1. Update the generated config file `config.json` to your liking
1. Run the Node module with `docker run --restart unless-stopped -v $(pwd):/data:z matrix-appservice-kakaotalk-node`
1. Open a new shell, since the prior `docker run` command runs in the foreground (unless `-d` is used)
1. `cd` to the repository root, and build the image for the bridge module with `docker build . -t matrix-appservice-kakaotalk`
1. Run a container for the bridge module for the first time, so it can create a config file for you: `docker run --rm -v $(pwd):/data:z matrix-appservice-kakaotalk`
1. Update the generated config file `config.yaml` to your liking. You'll at least need to change the homeserver settings, appservice address and permissions, and the rpc connection to the Node module
* Note that the Node module container's `/data/` directory is accessible in the bridge module's container at `/data/node/`
* Thus, if the Node module is configured to use a unix socket at `/data/<sock_name>`, the bridge module's config must set `rpc.connection.path: /data/node/<sockname>`
1. Generate the appservice registration by running the container again, and update your homeserver configuration to accept it
1. Run the bridge module with `docker run --restart unless-stopped -v $(pwd):/data:z matrix-appservice-kakaotalk`
* Additionally, you should either add the bridge to the same Docker network as your homeserver and database with `--network=<name>` (when they are running in Docker), or expose the correct port(s) with `-p <port>:<port>` or `--network=host` (when they are running outside Docker).
Simply `git pull` or `git rebase` the latest changes, rerun all `docker build` commands, then run new containers for the freshly-built images.