galnir / Master-Bot

A Discord music bot and dashboard with slash commands, playlist support, Spotify, music quiz, saved playlists, lyrics, gifs and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dashboard URL Config Fix | Invite button not working

PhantomNimbi opened this issue · comments

The basic setup in the config doesn't allow for external connections to the dashboard. I managed to get around that by setting both Internal IP and Internet IP of my server to an A record in my Google Domain.

For people not hosting from their own PC, the only IP needed is the Public IP of the server they are using to host the bot on. But if you are hosting on your own machine setting the Internal and Public IPs to the same A record will allow access from both the host network and outside networks

By doing that you can successfully access and login to the dashboard whether you're accessing it from the same network as the host machine or a separate network.

These are the config settings I had to change to get the dashboard to be accessible from any network. Mind I only changed the config in the .env file and the Discord Developer Portal. for this fix no changes were needed to the code itself.

NEXTAUTH_URL=http://<domain>:3000

and setting the redirect URL in the Discord Developer Portal to

http://<domain>:3000/api/auth/callback/discord

Just replace <domain> with the domain or IP that you are hosting from.

Hopefully that might help you with the dashboard setup however the next bit is actually more of an issue that doesn't seem to be related to the URL or config and can't be fixed though those. Basically this next part is likely more of a bug than a config issue.

The issue I'm having is the Invite button. For some reason it isn't actually working. It just highlights the Invite text when I try to click it. If you need an example simply test it on my dashboard and you should see that the Invite button simply isn't working as a button in my dashboard.

My dashboard can be accessed from: http://www.socket-development.nl:3000

commented

I keep forgetting to take care of the invite button, hopefully I'll commit a fix today.
Getting a public URL to work is tricky because the bot, unlike the site, can't be deployed to Vercel or alternatives like Netlify. I'm looking into ngrok and will comment here or write a short guide if it turns out good

commented

The invite button is now working, pull the latest changes.
Also as I wrote after I figure out the best way to get an external url working I'll write a guide :)