matrix-puppet-slack icon indicating copy to clipboard operation
matrix-puppet-slack copied to clipboard

issue generating slack-registration.yaml

Open Jasper-Ben opened this issue 5 years ago • 4 comments

Issue

When running the generating part of the install process the program prompts for user's localpart but exits without an error and without generating the registration.yaml after I provide this information. I am not sure if this is due to a mistake in the setup, or if this is a bug. Thus, attached my setup. Any help would be much appreciated!

Setup

setup_docker

config.json

URL uses Dockers local DNS system.

{
  "slack": [{
    "team_name": "XYZ",
    "user_access_token": "abcd",
    "notify": "only_active"
  }],
  "registrationPath": "slack-registration.yaml",
  "port": 8090,
  "bridge": {
    "homeserverUrl":"http://matrix-synapse:8008",
    "domain": "matrix-synapse",
    "registration": "slack-registration.yaml"
  }
}

Dockerfile

FROM node:12.4-alpine
RUN apk --no-cache add git \
  && git clone https://github.com/matrix-hacks/matrix-puppet-slack.git /app \
  && cd /app \
  && npm install
WORKDIR /app
CMD node index.js

Registration

For the registration conf generating process I use following command after building docker_image:

docker run --expose 8090 --name matrix-puppet-slack -it --rm --network=matrix-synapse_matrix-bridges -v /opt/matrix-synapse/data/matrix-puppet-slack/config.json:/app/config.json:ro docker_image node index.js -r -u "http://matrix-puppet-slack:8090"

Things tried so far

  • use external domain in config file
  • use combination of external and internal in homeserverUrl and Domain
  • checked if auth token works
  • checked that matrix-puppet-slack can access matrix-synapse

Jasper-Ben avatar Jun 26 '19 17:06 Jasper-Ben

I was able to check out 1.12, create the registration file. 1.12 wasn't working for my synapse 1.0 from Debian's buster backports, so I then checked out master, re-installed node stuff and then ran successfully.

ghost avatar Jul 22 '19 17:07 ghost

Should be fixed with #90

michaelnew avatar Aug 12 '19 18:08 michaelnew

Doesn't work for me either. I use the default configuration from: https://github.com/spantaleev/matrix-docker-ansible-deploy/ and in the documentation of matrix-puppet-slack the naming is unclear to me. While readme.md speaks about http://your-bridge-server:8090, config.sample.json uses https://synapse.keyvan.pw.

None of these are standard matrix terminology, I can offer synapse, mxisd, exim-relay, coturn, riot and dimension. Which of these do you mean?

Currently node index.js -r -u "http://127.0.0.1:8091" (tried a bunch of different domains and IPs, all the same) yields:

module.js:675
    throw err;
    ^

SyntaxError: /home/git/matrix-puppet-slack/config.json: Unexpected token ] in JSON at position 707
    at JSON.parse (<anonymous>)
    at Object.Module._extensions..json (module.js:672:27)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/git/matrix-puppet-slack/config_migrations.js:2:16)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)

dreamflasher avatar Aug 14 '19 20:08 dreamflasher

Was facing same issue with you when I tried to generate slack-registration.yaml file using this code node index.js -r -u "http://your-bridge-server:8090".

Try use this instead, npm start -- -r -c config.yaml -u "http://your-bridge-server:8090". You should see the log in success message on the cli after enter your localpart and password. This works fine for me anyhow. Good luck.

gonzalloe avatar Mar 04 '20 08:03 gonzalloe