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

[v7] Self-hosted instance does not activate the premium features. #13

Open
kurokobo opened this issue Apr 3, 2021 · 0 comments
Open

Comments

@kurokobo
Copy link
Contributor

kurokobo commented Apr 3, 2021

Describe the bug

The premium features cannot be used when the instance is self-hosted.

To Reproduce

  1. docker-compose down -v
  2. docker-compose up -d
  3. .au s size (not limited for this, all premium features are affected)

Additional Information

AutoMuteUs was changed to use Galactus to check premium status for the guild by this commit, but the credentials for PSQL aren't passed to galactus by current docker-compose and initialization for PSQL interface is skipped, therefore GetGuildPremiumHandler returns nothing instead of self-hosted state (by faked response from utils). As a result, the instance is determined as free tier.

The bot returns the message Sorry, but that setting is reserved for AutoMuteUs Premium users! See .au premium for details and some logs about GetGuildPremiumHandler are recorded.

galactus_1    | {"level":"error","ts":1617433894.30779,"caller":"galactus/guild.go:367","msg":"storage interface has not been initialized","stacktrace":"github.com/automuteus/galactus/internal/galactus.(*GalactusAPI).GetGuildPremiumHandler.func1\n\t/src/internal/galactus/guild.go:367\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2042\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\t/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:210\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2843\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1925"}

Workaround

The easiest workaround is adding POSTGRES_ADDR, POSTGRES_USER, and POSTGRES_PASS to ENV for galactus, however, it may be a bit excessive to pass DB credentials that will never be used just to get a fake response...

Version of bot & capture

  • AutoMuteUs: amongusdiscord:theGreatSchism
  • Galactus: galactus:theGreatSchism
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

1 participant