Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General Setup Errors #1

Open
Nedihardt97 opened this issue Jul 13, 2018 · 21 comments
Open

General Setup Errors #1

Nedihardt97 opened this issue Jul 13, 2018 · 21 comments

Comments

@Nedihardt97
Copy link

upon launching the app, the following is output:
image
the line in question contains the following:
const Discord = require("discord.js");
commenting this line out causes the same error to appear in the next line, and the next, and so on until all the dependency checkers are commented out and the system begins outputting errors in the middle of elements at anywhere a colon (:) is
Attempting to run via a node.js administrator cmd prompt version 8.11.0
All dependencies are installed

@alejzeis
Copy link
Owner

alejzeis commented Jul 13, 2018 via email

@Nedihardt97
Copy link
Author

ok, running it like that appears to allow the system to create the config file (loading values from app.js) and launch. However, it gets stuck at the output of:

Express now listening for requests
Discord Client Ready.

sending a message to discord or groupme fails to relay.
something to note is that I have not filled out the callbackURLPrefix: field
I suspect that is needed, however, I cannot discern what it needs to be nor can I find any clear answer to what it might need to be.

@alejzeis
Copy link
Owner

Yeah, sorry for lack of documentation. First make sure you have created a discord bot and invited it to your server (see this handy page). You'll need to get the token too and put that in bridgeBot.yml, in the token field.

The username field in bridgeBot.yml should be the same username that you gave the discord bot you created.

Next you need to create a groupme bot, (go here, and click on "create bot" (once you've signed into your groupme account)). The "callback URL" field is the most important, as that needs to be the URL of whatever device you'll be running the bridge on so GroupMe can send messages to the bridge.

The bridge will always listen at localhost/callback, so let's say i'm running the bridge at example.com on port 8088, the callback URL that I would give to groupMe would be example.com:8088/callback. However, maybe I'm running a webserver at that address, and/or I want to change the URL. That's where I would change callbackURLPrefix in bridgeBot.yml to something like /_groupme, so my callback URL would then become example.com:8088/_groupme/callback. You can leave it blank if you want, I added that feature because I'm running mine behind a reverse proxy setup.

So, once you've created the GroupMe bot, you'll need to copy the botId and put it in bridgeBot.ymlunder the botId field. You'll also need accessToken which you can get by clicking on the button accessToken on the GroupMe developers page on the top right.

Finally you'll need the discord Guild ID and Channel ID that you want to bridge. Make sure you have developer mode on in Discord (Should be under Settings, in "appearance"). Then right click on the Server that the channel belongs to, and click "copy ID". Your clipboard now has the ID which you can put in bridgeBot.yml under "guild". Repeat the same step to get the channel ID, except right clicking on the channel you want to bridge.

And that should be it!

It is a bit complicated, and it's designed to run on a server not a home computer as GroupMe has to be able to connect to the bridge to send it messages. There's no way around that. If you want to run it at home you'll need to port forward and such.

Also it can only bridge one channel to one group, which is quite a limitation.

Let me know if there's further issues, I'll be happy to help.

@Nedihardt97
Copy link
Author

Right, I think the main issue is the groupme side callback URL since I'm directly hosting the bridge on my desktop.
In which case, would it be MY.PC.IP.ADDRESS:PORT?
And if so, how should I go about determining the port?

@Nedihardt97
Copy link
Author

Nedihardt97 commented Jul 13, 2018

ok, so I gave it http://MY.PC.IP.ADDRESS:PORT on the groupme side and the API took it, but it's still not relaying the messages
I think it may be my port though

@alejzeis
Copy link
Owner

The port will be the value of listenPort in the config file. Make sure you've port forwarded, and if your computer has a firewall, opened the port on the firewall. The IP address will be your external IP address, not your internal.

@Nedihardt97
Copy link
Author

Nedihardt97 commented Jul 13, 2018

well, I added in the port forwarding in my config, but still no change
internal IP is set to the same IP as the the desktop I'm hosting on as well

@alejzeis
Copy link
Owner

alejzeis commented Jul 13, 2018 via email

@Nedihardt97 Nedihardt97 changed the title Compilation Syntax Errors General Setup Errors Jul 13, 2018
@Nedihardt97
Copy link
Author

I've set the firewall rule, added the service in the router config, entered the port into the app config, and entered the IP:Port into the groupme callback URL, and it still won't work

@alejzeis
Copy link
Owner

alejzeis commented Jul 14, 2018 via email

@Nedihardt97
Copy link
Author

Negative, doesn't relay either direction

@alejzeis
Copy link
Owner

alejzeis commented Jul 16, 2018 via email

@Nedihardt97
Copy link
Author

Yes, it showed up as online on the discord server, double checked the IDs. Program simply didn't do anything.

@alejzeis
Copy link
Owner

alejzeis commented Jul 17, 2018 via email

@abcasada
Copy link

Big thumbs up for "more clean and documented," haha. Any timeline on that? I'm probably gonna try to get this set up for me tonight but if you're almost done with a rewrite I could wait a couple days

@alejzeis
Copy link
Owner

alejzeis commented Jul 25, 2018 via email

@alejzeis
Copy link
Owner

Update: I've looked at the code and there really isn't anything to rewrite at all. I've gone ahead and updated the dependencies as there were some security vulnerabilities. I'm working on writing a setup guide in the README so people can actually set the bridge up for themselves.

@alejzeis
Copy link
Owner

README has been updated with a setup guide. I've re-set up my own bridge following the steps and it works correctly. I've also made some small changes to the code, probably the biggest is removing "callbackURLPrefix" which was confusing and simply making it "callbackURL" to set the whole callback URL that the bridge will listen on, (it's explained better in the README).

I think everything should be good to go, let me know if there are any additional problems, I'll be happy to help.

A Notice, If you tried the bridge before and it wasn't working, please re-download the project and start from scratch using the new code as that might help.

@abcasada
Copy link

Great, I'm looking forward to trying to get it going tonight. Thanks for doing the README, that should be a lot of help.

@jdas1996
Copy link

I am still having trouble understanding the server portion and would appreciate the help. I set up a server using Vultr, I don't have any firewall setup, so felt no need to open a port. So I kept the listenport at 8088. Installed the files on the server and it currently says "Discord Client Ready"

But I don't know what URL to put in the Callback URL field in the GroupMe Developers website.

@alejzeis
Copy link
Owner

@jdas1996 Assuming you've already set the discord settings in the config file (such as the bot token, username, guild and channel IDs):

The callback URL on the GroupMe site should be in the form of http://[Your server IP or domain]:8088/callback That should get it working. Then of course you need to set the GroupMe name, botId and token in the config file.

If you care about security however it's recommended you run a webserver such as Nginx or Apache on the server with an SSL cert so you can use HTTPS. You can then configure Nginx to forward requests from https://myserver.xyz/callback to "localhost:8088/callback", this is called a Reverse Proxy.

That way all the GroupMe messages sent from the GroupMe service to the bridge bot are encrypted over HTTPS, and then Nginx takes those HTTPS requests and passes them to localhost where the bot is running. There's a lot of guides on how to set this up, I can send more detailed instructions on how to do this if you are interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants