* A KakaoTalk account on a smartphone (Android or iOS)
## Optional requirements
* Native dependencies for [end-to-bridge](https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html): https://docs.mau.fi/bridges/python/optional-dependencies.html#all-python-bridges
## Initial setup
### node-kakao module
1.`cd` to the `node` directory and run `npm install`
1. Copy `node/example-config.json` to `node/config.json`
1. Edit `node/config.json` with desired settings (see [node/README.md](node/README.md) for details)
### Bridge module
1.`cd` to the repository root and create a Python virtual environment with `python3 -m venv .venv`, and enter it with `source .venv/bin/activate`
1. Install Python requirements:
*`pip install -Ur requirements.txt` for base functionality
*`pip install -Ur optional-requirements.txt` for [end-to-bridge](https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html) encryption and metrics
* Note that end-to-bridge encryption requires some native dependencies. For details, see https://docs.mau.fi/bridges/python/optional-dependencies.html#all-python-bridges
1. Copy `matrix_appservice_kakaotalk/example-config.yaml` to `config.yaml`, and update it with the proper settings to connect to your homeserver
* In particular, be sure to set the `rpc.connection` settings to use the socket you chose in `node/config.json`
The [systemd](systemd) directory provides sample service unit configuration files for running the bridge & node-kakao modules:
*`matrix-appservice-kakao.service` for the bridge module
*`matrix-appservice-kakao-node.service` for the node-kakao module
To use them as-is, follow these steps after [initial setup](#initial-setup):
1. Place/link your clone of this repository in `/opt/matrix-appservice-kakaotalk`
* If moving your repo directory after having already created a Python virtual environment for the bridge module, re-create the virtual environment after moving to ensure its paths are up-to-date
* Alternatively, clone it to `/opt/matrix-appservice-kakaotalk` in the first place
1. Install the services as either system or user units
* To install as system units:
1. Copy/link the service files to a directory in the system unit search path, such as `/etc/systemd/system/`
1. Create the services' configuration directory with `sudo mkdir /etc/matrix-appservice-kakaotalk`
1. RECOMMENDED: Create the `matrix-appservice-kakaotalk` user on your system with `adduser` or an equivalent command, then uncomment the `User` and `Group` lines in the service files
* If creating this user, also give it write permissions on the services' configuration directory with `chgrp matrix-appservice-kakaotalk /etc/matrix-appservice-kakaotalk && chmod g+w /etc/matrix-appservice-kakaotalk`
1. Copy/link the bridge & node-kakao module configuration files to the services' configuration directory as `config.yaml` and `node-config.json`, respectively