XanderStrike / goplaxt

Scrobble Plex plays to Trakt with ease!
MIT License
301 stars 35 forks source link

Postgresql support #24

Closed halkeye closed 5 years ago

halkeye commented 5 years ago

Only barely tested, wanted to get the PR up to get feedback. Especially what should happen if a user id is not found (right now I panic, but i'm not sure what proper behavior should be).

halkeye commented 5 years ago

So I don't know why the dockercloud builds are failing, but I think its because miniredis changed its urls to include /v2 at the end, but glide seems to fail no matter what i do

halkeye commented 5 years ago

Ah, need to pin a release - https://github.com/alicebob/miniredis/issues/78

XanderStrike commented 5 years ago

This looks good but shouldn't a postgres instance outside the container have a password? I don't have much experience with PG but I know with mysql you'd usually configure a user and password for your app. LMK if I'm totally off base here.

I think panicking in the case of missing users is fair. There isn't much we can do to improve the user experience for an app that silently accepts webhooks behind the scenes. At least when we 4-500 something shows up in Plex's logs (not that anyone checks those but oh well).

halkeye commented 5 years ago

I can't find the actual docs where I found it (should have saved it), but it supports a connection url

https://github.com/go-pg/pg/blob/a08a30ca8863774c082727a617901d3bddb44052/options_test.go#L24

If you have some suggestions on how to add it to the readme, I'll find the link tonight and update the docs

halkeye commented 5 years ago

https://godoc.org/github.com/lib/pq#hdr-Connection_String_Parameters

XanderStrike commented 5 years ago

Sorry to take so long to get back to you! I've got an injury that's put me out of commission for the most part. If this is ready to merge I'm happy to merge it! Just let me know.

halkeye commented 5 years ago

Oh nos. That bites. Sorry to hear that.

Yea I've been running it for a bit. It's good to go. There's no docs though.

halkeye commented 5 years ago

then a docker deploy when its done?

halkeye commented 5 years ago

\o/\o/\o/