Open joshsmith2 opened 4 years ago
Thanks for filing this :)
Likely related: https://github.com/pol-is/polisServer/issues/92
It's hard to debug this since removing pol.is
as the hardcoded url (https://github.com/pol-is/polisServer/issues/288) is something that prob needs to be dealt with first, before figuring out what's going on with xid stuff.
I'd recommend testing without changing the pol.is domain first, by modifying /etc/hosts
to point pol.is to your server IP. That way, you can set if that fixes your error, and know whether the root cause is (1) making SERVICE_URL configurable, or (2) a true bug with data-xid
.
Would you be able to test that first?
Thanks pat - yes, happy to. Looks like I'll need to sort out https on the hosted server first, but that's a good prompt as it needs doing anyway. Will update here when done + tested.
A thought - might this have something to do with .xip.io?
Take 123.123.123.123
as the ip of my Pol.is server. Without embedding, voting on 123.123.123.123.xip.io/convoid
works fine, but voting on 123.123.123.123/convoid
causes a familiar looking error:
"Cannot POST /_domainWhitelistError_api/v3/votes"
I'm going to set up SSL to test this in any case - but I'll see if I can get rid of that error too. I guess it would help to have a sense of what .xip.io was doing in the pol.is context so I can move away from it
Looks like I'll need to sort out https on the hosted server first
Re: HTTPS. Feel free to steal the approach from #253, as I needed to get insecure https working in order to get facebook login working in development
Notably, that is just insecure self-signed, so not helpful for production, only testing.
Having said that, mailcow-dockerized tackles SSL using letsencrypt, and uses docker-compose for standing up a production instance. We could eventually learn from that for our prod setup -- was hoping to discuss using that approach when we're further along. But self-signed is still worth getting in, imho
~~What config looks like for administrators: https://mailcow.github.io/mailcow-dockerized-docs/firststeps-ssl/ Code that allows setup: https://github.com/mailcow/mailcow-dockerized/tree/master/data/Dockerfiles/acme~~
EDIT: Spun docker+letsencrypt convo into new issue: https://github.com/pol-is/polisServer/issues/289
Re: HTTPS. Feel free to steal the approach from #253, as I needed to get insecure https working in order to get facebook login working in development
Amazing, thanks - testing now
Without embedding, voting on 123.123.123.123.xip.io/convoid works fine, but voting on 123.123.123.123/convoid causes a familiar looking error:
I'm assuming you've still got DEV_MODE=true? That's really permissive (*.xip.io is hardcoded into whitelists), and skirts some work that still needs to be done to make polis prod-ready. Despite the breaks, you'll probably want to disable DEV_MODE to know that things are being properly addressed by your fixes.
We're kinda getting into more general topics, so how about this: Let's continue discussion async in gitter, since this is a bit more general, then we can come back here when we've teased apart smaller tasks? :) https://gitter.im/pol-is/polisDeployment?at=5ed7da394c9b0f060d40eb1a
Sounds perfect, see you on Gitter
@joshsmith2 Hiya! Did you ever get this one sorted? If so, do you have a fork you could link, or any context you could share on how you resolved? (sorry if you did this in chat and I neglected to link back here...!)
^^ The above pull request resolves this issue - there was what is (maybe) a type in the UNIQUE constraint for the xids
table
Hello,
I've encountered an issue with the following setup:
dev
data-xid
attribute on incoming requestsHere's what the HTML snippet used for the embed looks like:
I found I needed to change the line
var polisUrl = "http://pol.is";
tovar polisUrl = "http://mydocker-composeserverip"
in order to get the convo embed to work. Having done this, everything works fine, but only if I take outdata-xid
. Leaving it in, the conversation loads, and the first statement presents itself, but voting gives me this error:Here's the error in the console:
As far as I can tell, this relates to
createXIDRecord
, at1010:18
ofserver.js
, which does have a mention of ON_CONFLICTAs far as I can see, the above code looks fine; on opening the postgres container up and running it with dummy values it seemed to work. Oddly, various
console.log(
commands which I could see inserver.js
, and might have helped with debugging, weren't printing (though this may be a config thing)As a note, I've tested setting
data-xid
on conversations hosted onhttps://pol.is
, and that works fine.