diff --git a/README.md b/README.md index a5b7e85..29880e5 100644 --- a/README.md +++ b/README.md @@ -4,5 +4,8 @@ A very hacky Matrix-LINE bridge based on running LINE's Chrome extension in Pupp ## Features & roadmap [ROADMAP.md](ROADMAP.md) +## Setup +[SETUP.md](SETUP.md) + ## Discussion Matrix room: [`#mautrix-line:miscworks.net`](https://matrix.to/#/#mautrix-line:miscworks.net) diff --git a/SETUP.md b/SETUP.md new file mode 100644 index 0000000..62a5442 --- /dev/null +++ b/SETUP.md @@ -0,0 +1,13 @@ +# Setup +1. Download the .crx file of the [LINE Chrome extension](https://chrome.google.com/webstore/detail/line/ophjlpahpchlmihnnnihgmmeilfjmjjc) (version 2.4.1), and extract it to `puppet/extension_files` +2. `cd` to the `puppet` directory and run `yarn --production` +3. Run `node prep_helper.js` to open the version of Chrome downloaded by Puppeteer, and click on the LINE icon next to the URL bar +4. Once the LINE popup appears, press F12 to show DevTools, which will reveal the LINE extension's UUID +5. Copy `puppet/example-config.json` to `puppet/config.json`, and update it with the UUID found in the previous step +6. Launch the Puppeteer module with `yarn start` or `node src/main.js` +7. `cd` to the main directory and create a Python virtual environment with `virtualenv -p /usr/bin/python3 .venv`, and enter it with `source .venv/bin/activate` +8. Install Python requirements with `pip install -r requirements.txt` +9. Copy `mautrix_line/example-config.yaml` to `config.yaml`, and update it with the proper settings to connect to your homeserver +10. Run `python -m mautrix_line -g` to generate an appservice registration file, and update your homeserver configuration to accept it +11. Run the bridge with `python -m mautrix_line` +12. Start a chat with the bot and follow the instructions diff --git a/puppet/prep_helper.js b/puppet/prep_helper.js new file mode 100644 index 0000000..4446804 --- /dev/null +++ b/puppet/prep_helper.js @@ -0,0 +1,13 @@ +import puppeteer from "puppeteer" + +(async () => +{ + const pathToExtension = "extension_files" + const browser = await puppeteer.launch({ + headless: false, + args: [ + `--disable-extensions-except=${pathToExtension}`, + `--load-extension=${pathToExtension}` + ] + }) +})()